TooTallNate / Java-WebSocket

A barebones WebSocket client and server implementation written in 100% Java.
http://tootallnate.github.io/Java-WebSocket
MIT License
10.48k stars 2.58k forks source link

"refuses handhsake" error after upgrafe from glassfish 4.0 to 4.1 #284

Closed greg-witczak closed 7 years ago

greg-witczak commented 10 years ago

My Android app works as expected when application server is Glassfish 4.0 (with websocket 1.0). But after upgrading it to 4.1 (with websocket 1.1, which is fully backward compatible), I get error and onClose is called, instead of onOpen, with parameters:

public void onClose(int code, String reason, boolean remote) Code: -1 Reason: draft org.java_websocket.drafts.Draft_10@42664cc0 refuses handshake Remote: false

CalvinKern commented 8 years ago

For anyone else experiencing this problem, I was able to get a success by creating the WebSocket with a different draft type.

For example:

mWebSocket = new WebSocketClient(uri, new Draft_17()) {
...
}
marci4 commented 7 years ago

Hello @greg-witczak,

as mentioned by @CalvinKern please use Draft_17!

Greetings marci4

sushant36 commented 7 years ago

did not help me Draft_17 deprecated in 1.3.4

marci4 commented 7 years ago

Sorry. I deprecated Draft_17 with 1.3.4 because I want people to use the upcoming features for RFC_6455.

The new draft is now Draft_6455

Greetings marci4