Skip to content

Commit

Permalink
ENH: updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
srossross committed Sep 17, 2013
1 parent 4ee96dd commit f566a42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 50 deletions.
15 changes: 15 additions & 0 deletions examples/https-secure.js
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);

55 changes: 5 additions & 50 deletions examples/https.js
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);




0 comments on commit f566a42

Please sign in to comment.