node.js - Making a proxy with request and express in node -


i'm trying make proxy express , request module. this post shows how pipe() request response:

app.use(express.json());       // support json-encoded bodies app.use(express.urlencoded()); // support url-encoded bodies //app.use(express.multipart());  app.use('/api', function(req, res) {   var url =proxyurl + req.url;   req.pipe(request(url)).pipe(res); }); 

it works request. on post request fails. can't figure out happening because runs timeout. post request works on proxy.

what doing wrong? there changes can debug request? have tried following, file empty:

req.pipe(fs.createwritestream("test.txt")); 

we experiencing same issues, because express.json(). after disabling json parser, work ok. not idle solution might need json parser.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -