0.0.5 • Published 2 years ago
@gamas/dev-proxy v0.0.5
Dev Proxy
Installation
$ npm install --save @gamas/dev-proxy
Basic example
import { Proxy } from "@gamas/dev-proxy";
const rules = [
{
label: "exemple",
route: "/",
target: "https://example.com",
replaceHostHeader: true
}
];
const proxy = Proxy
.createProxy(8081)
.useRules(rules)
.build();
proxy.start();
Rule properties
Name | Required | Type | Description |
---|---|---|---|
label | X | string | |
route | X | Route | |
target | X | Target | |
transformers | Transformer[] | ||
replaceHostHeader | boolean | ||
priority | number | ||
serverOptions | ServerOptions | See |
ServerOptions
This code is based on node-http-proxy, a programmable proxying library.
ServerOptions
Build locally
$ npm install
$ npm run build