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

ipv4 is shown in tracker also when ipv6 was specified during setup #25

Closed
asbachb opened this issue Dec 16, 2017 · 3 comments
Closed

ipv4 is shown in tracker also when ipv6 was specified during setup #25

asbachb opened this issue Dec 16, 2017 · 3 comments

Comments

@asbachb
Copy link
Contributor

asbachb commented Dec 16, 2017

Problem

When a machine has a dual stack configuration (ipv4 & ipv6). Always the ipv4 address is shown on tracker website.
This is caused since nodejs always resolve ipv4 dns before if not specified otherwise.

Solution

Since socket-io seems to be not configurable which dns should be used the dns needs to be resolved before connecting the socket. In order to get the right ip from dns the during the setup specified "ipv" property needs to be passed to dns request.

@num81
Copy link
Contributor

num81 commented Dec 16, 2017

The current work around for this issue is to put the ipv6 addresses into the nodes hosts file.

2400:cb00:2048:1::681b:250 ts1.eu.zensystem.io
2400:cb00:2048:1::681b:350 ts1.eu.zensystem.io
2400:cb00:2048:1::681b:250 ts1.na.zensystem.io
2400:cb00:2048:1::681b:350 ts1.na.zensystem.io
2400:cb00:2048:1::681b:250 ts1.sea.zensystem.io
2400:cb00:2048:1::681b:350 ts1.sea.zensystem.io

This forces the node to preference the ipv6 connection.

asbachb added a commit to asbachb/secnodetracker that referenced this issue Dec 17, 2017
…st (see HorizenOfficial#25)

Otherwise the ipv4 address is resolved.

Removed "{ multiplex: false }" option since it's the same as "{ forceNew : true }" according docs (https://socket.io/docs/client-api/#new-manager-url-options)
"[...] unless the multiplex option is passed with false. Passing this option is the equivalent of passing 'force new connection': true or forceNew: true."
@asbachb
Copy link
Contributor Author

asbachb commented Dec 17, 2017

Seems to be a well known problem in node applications: nodejs/node#14731

But also seems that there's no real fixup for that.

asbachb added a commit to asbachb/secnodetracker that referenced this issue Dec 20, 2017
…n selected (see HorizenOfficial#25)

!!!This is a temporary fix!!! A patch for node.js is beeing prepared which adds a flag to enable RFC behaviour in dns resolving.
@asbachb
Copy link
Contributor Author

asbachb commented Dec 20, 2017

I had a little discussion with some nice guy on node.js irc. We found out that node.js is not following the ipv6 RFC which describe that applications should return ipv6 addresses first.
node.js internally resort the addresses to show ipv4 first.

There's a PR to provide a flag to switch to an RFC compliant behaviour: nodejs/node#17793

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

No branches or pull requests

2 participants