This is a simple problem and Im sure there is an solution. I am trying to get the IP address of a socket which I have already connected to. I used trio.serve_tcp(handler, port) to create an server and now I want to know if someone is making thousands of connections to it but I need to know how to get the IP address of an accepted connection.
Asked
Active
Viewed 18 times
1 Answers
1
if you accepted by a handler ProxyHandler()
def ProxyHandler(newclient): print('New connection from : '+repr(newclient.socket.getpeername()))
It was that easy.
![](../../users/profiles/15627277.webp)
Kenggi Peters
- 11
- 3