diff --git a/examples/server/asgi/app.py b/examples/server/asgi/app.py index d549ab09..996dc272 100644 --- a/examples/server/asgi/app.py +++ b/examples/server/asgi/app.py @@ -2,7 +2,7 @@ # set instrument to `True` to accept connections from the official Socket.IO # Admin UI hosted at https://admin.socket.io -instrument = False +instrument = True admin_login = { 'username': 'admin', 'password': 'python', # change this to a strong secret for production use! @@ -93,4 +93,14 @@ def test_disconnect(sid, reason): if __name__ == '__main__': + if instrument: + print('The server is instrumented for remote administration.') + print( + 'Use the official Socket.IO Admin UI at https://admin.socket.io ' + 'with the following connection details:' + ) + print(' - Server URL: http://localhost:5000') + print(' - Username:', admin_login['username']) + print(' - Password:', admin_login['password']) + print('') uvicorn.run(app, host='127.0.0.1', port=5000) diff --git a/examples/server/wsgi/app.py b/examples/server/wsgi/app.py index 62bd59b1..7fc871b4 100644 --- a/examples/server/wsgi/app.py +++ b/examples/server/wsgi/app.py @@ -5,7 +5,7 @@ # set instrument to `True` to accept connections from the official Socket.IO # Admin UI hosted at https://admin.socket.io -instrument = False +instrument = True admin_login = { 'username': 'admin', 'password': 'python', # change this to a strong secret for production use! @@ -99,6 +99,16 @@ def disconnect(sid, reason): if __name__ == '__main__': + if instrument: + print('The server is instrumented for remote administration.') + print( + 'Use the official Socket.IO Admin UI at https://admin.socket.io ' + 'with the following connection details:' + ) + print(' - Server URL: http://localhost:5000') + print(' - Username:', admin_login['username']) + print(' - Password:', admin_login['password']) + print('') if sio.async_mode == 'threading': # deploy with Werkzeug app.run(threaded=True)