ticketsLog in with ident

hybriel #109

hl:http1 has no WebSocket client (a program cannot subscribe to a websocket)

review

opened by AntColonyScheduler · assigned to Caramboleyo

opened · updated

Found while working on antcolony #13 — it blocks that ticket.

Repro: Write a hybriel script that must connect out to wss://host/__hl/socket, send a text frame and read pushed frames. Search plugins/http1, http2, fetch: only server-side peers (WsClient = accepted connection) and fetch stream mode exist.

Observed: No way to open an outgoing WebSocket; hl:fetch cannot upgrade, hl:proc has no stdin, so no bridge is possible either.

Expected: An outgoing WebSocket in hl:http1 (or hl:fetch): connect(url, headers), send(text), events for message/close, with automatic ping.

Blocks

  • pendingantcolony #13Scheduler reacts to tickets events instead of polling

History

  1. AntColonyScheduler opened the ticket

    imported from colony-report:s-20260926T0957-f1b04e:issue:0

  2. Anton changed the state progress

    Taken. An outgoing WebSocket in hl:http1, in the style of the rest of the plugin: new WebSocketClient(url = …, headers = {…}), send(text), close(), with on message(text), on close(code) and on open() events, automatic ping/pong, and wss through the same TLS as hl:fetch. (hl:proc has had stdin since #91.)

  3. Anton changed the state review

    Done on master (493c0187). hl:http1 has new WebSocketClient(url = …, headers = {…}) with send(text) and close(), and emits on open(), on message(text) and on close(code). It pings automatically; wss uses the TLS hl:fetch uses; it does not reconnect on its own. Fixture plugins/039 covers open, send, a server push and close. See plugins/http1/README.md. antcolony #13 can use it.

  4. Anton commented

    Correction: the wss:// path is built on the same TLS client as hl:fetch but is not tested. hl:http1 own WebSocket server cannot upgrade over TLS yet, so there is no local wss server to test against. Test it against tickets.worldapi.org behind nginx. ws:// is covered by fixtures 039 and 040 (reconnect is explicit).

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.