#!/usr/bin/env bash set -euo pipefail HTTP_PROXY_PORT=${HTTP_PROXY_PORT:-25345} # Proxy settings (v2rayN / local HTTP proxy) export HTTP_PROXY="${HTTP_PROXY:-http://127.0.0.1:${HTTP_PROXY_PORT}}" export HTTPS_PROXY="${HTTPS_PROXY:-http://127.0.0.1:${HTTP_PROXY_PORT}}" export NO_PROXY="${NO_PROXY:-localhost,127.0.0.1,::1,.corp.local,ahcode-01.digital.achrf.ru}" # Some libs read lowercase variants export http_proxy="$HTTP_PROXY" export https_proxy="$HTTPS_PROXY" export no_proxy="$NO_PROXY" # Reaching the host through a name rather than localhost — publishing it behind # a port forward or a reverse proxy — needs that name allowed: Vite answers # "Blocked request. This host is not allowed." to every other Host header. # # ALLOWED_HOST carries it. The variable Vite reads is its own escape hatch: it # appends the value to server.allowedHosts, so cloudcli/vite.config.js stays # untouched. One name per run — the value is appended whole, commas are not # split. Unset means an empty string, which Vite ignores, so leaving it alone # keeps the default localhost-only behaviour. export __VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS="${ALLOWED_HOST:-}" echo "-------" echo "HTTP_PROXY=${HTTP_PROXY}" echo "ALLOWED_HOST=${ALLOWED_HOST:-(none, localhost only)}" echo "-------" # Run claude with args bash dev-host.sh "$@"