-
I want to use vs2019 to compile the curl library that supports WebSockets on windows, but I don't know how to do it |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
WebSocket support is experimental, please read about it in the curl everything book https://everything.curl.dev/libcurl/ws curl's cmake build supports enabling websockets by using bool option For example you could open a Visual Studio developer command prompt, make a separate directory to store the generated cmake build files, build curl and install:
and you open 'x64 Native Tools Command Prompt for VS 2019' shortcut and run mkdir C:\stuff\curl\cmake-build
cd /d C:\stuff\curl\cmake-build
cmake C:\stuff\curl-8.0.1 -DCURL_USE_SCHANNEL=ON -DENABLE_WEBSOCKETS=ON -DCMAKE_INSTALL_PREFIX:PATH=C:\stuff\curl\cmake-install
cmake --build . --target INSTALL --config Release You should see an 'Enabled protocols' of WS WSS and when you run You can use build systems other than cmake to build with Visual Studio (see projects and winbuild dirs for example) but you would have to define USE_WEBSOCKETS because there is no special build option to enable websockets. For example winbuild:
and curl would be output to something like C:\stuff\curl\curl-8.0.1\builds\libcurl-vc14.20-x64-release-dll-ipv6-sspi-schannel (bin,lib,include) and you copy it to your install location |
Beta Was this translation helpful? Give feedback.
-
This works. |
Beta Was this translation helpful? Give feedback.
WebSocket support is experimental, please read about it in the curl everything book https://everything.curl.dev/libcurl/ws
curl's cmake build supports enabling websockets by using bool option
ENABLE_WEBSOCKETS=ON
.For example you could open a Visual Studio developer command prompt, make a separate directory to store the generated cmake build files, build curl and install:
C:\stuff\curl\curl-8.0.1
C:\stuff\curl\cmake-build
C:\stuff\curl\cmake-install
and you open 'x64 Native Tools Command Prompt for VS 2019' shortcut and run