Force close all connections in a node.js http server

后端 未结 5 1496
被撕碎了的回忆
被撕碎了的回忆 2020-12-28 13:33

I have an http server created using:

var server = http.createServer()

I want to shut down the server. Presumably I\'d do this by calling:

<
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-28 13:33

    For reference for others who stumble accross this question, the https://github.com/isaacs/server-destroy library provides an easy way to destroy() a server (using the approach described by Ege).

提交回复
热议问题