Detect ip and port address to give them to the client