This question corresponds to this QtWebSockets implementation.
I am trying to include websockets server functionality in a bigger qt-based project.
I have cloned the repo above and built the library as well as the example applications (release mode). Among the examples there is an echoserver and an echoclient. After built i start the echoserver, which seems to be successful (on terminal i see: Echoserver listening on port 1234). Then i start the echoclient, which exits immediately (no printout on the console). The server console does not show any signs of detecting connection attempts. The server listens on 0.0.0.0:1234 (checked with netstat). The client tries to connect on "ws://localhost:1234/".
I modified the echoclient example to connect to echo.websocket.org and rebuilt it. After starting the client it connects successfully and the sent message is echoed back.
I created a simple html file with a websocket client trying to connect to the echoserver and opened it with a browser. This again cannot connect to the server (works with echo.websocket.org).
Environment:
I thought that this is something to do with the virtualbox networking settings, so i repeated the whole thing above on the host OS (win7, 64bit). I get the same results.
Br, Szabolcs
This problem does not happen in Qt 5.4 anymore. According to the comments above it was a bug in Qt and it seems to be fixed now, because in my environment the echoserver and echoclient work just fine.
My Environment:
Therefore I propose to mark this question as answered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With