[Libwebsockets] libwebsocket problem / tls with ws client

Andy Green andy at warmcat.com
Tue May 28 21:57:32 CEST 2019



On 5/28/19 8:52 AM, Wei, Catherine wrote:
> Thanks, I will try your suggestion.
> Another question about the usage of libwebsocket. Can you give some suggestion on how to use secure websocket?
> I want to start a secure websocket server and so the client can request connection to the server by "wss://ip:port"?

Just set the flag in info.ssl_connection

https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-client/minimal-ws-client-echo/protocol_lws_minimal_client_echo.c#n72

Make sure when you created the context, it initialized your tls library

https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c#n141

-Andy


More information about the Libwebsockets mailing list