# Basic WebSocket Example

<erl> out(A) -> Host = (A#arg.headers)#headers.host, {abs_path, Path} = (A#arg.req)#http_request.path, EndpointPath = filename:dirname(Path) ++ "websockets_example_endpoint.yaws", WebSocketLocation = Host ++ EndpointPath, Body = html_body(WebSocketLocation), {content, "text/html", Body}. %% this html was copied from the basic example in %% http://github.com/davebryson/erlang_websocket/ html_body(WebSocketLocation) -> "

# Basic Echo Example

- Sending \"bye\" closes the connection.
- Sending \"say hi later\" sends \"hi there!\" asynchronously.
- Sending \"fragmented message\" sends \"fag1frag2frag2\".
- Sending \"something\" does nothing.
- Other messages are echoed.

Use extended version
Enable keepalive timer
KeepAlive timeout (in milliseconds)
Say Something:
". </erl>