Commit ff68b830 authored by i317280's avatar i317280

feat: update

parent 457fc034
...@@ -72,6 +72,7 @@ class SSHws(Namespace, BaseWebSocketHandler): ...@@ -72,6 +72,7 @@ class SSHws(Namespace, BaseWebSocketHandler):
"chan": None, "chan": None,
"proxy": None, "proxy": None,
"client": None, "client": None,
"request": None,
} }
self.rooms[room] = { self.rooms[room] = {
"admin": request.sid, "admin": request.sid,
...@@ -88,7 +89,6 @@ class SSHws(Namespace, BaseWebSocketHandler): ...@@ -88,7 +89,6 @@ class SSHws(Namespace, BaseWebSocketHandler):
def on_host(self, message): def on_host(self, message):
# 此处获取主机的信息 # 此处获取主机的信息
print(message)
uuid = message.get('uuid', None) uuid = message.get('uuid', None)
userid = message.get('userid', None) userid = message.get('userid', None)
if uuid and userid: if uuid and userid:
...@@ -98,14 +98,15 @@ class SSHws(Namespace, BaseWebSocketHandler): ...@@ -98,14 +98,15 @@ class SSHws(Namespace, BaseWebSocketHandler):
self.socketio.start_background_task(self.clients[request.sid]["forwarder"].proxy, asset, system_user) self.socketio.start_background_task(self.clients[request.sid]["forwarder"].proxy, asset, system_user)
# self.forwarder.proxy(self.asset, system_user) # self.forwarder.proxy(self.asset, system_user)
else: else:
self.close() self.on_disconnect()
else: else:
self.close() self.on_disconnect()
def on_resize(self, message): def on_resize(self, message):
self.clients[request.sid]["request"].meta['width'] = message.get('cols', 80) if self.clients[request.sid]["request"]:
self.clients[request.sid]["request"].meta['height'] = message.get('rows', 24) self.clients[request.sid]["request"].meta['width'] = message.get('cols', 80)
self.clients[request.sid]["request"].change_size_event.set() self.clients[request.sid]["request"].meta['height'] = message.get('rows', 24)
self.clients[request.sid]["request"].change_size_event.set()
def on_room(self, message): def on_room(self, message):
if message == 'get': if message == 'get':
......
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