Proxy backend
proxy-backend
wrapps node-http-proxy
while monitoring the backend
status with status-monitor
.
Features
- Status checks / health checks , full features at status-monitor .
- Proxy http/websockets , full features at node-http-proxy (http-proxy) .
- Proxy traffic based on backend status.
node-http-proxy
is by far the best library to proxy http traffic.
It was just missing some healthchecks(status-monitor
) to the destination it's forwarding to.
Simple usage
The following example is an express website that proxy to a remote server only when it's valid
const ProxyBackend = ;const proxyBackend = proxyOptions : target : 'http://example.com' monitorOptions : requestOptions : url : 'http://example.com' { resstatus503 };proxyBackendproxyproxyBackendstart;proxyBackendstatusMonitorproxyBackendstatusMonitor //express....const express = const app = appapp app