I recently found the Twisted python library and was trying to set it up with a test script.
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
class Pong(Protocol):
def connectionMade(self):
self.transport.write("HTTP/1.0 200 OK\r\nContent-Length: 5\r\n\r\nPong!\r\n")
self.transport.loseConnection()
# Start the reactor
factory = Factory()
factory.protocol = Pong
reactor.listenTCP(8000, factory)
reactor.run()
When i run the above (I am using python 2.7.9 btw) in Terminal, I get an error. The last line of the error is below. If you need the rest, I can post it as well.
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1'