HttpFSOpts
Defined in: packages/core/src/kernel/fileservers/http.ts:35
Options bag for httpFS.
Remarks
Section titled “Remarks”fetcher is required; everything else tunes URL construction and
per-request auth. Consumers typically set protocol once per mount
(e.g. separate /net/http and /net/https mounts, as
pkgManager does) and supply a shared fetcher that may be
the global fetch or a wrapped proxy for browser-side CORS scenarios.
Properties
Section titled “Properties”fetcher
Section titled “fetcher”fetcher: (
url,init?) =>Promise<Response>
Defined in: packages/core/src/kernel/fileservers/http.ts:42
Fetch implementation called by open() and stat() to materialize
remote content. Must resolve with a Response whose .ok === true
on success; non-ok responses surface as ENOENT to the caller. For
browser sandboxes without global fetch, pass a bound polyfill.
Parameters
Section titled “Parameters”string
RequestInit
Returns
Section titled “Returns”Promise<Response>
getAuthHeader?
Section titled “getAuthHeader?”
optionalgetAuthHeader?: (pid,domain) =>string|null
Defined in: packages/core/src/kernel/fileservers/http.ts:59
Factotum hook called on open() (not stat()) to synthesize an
Authorization header. Returns the header value verbatim (e.g.
"Bearer <token>") or null to proceed unauthenticated. Invoked
with the caller’s PID and the first inner-path segment as domain.
Called only when the hook is supplied and the kernel passed a pid
through open().
Parameters
Section titled “Parameters”domain
Section titled “domain”string
Returns
Section titled “Returns”string | null
protocol?
Section titled “protocol?”
optionalprotocol?:"http"|"https"
Defined in: packages/core/src/kernel/fileservers/http.ts:50
URL scheme used when converting inner paths to absolute URLs.
Inner paths carry host+path only (e.g. example.com/api/foo); this
setting picks between https://example.com/api/foo and the http://
variant. Default: 'https'. Typical deployments mount two instances —
one per protocol — at sibling paths.