Documentation
1.0.0-beta.9 · exact release
Opaque binary proxy
Source fda16de1b352 · Published v1.0.0-beta.9
Returns an origin response directly. The binary or streaming body stays host-owned and is never decoded or copied into user scope.
Workflow
Section titled “Workflow”pulse doctorpulse inspectpulse testpulse devpulse buildThe documented test result below is executed by the documentation gate.
pulse test --json{ "status": "passed", "provider": "fastly", "summary": { "total": 1, "passed": 1, "failed": 0 }, "cases": [ { "name": "pass-through", "status": "passed", "response": { "status": 206 } } ]}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.
Wasm size
Section titled “Wasm size”| Artifact | Default build | --experimental-native-size | Reduction |
|---|---|---|---|
canonical-native.wasm | 2.3 KiB (2,304 bytes) | 2.2 KiB (2,205 bytes) | 4.3% |
bin/main.wasm | 39.3 KiB (40,291 bytes) | 32.4 KiB (33,191 bytes) | 17.6% |
The executable documentation gate rebuilds and measures both variants from this checkout. The provider artifact includes the Fastly header, transport recovery, and fetch deadline fixes. These are uncompressed on-disk sizes, not transfer sizes or platform limits.
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' }, }, },}))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'] }, }, }, ],}