A scoped Layer that starts a browser Modbus server proxied over a
WebSocket gateway (experimental upstream surface — browsers can't accept raw
TCP connections, so this binds via modbus-gateway or an equivalent WS-to-TCP
proxy).
Unlike the native tcpServerLayer, the WASM server does not start
serving on bind() — it requires an explicit, continuously-awaited serve()
call to drive its request loop. This layer forks that call into the scope in
the background so the returned Layer behaves the same as the native one
from the consumer's perspective (no extra step needed).
Parameters
options: WasmTcpServerOptions
WebSocket gateway URL and unit ID.
handlers: ServerHandlers
Callback functions that handle incoming Modbus requests
(same ServerHandlers shape as the native TCP/serial servers).
A scoped Layer that starts a browser Modbus server proxied over a WebSocket gateway (experimental upstream surface — browsers can't accept raw TCP connections, so this binds via
modbus-gatewayor an equivalent WS-to-TCP proxy).Unlike the native tcpServerLayer, the WASM server does not start serving on
bind()— it requires an explicit, continuously-awaitedserve()call to drive its request loop. This layer forks that call into the scope in the background so the returnedLayerbehaves the same as the native one from the consumer's perspective (no extra step needed).