2023-08-25 21:49:10 +03:00
|
|
|
# x-run: cd .. && python -m bta_proxy '201:4f8c:4ea:0:71ec:6d7:6f1b:a4f9'
|
2023-08-24 15:29:57 +03:00
|
|
|
import asyncio
|
2023-08-25 21:49:10 +03:00
|
|
|
from argparse import ArgumentParser
|
|
|
|
from sys import argv
|
2023-08-24 15:29:57 +03:00
|
|
|
|
2023-08-25 21:49:10 +03:00
|
|
|
from bta_proxy.proxy import BTAProxy
|
2023-08-24 15:29:57 +03:00
|
|
|
|
|
|
|
MAX_SIZE = 0x400000
|
|
|
|
|
2023-08-25 21:49:10 +03:00
|
|
|
|
|
|
|
|
|
|
|
async def main(args):
|
|
|
|
loop = asyncio.get_running_loop()
|
|
|
|
server = await asyncio.start_server(BTAProxy(args[0], 25565, loop).handle_client, "localhost", 25565)
|
|
|
|
|
|
|
|
async with server:
|
|
|
|
await server.serve_forever()
|
|
|
|
|
2023-08-24 15:29:57 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2023-08-25 21:49:10 +03:00
|
|
|
asyncio.run(main(argv[1:]))
|