Opaque binary proxy#
Returns an origin response directly. The binary or streaming body stays host-owned and is never decoded or copied into user scope.
Workflow#
pulse doctor
pulse inspect
pulse test
pulse dev
pulse build
The 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#
| Artifact | Default build | --experimental-native-size | Reduction |
|---|---|---|---|
canonical-native.wasm | 2.1 KiB (2,200 bytes) | 2.1 KiB (2,101 bytes) | 4.5% |
bin/main.wasm | 28.9 KiB (29,602 bytes) | 25.3 KiB (25,953 bytes) | 12.3% |
The executable documentation gate rebuilds and measures both variants on 1.0.0-beta.1. These are uncompressed on-disk sizes, not transfer sizes or platform limits.
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 app
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#
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'] },
},
},
],
}