Live data from Hacker News

Show HN: Include this JS library to enable cross-origin requests

github.com

31–33 of 33 posts

Re: Show HN: Include this JS library to enable cross-origin requests

#31

Earlier quoted context omitted.

Tell you what. Since I'm not a big fan of the lynchmob, here's the only positive critique I'll give you: proxying isn't an altogether terrible idea. It's not my first go to, but it does have it's place. HOWEVER. Allowing a third party to manage it, is. If you genuinely want to create some buzz and interest, source the serverside of this, and write some docs up how to deploy it to AWS, Heroku, etc. Bundle the JS with…

OK, it is a trust issue. However you can use this library and change the proxy url to your own server and still get the benefit of the fact that you don't need to rewrite external requests and just use jQuery.

At that point, if I wrote my own proxy server, I'd drop the JS altogether and just request a proxy link. I know what's cross-origin in my code, so if I wanted to mitigate it with a proxy, I don't need the additional library. Still say your best bet is losing the JS and opening up the server. I mean, what's going to be better here, telling everyone "it's a trust issue", or passing on a relatively simple self-hosted proxy server made specifically for CORS-faking? Else, my big trust question is "why exactly do you WANT me to forward my traffic through your black box server?"

Re: Show HN: Include this JS library to enable cross-origin requests

#32
post #3

Routing all your x-domain requests through an unknown third part via vanilla HTTP? What could possibly go wrong?

It's just your cross-origin traffic, which is not possible without this library, everything else will behave exactly the same.

And whoever is running this proxy will _promise_ not to log any sensitive information (API keys not the least) or otherwise use/modify the response for their own ends?

Not to mention that the API endpoint is HTTP only, meaning everything is broadcast in the clear.

Also, cross origin requests are perfectly possible without this library, it's precisely why we use JSONP and CORS.

When it comes to security, this library is a collection of anti-patterns. As well as the JS anti-pattern of not overwriting native objects, such as XMLHttpRequest in this context.

Re: Show HN: Include this JS library to enable cross-origin requests

#33

Earlier quoted context omitted.

"You can only use JSOP and CROS with sites you have control over or are designed to behave and support external requests." That's kind of the point.

It limits the thing you can do. This library allows you to easily get and display content from any external source.

Those limits are a security measure to protect against XSS and CSRF. Intentionally weakening your site security isn't a good idea for most people. Your mash up site evidently uses this to get around same origin policy without the cooperation of targeted sites. It would be interesting to know how you plan to mitigate those risks.
Post reply on HN