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

Rocket should bind to both IPv6 and IPv4 #491

Closed
mitchhentges opened this issue Dec 3, 2017 · 2 comments
Closed

Rocket should bind to both IPv6 and IPv4 #491

mitchhentges opened this issue Dec 3, 2017 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@mitchhentges
Copy link

Bug Reports

  1. Version of rocket: 0.3.3
  2. OS: Arch Linux x64

When Rocket starts a server where the address is localhost, it binds to IPv6 by default, rather than running on both IPv6 and IPv4.
This can cause a confusing developer experience where some tools (like Firefox) will check both IPv4 and IPv6 when you access localhost and will connect, but others (such as netcat, NodeJS's built-in http module, etc) won't find Rocket and will throw a "connection refused" error.
I expected Rocket to work more out-of-box, like http-server.

netstat -tulpn output:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      18215/node          // http-server
tcp6       0      0 ::1:8000                :::*                    LISTEN      16929/hello_world   // Rocket
<snip>
  1. How to reproduce the issue:
    Run the Rocket quickstart
git clone https://github.com/SergioBenitez/Rocket
cd Rocket
git checkout v0.3.3
cd examples/hello_world
cargo run

// from other terminal
netcat localhost 8000
// will immediately exit with exit code 1 (failed to connect)
  1. IMHO I think that Rocket should bind to both IPv4 and IPv6.
@SergioBenitez
Copy link
Member

I believe this is a dupe of #209.

@mitchhentges
Copy link
Author

Ah, yes, looks like the same issue! I should've looked further down that ticket when looking for one similar to mine :)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants