close connection immediately and blacklist #1620
-
if client's connection is probably attacking, how can I close it immediately and insert the address into a dynamic blacklist? pseudocode:
|
Beta Was this translation helpful? Give feedback.
Answered by
davidpdrsn
Dec 6, 2022
Replies: 1 comment
-
I don't know exactly, haven't done this before. But you can probably use hyper's low level connection API (https://docs.rs/hyper/latest/hyper/server/conn/index.html) and do a |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lithbitren
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know exactly, haven't done this before. But you can probably use hyper's low level connection API (https://docs.rs/hyper/latest/hyper/server/conn/index.html) and do a
tokio::select!
between handling the connection and aborting. To close the connection you justdrop
it.