Add-Ons & Services

Connect Websocket with Poco libraries

Please post support and help requests here.

Connect Websocket with Poco libraries

Postby lion87 » 30 Aug 2013, 14:06

I am trying to connect to the Echo Test Websocket (http://www.websocket.org/echo.html) using the Poco C++ libraries. In order to do so,
here is my code which should set up the Websocket:
Code: Select all
HTTPClientSession cs("echo.websocket.org");
HTTPRequest request(HTTPRequest::HTTP_GET, "/ws");
HTTPResponse response;

WebSocket* m_psock = new WebSocket(cs, request, response);
m_psock->close(); //close immidiately

However it does not work: I am getting an error message like this:

Code: Select all
Poco::Exception: WebSocket Exception: Cannot upgrade to WebSocket connection: Not Found

Can anybody help?

kind regards
Posts: 3
Joined: 01 Aug 2013, 15:33

Re: Connect Websocket with Poco libraries

Postby richard » 01 Dec 2013, 10:43

The request version must be 1.1.

See: http://stackoverflow.com/questions/2018 ... ket-server
Posts: 2
Joined: 01 Dec 2013, 00:56

Return to Support

Who is online

Users browsing this forum: No registered users and 6 guests