1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-28 01:16:10 +03:00
This commit is contained in:
Zack Scholl 2018-09-26 08:46:12 -07:00
parent 82b0d2d4c0
commit c0e9d478e7

View File

@ -42,7 +42,11 @@ func Run(debugLevel, port string) {
func run(port string) (err error) {
log.Debugf("starting TCP server on " + port)
server, err := net.Listen("tcp", "0.0.0.0:"+port)
rAddr, err := net.ResolveTCPAddr("tcp", "localhost:"+port)
if err != nil {
panic(err)
}
server, err := net.ListenTCP("tcp", rAddr)
if err != nil {
return errors.Wrap(err, "Error listening on :"+port)
}