News for hackers. Stuff that matters.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by ilaksh on Saturday May 12, 2012 @09:03PM (#3965678)
Maybe you could make a signup with Stripe or Paypal or something so that people could pay $5 or $10 per month to use it.. that way you would have enough money to at least pay for the server(s) and a reason to maintain it and come up with a way for it to automatically scale.

I mean do you have something like a load balancer or proxy or something that will allow it to scale horizontally in case a few people really take advantage or it becomes popular?

It seems like leaving it totally free would probably end up with it just not being worthwhile to maintain.. but if there is a little money going in and at least one well-known service starts using it then I would totally consider using it.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @12:56AM (#3969520)
It was quick for me to make and it doesn't really require maintenance - feel free to donate to the EFF in honor of the project.

In terms of scalability, the app is doing very little processing so it's really just a matter of how many concurrent connections Node can handle in & out, but I've read it's capable of hundreds of thousands or more. Let me know if you are seeing high latency.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by jaredsohn on Sunday May 13, 2012 @01:34AM (#3966151)
It is on nodejitsu so at least portions of the architecture should scale reasonably.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by howardr on Saturday May 12, 2012 @05:36PM (#3965217)
How reliable is this service trying to be?

While I think it is a cool service if a person is just hacking around, it is not something I would use with any revenue generating project.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @01:09AM (#3969558)
feel free to download the source to reimplement or host your own
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by jostylr on Saturday May 12, 2012 @05:43PM (#3965237)
I just recently did something similar: https://github.com/jostylr/cors-lite

It was to give a JSON API for http://bootswatch.com

It would be easy enough for anyone to host it on something like nodester.com or cloudfoundry.com and have it just for your own JSON data.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by bede on Saturday May 12, 2012 @08:15PM (#3965600)
I simply have to commend your choice of project title here.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by beggi on Saturday May 12, 2012 @06:57PM (#3965447)
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by apsurd on Saturday May 12, 2012 @06:19PM (#3965339)
cool service, I hope it remains up so we can depend on it.

Currently you can accomplish the same thing using Yahoo's YQL, if you'd rather trust a big company to stay up. Here's an example: http://y.ahoo.it/b7rnO

I'm using it on my website to parse my project's history.json file: http://ruhoh.com/latest-updates/, check the source on that to see how it works.

Be warned that YQL transforms arrays containing one element into strings =/, terrible I know but it works.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by ZenPsycho on Sunday May 13, 2012 @12:36AM (#3966050)
Trust Yahoo! to keep a service running?
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by mike_organon on Saturday May 12, 2012 @05:32PM (#3965201)
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by lunaru on Saturday May 12, 2012 @05:44PM (#3965241)
And in case anyone is wondering, that's how the Easier option is implemented (CORS), whereas the Easy option is just JSONP.

OP could probably make it more explicit since it's not just a JSONP service, but also a CORS relay.

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by NameNickHN on Saturday May 12, 2012 @06:21PM (#3965345)
I wanted to use CORS a while ago but without Opera and IE 6 and 7 supporting it, it'll take a while until it will be an alternative to JASONP.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by catshirt on Saturday May 12, 2012 @08:44PM (#3965644)
irrelevant really- you can't set the CORS header on a remote API you don't own.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @01:18AM (#3969588)
that's kind of the point. CORS just tells the browser to block the response, so this proxies the request and simply changes the headers to avoid that restriction.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by drivebyacct2 on Saturday May 12, 2012 @05:33PM (#3965209)
More functional too, but it requires complicity from the remote server.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by fooyc on Saturday May 12, 2012 @06:29PM (#3965372)
JSONP requires complicity from the remote server too
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by willtheperson on Saturday May 12, 2012 @11:52PM (#3965978)
I tried this once with a proxy script and it eventually lead to inconsistencies. I've settled on using an apache reverse proxy when I need to do cross-domain json posts (typically for dev work).Just put this in your vhost config

ProxyPass /api/ http://destination.com/api/ ProxyPassReverse /api/ http://destination.com/api/

[deleted]
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by drivebyacct2 on Saturday May 12, 2012 @05:15PM (#3965138)
I hope you meant, "If you want to pass any secure information that would require HTTPS you can't use it.". POST does not make anything "more secure". (And JSONP should work cross site with HTTPS anyway)

Of course if you want to do multipart submissions or anything too long to fit in a url, you'll be needing POST anyway.

[deleted]
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by chrisrogers on Saturday May 12, 2012 @05:22PM (#3965166)
As a general note, GET and POST requests expose their parameters with equal visibility. It's just that the browser makes it more obvious what your GET parameters are
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by jaredsohn on Sunday May 13, 2012 @01:30AM (#3966143)
One things these services often lack is the ability to change the user agent before making the request. For awhile, if one wanted to make use of Pinterest's API, they would just need to change the user agent to mimic the iPhone app. (Recently Pinterest has made using the API more difficult so such a technique is no longer sufficient.)
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by Jach on Sunday May 13, 2012 @08:51AM (#3966858)
I thought this was going to be about https://github.com/jaubourg/jquery-jsonp but apparently not. I wouldn't trust it, personally, though I see its uses.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by tomkin on Saturday May 12, 2012 @10:54PM (#3965881)
Well, based on the comments it sounds like you've exposed a need. People want it to be stable and don't seem comfortable with the idea of it being your hobby. Make them pay for it before someone else decides to.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @01:14AM (#3969571)
point taken. as long as nodejitsu provides free hosting, though, im happy to keep it free.
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by shaydoc on Sunday May 13, 2012 @06:21AM (#3966608)
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by rohan_me on Saturday May 12, 2012 @05:29PM (#3965193)
:P sweet
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by rorrr on Sunday May 13, 2012 @05:33AM (#3966502)
While useful, there are a few implications

1) security

   a) I won't trust you with my API keys

   b) If you get hacked, ANY javascript can be executed on my pages
2) scalability - how much traffics can you handle?

3) I can implement your service with a 3-line PHP script. Why would I use your service?

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by jaredsohn on Sunday May 13, 2012 @11:04AM (#3967166)
1a -- you aren't just trusting this site, you are trusting everyone since the API keys can be found within the source.

3 -- it is even simpler than that; the source can be found on github. At the very least, services such as this are useful as you are still developing.

For the viability of a commercial version of this project, I think the biggest question is: why would somebody use this instead of Yahoo's YQL?

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @01:06AM (#3969546)
no commercial version planned - I threw it up because it was something I was going to use (to build hackerhours.org), and figured it would be useful to others as well
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @03:31AM (#3969908)
1a) not all API calls require a secret
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by jaredsohn on Monday May 14, 2012 @04:13AM (#3970010)
True, but irrelevant.

Note that I was responding to "I won't trust you with my API keys"

On a tangent, while this is a problem for this particular website, the issue is solveable. (See YQL.)

Re:Show HN: JSONP - enable cross-domain requests to any JSON... by aidanfeldman on Monday May 14, 2012 @01:03AM (#3969539)
1a) feel free to download the source and host yourself or write three lines of PHP 1b) not if you use the AJAX version - any response will come in as a string, so just don't eval() 2) the limit is really how many concurrent connections Node can handle, and the answer is "many" 3) It's at least useful for small mashup sites where you can throw up an HTML file with some JS - no server code needed
Re:Show HN: JSONP - enable cross-domain requests to any JSON... by tommoor on Sunday May 13, 2012 @06:55AM (#3966667)
I think number 3 is the biggest point here, i'm all for solving developer pain points but would be interested to see if there really is a market for this?