3 ms·
But still, the most notable library exception is the HTTP library. And nowadays this is the "lingua franca" for most of the internet. There a few such libraries
by Mailtemi 6y ago
But still, the most notable library exception is the HTTP library.
And nowadays this is the "lingua franca" for most of the internet.
There a few such libraries like nghttp2 (but it is version 2 only), boost.beast, and many others, (but they are HTTP 1.1 only). And it is not easy to combine them.
- benreesman 6y agoProxygen is a great C++ HTTP library. - fully evented with arbitrary number of threads servicing event loops - straightforward API with examples - HTTP 1.1/2/3 out of the box - terminates SSL/TLS out of the box - extremely hardened It’s not tiny and header only or anything trendy like that, but it’s fast as hell, easy to code to, builds with cmake easily, actively developed, and runs one of the biggest sites on the Web. I have yet to find a major downside.
- RandoHolmes 6y agoI avoid header-only libs like the plague and don't really understand why people prefer them. I mean, I get it, I just don't agree with the tradeoffs. header-only slows compilation down just so you can avoid adding in a single line in your build chain of choice. It's just not a trade off worth making imo. So to me, not being header only is a pro, not a con.
- Mailtemi 6y agoHave you tried "explicit template instantiation"? If the library templates have good separation, you can just add a cpp file so the compiler doesn't need to deduce the type each time.
- RandoHolmes 6y agoyep, that's exactly what I do when I really end up having to use a header-only lib that uses templates. It's not that I'll outright refuse to use a header-only lib, only that I very very strongly prefer not using them.
- Mailtemi 6y agoWhat a miss! 10x, I remember when I searched for an http2 / http1.1 Proxygen hadn't HTTP 2 support yet, at least client-side. So I'made a little hack into nghttp2 to fall back for 1.1 connections.