Commit 7864f237 authored by ibuler's avatar ibuler

[Bugfix] websocket remote addr

parent 16d05a3c
......@@ -26,7 +26,7 @@ class BaseWebSocketHandler:
def prepare(self, request):
# self.app = self.settings["app"]
x_forwarded_for = request.headers.getlist("X-Forwarded-For").split(',')
x_forwarded_for = request.headers.get("X-Forwarded-For", '').split(',')
if x_forwarded_for and x_forwarded_for[0]:
remote_ip = x_forwarded_for[0]
else:
......
......@@ -138,7 +138,7 @@ class Server:
logger.info("Closed server {}".format(self))
self.chan.close()
self.stop_evt.set()
self.chan.transport.close()
self.chan.close()
@staticmethod
def _have_enter_char(s):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment