housleyjk / ws-rs

Lightweight, event-driven WebSockets for Rust.
MIT License
1.46k stars 219 forks source link

Unable to connect to WS server #311

Open cxnky opened 4 years ago

cxnky commented 4 years ago

I copied the client example, and changed the URL to ws://mydomain.com:port (obviously valid values), but it can't send a message because it just throws the error:

Error: WS Error <Io(Os { code: 10057, kind: NotConnected, message: "A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied." })>

ajaydevarakonda7 commented 4 years ago

Hi @cxnky, Tried to use this https://github.com/housleyjk/ws-rs/blob/master/examples/client.rs example with ws://echo.websocket.org and it ran just fine.

May be you could try if the websocket is truly working in browser or any other language, just put it in a small connecting example?