This commit is contained in:
@@ -37,6 +37,25 @@ echo "==> UI responded; checking it looks like the HTK app"
|
||||
grep -qi 'httptoolkit\|<div id="app"\|<title' /tmp/htk-index.html \
|
||||
|| { echo "!! served index.html doesn't look like the UI"; exit 1; }
|
||||
|
||||
# The WebSocket/subscription path is where bun's built-in `ws` shim used to kill
|
||||
# the server, and no amount of HTTP probing reaches it. Needs node + the server's
|
||||
# node_modules for the mockttp client, so it's skipped in the self-containment
|
||||
# run (where the source tree is deliberately hidden).
|
||||
if [ "${WS_CHECK:-0}" = "1" ]; then
|
||||
MOCKTTP_PORT="${MOCKTTP_PORT:-45456}"
|
||||
NM="$ROOT/httptoolkit-server/node_modules"
|
||||
if [ -d "$NM" ] && command -v node > /dev/null; then
|
||||
echo "==> checking admin WebSocket + subscription stream on :$MOCKTTP_PORT"
|
||||
NODE_PATH="$NM" node "$ROOT/scripts/ws-check.js" \
|
||||
"http://127.0.0.1:${MOCKTTP_PORT}" "http://localhost:${PORT}" \
|
||||
|| { echo "!! admin WebSocket check failed"; exit 1; }
|
||||
# That check is only meaningful if it didn't take the server down with it:
|
||||
kill -0 "$PID" 2>/dev/null || { echo "!! binary died during WebSocket check"; exit 1; }
|
||||
else
|
||||
echo "==> SKIP WebSocket check (needs node + httptoolkit-server/node_modules)"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "==> checking management API is listening on :$SERVER_PORT"
|
||||
# corsGate rejects requests without an allowed Origin with a JSON 403 - that's a
|
||||
# *successful* connection (the server is up), which is all we need to confirm.
|
||||
|
||||
Reference in New Issue
Block a user