Skip to content

WebSocket Closes Immediately After Connection on Android (RN 0.74.5, Stomp 7.0.0) #649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
nazlisen opened this issue Mar 23, 2025 · 2 comments

Comments

@nazlisen
Copy link

I am experiencing an issue where the WebSocket connection closes immediately after opening, but only on Android. The same code works fine on iOS.

Environment
• React Native version: 0.74.5
• StompJS version: 7.0.0
• Platform: Android

When adding console.log to the debug function, the following logs appear:

Opening web socket…
Web socket opened…
Connect
necessary information(hearbeat ,accept-version etc.)
Connected closed (wss url)

In the onclose event, the following log appears:

{ code: 1000, isTrusted: false, reason: "" }

Additional Details
• I have tried adding forceBinaryWSFrames and appendMissingNULLonIncoming, but they had no effect.
• I also implemented the TextEncoder workaround mentioned in the documentation, but the issue persists.
• Upgrading the library version did not work

It seems that the WebSocket connection closes automatically after an attempt to connect.

Are there any recommended workarounds or fixes for this problem?

@ted911
Copy link

ted911 commented May 21, 2025

same issue,
Env

  • RN 0.78.1
  • stompJS 7.1.1
  • platform android

Opening Web Socket...
Web Socket Opened...
CONNECT
Authorization:Bearer test-token
accept-version:1.2,1.1,1.0
heart-beat:10000,10000

@ted911
Copy link

ted911 commented May 21, 2025

i found this error,

can you try again without forceBinaryWSFrames option.

i try this method, it work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants