← index #10508PR #8931
Off-topic · high · value 0.350
QUERY · ISSUE

Timeout support for websocket/webrepl

openby jimmoopened 2023-01-16updated 2024-09-12
enhancement

Reported here: https://github.com/orgs/micropython/discussions/10444

Webrepl constructs a websocket with BLOCKING_WRITE set. There's no timeout, so prints can hang.

CANDIDATE · PULL REQUEST

webrepl: Allow the page to run from the device (over HTTP).

mergedby jimmoopened 2022-07-20updated 2022-07-23
extmod

This is an attempt to solve the issue where the publicly-hosted webrepl on https://micropython.org/webrepl is currently non-functional due to the page being served via https, but attempting to connect to a device hosting a non-secure websocket. See #5266

The main details of this change are in the corresponding webrepl client PR -- https://github.com/micropython/webrepl/pull/70

This PR contains:

  • Removes unused client_handshake from websocket_helper, and then merges the remainder of this file (server_handshake) into webrepl.py (to reduce firmware size).
  • Adds the respond-as-HTTP handling to server_handshake to serve up the <base><script> page.
  • Allow the static host to be configured in webrepl_cfg.py (Consider making this part of webrepl_setup flow?)

For testing I've set the default host to https://gitcdn.link/cdn/jimmo/webrepl/webrepl-on-device/ to point to the files from the PR but this should be https://micropython.org/webrepl/ once deployed.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied