Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rfc7230: Port number in Host header when not std. #132

Open
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

dominicletz
Copy link
Contributor

I ran into a problem of getting a "Forbidden" return on a ws://localhost:9944 service when using websockex while connecting with wscat worked fine. After inspecting the wire communication with tcpdump I found that wscat was always sending the port number in the communication: Host: localhost:9944 while websockex did not include it and just submitted Host: localhost -- The service was checking that hostname and did not allow any connections not matching the hostname + port.

After checking rfc7230 on this it seems appending the port number is in fact the right thing to do when the port number is different from the default port of the scheme (http/ws=80 and https/wss=443).

This patch fixes the issue and gets us nearer to rfc7230 conformance.

HenKo-94 and others added 30 commits December 20, 2021 15:32
 and skip ssl tests that fails in the v0.4.3 code
According to [this article](https://www.lob.com/blog/websocket-org-is-down-here-is-an-alternative) the server at `echo.websocket.org` was shut down in 2021. The author provides an alternative echo server URL, used here.

See also [this Elixir forum thread](https://elixirforum.com/t/matcherror-no-match-of-right-hand-side-value-error-websockex-requesterror-code-200-message-ok/51900) where the issue was originally reported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants