compatibility websocket server / add non ssl echo_server which does not run into the ssl error (#140)

This commit is contained in:
Benjamin Sergeant
2020-01-12 10:34:33 -08:00
parent 9651f3823d
commit a01584ad9d
6 changed files with 1448 additions and 7 deletions

View File

@ -18,8 +18,9 @@ ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.load_cert_chain('trusted-server-crt.pem',
'trusted-server-key.pem')
print('Serving on localhost:8766')
host = os.getenv('BIND_HOST', 'localhost')
print(f'Serving on {host}:8766')
start_server = websockets.serve(echo, host, 8766, max_size=2 ** 30, ssl=ssl_context)
asyncio.get_event_loop().run_until_complete(start_server)