Commit bbf38e4c authored by ibuler's avatar ibuler

Change something

parent 05c0e693
......@@ -50,6 +50,7 @@ class Coco:
self.make_logger()
self.sshd = None
self.running = True
def make_logger(self):
create_logger(self)
......
......@@ -40,7 +40,7 @@ class ProxyServer:
try:
ssh.connect(asset.ip, port=asset.port, username=system_user.username,
password=system_user.password, pkey=system_user.private_key)
except (paramiko.AuthenticationException,) as e:
except (paramiko.AuthenticationException, paramiko.ssh_exception.NoValidConnectionsError) as e:
pass
except socket.error:
......
#!coding: utf-8
import socket
import select
from . import char
from .utils import TtyIOParser, wrap_with_line_feed as wr, \
wrap_with_primary as primary, wrap_with_warning as warning
......
import json
import threading
import select
BUF_SIZE = 4096
......@@ -160,12 +158,10 @@ class WSProxy:
def forward(self):
while not self.stop_event.is_set():
r, w, e = select.select([self.child], [], [])
if self.child in r:
data = self.child.recv(BUF_SIZE)
if len(data) == 0:
self.close()
self.ws.write_message(data)
data = self.child.recv(BUF_SIZE)
if len(data) == 0:
self.close()
self.ws.write_message(data)
def auto_forward(self):
thread = threading.Thread(target=self.forward, args=())
......
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