Rocket should bind to both IPv6 and IPv4
mitchhentges opened this issue · 2 comments
mitchhentges commented
Bug Reports
- Version of rocket:
0.3.3
- 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>
- 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)
- IMHO I think that Rocket should bind to both IPv4 and IPv6.
SergioBenitez commented
I believe this is a dupe of #209.
mitchhentges commented
Ah, yes, looks like the same issue! I should've looked further down that ticket when looking for one similar to mine :)
Thanks!