Browse Source

Working twistd launcher. twistd -n -y twgs.tac

Steve Thielemann 5 years ago
parent
commit
8d554cf5a5
1 changed files with 20 additions and 0 deletions
  1. 20 0
      twgs.tac

+ 20 - 0
twgs.tac

@@ -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)
+