I'm trying to get the YAWS websocket example from here running on my local. It's a basic ws-based echo server.
I have
- YAWS set up and running on
localhost:8080
(direct from the Debian repos; no conf changes except pointing it to a new root directory) - the code listing from the bottom of this page wrapped in
<erl>
tags saved aswebsockets_example_endpoint.yaws
- this page saved as
index.yaws
(I literally copy/pasted the view-source for it, saved it as that file and pointed the socket request atlocalhost:8080
rather thanyaws.hyber.org
).
When I visit localhost:8080/websockets_example_endpoint.yaws
in-browser, it displays the text "You're not a web sockets client! Go away!", as expected. When I visit localhost:8080
, it points me to the javascript enabled form, but the "Connect" button does nothing when clicked. If I leave index.yaws
pointed at yaws.hyber.org
instead of localhost:8080
, the echo server connects and works exactly as expected.
Can anyone give me a hint as to what I'm doing wrong (or alternatively, point me to source for a working example)?