Replies: 4 comments
-
We didn't have discussions enabled before, but I figure they would be a good choice for our project... and this issue is perfect for a discussion 😂 I don't know for sure if the functionality is built-in in a friendly way, but I know that I'm tracking it via session.host_name I'm pretty sure that you can get the client connection from somewhere. You could check the aiosmtpd code to see how the hostname gets passed - if that's coming directly from the client socket then it's at least as trustworthy as any other mechanism. But if you have a proxy in front of your server then it might report the proxy as the client, rather than the ultimate end client, so you may need to do some poking around to figure it out. But generally speaking I think that the session object should, ya know, contain each session. HTH! |
Beta Was this translation helpful? Give feedback.
-
Wonderful :D ! I can easily track the "connections" part with the Not every server will do a proper One thing I thought about was overriding the You mention tracking the session object. I agree that is an interesting idea, but the same remain : how to track that the session object is "closed" (set to none) ? Another way, maybe (again, not sure), would be to somehow track the |
Beta Was this translation helpful? Give feedback.
-
Trying to find the best solution, I came up with something that seems robust: I add a "done callback" to the handler_coroutine :
From my tests, it seems to handle all the cases (normal quit, disconnect from server, from client, exception, hard close). Of course, I'm open to a better and more robust solution if any ! |
Beta Was this translation helpful? Give feedback.
-
Seems to be a good feature to be added publicly (no leading underscore) in 1.5.0 :) |
Beta Was this translation helpful? Give feedback.
-
Hi!
(This is not an issue, sorry if it's not i the right place)
I'm wondering if there is a way to track when a user is connecting, but also when disconnecting, with guarantee about the disconnect (connection closed, lost, exception, error, etc).
The idea is to implement a counter to track the number of active connections at a specific time to limit the abusers.
Thanks in advance :)
Beta Was this translation helpful? Give feedback.
All reactions