AtlatestRepositorysigil-http3

sigil-http3 / tree / scriptsphantom-continuous-punch-run.sh

1#!/usr/bin/env bash
2set -euo pipefail
3cd "$(dirname "$0")/.."
4umask 077
5mkdir -p build
6node --check scripts/continuous-punch-window.mjs
7node --check scripts/punch-firewall.mjs
8timeout --foreground 15 node --test test/test-continuous-punch-window.mjs
9export HTTP3_CONTINUOUS_PUNCH_RUN=1
10node scripts/prepare-punch-inputs.mjs
11export HTTP3_IPV6_ADDRESS
12HTTP3_IPV6_ADDRESS=$(node --input-type=module -e '
13import { networkInterfaces } from "node:os";
14const addresses = networkInterfaces()[process.env.HTTP3_INTERFACE]?.filter(a => a.family === "IPv6" && /^[23]/.test(a.address) && !a.internal);
15if (!addresses?.length) throw new Error("No assigned global IPv6");
16console.log(addresses[0].address);')
17export HTTP3_PREFLIGHT_SAN="IP:127.0.0.1,IP:::1,IP:$HTTP3_IPV6_ADDRESS,DNS:localhost"
18export HTTP3_PREFLIGHT_PREBUILT=1 HTTP3_PREFLIGHT_HTTPS_PAGE=1 HTTP3_PREFLIGHT_QUERY=1
19export HTTP3_SPIKE_SDK_JOB=http3-example HTTP3_SPIKE_TRACE=1 HTTP3_SPIKE_TRACE_PROBE=1
20HTTP3_PREFLIGHT_HOST=::1 bash scripts/phantom-browser-preflight.sh
21export HTTP3_SOURCE_REVISION
22HTTP3_SOURCE_REVISION=$(git rev-parse HEAD)
23exec node scripts/continuous-punch-window.mjs run