A behavior used with BeamJS framework to proxy HTTP/S requests and WebSocket connections with or without rules.
- Protocol Support: Proxies HTTP, HTTPS, and WebSockets (ws/wss).
- Load Balancing: Deep route-based distribution with active health checks.
- Advanced Proxying: Virtual hosting, domain routing, and reverse proxy.
- Connection Handling: Event-driven architecture, long-polling, and auto-redirects.
npm install proxy-behaviourrequire('proxy-behaviour')({
name: 'proxyDemo',
pass: 'http://localhost:1430'
});name: Behavior name/intent (required).pass: Target URL.passes: Array of{ host, path }targets for load balancing.path: Base route (default/).host: Virtual host.version: Behavior version.relative: Preserve relative paths.setHost: RewriteHostheader.trustHost: Bypass SSL verification.reverse: Add reverse proxy headers (X-Forwarded-*).followRedirects: Auto-follow HTTP redirects.timeout: Socket timeout in milliseconds.target: Dynamic target override (String/Function).