How to configure tunneling proxy
See original GitHub issueProblem Description
I am using proxy middleware to communicate with an endpoint which lives in open internet but I am behind a corporate proxy. So when I try to connect to the endpoint I am getting following error.
ROXY ERROR: ENOTFOUND. localhost:3000 -> https://www.example.com.au/login
I wonder how to configure agent for http-proxy-middleware.
I have tested a simple https with a agent and works fine and code as follows.
var tunnel = require('tunnel');
var tunnelingAgent = tunnel.httpsOverHttp({
proxy: {
host: 'office.proxy.com.au',
port: 8080
}
})
var https = require('https')
var post_req = https.request({
host: 'www.example.com.au',
port: '443',
path: '/logon',
method: 'GET',
agent: tunnelingAgent,
timeout: 10000,
followRedirect: true,
maxRedirects: 10
}, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log('Response: ' + chunk);
});
});
post_req.write("name=mario");
post_req.end();
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
SSH Tunneling and Proxying | Baeldung on Linux
A special case of the forward TCP tunnels is the Socks proxy capability. Using these options, the SSH client listens on a specified...
Read more >Proxy servers and tunneling - HTTP - MDN Web Docs
There are two types of proxies: forward proxies (or tunnel, or gateway) and reverse proxies (used to control and protect access to a...
Read more >Configure VMware Tunnel Proxy
Navigate to Groups & Settings > All Settings > System > Enterprise Integration > VMware Tunnel Proxy > Configuration and select the Advanced...
Read more >Proxy tunneling - FIREHOUSE Software
Proxy tunneling via the HTTP CONNECT method lets a user who accesses the Internet through a proxy server connect to FH Web Edition...
Read more >How to SSH a Tunnel Proxy - SnapShooter Tutorials
SSH Tunneling allows access to resources on the remote server or allows access to your local resources to someone else. You will need...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chimurai Sorry to bring up such an old issue! When using this solution, proxyReq.SetHeader breaks - the error message is Cannot set headers after they are sent to the client Any help will be appreciated!
Same here