Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Split" one request to multiple servers

Is it possible to split a request to multiple endpoint servers ?

So for example: If server A receives one request it will then forward it to 3 different servers (B,C and D) which will receive that original request with X-Forwarded-For header.

              forward
request => A ========> B  
             ========> C
             ========> D

The response for that matter can be a simple 200 OK.

I have played around with HAProxy and Apache's mode_proxy so far with no success.

Also read about HTTP Pipelining but I don't think this is the case here.

like image 270
shdev Avatar asked Dec 06 '11 03:12

shdev


2 Answers

Gor was written to do exactly this.

Hat tip to Arthur Lutz for posting the answer here.

like image 103
chmac Avatar answered Nov 03 '22 06:11

chmac


Hm. How would I do that? Most networking setups, wether they are doing a proxy request or load balancing will retain a one-to-one relationship between the incoming request and the final destination for that specific request. I think you would need some code in between. I think I'd use mod_perl or a custom apache module in C to intercept the request at an early phase and do the multiple routing with sub-requests.

like image 20
Devin Ceartas Avatar answered Nov 03 '22 07:11

Devin Ceartas