How to prevent DOS attacks on my http server which written in node.js?

后端 未结 3 2118
醉酒成梦
醉酒成梦 2021-02-10 11:36

using node.js, the net module for building a tcp server which can hande http requests.

I would like to prevent dos attacks so what I have done is somthing like this:

3条回答
  •  梦毁少年i
    2021-02-10 12:09

    from the API if it helps anyone, should be used smartly :

     server.pause(msecs)
    

    Stop accepting connections for the given number of milliseconds (default is one second). This could be useful for throttling new connections against DoS attacks or other oversubscription.

提交回复
热议问题