smartystreets / goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
http://smartystreets.github.io/goconvey/
Other
8.25k stars 555 forks source link

goconvey -host=0.0.0.0 uses tcp6 in stead of tcp #427

Open IzakMarais opened 8 years ago

IzakMarais commented 8 years ago

I am trying to run the goconvey server binding to host 0.0.0.0. However, while the default 127.0.0.1 (or other IPS, eg. in the 172 range) binds correctly using tcp, 0.0.0.0 binds using tcp6:

Correct

$ goconvey
2016/05/11 05:30:07 goconvey.go:61: Initial configuration: [host: 127.0.0.1] [port: 8080] [poll: 250ms] [cover: true]
2016/05/11 05:30:08 tester.go:19: Now configured to test 10 packages concurrently.
2016/05/11 05:30:08 goconvey.go:192: Serving HTTP at: http://127.0.0.1:8080
2016/05/11 05:30:08 goconvey.go:105: Launching browser on 127.0.0.1:8080

$ netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      15300/bin/goconvey

Problem

$ goconvey -host=0.0.0.0
2016/05/11 05:40:23 goconvey.go:61: Initial configuration: [host: 0.0.0.0] [port: 8080] [poll: 250ms] [cover: true]
2016/05/11 05:40:23 tester.go:19: Now configured to test 10 packages concurrently.
2016/05/11 05:40:23 goconvey.go:192: Serving HTTP at: http://[::]:8080
2016/05/11 05:40:23 goconvey.go:105: Launching browser on [::]:8080

$ netstat -tlnp
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:22              0.0.0.0:*               LISTEN      -
tcp6       0      0 :::8080                 :::*                    LISTEN      14923/bin/goconvey
benpaxton-hf commented 7 years ago

A server listening on [::] can be reached on any local IP address, whether IPv4 or IPv6.