TooTallNate / node-proxy-agent

Maps proxy protocols to `http.Agent` implementations
285 stars 69 forks source link

proxy-agent return circular 302 on endpoints of https://api.meetup.com #9

Closed jkutianski closed 7 years ago

jkutianski commented 8 years ago

This is my test code:

var https = require('https');
var ProxyAgent = require('proxy-agent');

var proxyUri = 'http://localhost:3128';

https.get({
    host: 'api.meetup.com',
    path: '/2/cities',
    agent: new ProxyAgent(proxyUri)
}, function (res) {
    console.log(res.statusCode, res.headers);
    res.pipe(process.stdout);
});

The returned res.headers are

{
     date: 'Thu, 21 Jul 2016 22:35:05 GMT',
     'content-type': 'text/html; charset=iso-8859-1',
     'content-length': '325',
     connection: 'close',
     'set-cookie': ['__cfduid=d6e8ffe944c1eac207a133b7a263ee6121469140504; expires=Fri, 21-Jul-17 22:35:04 GMT; path=/; domain=.meetup.com; HttpOnly'],
     location: 'https://api.meetup.com/2/cities/',
     server: 'cloudflare-nginx',
     'cf-ray': '2c621fbaa2861d30-EZE'
 }

If I comment agent: new ProxyAgent(proxyUri) everything works fine. I tested this with 3 differents proxies.

On this ISSUE they suggest me that it's a proxy-agent bug but I can't found nothing wrong on it.

TooTallNate commented 8 years ago

I can reproduce, and indeed that is rather strange. On meetup.com's end, the proxy should be completely transparent. I'll try to dig into this soon when I have some time, if you don't beat me to it.

jkutianski commented 8 years ago

Thank Nathan!

jkutianski commented 7 years ago

Solved on https://github.com/TooTallNate/node-proxy-agent/commit/1bdfc4ad7a5d54ac9530b9f1c37be08338b5cdff