Closed huhuhong closed 8 years ago
Help ! Help !
@huhuhong your server does not reply (at least to this request) correctly
The response should be more like:
HTTP/1.1 101 Switching Protocols
Server: websocket-sharp/1.0
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: PBiGdYTaidm4dmlhGPixbCo5fWc=
Please have a look at IsWebSocketResponse to see what's required in a proper websocket response.
Thanks a lot and issue had resolved.
Solution:
WebSocket ws = new WebSocket("ws://localhost:8080/spring-websocket-stomp-apollo/chat/websocket");
//WebSocket ws = new WebSocket("ws://localhost:8080/spring-websocket-stomp-apollo/chat");
Description: Previously i'm focusing on cloning the communication flow of stomp javascript client.
Sample Code:
Sample Result:
Question: My server did return HTTP1.1 but somehow it still fail on Handshake. Any clues?
I have a StompJS Browser Client with Javascript as below and it was able to connect successfully.