1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-12 04:58:34 +03:00

fixed tunnel ouput

This commit is contained in:
Adolfo Gómez García 2023-05-04 15:17:40 +02:00
parent 90213a75e8
commit 5d88f90010
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -301,18 +301,20 @@ class TunnelProtocol(asyncio.Protocol):
self.owner.finished.set()
def connection_made(self, transport: 'asyncio.transports.BaseTransport') -> None:
logger.debug('Connection made: %s', transport.get_extra_info('peername'))
self.source = self.transport.get_extra_info('peername')
logger.debug('Connection made: %s', self.source)
# Try to get the cipher used to show it in the logs
try:
cipher, tls_version, bits = transport.get_extra_info('cipher')[:3]
if cipher:
logger.info('TLS FOR %s: %s (%s)', self.pretty_source(), tls_version, cipher)
except Exception:
pass
except Exception: # nosec, ingore if not TLS (but should not happen)
logger.info('TLS FOR %s: NONE', self.pretty_source())
# We know for sure that the transport is a Transport.
self.transport = typing.cast('asyncio.transports.Transport', transport)
self.cmd = b''
self.source = self.transport.get_extra_info('peername')
def data_received(self, data: bytes):
self.runner(data) # send data to current runner (command or proxy)