Compare commits

..

No commits in common. "master" and "v0.1.0" have entirely different histories.

View File

@ -48,7 +48,7 @@ class Proxy:
async def handle_client(self, r, w):
peer = w.get_extra_info("peername")
print(f'{peer} connected')
loop = asyncio.get_running_loop()
loop = asyncio.get_event_loop()
try:
async with websockets.connect(
self.url, subprotocols=self.subproto) as ws:
@ -96,8 +96,7 @@ def main(argv):
args = parser.parse_args()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop = asyncio.get_event_loop()
proxy = Proxy(args.port, args.listen, args.url, args.subproto)
loop.run_until_complete(proxy.start())
loop.run_forever()