Closed AlexNodex closed 4 years ago
Hi Alex, sorry for the delay, could you maybe suggest how you would like to make this work - which methods would change? Thanks
The Client
constructor could add an optional IP address then in the getHttpClient
method the config could be checked to see if a source ip was set and add it as a key/value option under curl.options
using the key CURLOPT_INTERFACE
and the value of the IP address.
I can create a PR if you like?
Yes, I think we could add it as an option in the config array? PR would make it easier to discuss
Cheers
Op ma 29 jun. 2020 10:15 schreef AlexNodex notifications@github.com:
The Client constructor could add an optional IP address then in the getHttpClient method the config could be checked to see if a source ip was set and add it as a key/value option under curl.options using the key CURLOPT_INTERFACE and the value of the IP address.
I can create a PR if you like?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/afosto/yaac/issues/16#issuecomment-651006234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFROB2EYXDITIFJKFK5ELH3RZBERHANCNFSM4NZHDKMA .
I'm not sure that 0.0.0.0 is a good default here. It will limit the http call to IPv4 traffic only. "::" might be a better default, but that could also have side-effects we don't know about.
I would prefer to not set CURLOPT_INTERFACE at all by default. This way the user can decide for themselves.
I'll look into this tomorrow, you could be right. Thanks!
Op do 2 jul. 2020 18:21 schreef Tobias Mädel notifications@github.com:
I'm not sure that 0.0.0.0 is a good default here. It will limit the http call to IPv4 traffic only. "::" might be a better default, but that could also have side-effects we don't know about.
I would prefer to not set CURLOPT_INTERFACE at all by default. This way the user can decide for themselves.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afosto/yaac/issues/16#issuecomment-653103049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFROB2E6FLKXV6STBSOKQRDRZSXYBANCNFSM4NZHDKMA .
Great, thanks! :)
Would you accept a pull request to set the source IP?
Letsencrypt has limits on the number of requests from a single IP address over a 3 hour period. If you have an infrastructure with a lot of domains and accompanying IP addresses this can become impossible to manage. Guzzle allows setting the source IP via curl options so an IP could be passed to the client constructor to send the request from that IP address?