vti / protocol-websocket

Protocol::WebSocket
Other
40 stars 27 forks source link

No client examples at all #36

Open PaulGWebster opened 8 years ago

PaulGWebster commented 8 years ago

Why is every example acting as a server?

vti commented 8 years ago

So you contribute and write one ;)

PaulGWebster commented 8 years ago

Mhmmm I needed it for poe so I wrote https://metacpan.org/pod/POE::Component::Client::WebSocket

;-)

pascal-dev commented 7 years ago

Please, could you give a script example using the "ws://echo.websocket.org" web socket ?

This web socket can be tested here : it sends back messages similar to the ones it receives. This client script would demonstrate how to connect to the web socket, send messages and get messages (for example, it would send "xxx" and get back "xxx").

Thank you very much in advance :-)

vti commented 7 years ago

It's already written. Check out https://github.com/vti/protocol-websocket/blob/master/util/wsconsole

pascal-dev commented 7 years ago

Thank you. It works with "ws://echo.websocket.org" but not with "wss://echo.websocket.org" (secure WebSocket (TLS)). Something has to be changed ?

vti commented 7 years ago

That would require AnyEvent::Handle with tls connect.

pascal-dev commented 7 years ago

Thanks ! I added 'tls => "connect",' in your script (after line 42) and it works with secure Web Socket (URL like "wss://...").