Logo
Explore Help
Sign In
Stian/Shade
1
0
Fork 0
You've already forked Shade
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
v4.15.0
Shade/bench/media-relay.ts

8 lines
462 B
TypeScript
Raw Permalink Normal View History

fix(media,server): films over 128 MiB were refused; docs/media.md Bun.serve refuses request bodies over 128 MiB by default, so every film larger than that got a 413 from both `shade media serve` and the container. The cap is now raised to the media object limit only when media is mounted, and every other route gets an explicit 128 MiB bodyLimit — several read the whole body before checking its size, so Bun's default was their only guard. Verified on the standalone process: 300 MiB sealed film round trip identical; a 200 MiB POST to a prekey route still 413. docs/media.md: formats (SMF1, SLF1, grants) as the cross-language contract, key schedule, what the relay learns, design notes, limits. bench/media.ts: throughput, seek latency, live fan-out → media.chart.json. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-18 21:15:13 +02:00
/** A live relay in its own process for bench/media.ts; prints its port. */
import { websocket } from 'hono/bun';
import { createLiveRelay, MemoryLivePinStore } from '../packages/shade-media/src/server.js';
const relay = createLiveRelay({ pins: new MemoryLivePinStore(), viewerHighWater: 32 * 1024 * 1024 });
const server = Bun.serve({ port: 0, fetch: (req, srv) => relay.app.fetch(req, { server: srv }), websocket, idleTimeout: 0 });
console.log(server.port);
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.5 Page: 19ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API