$ npm install --save @gamas/dev-proxy
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();
Name | Required | Type | Description |
---|---|---|---|
label | X | string | |
route | X | Route | |
target | X | Target | |
transformers | Transformer[] | ||
replaceHostHeader | boolean | ||
priority | number | ||
serverOptions | ServerOptions | See |
This code is based on node-http-proxy, a programmable proxying library.
ServerOptions
$ npm install
$ npm run build