Listen to a different IP address

前端 未结 4 1059
自闭症患者
自闭症患者 2020-12-10 02:34

This is my code:

var server = express();

// Create the HTTP server
http
    .createServer(server)
    .listen(80, \'10.10.10.10\');

Once t

4条回答
  •  悲&欢浪女
    2020-12-10 02:51

    What your are trying to accomplish is quite non-standard in my opinion. I would suggest server.close(). Close will wait all request to finish and trigger the "close" event. You can bind on that event to listen on the new IP. This is quite weird tho.

提交回复
热议问题