Hyperlinkv0.8.0-beta.28

Hyperlink

Hyperlink.httpconstsrc/Hyperlink.ts:3999
<Self>(
  node: NodeKey<Self> & {
    readonly url?: string
    readonly endpoints?: Endpoints
  },
  options?: {
    readonly url?: string
    readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>
  }
): Layer.Layer<Self>

Wire a Node's transport over http — the server/CLI/backend case. Builds the http client Protocol (Fetch + serialization) from a url and re-keys it under the node. Serialization defaults to defaultSerialization (ndjson), matching httpServer's default so the two sides agree by construction. In a browser this fails hard (HttpClientInBrowser) — http starves at the ~6-connection cap; use ws there.

const EdgeLive = Hyperlink.http(EdgeNode, { url: "http://10.0.0.2:3002/rpc" });
clientsNodedefaultSerializationhttpServerws
Source src/Hyperlink.ts:399917 lines
const http = <Self>(
  node: NodeKey<Self> & { readonly url?: string; readonly endpoints?: Endpoints },
  options?: {
    readonly url?: string;
    readonly serialization?: Layer.Layer<RpcSerialization.RpcSerialization>;
  },
): Layer.Layer<Self> =>
  // The client sibling of {@link Node.http} = `connect` + {@link protocolHttp}. Prefers the node's own
  // Http endpoint (multi-protocol), then its primary `url`, then `"/rpc"` (same-origin) — `options.url`
  // overrides. The browser guard lives in `protocolHttp` (the root), so it applies here too.
  connectLayer(
    node,
    protocolHttp(
      options?.url ?? node.endpoints?.Http?.url ?? node.url ?? "/rpc",
      options?.serialization,
    ),
  );