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

allow apps to listen on IPv6 addresses #899

Merged
merged 1 commit into from
Dec 28, 2020
Merged

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Dec 18, 2020

This is based on PR #882, so the commit of interest is bfb407e.

The issue is that host + ":" port is not always correct for IPv6 because the host needs brackets around it when joined with a port. This updates all the listen address parsing and construction code to work properly with IPv6.

For dcrdex with --rpclisten=[::1]:17232:

before

NewServer failed: address ::1:17232: too many colons in address

after

[INF] COMM: RPC server listening on [::1]:17232

A similar fix is applied to client.

@chappjc chappjc changed the title Ipv6 listen allow apps to listen on IPv6 addresses Dec 18, 2020
@buck54321
Copy link
Member

This ready after rebase? Seems good to me.

Copy link
Member

@JoeGruffins JoeGruffins left a comment

Choose a reason for hiding this comment

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

Working well with localhost. I know nothing about ipv6 though. Should logs also have brackets?

2020-12-28 15:43:43.434 [TRC] COMM[WS]: Sent 37 and dropped 0 messages to ::1 before shutdown.
2020-12-28 15:43:43.434 [DBG] AUTH: Link down: id=1, ip=::1.
2020-12-28 15:43:43.434 [TRC] COMM: Disconnected websocket client ::1

@chappjc chappjc merged commit f0ef965 into decred:master Dec 28, 2020
@chappjc chappjc deleted the ipv6-listen branch December 28, 2020 15:30
@chappjc
Copy link
Member Author

chappjc commented Dec 28, 2020

@JoeGruffins perhaps brackets would look nicer there, but the net.IP stringer doesn't put them in and I'm not sure it's worth the extra work to wrap the string if it's ipv6. The brackets would be totally necessary for readability if there were a port though.

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

3 participants