Skip to content

Commit

Permalink
Use client IP in logs, not host
Browse files Browse the repository at this point in the history
This is the more common behaviour, and it is also more reliable as
it may require some time to look up hostnames and they may change
over time.
  • Loading branch information
CendioOssman committed Apr 25, 2019
1 parent e4658ad commit be9823b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion websockify/websockifyserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, req, addr, server):
SimpleHTTPRequestHandler.__init__(self, req, addr, server)

def log_message(self, format, *args):
self.logger.info("%s - - [%s] %s" % (self.address_string(), self.log_date_time_string(), format % args))
self.logger.info("%s - - [%s] %s" % (self.client_address[0], self.log_date_time_string(), format % args))

#
# WebSocketRequestHandler logging/output functions
Expand Down

0 comments on commit be9823b

Please sign in to comment.