Skip to content

wss dial: connectToRemote over ws/wss URLs (mesh.exadev.io) - #150

Merged
Mearman merged 1 commit into
mainfrom
feat/wss-dial
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/wss-dial

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes #149.

connectToRemote's host argument now also accepts a ws:// or wss:// URL, dialling a WebSocket-served hub (mesh.exadev.io answers wss only) instead of raw TLS -- the port is meaningless in URL form. Any other URL scheme is refused up front rather than surfacing as an opaque DNS error from the TLS dial treating the whole URL as a hostname.

The dial is agent-comms' own edge adapter (src/core/ws-dial.ts, the same layering its TLS adapter occupies) rather than a wire-mesh-node dependency: wire-mesh-node is not published to npm as a consumable package (placeholder 0.0.0). It frames identically -- one CBOR frame per binary WebSocket message -- so a hub sees the same bytes from this client as from any other.

Integration-tested against a minimal in-test fake hub speaking the real protocol (handshake reply, connect_request answered manage-ok): the URL branch drives the identical session + connect_request flow the TLS branch uses. The adapter itself is unit-tested against a real loopback ws server (round trip, scheme rejection, receive-stream end on server close).

@Mearman
Mearman marked this pull request as ready for review September 16, 2026 22:21
connectToRemote's host argument now also accepts a ws or wss URL,
dialling a WebSocket-served hub (e.g. the mesh.exadev.io
cloudflare-hub, which answers wss only) instead of raw TLS -- the
port is meaningless in URL form. Any other URL scheme is refused up
front rather than surfacing as an opaque DNS error from the TLS dial
treating the whole URL as a hostname. The URL branch drives the
identical session + connect_request flow the TLS branch uses, proven
by an integration test against a minimal in-test fake hub speaking
the real protocol.

The dial is agent-comms' own edge adapter (src/core/ws-dial.ts, the
same layering its TLS adapter occupies) rather than a wire-mesh-node
dependency: wire-mesh-node is not published to npm as a consumable
package (a placeholder 0.0.0). It frames identically -- one CBOR
frame per binary WebSocket message -- so a hub sees the same bytes
from this client as from any other.

Closes #149
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-16T22:32:05.654032Z 9921b24 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebSocket (wss://) dial option for cross-machine connections so agents can reach a Cloudflare Workers hub

1 participant