123456789101112131415161718192021222324252627 |
- #!/usr/bin/env python3
- import sys
- from twisted.internet import reactor
- from twisted.internet import protocol
- import logging
- import logging.config
- from twisted.python import log
- # from twisted.python.logfile import DailyLogFile
- from config import config, version
- from proxy import Player
- logger = logging.getLogger(__name__)
- log.PythonLoggingObserver().start()
- # if "logfile" in config and config["logfile"]:
- # log.startLogging(DailyLogFile("proxy.log", "."))
- # else:
- # log.startLogging(sys.stdout)
- logger.error("This is version: {0}".format(version))
- factory = protocol.Factory()
- factory.protocol = Player
- reactor.listenTCP(config["listen_port"], factory, interface=config["listen_on"])
- reactor.run()
|