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

on ipv6 supporting server stratum sockets are opening only in ipv6 addresses #20

Closed
konak opened this issue Mar 7, 2022 · 4 comments
Closed

Comments

@konak
Copy link

konak commented Mar 7, 2022

Hi !

I have installed foundation-server on my server hosted on provider network and configured both ipv6 and ipv4.
After starting stratum server were opening port only on ipv6 addresses.

locally I have changed code in file of foundation-stratum project:
https://github.com/blinkhash/foundation-stratum/blob/master/scripts/main/network.js
from line 71 to:

  const listenOptions = {
    port: parseInt(currentPort),
    host: "0.0.0.0",
    ipv6Only: false
  };

  // Setup Server to Listen on Port
  server.listen(listenOptions, () => {
    serversStarted += 1;
    if (serversStarted == stratumPorts.length) {
      _this.emit('started');
    }
  });

Server started listening to on ipv4 address ..
If it is Ok, I can make that change in the project.

Wish you all the best !

@blinkhash
Copy link
Owner

Seems like a good change, thanks for the contribution! I'll review it further if you open a PR

@konak
Copy link
Author

konak commented Mar 12, 2022

Will check the case to accept connections on IPv6 and IPv4 concurrently and will make a PR in this two days.

@konak
Copy link
Author

konak commented Mar 12, 2022

Need some doublechecking on the server where I had that issue. Seems that issue does not exist on lates version of node. It is starting listen on IPv6 port like:

root@xx:/home/ttt# netstat -na | grep 2299
tcp6       0      0 :::2299                 :::*                    LISTEN

but accepting connections from IPv4 too:

root@xx:/home/ttt# netstat -na | grep 2299
tcp6       0      0 :::2299                 :::*                    LISTEN
tcp6       0      0 65.108.84.205:2299      37.157.212.30:55355     ESTABLISHED

It will be possible to do in next two days, when I will put the server to maintenance mode.
Sorry for inconvenience.

@konak
Copy link
Author

konak commented Mar 13, 2022

I have doublechecked the code on the server had that issue. Everything were working just fine without any code changes. Seems the issue was in node version or in some other thing. So there is no any need to make changes in the code. With current implementation server is starting listen on IPv6 port but it is also accepting IPv4 connections.
Sorry for inconvenience. My fault.

@konak konak closed this as completed Mar 13, 2022
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