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?