I tried the new WebSocket API (as a client)


In the past days I've been playing with the new WebSocket API, and I was having problems during the handshake, using the "easy mode" API soup_session_websocket_connect_async and soup_session_websocket_connect_finish, with a service responding 400 bad request and another service responding 1.1 8 message corrupted.

Those where both wss:// services, and when I tried a ws:// one it worked with no other changes to the code.

After reading docs, sources, test, debugging and mindless trial and error, turns out I just had to add "wss" to the https-aliases of the SoupSession for the TLS layer to kick in.

Is it intended to work like that? Since the spec only defines those 2 url schemes, couldn't soup_websocket_client_prepare_handshake handle that, as it already does all the dirty work?
If that's the intended behavior I humbly suggest to at least mention that in the docs as that's quite cryptic :)

Actually I am doing this in _javascript_ from GJS, but I'm pretty sure it applies in general.

Thanks for your time and efforts!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]