I'm following a tutorial to use Twisted to connect to an app. But at the time of testing the connection to localhost for testing, it appears that it is not responding.
I am using the following script in the chatserver.py file:
from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor
class IphoneChat(Protocol):
def connectionMade(self):
print " um cliente conectado"
factory = Factory()
factory.protoco = IphoneChat
reactor.listenTCP(80, factory)
print "Iphone Chat server started"
reactor.run()
Then I open another console window to test with the following command:
telnet localhost 80
And I get the following error:
Trying :: 1 ... telnet: connect to address :: 1: Connection refused Trying 127.0.0.1 ... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host
How do I get Twisted to work on Mac OSX?