From b2e9142ea9a61af8c6e55a39a392136306dc0312 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sun, 12 Jul 2026 00:49:49 +0200 Subject: towards a Jetty 9 decoupling baseline for the Jetty 12 migration --- test/proxy-smoke-test.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 test/proxy-smoke-test.sh (limited to 'test/proxy-smoke-test.sh') diff --git a/test/proxy-smoke-test.sh b/test/proxy-smoke-test.sh new file mode 100755 index 000000000..ccae2227b --- /dev/null +++ b/test/proxy-smoke-test.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env sh + +# Live HTTP proxy and CONNECT contract. The peer must be started with the +# transparent proxy enabled and both targets must be controlled test services. + +set -eu + +proxy=${YACY_SMOKE_PROXY:-} +http_target=${YACY_SMOKE_PROXY_HTTP_TARGET:-} +https_target=${YACY_SMOKE_PROXY_HTTPS_TARGET:-} +[ -n "$proxy" ] && [ -n "$http_target" ] && [ -n "$https_target" ] || { + echo "SKIP: set YACY_SMOKE_PROXY, YACY_SMOKE_PROXY_HTTP_TARGET and YACY_SMOKE_PROXY_HTTPS_TARGET" >&2 + exit 2 +} + +timeout=${YACY_SMOKE_TIMEOUT:-30} +curl --silent --show-error --fail --max-time "$timeout" --proxy "$proxy" \ + --noproxy '' \ + "$http_target" >/dev/null +echo "ok 1 - HTTP proxy traffic" + +# An HTTPS request through an HTTP proxy necessarily establishes a CONNECT tunnel. +curl --silent --show-error --fail --max-time "$timeout" --proxy "$proxy" \ + --noproxy '' \ + "$https_target" >/dev/null +echo "ok 2 - HTTPS CONNECT tunnel" + +echo "PASS: proxy and CONNECT contract" -- cgit v1.2.3