wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.22k stars 295 forks source link

use okhttp3 websocket return 1005 #253

Closed 1371030 closed 7 years ago

1371030 commented 7 years ago

use okhttp3 https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

use this sample. change ws to ws://127.0.0.1 wait 10SECONDS, websocket return 1005

wandenberg commented 7 years ago

Hi @1371030 if you are using the WebSocketEcho.java example only changing the ws address the behaviour is as expected. This sample send 3 messages and then close the connection as you can see here. The close frame tell to the server that the client don't want to keep the connection open, and the server closes the connection on its side. The 1005 code that you received is a code on the okhttp3 client, indicating that the server closed the connection without specifying a reason (check here). Which is totally OK on this case, since the client already know the reason it asked to close the connection.

1371030 commented 7 years ago

thanks,nginx-push-stream-module very nice!