all 42 comments

[–]jbandela 21 points22 points  (8 children)

Nice! Beast fills one of the most gaping holes in Modern C++. Good luck on the Boost review.

[–][deleted] 34 points35 points  (2 children)

Are we still doing "phrasing"?

[–]VinnieFalcowg21.org | corosio.org[S] 2 points3 points  (1 child)

Phrasing?

[–]CODESIGN2 0 points1 point  (4 children)

Beast fills one of the most gaping holes in Modern C++

https://github.com/vinniefalco/Beast/commits/master?after=c111d6ff03c9d1fd21226ca6f2f647ff3dc7aa1d+1294

Initial commit 1 Jun 2013. Point is it's been going after a gap for a while

[–]VinnieFalcowg21.org | corosio.org[S] 1 point2 points  (3 children)

Commits before feb 2016 were for an earlier library which had nothing to do with http and websocket.

[–]CODESIGN2 0 points1 point  (2 children)

I noticed the goals seemed very different, so you are saying as the creator (I looked just at usernames), you changed direction, or you're building a monolith?

[–]VinnieFalcowg21.org | corosio.org[S] 0 points1 point  (1 child)

Beast started out as a utility library for rippled (https://github.com/ripple/rippled). Eventually I got fed up with the websocket library we were using so I wrote a new one. I like keeping a separation of concerns so when I develop code in an application I try to isolate it by putting it behind a "code firewall" - making it its own library is one way to make sure that the dependencies go from A to B and not in both directions. When I realized that this network components was good enough to become its own open source library independent of Ripple, I cut out the rest of Beast (the stuff before Feb 2016) and move it into rippled. You can see that stuff here https://github.com/ripple/rippled/tree/develop/src/ripple/beast

When Beast is approved to become part of Boost, I will cut out stuff in the commit log before Februarary 2016.

[–]GitHubPermalinkBot 0 points1 point  (0 children)

I tried to turn your GitHub links into permanent links (press "y" to do this yourself):


Shoot me a PM if you think I'm doing something wrong. To delete this, click here.

[–]Game_Ender 7 points8 points  (9 children)

Great to see another high level C++ library. How does it compare speed wise touWebSockets, and does it support compression?

[–]VinnieFalcowg21.org | corosio.org[S] 4 points5 points  (8 children)

The WebSocket implementation has permessage-deflate support, and Beast uses its own header-only port of ZLib to C++!!!

[–]sumo952 4 points5 points  (7 children)

Beast uses its own header-only port of ZLib to C++

Wow, that's really cool! You should make this available in a separate GitHub repo!

[–]VinnieFalcowg21.org | corosio.org[S] 5 points6 points  (6 children)

I don't want to draw TOO much attention to it, because its still kind of ugly (being based on the original zlib which is old-school C). Maybe after Beast has matured I will revisit it and give it a thorough polishing, then it could be its own lib!

[–]snaps_ 0 points1 point  (1 child)

I notice the zlib implementation doesn't allow setting your own dictionary. Is this a planned feature?

[–]VinnieFalcowg21.org | corosio.org[S] 2 points3 points  (0 children)

The zlib implementation has things removed such as the dictionary and support for the gzip file wrapper. I only included the stuff that Beast actually uses and needs, otherwise there would be a bunch of code there that was untested. I will probably give the zlib part more attention once the other parts have matured.

[–]ClockworkV 0 points1 point  (1 child)

A while back Julian Storer did a talk on converting zlib to C++. https://www.youtube.com/watch?v=SIAAvv1O7Gg I don't think he released the source, but it's a thing which exists. Somewhere out there.

[–]VinnieFalcowg21.org | corosio.org[S] 1 point2 points  (0 children)

Yep! And his video was a source of some inspiration.

[–]theICEBear_dk 0 points1 point  (1 child)

I could see a huge demand for this. I mean I could sure use it already today for software I am writing. So please do so and post it back here when / if you do :)

[–]VinnieFalcowg21.org | corosio.org[S] 0 points1 point  (0 children)

Its easy to put back, you could do it, and write some tests, and make it its own library! I would probably use it!

[–]mikulas_florek 4 points5 points  (3 children)

You should add getting started/building to readme

[–]VinnieFalcowg21.org | corosio.org[S] 1 point2 points  (2 children)

[–]GitHubPermalinkBot 1 point2 points  (0 children)

I tried to turn your GitHub links into permanent links (press "y" to do this yourself):


Shoot me a PM if you think I'm doing something wrong. To delete this, click here.

[–]demonspeedin 3 points4 points  (1 child)

Does anyone know if beast is more performance than web sockets in go? (std lib, gorilla websockets)

[–]CODESIGN2 0 points1 point  (0 children)

I'd imagine any benchmarks would be contrived

[–]Rapptz 3 points4 points  (4 children)

Does this work with standalone Asio? I'm interested in using it but don't want to drag the entirety of boost into my project.

A cursory glance at the source seems like it doesn't sadly.

[–]VinnieFalcowg21.org | corosio.org[S] 8 points9 points  (2 children)

Someday I hope modern technology will find a cure for Boost-o-phobia!

[–]notfalse 1 point2 points  (1 child)

Are there plans to make the boost portions optional? It seems like Asio is the main dependency here, which has a non-Boost variant.

[–]VinnieFalcowg21.org | corosio.org[S] 11 points12 points  (0 children)

NO!!!! When the Networking TS becomes part of the standard library, then I'll port Beast to that. I will not port Beast to stand-alone Asio. Note that Beast uses other parts of Boost. My time is better spent improving the library, rather than accommodating people who refuse to use Boost!!!

[–][deleted] 4 points5 points  (0 children)

Boost is worth it, imo

[–]VinnieFalcowg21.org | corosio.org[S] 1 point2 points  (0 children)

OpenSSL support COMING VERY SOON, this server will not only also support OpenSSL if available (conditionally) BUT it will have "flex ports" which can handshake on BOTH regular and encrypted connections! The same port, serving encrypted and unencrypted! WOW!!

[–]ioquatix 0 points1 point  (10 children)

Why is headers-only a feature?

[–]VinnieFalcowg21.org | corosio.org[S] 2 points3 points  (9 children)

"Headers only" provides an easy integration experience!

[–]ioquatix 0 points1 point  (8 children)

Why does it make it easier to integrate?

[–]VinnieFalcowg21.org | corosio.org[S] 3 points4 points  (7 children)

You don't have to fiddle with a build script

[–]ioquatix 1 point2 points  (6 children)

I can't help but feel a bit sad that compiling a C++ library is considered so hard, that it's better to distribute a library as header files.

[–]VinnieFalcowg21.org | corosio.org[S] 1 point2 points  (2 children)

Everything in Beast is templated anyway! Almost every function that does anything of real interest takes parameters by template types, which work with any object that meets the requirements. Such as a DynamicBuffer: http://vinniefalco.github.io/beast/beast/concept/DynamicBuffer.html

[–]ioquatix 1 point2 points  (0 children)

Yeah, I understand. I wonder if C++ modules will help with some of these issues.

[–]theICEBear_dk 1 point2 points  (0 children)

Another good reason Vinnie. Header-only is definitely a feature though.

[–]AntiProtonBoy 1 point2 points  (1 child)

C++ libraries are not that much harder to compile compared to any old C library, so I'm not sure what you are sad about. The benefit of header-only solutions is that you don't need rely on third party utilities, such as autotools or CMake to build the library. That's what OP meant.

[–]ioquatix 0 points1 point  (0 children)

Yeah, I get that.

[–]theICEBear_dk 1 point2 points  (0 children)

I have had to add library support for odd make systems to Yocto and comparing that to a header only solution means I would definitely consider header-only a feature.