becvert / cordova-plugin-websocket-server

Cordova WebSocket Server Plugin
MIT License
84 stars 35 forks source link

How to connect #47

Closed northkode closed 6 years ago

northkode commented 6 years ago

How does an outside device connect to this..

all i get on starting the server is:

index.js:69 Listening on :::41574

but when i use my local ip from my network it says: VM3493:1 WebSocket connection to 'ws://192.168.1.72:41574/' failed: Error during WebSocket handshake: Unexpected response code: 404

becvert commented 6 years ago

What's an outside device for you? Your client needs to be on the same network. Also you need a pure web socket client implementation to be able to connect. socket.io's client won't do as far as I know for instance.

comrat commented 6 years ago

I've same problem and try it with socket.io and with pure WebSocket but the result was the same - the 'handshake error 404'. And I've try to remove some properties from 'start' method options: "origins", "protocols" and "tcpNoDelay" (I've copypasted them from README.md example) and It works for me HIH

becvert commented 6 years ago

release 1.4.10 should fix this. protocols option was the culprit.

becvert commented 6 years ago

Closing now