8000 Root URL without trailing slash leads to %WebSockex.ConnError{original: :closed}) · Issue #102 · dominicletz/websockex · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /react-partial>

Root URL without trailing slash leads to %WebSockex.ConnError{original: :closed}) #102

Open

Description

@ftes

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?

Activity

  1. ftes commented on Nov 29, 2021

    @ftes
    Author

    From a brief look at the weasel source I couldn't find any "add a trailing /" logic.
    Probably the browser adds / as the default path.

  2. changed the title [-]URL without trailing slash leads to %WebSockex.ConnError{original: :closed})[/-] [+]Root URL without trailing slash leads to %WebSockex.ConnError{original: :closed})[/+] on Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0