A rewriting proxy to handle OAuth redirects and authentication flows behind FRP.
- Dynamic URL rewriting for OAuth/ADFS authentication flows
- Cookie manipulation for cross-domain authentication
- CORS handling
- Configurable via environment variables
- Security-focused logging (no sensitive data in logs)
Copy .env.example to .env and configure:
cp .env.example .envRequired:
PROXY_PORT: Port to run the proxy server (default: 8888)PUBLIC_HOSTNAME: Public hostname/IP that clients use to access the proxy
Optional:
REWRITE_DOMAINS: Comma-separated list of domains to rewrite in responsesDOMAIN_MAP: JSON object mapping domains to custom backend targets
NODE_ENV=production
PROXY_PORT=8888
PUBLIC_HOSTNAME=yourhost.com
REWRITE_DOMAINS=login.microsoftonline.com,aadcdn.msauth.net,graph.microsoft.com,paospace.ykpaoschool.cn:8192
DOMAIN_MAP={"paospace.ykpaoschool.cn:8192":"https://127.0.0.1:8889"}# Configure environment
cp .env.example .env
# Edit .env with your settings
# Start the service
docker-compose up -d# Configure environment
cp .env.example .env
# Edit .env with your settings
# Install dependencies
npm install
# Start the proxy
npm startTo expose internal services through this proxy using FRP (Fast Reverse Proxy):
[common]
server_addr = your-frp-server.com
server_port = 7000
[paospace]
type = https
local_ip = 127.0.0.1
local_port = 8192
custom_domains = paospace.ykpaoschool.cn- Run FRP client to expose internal service (e.g., paospace.ykpaoschool.cn:8192)
- Configure this proxy with
DOMAIN_MAPto route requests to the FRP-exposed service - Set
PUBLIC_HOSTNAMEto your proxy's public address - Access via:
http://your-proxy:8888/https://paospace.ykpaoschool.cn:8192
# Install dependencies
npm install
# Run in development mode
npm start