I presently attempt to implement an easy HTTP-server for many type of comet-technique (lengthy polling XHR-demands). As JavaScript is extremely strict about crossdomain demands I've got a couple of questions:

  1. When I understood any apache worker is blocked while serving a request, so writing the "script" like a usual website would block the apache, when all employees getting a request for everyone. --> Doesn't work!
  2. I emerged using the idea writing a own simple HTTP server just for serving this lengthy polling demands. This server shouldn't be obstructing, so each worker could handle many request simultaneously. As my website also consists of content / images etc and my server need not server content I began him on the different port then 80. The issue now's which i can't interact between my JavaScript shipped by my apache and my comet-server running on the different port, due to some crossdomain limitations. --> Doesn't work!
  3. I Quickly emerged using the idea to make use of mod_proxy to map my server on the new subdomain. I truly don't could work out how mod_proxy works however i could suppose I understand have a similar effect as on my small first approach?

An amount be the easiest method to create these type of combination this type of classic website which lengthy-polling XHR-demands? Should i implement content delivery on my small server inside my own?

I am confident using mod_proxy will block a staff as the request has been processed.

If you're able to use 2 Insolvency practitioners, there's a simple solution. Let us say IP A is 1.1.1.1 and IP B is 2.2.2.2, and let us say your domain is example.com.

This is the way it'll work:

-Configure Apache to pay attention on port 80, only on IP A.

-Start your other server on port 80, only on IP B.

-Configure the XHR demands to become on the subdomain of the domain, but with similar port. Therefore the mix-domain limitations don't prevent them. So your internet site is example.com, and also the XHR demands visit xhr.example.com, for instance.

-Configure your DNS to ensure that example.com resolves to IP A, and xhr.example.com resolves to IP B.

-You are done.

This solution works for those who have 2 servers and they all have its IP, and it'll act as well for those who have one server with 2 Insolvency practitioners.

If you cannot use 2 Insolvency practitioners, I might have another solution, I am checking whether it's relevant for your situation.