curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: WebSocket custom port name as in JavaScript websockets

From: Johny Bravo via curl-library <curl-library_at_lists.haxx.se>
Date: Thu, 25 May 2023 20:03:15 +0200 (CEST)

No, I have wss server written in libwebsockets that runs on my server. Part
of libwebsocket init is to set "port name"
const char * name => Protocol name that must match the one given in the
client Javascript new WebSocket(url, 'protocol') name

But I am not sure, how to read from my server using libCURL if I setup
protocol name on the server. If I leave name empty, it does not work either
plus JS version does not work either.
---------- Původní e-mail ----------
Od: Dan Fandrich via curl-library <curl-library_at_lists.haxx.se>
Komu: curl-library_at_lists.haxx.se
Kopie: Dan Fandrich <dan_at_coneharvesters.com>
Datum: 25. 5. 2023 19:25:16
Předmět: Re: WebSocket custom port name as in JavaScript websockets
"On Thu, May 25, 2023 at 05:23:58PM +0200, Johny Bravo via curl-library
wrote:
> I have tried websocket API, but I cannot get it working and receive
message.
> If I use the ws in JavaScript, I have:
>
> var socket = new WebSocket( "wss://some_url", "example");
>
> However, I dont know, how to set "example" port in libCURL API. I have
tried

It sounds like you're trying to use libcurl to talk to a browser. My
understanding is that this will never work, because WebSockets is for
peer-to-server communication and not peer-to-peer and libcurl provides only
a client WebSockets implementation, like a browser does.

Dan
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library 
Etiquette: https://curl.se/mail/etiquette.html 
"


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-05-25