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 for connecting to IPv6 peers and setting peer Ports #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MeijerinkB
Copy link

A small patch that allows IPv6 addresses to be used as peers. This is currently prevented due to a conflict between net.IP (which wants the address without brackets) and net.Dial (which requires brackets).
Also modified the way peers are parsed to allow a port to be added so it becomes possible to connect to a peer not listening on the default port. Due to the way net.IP and net.SplitHostPort work this does cause the somewhat confusing situation that IPv6 addresses without a port are only accepted without brackets, but addresses with a port require them.

IPv6 addresses given to -peers are now handled in a way that prevents
conflict between net.IP (which wants the address without brackets)
and net.Dial (which requires brackets).
Ports can now also be added so it is possible to connect to peer not
listening on the default port.
@benjojo
Copy link
Owner

benjojo commented Apr 22, 2021

Looks good to me, thank you!

I'll give this a test later and if it works I'll merge

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.

2 participants