http-proxy

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2020 Jun 23 9:16
Editor
Edited
Edited
2023 Feb 10 5:1
Refs
Refs

function

const http = require('http') const httpProxy = require('http-proxy') const proxy = httpProxy.createProxyServer({}) http.createServer(function (req, res) { proxy.web(req, res, { target: 'http://localhost:3000' }) }).listen(3333) proxy.on('error', function (err, req, res) { if (err) console.log(err) res.writeHead(500) res.end('Ooops, something went very wrong...') })
 
websocket support
proxyServer.on('upgrade', function (req, socket, head) { proxy.ws(req, socket, head); });
 
 
How to create a simple http proxy in node.js?
I'm trying to create a proxy server to pass HTTP GET requests from a client to a third party website (say google).
How to create a simple http proxy in node.js?
 
Catch proxy error? · Issue #264 · http-party/node-http-proxy
Dismiss GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Sign up You can't perform that action at this time. You signed in with another tab or window. You signed out in another tab or window.
Catch proxy error? · Issue #264 · http-party/node-http-proxy
 
 

Recommendations