stomp-js / stompjs

Javascript and Typescript Stomp client for Web browsers and node.js apps
Apache License 2.0
763 stars 81 forks source link

Not able to subscribe to the topic seems to be onConnect function is not executing #578

Closed tarunkhurana1988 closed 1 year ago

tarunkhurana1988 commented 1 year ago

I am using NodeJS for backend and ReactJS for frontend using stomp protocol. I am using ws for websocket. I used the recent version of @stomp/stomjs and also tried with downgraded version. I am attaching files which is using 5.0.0.

The issue I am facing onConnect function not working. Due to this I am unable to subscribe to topics. There are other functions like debug, beforeConnect working.

It is not working in any browser not sure I am doing something wrong?

Can you please have a look?

react-websocket.zip

kum-deepak commented 1 year ago

Please switch on debug and attach your entire console output.

tarunkhurana1988 commented 1 year ago

Hi @kum-deepak attached the zip file and added a github repo also containing source code https://github.com/tarunkhurana/websocket-stomjs-demo

Also I am running the front-end application on different port and back-end application on different port. For that I have set the headers. output.zip

tarunkhurana1988 commented 1 year ago

@kum-deepak I tried to debug the code it seems to be server is not sending CONNECTED frame back to the client that's why the client onConnect callback is not executing but client is sending CONNECT frame based on the screenshot provided it seems to be server (stomp library) is not processing and sending the CONNECTED frame back and the server side is also not executing onConnect callback

kum-deepak commented 1 year ago

I am closing this issue, as it does not seem to be an issue related to this library. Please reopen if there is a need.