Conversation
|
|
First reviewer to find this, please feel free to relieve the other reviewers. I’m casting a wider net than necessary: any review, not all reviews. |
b47eb0d to
a75c587
Compare
a75c587 to
03b3ce7
Compare
|
Code looks reasonable, and even moreso now after my improvements while reviewing. I'm as yet unable to run the gateway using |
d3deccc to
7d73ee7
Compare
| // NOTE this was prior behavior, but we may want to consider passing `actual.address` out, since config might be `0.0.0.0`? | ||
| const actual = `http://${addr.config.address}:${addr.actual.port}`; | ||
| return actual; |
There was a problem hiding this comment.
@kriskowal you attention here please, as this is a new thing I introduced in my review update ; also rhymes with the usage site where we log-listening above
- add missing ts-check comment, fix lsp-auto-format churn - explicate web socket 1008 status code - improve some console log entry formats - avoid double-sending weblet response in error branch - further explicate OS-resolved listen addr vs config wanted
7d73ee7 to
9a772d2
Compare
|
Well:
So I'm not sure yet what the difference is between this one and the gateway in the llm ranch... |
Description
This sets the stage for Endo Familiar, an Electron app that manages the daemon and serves local HTTP web applications through a custom
localhttp://protocol handler. The unified gateway eliminates the need for each weblet to claim a dedicated port, allowing Electron to route requests to weblets by hostname instead.Adds a unified HTTP/WebSocket gateway server to the Endo daemon, listening on
ENDO_ADDR(default127.0.0.1:8920). Weblets can register on the shared server using hostname-based isolation or opt into a dedicated port with path-based isolation. Gateway clients connect over WebSocket and callfetch(token)to retrieve formula values via CapTP.Extracts
trackConnection,openCapTPSession, andmakeWebletFarhelpers to deduplicate the gateway and weblet connection paths. Installs@types/wsto replace@ts-ignoredirectives.Security Considerations
Only loopback connections (
127.0.0.1,::1,::ffff:127.0.0.1) are accepted. Non-local connections are rejected with a 1008 close code. This restriction will be revisited when CapTP is replaced with OCapN over Noise Protocol.Scaling Considerations
None. One HTTP server replaces per-weblet servers when no dedicated port is requested.
Documentation Considerations
The daemon README now documents the
ENDO_ADDRenvironment variable and its usage withendo start.Testing Considerations
New
gateway.test.jscovers: gateway info page, WebSocketfetch(token), weblet on the unified server, and weblet on a dedicated port.Compatibility Considerations
getPort()is renamed togetAddress()and now returns a URL string instead of a port number. Callers must be updated.Upgrade Considerations
None.