zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.95k stars 1.96k forks source link

Whether websocketpp must rely on the boost library #813

Open windowcc opened 5 years ago

SirDifferential commented 5 years ago

There's a FAQ about this here:

## Dependency Management

### Can WebSocket++ be used without Boost?
Yes. WebSocket++ only uses Boost features as polyfills for C++11 language features and libraries. If you have a C++11 compiler and standard library you can use WebSocket++ without Boost. In most cases setting your build environment to use the C++11 (or later) language dialect is sufficient to enable this mode of use.

With less common compilers (and sometimes very recently release compilers) there may be specific issues with certain libraries that aren't automatically detected by the library. For these situations there are additional defines available to fine tune which C++11 libraries and features are used. TODO: more details about them.

For the iostream/raw transport the C++11 standard library is sufficient. For the Asio based transports, there is no C++11 library that provides the networking capabilaties that Asio does. As such even with a C++11 build system, you will need a standalone copy of Asio to use if Boost Asio is not available.

MinGW users who want to avoid Boost should also consult the nearby question about MinGW compatibility.

For a modern compiler, all that's required is defining ASIO_STANDALONE before the includes and then having ASIO headers somewhere in the include path.