-
Notifications
You must be signed in to change notification settings - Fork 59
Version 1.2.4 not working anymore on browsers #74
Comments
I had no issue upgrading to latest but if you can provide more info I would look into it |
after some trial & error it seems like I'm able to use version 1.2.4 where I change this line:
with this one of a previous version:
|
That's because you are not respecting the websocket protocols property. Look at this issue and associated fix #66 |
If you give a specific list of protocol at your websocket here https://github.com/JSteunou/webstomp-client/blob/master/src/webstomp.js#L12 or let the default list, your server must accept / handle at least one protocol in the list. example from a real app: the websocket request contains header |
I'm sorry, I'm not sure about where is the problem and what I've to do. I've no control con the server, it's handled by https://docs.spring.io/spring-integration/reference/html/stomp.html and I suppose they follow specifications. |
So, to make it work, do I need to specify the exact protocol I want to use? |
Could you show me how you initialize your webstomp client in JS and what are the headers you can see on the http request (the one upgraded as websocket) from your browser devtool for example. |
I use a code like this:
I'll look for the headers |
ok that means that the client will send the default list of supported STOMP protocols |
I see, but that's one of the most used implementations so it's very bad to not work with it. We can open an issue there if you find that their implementation is against specs. And I can provide you (privately) a STOMP endpoint if you want to make some tests yourself |
I will let you open an issue at spring project if there is an issue on their side, I will not have the time to handle all possible server implementation. I follow the spec and handle this client, that's enough for the little time I have for side projects :) You did not tell me yet what is the http response header you get from your server. |
The connection works fine if I use those options:
|
Debugging your code it seems like in this.ws.onpen() function _this.ws.protocol is empty, while it should not be. Can this be a problem? This is happening in node, using the "ws" npm package as a websocket provider |
I will look into it when I will be back but this is weird. If you let default which is a list of |
The issue is still marked as "needs input", does it? |
Yes. Could you give me a clear state of what works and what does not work (which options, which server, ...) and for each case what are the http response headers and And look here https://github.com/JSteunou/webstomp-client/blob/master/dist/webstomp.js#L98 When there are no protocols matching, the |
What I can tell you for sure is that using the Spring Framework toolkit as a STOMP server, this happens:
|
Ok but I need more information to find the issue, and unless you do not provide it I cannot understand if and where there is an issue from this lib |
ok, please tell me the specifics of what you need, I already sent you the snapshot of the capture of the stream |
I just did
|
Hi there, I'm running into the same issue as @Polve. Basically what's happening is if the server responds with a |
That's weird because again they are all in the list of handle protocols, and I cannot reproduce this issue (when WS instance correctly created with a matched list of expected protocols). Have you try to add some breakpoints in the webstomp client to debug this issue and find what happen? |
You might be concerned by #75 (comment) |
I upgraded my code to use the latest version of this library and while it still work fine under node, it stops working (it does not complete the connection) while running in the browser.
I think it has something to do with the way you handle the supported protocols but I've not yet been able to pinpoint exactly.
The text was updated successfully, but these errors were encountered: