1234567891011121314151617181920 |
- from twisted.application.service import Application
- from twisted.application.internet import TCPServer
- from twisted.internet import protocol
- # twistd -n -y twgs.tac
- # https://steemit.com/utopian-io/@mattockfs/tutorial-asynchonous-python-with-twisted-and-asyncio-part-two
- import os
- import sys
- sys.path.append(os.path.abspath('.'))
- from config import config, version
- from proxy import Player
- application = Application('TWGS-Proxy')
- factory = protocol.Factory()
- factory.protocol = Player
- service = TCPServer(config['listen_port'], factory)
- service.setServiceParent(application)
|