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 IPv6 local_addr for UDP services #92

Closed
rapiz1 opened this issue Jan 11, 2022 · 0 comments · Fixed by #94
Closed

Support IPv6 local_addr for UDP services #92

rapiz1 opened this issue Jan 11, 2022 · 0 comments · Fixed by #94
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@rapiz1
Copy link
Owner

rapiz1 commented Jan 11, 2022

rathole/src/helper.rs

Lines 40 to 46 in e6dd0c8

/// Create a UDP socket and connect to `addr`
pub async fn udp_connect<A: ToSocketAddrs>(addr: A) -> Result<UdpSocket> {
// FIXME: This only works for IPv4
let s = UdpSocket::bind("0.0.0.0:0").await?;
s.connect(addr).await?;
Ok(s)
}

UdpSocket::bind("0.0.0.0:0").await? binds to a IPv4 UDP socket and cannot be used to connect to an IPv6 address. A match on addr can solve this issue.

@rapiz1 rapiz1 added enhancement New feature or request good first issue Good for newcomers labels Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant