Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Generalized (jsonp) proxy #27

Closed
drewwells opened this Issue · 7 comments

3 participants

@drewwells

One of the common issues these days is making requests to third part domains that don't support json and/or jsonp. Please provide an example of this in your demo.

I wrote one that kind of sucks here: https://gist.github.com/864549. 75% of the code is to prevent errors that would crash NodeJS.

For example,
/?url=http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json
Or for XML, User needs to convert this to JSON
/?url=http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full

This sort of works, obviously its broken b/c I don't rebuild absolute URLs:
?url=http://google.com/

However, this one seriously breaks and I don't know why
?url=http://woot.com/

@indexzero
Owner

Seems like this would be best implemented as a standalone library that uses node-http-proxy.

@drewwells

Seriously? I would think this is very important use case. It seems that the major pain for Web Dev's have shifted from IE6 to the horrendous state of same-domain policies. Every JS application needs one a proxy now, and that isn't going to change for some time.

@indexzero
Owner

Yes, seriously. The goal of node-http-proxy is to write a pure javascript HTTP proxy as compliant as possible with RFC2616 (HTTP/1.1 Specification): http://www.ietf.org/rfc/rfc2616.txt

Although I agree with you that this would be a valuable feature, it clearly does not align with this goal. Be happy to contribute / collaborate on the standalone library, but it does not belong in node-http-proxy.

@Marak

I gotta agree with indexzero on this. A generalized json-p proxy should be a standalone project. If you make a separate module that wraps this functionality up nicely, I'd be glad to link it to the ReadMe for http-proxy.

@drewwells

You guys are making a browser-style 'web proxy' if I understand correctly, I'll be using Node directly rather than building ontop of this http-proxy

@Marak

Huh? It's a proxy for http requests, not sure how else to explain that.

Either way, best of luck.

@indexzero
Owner

node-http-proxy is not designed to run in the browser. It is designed to run on the server using node.js.

It is also designed to compete with things like nginx, and HAProxy. Very heavy C/C++ libraries that are difficult to contribute to or improve without a large upfront effort in learning the codebase and low-level networking approaches.

You really should use node-http-proxy rather than just node.js directly. We do a lot of things that aren't immediately obvious if you're just doing http.request().

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.