You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proxying from HTTPS to HTTPS is essentially the same as proxying from HTTPS to HTTP, but you must include `target` option in when calling `httpProxy.createServer` or instantiating a new instance of `HttpProxy`.
271
+
Proxying from HTTPS to HTTPS is essentially the same as proxying from HTTPS to HTTP, but you must include the `target` option in when calling `httpProxy.createServer` or instantiating a new instance of `HttpProxy`.
https.createServer(options.https, function (req, res) {
301
-
proxy.proxyRequest(req, res, {
302
-
host:'localhost',
303
-
port:8000
304
-
})
305
+
proxy.proxyRequest(req, res);
305
306
}).listen(8002);
306
307
307
308
//
@@ -325,7 +326,7 @@ httpProxy.createServer(
325
326
```
326
327
327
328
## Proxying WebSockets
328
-
Websockets are handled automatically when using the `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how:
329
+
Websockets are handled automatically when using `httpProxy.createServer()`, but if you want to use it in conjunction with a stand-alone HTTP + WebSocket (such as [socket.io][5]) server here's how:
329
330
330
331
```js
331
332
var http =require('http'),
@@ -334,26 +335,24 @@ var http = require('http'),
334
335
//
335
336
// Create an instance of node-http-proxy
336
337
//
337
-
var proxy =newhttpProxy.HttpProxy();
338
+
var proxy =newhttpProxy.HttpProxy(
339
+
target: {
340
+
host:'localhost',
341
+
port:8000
342
+
});
338
343
339
344
var server =http.createServer(function (req, res) {
0 commit comments