cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how do I create websocket client with libcurl (was: A quick hack to support Websocket with libcurl)

From: YAMADA Yasuharu <yasuharu.yamada_at_access-company.com>
Date: Tue, 17 Mar 2015 09:54:06 +0900

Hi Danial,

2015-03-16 19:56 GMT+09:00 Daniel Stenberg <daniel_at_haxx.se>:

> I hope it works fine for 7.40.0 or later.
>>
>
> Why don't you try and then tell us?

sorry I did not focus this problem long time.
I try to test 7.28.0~7.40.0 these days.

 So I have questions:
>> - that dummy code is correct how to use cURL API?
>>
>
> It lacks a lot of checks and it uses a busy-loop so I wouldn't call it
> correct, but I believe it should work.
>

I'd like to confirm.
Is it correct how to use cURL API like that dummy code?

Set a few break-point and figure out what happens?

curl_multi_perform() CONNECT to server
curl_easy_send()
-> easy_connection()
-> Curl_getconnectinfo()
-> data->multi_easy is NULL because it does not use easy_perform()
-> return CURL_SOCKET_BAD by Curl_getconnectinfo()

# I guess
https://github.com/fredericgermain/curl/commit/b9baee6e347c193d8a75c61bcdffad24e85aa1c8
is convenient for this issue.

 - there is another way to create the application?
>
> Skip libcurl and just connect a socket to the server? You're not using
> libcurl very much anyway...

The application is web browser and we use libcurl for it more than 4 years.
I know it can connect to websocket server through socket.
but for browsing, the connection through proxy, authentication, SSL/TLS,
etc.
It is difficult to use socket directory.

Best regards,
thanks
===============
YAMADA Yasuharu
ACCESS CO., LTD.
Yasuharu.Yamada_at_access-company.com

-- 
.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-17