Beispiel #1
0
class TelnetProxy(TelnetProtocol):

    term = "xterm"
    size = (24, 80, 0, 0)

    def __init__(self):
        self.proxy = Proxy()

    def connectionMade(self):
        self.proxy.transport = self.transport

        endpoint = TCP4ClientEndpoint(reactor,
                                      self.host,
                                      self.port,
                                      timeout=30)
        d = endpoint.connect(CommandTransport(self.command))

        @d.addCallback
        def cb(protocol):
            protocol.client = self

        @d.addErrback
        def eb(failure):
            log.err(failure)
            self.transport.loseConnection()

    def dataReceived(self, data):
        self.proxy.dataReceived(data)

    def loseConnection(self):
        self.transport.loseConnection()
Beispiel #2
0
class TelnetProxy(TelnetProtocol):

    term = "xterm"
    size = (24, 80, 0, 0)

    def __init__(self):
        self.proxy = Proxy()

    def connectionMade(self):
        self.proxy.transport = self.transport

        d = cc.connectTCP("localhost", 9000)
        @d.addCallback
        def cb(protocol):
            protocol.client = self
        @d.addErrback
        def eb(failure):
            log.err(failure)
            self.transport.loseConnection()

    def dataReceived(self, data):
        self.proxy.dataReceived(data)

    def loseConnection(self):
        self.transport.loseConnection()
class TelnetProxy(TelnetProtocol):

    term = "xterm"
    size = (24, 80, 0, 0)

    def __init__(self):
        self.proxy = Proxy()

    def connectionMade(self):
        self.proxy.transport = self.transport

        endpoint = TCP4ClientEndpoint(reactor, self.host, self.port,
                                      timeout=30)
        d = endpoint.connect(CommandTransport(self.command))
        @d.addCallback
        def cb(protocol):
            protocol.client = self
        @d.addErrback
        def eb(failure):
            log.err(failure)
            self.transport.loseConnection()

    def dataReceived(self, data):
        self.proxy.dataReceived(data)

    def loseConnection(self):
        self.transport.loseConnection()
Beispiel #4
0
    def __init__(self, *args, **kwargs):
        SSHChannel.__init__(self, *args, **kwargs)

        self.proxy = Proxy()
        attach_protocol_to_channel(self.proxy, self)
Beispiel #5
0
 def __init__(self):
     self.proxy = Proxy()
Beispiel #6
0
 def __init__(self):
     self.proxy = Proxy()
Beispiel #7
0
 def dataReceived(self, data):
     print("Data received: %s" % data)
     Proxy.dataReceived(self, data)