-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var caronte = require('caronte'), | ||
https = require('https'); | ||
/* | ||
* Create your proxy server pointing to a secure domain | ||
* Enable ssl validation | ||
*/ | ||
var options = {target : 'https://google.com', | ||
agent : https.globalAgent, | ||
headers: {host: 'google.com'} | ||
}; | ||
|
||
var proxyServer = caronte.createProxyServer(options); | ||
console.log("Proxy server listening on port 8000"); | ||
proxyServer.listen(8000); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,10 @@ | ||
var http = require('http') | ||
, https = require('https') | ||
, caronte = require('caronte') | ||
; | ||
// | ||
// Create your proxy server | ||
// | ||
var options = {target:'https://google.com', | ||
agent: new https.Agent({rejectUnauthorized:false}), | ||
}; | ||
var caronte = require('caronte'); | ||
/* | ||
* Create your proxy server pointing to a secure domain | ||
*/ | ||
var options = {target:'https://google.com'}; | ||
|
||
var proxyServer = caronte.createProxyServer(options); | ||
|
||
proxyServer.ee.on('*:error', function(err, req, res){ | ||
res.end('There was an error proxying your request'); | ||
}); | ||
|
||
console.log("Proxy server listening on port 8000"); | ||
proxyServer.listen(8000); | ||
|
||
|
||
// | ||
// Create your proxy server | ||
// | ||
var options2 = {target:'https://google.com', | ||
headers: {'host':'google.com'}, | ||
}; | ||
|
||
var proxyServer2 = caronte.createProxyServer(options2); | ||
|
||
proxyServer2.ee.on('*:error', function(err, req, res){ | ||
res.end('There was an error proxying your request'); | ||
}); | ||
|
||
console.log("Proxy server 2 listening on port 8001"); | ||
proxyServer2.listen(8001); | ||
|
||
// | ||
// Create your proxy server | ||
// | ||
var options3 = {target:'https://google.com', | ||
xfwd:true}; | ||
|
||
var proxyServer3 = caronte.createProxyServer(options3); | ||
|
||
proxyServer3.ee.on('*:error', function(err, req, res){ | ||
res.end('There was an error proxying your request'); | ||
}); | ||
|
||
console.log("Proxy server 3 listening on port 8002"); | ||
proxyServer3.listen(8002); | ||
|
||
|
||
|
||
|