1.0.0-beta.10 · latest
Opaque binary proxy
Source e69e4b6f1381 · Published v1.0.0-beta.10
Returns an origin response directly. The binary or streaming body stays host-owned and is never decoded or copied into user scope.
Handler
Section titled “Handler”import { Pulse } from '@pulse-compute/pulse'
const app = new Pulse({ auto: true })
app.get('/archive', async (ctx) => { return ctx.fetch('https://assets.example.com/archive.bin')})
export default appProject config
Section titled “Project config”import { defineConfig } from '@pulse-compute/pulse'
export default defineConfig((_scope) => ({ pulse: { entry: 'src/index.ts', tests: 'tests/pulse.harness.ts', defaultProfile: 'local', strict: true, }, local: { host: 'fastly', target: 'native', outDir: 'dist', dev: { fetches: { 'https://assets.example.com/archive.bin': { opaque: true, status: 206, headers: [ ['content-type', 'application/octet-stream'], ['x-part', 'one'], ['x-part', 'two'], ], chunks: ['opaque-example'], }, }, }, fastly: { bindings: { backends: { 'https://assets.example.com': 'assets_backend', }, dynamicBackends: false, }, build: { name: 'pulse-opaque-proxy-example' }, }, },}))Request and response
Section titled “Request and response”Generated from the executable test harness below; these are tested requests or event frames, not an exhaustive application specification. Expected errors and emitted events are included; fixtures and provider setup remain in the harness.
| Request | Expected response |
|---|---|
pass-throughGET /archive | {"status":206,"bodyClass":"opaque","headers":[["x-part",["one","two"]]]} |
Inspect
Section titled “Inspect”The selected profile is local; this checked excerpt identifies its target, provider and recognized capabilities. Paths, hashes and additional inspection fields are omitted.
npm run inspect -- --json{ "status": "ok", "project": { "target": "native" }, "provider": { "id": "fastly" }, "compiler": { "capabilities": [ "fetch", "response.text" ] }}Doctor
Section titled “Doctor”Check this project and its local toolchain before execution. This selected result is verified by the documentation gate; another machine may report different prerequisite checks.
npm run doctor -- --json{ "status": "passed", "summary": { "warnings": 0, "failed": 0 }}Report
Section titled “Report”Build once into a separate directory, then replay the retained artifact without running or rebuilding the application. This checked excerpt accounts for registered handlers in the build evidence; it is not runtime request coverage.
npm run build -- --out .pulse-docs-buildnpm exec -- pulse report --artifact .pulse-docs-build/pulse-build.json --json{ "kind": "pulse.application-report", "reportVersion": 1, "analytics": { "coverage": { "handlers": { "expected": 1, "observed": 1, "reason": null, "status": "complete" } } }}Optional offline HTML uses the same retained evidence:
npm exec -- pulse report --artifact .pulse-docs-build/pulse-build.json --htmlReview reports before sharing. Missing, stale or incompatible evidence is an error; timings, paths and hashes are not presented as stable output.
Interactive report captured from this example at source e69e4b6f1381. Build evidence describes this captured build, not a runtime guarantee.
Workflow
Section titled “Workflow”pulse doctorpulse inspectpulse testpulse devpulse buildThe documented test result below is executed by the documentation gate.
Fastly builds produce a verified .pulse-docs-build/bin/main.wasm. Configured
tests execute through the local-conformance runtime; compiled-target execution
remains in the explicit reality profile.
Test result
Section titled “Test result”pulse test --json{ "status": "passed", "provider": "fastly", "summary": { "total": 1, "passed": 1, "failed": 0 }, "cases": [ { "name": "pass-through", "status": "passed", "response": { "status": 206 } } ]}Test harness
Section titled “Test harness”export default { cases: [ { name: 'pass-through', request: { path: '/archive' }, fetches: { 'https://assets.example.com/archive.bin': { opaque: true, status: 206, headers: [ ['content-type', 'application/octet-stream'], ['x-part', 'one'], ['x-part', 'two'], ], chunks: ['opaque-example'], }, }, expect: { status: 206, bodyClass: 'opaque', headers: { 'x-part': ['one', 'two'] }, }, }, ],}Wasm size
Section titled “Wasm size”For build settings, see Native build optimization.
| Artifact | Default build |
|---|---|
Portable guest canonical-native.wasm | 2.2 KiB (2,205 bytes) |
Deployable Fastly module bin/main.wasm | 35.8 KiB (36,637 bytes) |
The executable documentation gate rebuilds and measures these default artifacts. Measured with Node 24.18.0 and lockfile-pinned AssemblyScript 0.28.18. The provider artifact includes Fastly transport handling, deadlines, the complete send-error detail record, and bounded transport diagnostics through WASI stdout. The clock and stdout imports are checked explicitly. These are uncompressed on-disk sizes, not transfer sizes or platform limits.