You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use this wonderful proxy library to forward a request to multiple different endpoints. My plan is to create an altered-source version of the library and do something like this:
if(options.forward){varforwards=Array.isArray(options.forward) ? options.forward : [options.forward];// added this...for(varforwardofforwards){// ...and this loop// If forward enable, so just pipe the requestvarforwardReq=(options.forward.protocol==='https:' ? https : http).request(common.setupOutgoing(options.ssl||{},options,req,'forward'));// error handler (e.g. ECONNRESET, ECONNREFUSED)// Handle errors on incoming request as well as it makes sense tovarforwardError=createErrorHandler(forwardReq,forward);req.on('error',forwardError);forwardReq.on('error',forwardError);(options.buffer||req).pipe(forwardReq);}if(!options.target){returnres.end();}}
Questions:
Is it possible to do this without creating an altered-source version?
If not, would you accept a pull request?
The text was updated successfully, but these errors were encountered:
gravyTrainee
changed the title
Forwarding to multiple domains
Forwarding to multiple endpoints
Sep 1, 2021
Hello!
I'd like to use this wonderful proxy library to forward a request to multiple different endpoints. My plan is to create an altered-source version of the library and do something like this:
Questions:
The text was updated successfully, but these errors were encountered: