Twisted TCP / IP Python Connection
I have a Linode account and I am trying to telnet with a basic TCP / IP server written in Python (Twisted) installed in linode with ubuntu lts:
import os
from twisted.internet import protocol, reactor
class Echo(protocol.Protocol):
def dataReceived(self, data):
self.transport.write(data)
class EchoFactory(protocol.Factory):
def buildProtocol(self, addr):
return Echo()
port = 5000
reactor.listenTCP(port, EchoFactory(), interface="<my linode ip>")
reactor.run()
I thought I could just do telnet <my linode ip> 5000
and be able to send and receive messages from the server, for example when testing the application locally with telnet localhost <some port>
Could you please pass me some reference or link to help me with this? I believe I need to configure something on linode where is the server application installed? It's complicated? Thank.
+3
source to share
2 answers