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

Make TlsStream public and remote_addr accessible #217

Closed
wants to merge 2 commits into from

Conversation

ousado
Copy link

@ousado ousado commented Aug 3, 2023

Make TlsStream public and remote_addr accessible - useful if access to the remote address is required in make_service_fn, service_fn or connection/request handlers:

let make_svc = make_service_fn(|stream:&TlsStream| {
    let remote_addr = stream.remote_addr();
    async move {
        Ok::<_, io::Error>(service_fn(move |req| {
            handle_connection(req, remote_addr)
    }))
}

@ousado
Copy link
Author

ousado commented Aug 4, 2023

should have looked at the other TlsAcceptor and related PRs first.

@ousado ousado closed this Aug 4, 2023
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.

None yet

1 participant