|
@@ -0,0 +1,20 @@
|
|
|
+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)
|
|
|
+
|