forked from royale-proxy/cr-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproxy.py
22 lines (17 loc) · 800 Bytes
/
proxy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from twisted.internet import reactor
from coc.message.definitions import CoCMessageDefinitions
from coc.server.endpoint import CoCServerEndpoint
from coc.server.factory import CoCServerFactory
from coc.client.endpoint import CoCClientEndpoint
from coc.proxyconfig import ProxyConfig
from coc.replay import Replay
config_file = "config.json"
if __name__ == "__main__":
ProxyConfig.start(config_file)
Replay.start()
definitions = CoCMessageDefinitions.read()
client_endpoint = CoCClientEndpoint(reactor, "game.clashroyaleapp.com", 9339)
server_endpoint = CoCServerEndpoint(reactor, 9339)
server_endpoint.listen(CoCServerFactory(client_endpoint, definitions))
print("listening on {}:{} ...".format(server_endpoint.interface, server_endpoint.port))
reactor.run()