question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proxy dont work with post action

See original GitHub issue

I setup proxy middleware on express. Proxy work as expected with get request. But I can’t use login form in anymore. note: i have rewrite the form action url to my proxy manually. capture

Setup

  • server: express

proxy middleware configuration

var apiProxy = proxy('/proxy', {
    target: 'https://m.facebook.com/',
    changeOrigin: true,
    pathRewrite: {  '^/proxy/login.php': '/login.php' },
    onProxyReq: (proxyReq, req, res) => {
        proxyReq.setHeader( 'User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' );
    }
});

server mounting

var app = express();

app.use(apiProxy);
app.listen(3001);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chimuraicommented, Jan 30, 2018

POST requests are supported. Some issues might occur if your using body-parser for example. In those cases make sure you’ve configured/mount the proxy prior to the body-parser.

2reactions
chimuraicommented, Jan 29, 2018

Issue has gone stale; Closing issue. Feel free to re-open.

Thanks.

PS: I think StackOverflow would be a better place to troubleshoot your setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

post does not work when behind a proxy - Stack Overflow
The problem isn't with your code. It's a bug in the web-based proxy service you are using. You can't expect services like that...
Read more >
Cannot forward Post and PUT request using proxy.web method
getParameter("data") to get my posted data in Java. And then I try @zanaca 's method, but it doesn't work. On Java Server, I...
Read more >
App proxy doesn't send a request as it should
You can do POST or GET. It is your choice. The App Proxy does not care. It is simply a wrapper and forwards...
Read more >
Proxy doesn't work after upgrade to SDK 9 - Apple Developer
We have a problem with accessing servers in the mobile network which uses proxy. Before SDK 9 everything was working like a charm...
Read more >
Set up Lambda proxy integrations in API Gateway
Learn how to configure a Lambda proxy integration request and integration response in API Gateway.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found