0

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.

1 Answers1

1

if you accepted by a handler ProxyHandler()

def ProxyHandler(newclient):
   print('New connection from : '+repr(newclient.socket.getpeername()))

It was that easy.