machinezone / IXWebSocket

websocket and http client and server library, with TLS support and very few dependencies
BSD 3-Clause "New" or "Revised" License
549 stars 177 forks source link

Can't connect to wss endpoint #425

Open fkaduch opened 1 year ago

fkaduch commented 1 year ago

Hello,

I am trying IXWEbSocket sample code and I setup server and client successfully. The client tries to connect to server at wss endpoint "wss://localhost:8008", but I am getting this error from the server:

$./IXWebSocketServer /IXWebSocketServer WebSocketServer::handleConnection() HTTP status: 400 error: Invalid HTTP method, need GET, got

I am attaching IXWebSocket client and server sample code.

Sample code works well when I use ws endpoint "ws://localhost:8008".

I used also this Javascript client main_client.docx main_server.docx to connect to the IXWebSocket server:

https://www.lddgo.net/en/network/websocket

and it works with ws endpoint "ws://localhost:8008", but not with a wss one "wss://localhost:8008".

I build the library with these options on Ubuntu 20.04 LTS:

$ cmake -DUSE_TLS=1 -DUSE_ZLIB=0 -DUSE_WS=1 -DUSE_TEST=1 -DUSE_OPEN_SSL=1 ..

I appreciate help

peterphonic commented 1 year ago

Did you create your key and certificate?