Skip to content
New issue

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

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

Already on GitHub? # to your account

Add ALPN Protocols Client & Server config option #1

Merged
merged 5 commits into from
Dec 10, 2022
Merged

Add ALPN Protocols Client & Server config option #1

merged 5 commits into from
Dec 10, 2022

Conversation

LeHaine
Copy link
Contributor

@LeHaine LeHaine commented Dec 10, 2022

Adds a client & server config option to pass in ALPN protocols. It is empty by default.

This includes a new with_alpn_protocols() method for ClientConfig and ServerConfig.

@@ -67,7 +69,8 @@ fn sync_example() {
// clients, as well as the total number of expected clients (or None if server can accept any
// number of clients). A thread will be spun up to wait for extra clients beyond the number
// to block on.
let server_config = ServerConfig::new(server_addr, 0, Some(1), 3, 2);
let mut server_config = ServerConfig::new(server_addr, 0, Some(1), 3, 2);
server_config.with_alpn_protocols(alpn_protocols);
Copy link
Owner

Choose a reason for hiding this comment

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

I would like to keep the actual example code a minimal example. Could you either add this as a comment like:

// Here you can set various optional configurations
// server_config.with_alpn_protocols(&[b"hq-29"]);

Same with the client config below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely.

@spoorn
Copy link
Owner

spoorn commented Dec 10, 2022

Thanks!

@spoorn spoorn merged commit b844651 into spoorn:main Dec 10, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants