views:

51

answers:

3

Does anyone has any solutions on accomplishing asynchronous cross-domain GET requests. I am looking to make a site that checks available names of other sites. The faster the better.

I'd like it to use my server if possible, as its most likely faster than the client. Would most likely send it a huge array (300-10000) requests.

Examples, links, anything will work.

+1  A: 

You would have to make a same-domain get request to your server, and have your PHP script do the checking (maybe using CURL) before responding to the request.

http://www.php.net/manual/en/curl.examples-basic.php

Fosco
A: 

Check out curl http://us.php.net/curl

Scott Saunders
+1  A: 

Do you want to perform the Cross-Domain Check using JavaScript or using PHP?

If using JavaScript you will probably be restricted by the Same-Origin Policy, though some pages may allow your browser to access them using Ajax.

If using PHP there is no way to perform a asynchronous request, because PHP is synchronous all over.

Maybe a good variant would be to send a request to a Node.JS server from your JavaScript and then let Node.JS get the page without blocking a process?

nikic