var tunnel = require('tunnel');
var tunnelingAgent = tunnel.httpsOverHttp({
proxy: {
host: 'localhost',
port: 3128
}
});
var req = https.request({
host: 'example.com',
port: 443,
agent: tunnelingAgent
});
var tunnelingAgent = tunnel.httpOverHttp({
maxSockets: poolSize,
proxy: {
host: proxyHost,
port: proxyPort,
localAddress: localAddress,
proxyAuth: 'user:password',
headers: {
'User-Agent': 'Node'
}
}
});
var req = http.request({
host: 'example.com',
port: 80,
agent: tunnelingAgent
});
var tunnelingAgent = tunnel.httpsOverHttp({
maxSockets: poolSize,
ca: [ fs.readFileSync('origin-server-ca.pem')],
key: fs.readFileSync('origin-server-key.pem'),
cert: fs.readFileSync('origin-server-cert.pem'),
proxy: {
host: proxyHost,
port: proxyPort,
localAddress: localAddress,
proxyAuth: 'user:password',
headers: {
'User-Agent': 'Node'
},
}
});
var req = https.request({
host: 'example.com',
port: 443,
agent: tunnelingAgent
});
var tunnelingAgent = tunnel.httpOverHttps({
maxSockets: poolSize,
proxy: {
host: proxyHost,
port: proxyPort,
localAddress: localAddress,
proxyAuth: 'user:password',
headers: {
'User-Agent': 'Node'
},
ca: [ fs.readFileSync('origin-server-ca.pem')],
servername: 'example.com',
key: fs.readFileSync('origin-server-key.pem'),
cert: fs.readFileSync('origin-server-cert.pem'),
}
});
var req = http.request({
host: 'example.com',
port: 80,
agent: tunnelingAgent
});
var tunnelingAgent = tunnel.httpsOverHttps({
maxSockets: poolSize,
ca: [ fs.readFileSync('origin-server-ca.pem')],
key: fs.readFileSync('origin-server-key.pem'),
cert: fs.readFileSync('origin-server-cert.pem'),
proxy: {
host: proxyHost,
port: proxyPort,
localAddress: localAddress,
proxyAuth: 'user:password',
headers: {
'User-Agent': 'Node'
}
ca: [ fs.readFileSync('origin-server-ca.pem')],
servername: 'example.com',
key: fs.readFileSync('origin-server-key.pem'),
cert: fs.readFileSync('origin-server-cert.pem'),
}
});
var req = https.request({
host: 'example.com',
port: 443,
agent: tunnelingAgent
});