Search code examples
visual-c++uwebsockets

How to use uWebsockets from Visual Studio C++?


uWebSockets https://github.com/uNetworking/uWebSockets

How to use this from Visual Studio C++ ? I wish to implement a simple websocket server. I don't want to use Makefile, wish to use normal visual studio project build.


Solution

  • This is how to use uWebsockets from Visual C++ IDE project, step by step:

    1. Install Vcpkg https://github.com/microsoft/vcpkg
      then command line the following
    2. set VCPKG_DEFAULT_TRIPLET=x64-windows
    3. vcpkg install uwebsockets

    At this point there is then a folder vcpkg\installed\x64-windows which contains the header files and library files and dlls (if you need the dlls).

    In your Visual C++ project properties set the include directory and lib directory in the VC Directories.

    Then #include <uwebsockets/App.h> and paste code from uwebsockets.