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

convert from url::Url on connect / accept #15

yoshuawuyts opened this issue Feb 4, 2020 · 0 comments

convert from url::Url on connect / accept #15

yoshuawuyts opened this issue Feb 4, 2020 · 0 comments


Copy link

@yoshuawuyts yoshuawuyts commented Feb 4, 2020

tcp takes localhost:8080, http takes http://localhost:8080/foo/bar, tls takes localhost. Converting between all of these can be difficult to remember; it'd be great if TLS knew how to take a Url and get the relevant bits.

The way I'd do this would be to introduce a new type: Host that has From<&Url> and From<&str> impls. accept would then be:

pub async fn accept(host: impl Into<Host>, stream: impl Read + Write) -> Result;

This would make it lots easier to use TLS on top of existing streaming HTTP setups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.