NathanaelA / nativescript-websockets

Websockets for NativeScript
83 stars 43 forks source link

Cannot open web socket for Android #79

Closed nitnahtnit closed 3 years ago

nitnahtnit commented 4 years ago

Hello, I'm trying to create a websocket to a server on LAN using nativescript (vue). The app is running on a physical device Android 9.

When I use

let socket = new WebSocket("wss://:5566/ws", ['wss']); socket.addEventListener('open', ev => console.log('opened'));

Or

let socket = new WebSocket("wss://:5566/ws", []); socket.addEventListener('open', ev => console.log('opened'));

It does not give an errors but the server doesn't receive anything, however the server is reacting to a test connection made from browser console using the browser WebSocket(). Am I missing something?

Inside socket is has the _url set correctly, When I call socket.isOpen() it returns false.

Petru-design commented 3 years ago

Any updates on this? I have the exact same issue

nitnahtnit commented 3 years ago

No sorry was too much pain so went native android instead

NathanaelA commented 3 years ago

Please test the demo. I just tried the latest version (2.0) on a very recent android emulator and had no issues.