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

Improve network address config documentation, update TODO #219

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## High priority

* Change network address handling to accept separate IPv4 and IPv6
addresses. Open a socket for each one, setting ipv6_only flag on
the IPv6 one (unless user opts out).
* update zerocopy version (will likely require minor rewrite)

* udp (uring)
Expand Down
20 changes: 8 additions & 12 deletions crates/http/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,14 @@ pub struct NetworkConfig {
/// - "127.0.0.1:3000" binds to port 3000 on the loopback interface
/// (localhost)
///
/// When it comes to IPv6-style addresses, behaviour differs between
/// operating systems. On Linux or macOS, by default, both IPv4 and IPv6
/// traffic is received. For instance:
/// - "[::]:3000" binds on all interfaces on port 3000, with both IPv4 and
/// IPv6 traffic being accepted
/// - "[::1]:3000" binds on the loopback interface (localhost) on port
/// 3000, with both IPv4 and IPv6 traffic being accepted
///
/// In this case, to only accept traffic over IPv6, use an IPv6-style
/// address, and additionally set "only_ipv6" below.
///
/// For other operating systems, please refer to their documentation.
/// When it comes to IPv6-style addresses, behaviour is more complex and
/// differs between operating systems. On Linux, to accept both IPv4 and
/// IPv6 traffic on any interface, use "[::]:3000". Set the "only_ipv6"
/// flag below to limit traffic to IPv6. To bind to the loopback interface
/// and only accept IPv6 packets, use "[::1]:3000" and set the only_ipv6
/// flag. Receiving both IPv4 and IPv6 traffic on loopback is currently
/// not supported. For other operating systems, please refer to their
/// respective documentation.
pub address: SocketAddr,
/// Only allow access over IPv6
pub only_ipv6: bool,
Expand Down
20 changes: 8 additions & 12 deletions crates/udp/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,14 @@ pub struct NetworkConfig {
/// - "127.0.0.1:3000" binds to port 3000 on the loopback interface
/// (localhost)
///
/// When it comes to IPv6-style addresses, behaviour differs between
/// operating systems. On Linux or macOS, by default, both IPv4 and IPv6
/// traffic is received. For instance:
/// - "[::]:3000" binds on all interfaces on port 3000, with both IPv4 and
/// IPv6 traffic being accepted
/// - "[::1]:3000" binds on the loopback interface (localhost) on port
/// 3000, with both IPv4 and IPv6 traffic being accepted
///
/// In this case, to only accept traffic over IPv6, use an IPv6-style
/// address, and additionally set "only_ipv6" below.
///
/// For other operating systems, please refer to their documentation.
/// When it comes to IPv6-style addresses, behaviour is more complex and
/// differs between operating systems. On Linux, to accept both IPv4 and
/// IPv6 traffic on any interface, use "[::]:3000". Set the "only_ipv6"
/// flag below to limit traffic to IPv6. To bind to the loopback interface
/// and only accept IPv6 packets, use "[::1]:3000" and set the only_ipv6
/// flag. Receiving both IPv4 and IPv6 traffic on loopback is currently
/// not supported. For other operating systems, please refer to their
/// respective documentation.
pub address: SocketAddr,
/// Only allow access over IPv6
pub only_ipv6: bool,
Expand Down
20 changes: 8 additions & 12 deletions crates/ws/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,14 @@ pub struct NetworkConfig {
/// - "127.0.0.1:3000" binds to port 3000 on the loopback interface
/// (localhost)
///
/// When it comes to IPv6-style addresses, behaviour differs between
/// operating systems. On Linux or macOS, by default, both IPv4 and IPv6
/// traffic is received. For instance:
/// - "[::]:3000" binds on all interfaces on port 3000, with both IPv4 and
/// IPv6 traffic being accepted
/// - "[::1]:3000" binds on the loopback interface (localhost) on port
/// 3000, with both IPv4 and IPv6 traffic being accepted
///
/// In this case, to only accept traffic over IPv6, use an IPv6-style
/// address, and additionally set "only_ipv6" below.
///
/// For other operating systems, please refer to their documentation.
/// When it comes to IPv6-style addresses, behaviour is more complex and
/// differs between operating systems. On Linux, to accept both IPv4 and
/// IPv6 traffic on any interface, use "[::]:3000". Set the "only_ipv6"
/// flag below to limit traffic to IPv6. To bind to the loopback interface
/// and only accept IPv6 packets, use "[::1]:3000" and set the only_ipv6
/// flag. Receiving both IPv4 and IPv6 traffic on loopback is currently
/// not supported. For other operating systems, please refer to their
/// respective documentation.
pub address: SocketAddr,
/// Only allow access over IPv6
pub only_ipv6: bool,
Expand Down
Loading