mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[examples] fixed https examples
This commit is contained in:
parent
fd42dcef01
commit
a467b7b4a9
@ -4,10 +4,10 @@ var httpProxy = require('../lib/http-proxy'),
|
|||||||
* Create your proxy server pointing to a secure domain
|
* Create your proxy server pointing to a secure domain
|
||||||
* Enable ssl validation
|
* Enable ssl validation
|
||||||
*/
|
*/
|
||||||
var options = {target : 'https://google.com',
|
var options = { target : 'https://google.com',
|
||||||
agent : https.globalAgent,
|
agent : https.globalAgent,
|
||||||
headers: {host: 'google.com'}
|
headers: {host: 'google.com'}
|
||||||
};
|
};
|
||||||
|
|
||||||
var proxyServer = httpProxy.createProxyServer(options);
|
var proxyServer = httpProxy.createProxyServer(options);
|
||||||
console.log("Proxy server listening on port 8000");
|
console.log("Proxy server listening on port 8000");
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
var httpProxy = require('http-proxy');
|
var httpProxy = require('../lib/http-proxy');
|
||||||
/*
|
/*
|
||||||
* Create your proxy server pointing to a secure domain
|
* Create your proxy server pointing to a secure domain
|
||||||
*/
|
*/
|
||||||
var options = {target:'https://google.com'};
|
var options = { target:'https://google.com',
|
||||||
|
headers: {host: 'google.com'}
|
||||||
|
};
|
||||||
|
|
||||||
var proxyServer = httpProxy.createProxyServer(options);
|
var proxyServer = httpProxy.createProxyServer(options);
|
||||||
console.log("Proxy server listening on port 8000");
|
console.log("Proxy server listening on port 8000");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user