Skip to content

Commit

Permalink
reenable ping
Browse files Browse the repository at this point in the history
  • Loading branch information
alwaysintreble authored and black-sliver committed Jun 24, 2023
1 parent ec0822c commit f1ccf1b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions WebHostLib/customserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ async def main():
ctx.init_save()
ssl_context = load_server_cert(cert_file, cert_key_file) if cert_file else None
try:
ctx.server = websockets.serve(functools.partial(server, ctx=ctx), ctx.host, ctx.port, ping_timeout=None,
ping_interval=None, ssl=ssl_context)
ctx.server = websockets.serve(functools.partial(server, ctx=ctx), ctx.host, ctx.port, ssl=ssl_context)

await ctx.server
except Exception: # likely port in use - in windows this is OSError, but I didn't check the others
ctx.server = websockets.serve(functools.partial(server, ctx=ctx), ctx.host, 0, ping_timeout=None,
ping_interval=None, ssl=ssl_context)
ctx.server = websockets.serve(functools.partial(server, ctx=ctx), ctx.host, 0, ssl=ssl_context)

await ctx.server
port = 0
Expand Down

0 comments on commit f1ccf1b

Please sign in to comment.