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

feat(iroh-net): Send HTTP/1.1 HOST header on requests to relay #2881

Merged
merged 3 commits into from
Nov 4, 2024

Conversation

matheus23
Copy link
Member

@matheus23 matheus23 commented Nov 1, 2024

Description

Reverse proxies that map multiple virtual hosts need some help to know where to forward requests to.
That's what the HOST header is for, and it's mandatory for HTTP/1.1 requests.

Closes #2870

Change checklist

  • Self-review.
  • [ ] Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • [ ] All breaking changes documented.

@matheus23 matheus23 self-assigned this Nov 1, 2024
@matheus23
Copy link
Member Author

@link2xt please try out this PR and let us know if it helps ✌️

Copy link

github-actions bot commented Nov 1, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2881/docs/iroh/

Last updated: 2024-11-04T08:32:35Z

@link2xt
Copy link
Contributor

link2xt commented Nov 1, 2024

Reverse proxies need some help to know where to forward requests to.

That's a bit strange explanation. I already know at my reverse proxy where I want to forward requests, it's just that Host header is required by HTTP/1.1 standard and nginx is strict about enforcing it.

Copy link

github-actions bot commented Nov 1, 2024

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 5340b50

@matheus23
Copy link
Member Author

matheus23 commented Nov 1, 2024

I can see that reading strange to you. I adjusted the PR description to hopefully clarify.
Not all proxies need this HOST header to help them. Only the ones that map multiple virtual hosts.
And if I'm reading the history here correctly, they added mandatory support for HOST headers to make all client applications send them by default, so any virtual-host-mapping proxies out there just work.

@link2xt
Copy link
Contributor

link2xt commented Nov 1, 2024

Tested, can connect to the relay over nginx proxy now.

@matheus23 matheus23 added this pull request to the merge queue Nov 4, 2024
@matheus23 matheus23 removed this pull request from the merge queue due to a manual request Nov 4, 2024
@matheus23 matheus23 added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit 4bfa58e Nov 4, 2024
27 of 28 checks passed
@matheus23 matheus23 deleted the matheus23/add-host-header branch November 4, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

iroh-net does not send the Host: header to the relay
3 participants