provide argument option as already parsed url to http-proxy (#25164)

This commit is contained in:
Daniel Schmidt
2018-05-04 14:05:41 -07:00
committed by Andy
parent 5872451016
commit b3647b5bb5
2 changed files with 13 additions and 3 deletions
+8
View File
@@ -24,3 +24,11 @@ proxy.on("start", (req, res, target) => {
http.createServer((req, res) => {
proxy.web(req, res);
});
const newProxy = HttpProxy.createProxyServer({
target: {
host: 'localhost',
port: '9015'
},
ws: true
});
+5 -3
View File
@@ -1,6 +1,8 @@
// Type definitions for node-http-proxy 1.16
// Project: https://github.com/nodejitsu/node-http-proxy
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>, Florian Oellerich <https://github.com/Raigen>
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
// Florian Oellerich <https://github.com/Raigen>
// Daniel Schmidt <https://github.com/DanielMSchmidt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -166,9 +168,9 @@ declare namespace Server {
/** Buffer */
buffer?: stream.Stream;
/** URL string to be parsed with the url module. */
target?: string;
target?: ProxyTargetUrl;
/** URL string to be parsed with the url module. */
forward?: string;
forward?: ProxyTargetUrl;
/** Object to be passed to http(s).request. */
agent?: any;
/** Object to be passed to https.createServer(). */