stomp-js / stomp-websocket

Stomp client for Web browsers and node.js apps
https://stomp-js.github.io/stomp-websocket/
Apache License 2.0
141 stars 36 forks source link

Get Handshake Response code / Don't retry on 403 #36

Closed zkendall closed 6 years ago

zkendall commented 6 years ago

I'm tearing my hair out trying to not retry on 403 response code from initial handshake.

screen shot 2018-05-11 at 12 34 39 pm

Do you know of any way to do this or can it be added to feature backlog?

kum-deepak commented 6 years ago

It has been a black box for me as well. There is WebSocket handshake which happens at the time of opening WebSocket connection. The actual requests are opaque and I have not been able to find a way to access those.

The Exception that you are seeing is within libraries Browser maintains - definitely likely to vary across Browsers.

zkendall commented 6 years ago

Dang. That's too bad. Current work around for me is to call auth to validate my token in my error handler. If that returns a 4xx, then I set reconnect_delay back to 0, otherwise I double it to back off.

kum-deepak commented 6 years ago

Closing this issue, please reopen if needed.

kum-deepak commented 6 years ago

Planning for next version of stompjs is on the way. Your participation will be really appreciated, please join at https://github.com/stomp-js/stompjs/issues/1