reactphp / socket

Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.

Home Page:https://reactphp.org/socket/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Security] Response size limitation

ziaratban opened this issue · comments

Hi

How can i limit the size of the response from the client to prevent a ddos ​​attack?

For example, after sending a client more than 100 bytes, the connection must be disconnected.

ratchetphp/Ratchet#892

@ziaratban Thanks for bringing this up, but it's kind of hard to give useful information with this little information. What response are we talking about and what kind of DDoS are we talking about?

If you want to close the connection, you can simply call $connection->close(). If you want to close the connection after sending some data (such as 100 bytes), you may call $connection->end($data) together with a possible time out handling logic to also call close().

I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can always reopen this 👍

@clue thanks.
I thinks It's better to continue this issue in ratchetphp/Ratchet#892