4 ms·
This is great. Does it rely on web sockets?
by bernardv 6y ago
This is great. Does it rely on web sockets?
- crazypython 6y agoIt seems to stream the HTML over the original HTTP socket– web browsers can render incomplete streams of HTML.
- lovasoa 6y agoLooking at it from the web inspector, yes, it's entirely over websockets, sending json messages : {"event":"input_event","task_id":"main-140213579376912","data":{"event_name":"blur","name":"weight","value":"21"}} {"command": "output", "spec": {"type": "markdown", "content": "Your BMI: `1458.3`, Category: `Severely obese`", "sanitize": true, "scope": "#pywebio-scope-ROOT", "position": -1}, "task_id": "main-140213579376912"}
- Wang0618 6y agoBoth http and websocket protocol can be used to implement server-browser communication in PyWebIO. The websocket is default, and you can use `pywebio.platform.tornado_http.start_server()` or `pywebio.platform.path_deploy_http()` to use http polling to communicate.