Skip to content
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

Add support for HTTP proxying #11

Closed
wants to merge 4 commits into from

Conversation

Projects
None yet
3 participants
@jsvine
Copy link

commented Jul 11, 2012

The superagent does not support proxying. But https://github.com/mikeal/request does support it, and it's not too difficult to swap out superagent for request. Made that change, plus:

  • Made the relevant change to package.json.
  • Added proxy key-val pair to request-based queries.
  • Added note about proxying to README.md.

jsvine added some commits Jul 10, 2012

Replace `superagent` with `request` in main library.
Works same as the old version, but will allow for proxy support and
other features `request` supports but `superagent` doesn't.

Sticking as closely as possible to the package's code-style.
Add proxy option to requests.
User can pass `proxy` as a key-value pair to `new CartoDB([...])`.
Doing so will set a proxy on the CartoDB queries handled by the
`request` module, but not those handled by `oauth`.
@impronunciable

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2012

@javisantana Is more authorized to close this. IMO is more an application thing than a library one. Proxying with node it's pretty easy (req.pipe(proxy).pipe(res))

@javisantana

This comment has been minimized.

Copy link
Contributor

commented Dec 18, 2012

I understand that @jsvine wants to access cartodb through an external proxy, right? I dont know how "req.pipe(proxy).pipe(res)" works

we are using superagent which looks like does not support proxy but i dont know if we are using it for some special reason.

So we see two options here:

  • switch to request to support it
  • add support for proxy with superagent (as far as i know it is add some headers)

@danzajdband is there any reason why we should keep using superagent?

the lovely thing here is that proxy feature request is the first one in superagent tracker visionmedia/superagent#1

also i'd like to apologize, I didn't see this pull request from @jsvine 5 months ago

@impronunciable

This comment has been minimized.

Copy link
Contributor

commented Dec 18, 2012

I just like more superagent API. If external proxy support is a good feature to add I'm not against it.

@impronunciable

This comment has been minimized.

Copy link
Contributor

commented Jul 10, 2013

I saw this new module https://github.com/TooTallNate/superagent-proxy and automatically remembered this issue. I'll try to update this module soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.