Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def sshconnect(service):
protocol = factory.buildProtocol(None)
transport = sshtunnel.RFBSSHChannel(protocol)
request = forwarding.packOpen_direct_tcpip(
(info['vnchost'], info['vncport']), # The remote endpoint
('localhost', 0)) # The local endpoint
log.msg("Opening VNC connection to %s:%d over SSH tunnel" % (info['vnchost'], info['vncport']))
service.openChannel(transport, request)
return service