TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.

Home Page:http://tootallnate.github.io/Java-WebSocket

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Websocket Upgrade connection

krishnak opened this issue · comments

Hello, An excellent work - congratulations. I am trying to connect to a third party server which upgrades the HTTP connection to a websocket connection using sec-websocket-version header. I am enclosing the relevant headers I captured via Wireshark for the TLS request.

I looked at your examples, I found an example for SSL Client, I also found an example for sec-websocket-protocol.

However I didn't find any explicit examples for connection upgrade. Could you please advise whether your library supports my requirement? If so could you post some pseudocode.

Screenshot from 2024-01-14 20-08-31

Hello @krishnak,
it looks like the attached screenshot is from a browser judging by the Origin header.

I am not aware of any upgrade from http to ws.
Just use the normal scheme ws and wss for encrypted communication.

Best regards,
Marcel

You can have a look at asynchttp client, if you choose to implement this http to websocket upgrade feature.