@robinpath/proxy
0.1.1PublicHTTP proxy and request forwarding module using Node.js built-in http module. Supports creating proxy servers, URL rewriting, header manipulation, request and response interception, round-robin load balancing, and health checking. No external dependencies required.
@robinpath/proxy
HTTP proxy and request forwarding module using Node.js built-in http module. Supports creating proxy servers, URL rewriting, header manipulation, request and response interception, round-robin load balancing, and health checking. No external dependencies required.
Why use this module?
The proxy module lets you:
- Forward a single HTTP request to a target server and return the response
- Create a new HTTP proxy server instance
- Start a proxy server and begin listening for requests
- Stop a running proxy server and clean up resources
- Add a URL rewrite rule to transform incoming request paths
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/proxy
Quick Start
No credentials needed — start using it right away:
proxy.create
Available Functions
| Function | Description |
|---|---|
proxy.forward | Forward a single HTTP request to a target server and return the response |
proxy.create | Create a new HTTP proxy server instance |
proxy.start | Start a proxy server and begin listening for requests |
proxy.stop | Stop a running proxy server and clean up resources |
proxy.rewrite | Add a URL rewrite rule to transform incoming request paths |
proxy.addHeader | Add a header to all proxied responses |
proxy.removeHeader | Remove a header from all proxied responses |
proxy.onRequest | Register an interceptor function for incoming requests |
proxy.onResponse | Register an interceptor function for proxy responses |
proxy.balance | Configure round-robin load balancing across multiple target servers |
proxy.health | Check the health of a target server by sending a HEAD request |
proxy.list | List all active proxy server instances and their configurations |
proxy.stats | Get statistics for a proxy server including request count, errors, and uptime |
Examples
Create a new HTTP proxy server instance
proxy.create
Start a proxy server and begin listening for requests
proxy.start
Stop a running proxy server and clean up resources
proxy.stop
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/proxy";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
proxy.create
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | yesterday |
Related Modules
@robinpath/api
HTTP client for making requests to external APIs with profiles, auth, download/upload, and auto-JSON parsing
@robinpath/auth
API authentication helpers (Basic, Bearer, API key, HMAC) for RobinPath
@robinpath/browser
Headless browser automation with Puppeteer: launch browsers, navigate pages, interact with elements, take screenshots, generate PDFs, and scrape data
@robinpath/cookie
HTTP cookie parsing, serialization, signing/verification, Set-Cookie handling, and cookie jar management
$ robinpath install @robinpath/proxy
