## Unsafe way to get the address behind a proxy in werkzeug. import werkzeug.serving class RequestHandler(werkzeug.serving.WSGIRequestHandler): def address_string(self): addrs = self.headers['x-forwarded-for'] if addrs: return addrs.split(',')[-1] return self.client_address[0] werkzeug.serving.WSGIRequestHandler = RequestHandler