Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536// node:http2, refused. Requests reach guests as HTTP/1.1 exchanges over the SW// bridge, so there is no HTTP/2 session to expose. The classes exist so imports and// `instanceof` checks (frameworks branching on Http2ServerRequest) work and are// always false; every way to make a server or session throws.import { refused, refusedClass } from "./refuse";
const WHY = "guest servers speak HTTP/1.1 over the Service Worker bridge";
export const http2 = { /** A plain symbol a header object can carry as a key, naming which headers never * go on the wire compressed (HPACK's "never indexed"). No HPACK runs here, but the * symbol itself is pure JS and costs nothing to provide. */ sensitiveHeaders: Symbol("sensitiveHeaders"), Http2ServerRequest: refusedClass("http2", "Http2ServerRequest", WHY), Http2ServerResponse: refusedClass("http2", "Http2ServerResponse", WHY), createServer: refused("http2", "createServer", WHY), createSecureServer: refused("http2", "createSecureServer", WHY), connect: refused("http2", "connect", WHY), getDefaultSettings: refused("http2", "getDefaultSettings", WHY), getPackedSettings: refused("http2", "getPackedSettings", WHY), getUnpackedSettings: refused("http2", "getUnpackedSettings", WHY), performServerHandshake: refused("http2", "performServerHandshake", WHY), /** Plain protocol numbers, safe to read; nothing here can act on them. */ constants: { NGHTTP2_NO_ERROR: 0, NGHTTP2_PROTOCOL_ERROR: 1, NGHTTP2_INTERNAL_ERROR: 2, NGHTTP2_CANCEL: 8, HTTP2_HEADER_STATUS: ":status", HTTP2_HEADER_METHOD: ":method", HTTP2_HEADER_AUTHORITY: ":authority", HTTP2_HEADER_SCHEME: ":scheme", HTTP2_HEADER_PATH: ":path", },};