-
Notifications
You must be signed in to change notification settings - Fork 358
Open
Description
if client's connection of actix-web is probably attacking, how can I close it immediately and insert the address into a dynamic blocklist?
when a addr is in the blocklist, i don't what to parse the uri or headers from this addr, just close the connection without sending or receiving any of the message.
let listener = TcpListener::bind(...).await?;
while let (socket, addr) = listener.accept().await? {
if blocklist.contains(&addr) {
continue;
}
tokio::spawn(async move {
...
if connection_is_attacking() {
blocklist.insert(addr);
connection.close_immediately();
}
...
});
}
Metadata
Metadata
Assignees
Labels
No labels