diff --git a/types/http-proxy/http-proxy-tests.ts b/types/http-proxy/http-proxy-tests.ts index 70ea803da6..1610befc7d 100644 --- a/types/http-proxy/http-proxy-tests.ts +++ b/types/http-proxy/http-proxy-tests.ts @@ -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 +}); diff --git a/types/http-proxy/index.d.ts b/types/http-proxy/index.d.ts index e9ef9a572d..fb7eb26abc 100644 --- a/types/http-proxy/index.d.ts +++ b/types/http-proxy/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for node-http-proxy 1.16 // Project: https://github.com/nodejitsu/node-http-proxy -// Definitions by: Maxime LUCE , Florian Oellerich +// Definitions by: Maxime LUCE +// Florian Oellerich +// Daniel Schmidt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -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(). */