TCP servers: Drop Connection instead of reset or response?

Is it possible in Node.JS to "delete" a connection so that

  • The client never receives a response (200, 404 or otherwise)
  • The client is never notified of the end of the connection (never receives a reset connection or end of stream)
  • Server resources are freed (the server should not try to maintain the connection in any way)

I specifically ask about Node.JS HTTP servers (which are really just complex TCP servers) on Solaris., But if there are cases for other OSs (Windows, Linux) or programming languages ​​(C / C ++, Java) that allow it interests me.

Why do I need it?

To annoy or slow down (possibly single-threaded) robots like phpMyAdmin Probe .

I know that this is not exactly what is important, but these types of questions can help me know the boundaries of my programs.

I know that the client host is likely to retransmit connection packets, since I never send a reset.

+4
source share
2 answers

This is not possible on a common TCP stack (compared to your own TCP stack). The reasons are as follows:

  • Closing a socket sends an RST
  • Even if you do not send RST, the client continues to assume that the connection is open when the server closed the connection. If the client sends any packet to this connection, the server sends RST.

You might want to study the firewall of these robots, and block / speed restrict their IP addresses to something like iptables (linux) or the equivalent on a solarium.

+1
source

closing the connection should not send RST. There are 3 ways to disrupt the process.

+1
source

Source: https://habr.com/ru/post/1381189/


All Articles