|
@@ -78,6 +78,8 @@ def _webio_routes(applications, cdn, check_origin_func):
|
|
while True:
|
|
while True:
|
|
try:
|
|
try:
|
|
msg = await websocket.receive()
|
|
msg = await websocket.receive()
|
|
|
|
+ if msg["type"] == "websocket.disconnect":
|
|
|
|
+ raise WebSocketDisconnect(msg["code"])
|
|
text, binary = msg.get('text'), msg.get('bytes')
|
|
text, binary = msg.get('text'), msg.get('bytes')
|
|
event = None
|
|
event = None
|
|
if text:
|
|
if text:
|
|
@@ -107,6 +109,8 @@ def webio_routes(applications, cdn=True, allowed_origins=None, check_origin=None
|
|
|
|
|
|
The arguments of ``webio_routes()`` have the same meaning as for :func:`pywebio.platform.fastapi.start_server`
|
|
The arguments of ``webio_routes()`` have the same meaning as for :func:`pywebio.platform.fastapi.start_server`
|
|
|
|
|
|
|
|
+ .. versionadded:: 1.3
|
|
|
|
+
|
|
:return: FastAPI/Starlette routes
|
|
:return: FastAPI/Starlette routes
|
|
"""
|
|
"""
|
|
try:
|
|
try:
|
|
@@ -144,6 +148,8 @@ def start_server(applications, port=0, host='',
|
|
For details, please refer: https://www.uvicorn.org/settings/
|
|
For details, please refer: https://www.uvicorn.org/settings/
|
|
|
|
|
|
The rest arguments of ``start_server()`` have the same meaning as for :func:`pywebio.platform.tornado.start_server`
|
|
The rest arguments of ``start_server()`` have the same meaning as for :func:`pywebio.platform.tornado.start_server`
|
|
|
|
+
|
|
|
|
+ .. versionadded:: 1.3
|
|
"""
|
|
"""
|
|
kwargs = locals()
|
|
kwargs = locals()
|
|
|
|
|