Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiHttpClient #9

Open
joelwurtz opened this issue Jan 29, 2016 · 6 comments
Open

MultiHttpClient #9

joelwurtz opened this issue Jan 29, 2016 · 6 comments
Labels

Comments

@joelwurtz
Copy link
Member

Having a client that accept multi http clients, when it receives a request it will duplicate the call to all the underlying client and return a BatchResponse (like the batchclient)

It should done the call in async mode if possible or in sync mode if no async is available.

One of the use case can be for FosHttpCache when we need to send a request over multiple varnish instance.

@sagikazarmark
Copy link
Member

I don't think we can use BatchResponse in this case, as Responses are indexed by request, which is only one in this case. You either have to clone the requests or create a response object which indexes responses by client.

@joelwurtz
Copy link
Member Author

Good point, we will need to map the response with the httpclient in this case IMO.

@dbu
Copy link
Contributor

dbu commented Feb 23, 2016

in FriendsOfSymfony/FOSHttpCacheBundle#283 we found that we should be able to use the --resolve option of curl [http://serverfault.com/questions/443949/how-to-test-a-https-url-with-a-given-ip-address](to force the IP of a domain), which translates to CURLOPT_RESOLVE in php .

it would be great if the multiplexer could handle this situation. any idea how we could achieve this in a generic way? or can / should we somehow pass information down to the actual implementation?

@sagikazarmark
Copy link
Member

Maybe your Capability idea could work here. Pair a client with a (set of) RequestMatcher and send the request with the matching client.

@dbu
Copy link
Contributor

dbu commented Feb 23, 2016

but that only delegates the problem to the matching client. we need to send the same request to various IPs, and we found that if HTTPS is used, the certificate will be for the HOST header, but curl at least verifies based on the IP that was used, not on the hostname.

@dbu
Copy link
Contributor

dbu commented Jan 8, 2019

in FOSHttpCache, this is what we currently do: https://github.com/FriendsOfSymfony/FOSHttpCache/blob/master/src/ProxyClient/HttpDispatcher.php#L188

its a very specific scenario, however. and i think all scenarios that require sending a request to multiple hosts are very specific. you also would need to change the requests one way or another in each client, to make this actually do anything. therefore i am not sure if we should provide something here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants