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

Support requets to domain names in example http_server #2513

Merged
merged 2 commits into from
Apr 29, 2021
Merged

Support requets to domain names in example http_server #2513

merged 2 commits into from
Apr 29, 2021

Conversation

telotic
Copy link
Contributor

@telotic telotic commented Apr 24, 2021

A String authority will be converted to SocketAddr (https://docs.rs/tokio/1.5.0/tokio/net/trait.ToSocketAddrs.html) via under-the-hood DNS lookups. The proxy only needs to check whether the authority part exists (the uri is an absolute uri) to support requests to domain names. This would make the example even more useful.

Another change I packed into this PR is to slightly simplify the tunnel method using tokio::io::copy_bidirectional. I'm open for objections if this introduces some side effects that I'm unware of.

Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clean up, thanks!

@seanmonstar seanmonstar merged commit 4e9a006 into hyperium:master Apr 29, 2021
@telotic telotic deleted the improve-http-server branch April 29, 2021 00:22
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.

2 participants