Re: better handling of websocket protocol upgrades

2015-07-29 Thread Frank Meier
On 25/07/15 01:03, Daniel Stenberg wrote: If Curl_getconnectinfo() would not not just care about lastconnect socket, but also would retrieve the connection that is actually being used, my approach would work. This was suggested in https://github.com/bagder/curl/pull/86, but was never merged.

Re: better handling of websocket protocol upgrades

2015-07-27 Thread Frank Meier
On 27/07/15 15:49, Gisle Vanem wrote: Sorry I haven't followed this thread. So I don't know really what you're trying to accomplish. Is your intention to handle all the nitty-gritty details of WebSocket (RFC6455) yourself? So in the end make this possible? curl ws://echo.websocket.org/ curl

Re: better handling of websocket protocol upgrades

2015-07-27 Thread Gisle Vanem
Frank Meier wrote: consider yet to check the correctness of the Sec-WebSocket-Accept header. But of course there will be a minimum of checks that have to be performed before libcurl switches to websocket-mode. Sorry I haven't followed this thread. So I don't know really what you're trying to

Re: better handling of websocket protocol upgrades

2015-07-27 Thread Frank Meier
On 25/07/15 01:03, Daniel Stenberg wrote: If you insist on using libcurl for this, then I think that is at least a way you _can_ do it. Yes, the benefit of using curl in this case, only to establish the connection, is really small. That's why I tried to find/implement a solution were the

Re: better handling of websocket protocol upgrades

2015-07-24 Thread Daniel Stenberg
On Thu, 23 Jul 2015, Frank Meier wrote: After some reading, the approach to use websockets with libcurl seems to be to let libcurl only establish the connection with CURLOPT_CONNECT_ONLY and then use curl_easy_send() and curl_easy_recv() on the easy_handle. This means to send and receive the

better handling of websocket protocol upgrades

2015-07-23 Thread Frank Meier
Hi After some reading, the approach to use websockets with libcurl seems to be to let libcurl only establish the connection with CURLOPT_CONNECT_ONLY and then use curl_easy_send() and curl_easy_recv() on the easy_handle. This means to send and receive the HTTP headers also with this