In nodejs, how do I check if a port is listening or in use

后端 未结 3 1659
再見小時候
再見小時候 2021-02-19 23:20

I\'ll be very specific here in the hope that folks who understand this can edit to rephrase to the general situation.

Currently when you run "node debug", it sp

3条回答
  •  抹茶落季
    2021-02-20 00:16

    You should be able to use the node-netstat module to detect ports that are being listened to. Unfortunately, it seems that it only supports Windows and Linux, as is. However, the changes that would be required to have it support OS X do not look to be terribly large. UPDATE: It now supports OS X...er macOS...er whatever they're calling it now.

提交回复
热议问题