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
You can activate the validation of a secure SSL certificate to the target connection (avoid self signed certs), just set `secure: true` in the options.
225
241
@@ -257,6 +273,8 @@ httpProxy.createServer({
257
273
}).listen(443);
258
274
```
259
275
276
+
**[Back to top](#table-of-contents)**
277
+
260
278
#### Proxying WebSockets
261
279
You can activate the websocket support for the proxy using `ws:true` in the options.
262
280
@@ -297,6 +315,8 @@ proxyServer.on('upgrade', function (req, socket, head) {
297
315
proxyServer.listen(8015);
298
316
```
299
317
318
+
**[Back to top](#table-of-contents)**
319
+
300
320
### Options
301
321
302
322
`httpProxy.createProxyServer` supports the following options:
@@ -327,6 +347,8 @@ If you are using the `proxyServer.listen` method, the following options are also
327
347
***ssl**: object to be passed to https.createServer()
328
348
***ws**: true/false, if you want to proxy websockets
329
349
350
+
**[Back to top](#table-of-contents)**
351
+
330
352
### Listening for proxy events
331
353
332
354
*`error`: The error event is emitted if the request to the target fail. **We do not do any error handling of messages passed between client and proxy, and messages passed between proxy and target, so it is recommended that you listen on errors and handle them.**
@@ -383,6 +405,8 @@ proxy.on('close', function (req, socket, head) {
383
405
});
384
406
```
385
407
408
+
**[Back to top](#table-of-contents)**
409
+
386
410
### Shutdown
387
411
388
412
* When testing or running server within another program it may be necessary to close the proxy.
@@ -399,6 +423,8 @@ var proxy = new httpProxy.createProxyServer({
399
423
proxy.close();
400
424
```
401
425
426
+
**[Back to top](#table-of-contents)**
427
+
402
428
### Miscellaneous
403
429
404
430
#### ProxyTable API
@@ -415,6 +441,8 @@ $ npm test
415
441
416
442
Logo created by [Diego Pasquali](http://dribbble.com/diegopq)
417
443
444
+
**[Back to top](#table-of-contents)**
445
+
418
446
### Contributing and Issues
419
447
420
448
* Search on Google/Github
@@ -423,6 +451,8 @@ Logo created by [Diego Pasquali](http://dribbble.com/diegopq)
423
451
* Commit to your local branch (which must be different from `master`)
424
452
* Submit your Pull Request (be sure to include tests and update documentation)
0 commit comments