The connection should be established with and without a trailing slash.
This works: WebSockex.start_link("ws://localhost", ...
This works: WebSockex.start_link("ws://localhost/not-root", ...
Remarks
Maybe this is an issue of my websocket server, rather than the WebSockex client?
However, the connection can be established by a different websocket client (Firefox weasel plugin).
Looking at the network trace of that plugin, it looks like it adds the trailing slash automatically in the HTTP request if it was not explicitly provided. Could that be a sensible approach for WebSockex as well?
How to reproduce
WebSockex.start_link("ws://localhost", __MODULE__, nil)
Error:reason: %WebSockex.ConnError{original: :closed}
Expected behaviour
The connection should be established with and without a trailing slash.
This works:
WebSockex.start_link("ws://localhost", ...
This works:WebSockex.start_link("ws://localhost/not-root", ...
Remarks
Maybe this is an issue of my websocket server, rather than the
WebSockex
client?However, the connection can be established by a different websocket client (Firefox weasel plugin). Looking at the network trace of that plugin, it looks like it adds the trailing slash automatically in the HTTP request if it was not explicitly provided. Could that be a sensible approach for
WebSockex
as well?