Modules@robinpath/proxy

@robinpath/proxy

0.1.1Public

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.

@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.

Category Functions Auth License

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

FunctionDescription
proxy.forwardForward a single HTTP request to a target server and return the response
proxy.createCreate a new HTTP proxy server instance
proxy.startStart a proxy server and begin listening for requests
proxy.stopStop a running proxy server and clean up resources
proxy.rewriteAdd a URL rewrite rule to transform incoming request paths
proxy.addHeaderAdd a header to all proxied responses
proxy.removeHeaderRemove a header from all proxied responses
proxy.onRequestRegister an interceptor function for incoming requests
proxy.onResponseRegister an interceptor function for proxy responses
proxy.balanceConfigure round-robin load balancing across multiple target servers
proxy.healthCheck the health of a target server by sending a HEAD request
proxy.listList all active proxy server instances and their configurations
proxy.statsGet 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

License

MIT

Versions (1)

VersionTagPublished
0.1.1latestyesterday
Install
$ robinpath install @robinpath/proxy
Version0.1.1
LicenseMIT
Unpacked Size6.4 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

web