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

SimpleHttp IPv6 support #62

Closed
tthebst opened this issue Jun 30, 2022 · 1 comment · Fixed by #63
Closed

SimpleHttp IPv6 support #62

tthebst opened this issue Jun 30, 2022 · 1 comment · Fixed by #63

Comments

@tthebst
Copy link
Contributor

tthebst commented Jun 30, 2022

https://github.com/apoelstra/rust-jsonrpc/blob/master/src/simple_http.rs#L302

Url parsing currently fails for IPv6 addresses.

My suggestion would be to sth simpler like this. Instead of trying to split the string.

// Needs to be of format <host_name>:<port>
let mut addr = match after_auth.to_socket_addrs() {
    Ok(addr) => addr,
    Err(_) => {
        // Try to add fallback port
        format!("{}:{}", after_auth, fallback_port).to_socket_addrs()?
    }
};
@apoelstra
Copy link
Owner

This seems like it'd be worth a shot. I seem to remember trying this a long time ago and finding that passing strings directly to to_socket_addrs didn't work for some reason.

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 a pull request may close this issue.

2 participants