3

Server listening on localhost:8080

PhantomJS listening on localhost:8081

Proxy setup to send request to PhantomJS from Server

var proxy = httpProxy.createProxyServer({ target: 'http://localhost:8081'});
var server = http.createServer(function(req, res) {

    if (req.url === '/phantom') proxy.web(req, res);
    else res.end('yes yes');
});

server.listen(8080);

Post request to http://localhost:8080/phantom (Server Proxy) has "undefined" request.post

Post request to http://localhost:8081/ (PhantomJS) has populated request.post

What must I do to receive the post data via the proxy?

4

1 回答 1

-1

尝试 127.0.0.1 替换本地主机

于 2014-11-03T23:20:52.660 回答