-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POST request non proxyed #42
Comments
it seems that |
👍 |
1 similar comment
👍 |
👍 I experience the same problems. Is any work going on this issue? |
Fixed the problem (at least for me): The issue was that I had a body parser consuming the req stream before the proxy-middleware could consume the req stream. Moving the proxy middleware before the body parser fixed the problem. Though the question remains, if it would be a feature to at least close the connection to the host with an error (right now the response times out). |
Hi,
it seems that POST requests are not proxyed correctly as I see no requests arriving on destination server. The same request works fine from chrome/postman to the destination proxy. Also get requests works fine
BTW I've added this to handle the form data:
var body=req.body;
if (body) {
opts.form=body
}
before
var myReq = request(opts, function (myRes) {
my opts variable contains the following:
{ protocol: 'http:',
slashes: true,
auth: null,
host: '127.0.0.1:4000',
port: '4000',
hostname: '127.0.0.1',
hash: null,
search: null,
query: null,
pathname: '/admin',
path: '/admin/test',
href: 'http://127.0.0.1:4000/admin',
method: 'POST',
headers:
{ connection: 'keep-alive',
'content-length': '263',
'cache-control': 'no-cache',
origin: 'chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm',
'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.78 Safari/537.36',
'content-type': 'application/x-www-form-urlencoded',
accept: '/',
'accept-encoding': 'gzip, deflate',
'accept-language': 'it-IT,it;q=0.8,en-US;q=0.6,en;q=0.4',
cookie: ...' },
form:
{ key1: 'value1' } }
do you have any idea about that ?
thanks
giuliano
The text was updated successfully, but these errors were encountered: