Level 50
not sure, but i would try this:
$response = Http::withOptions([
'curl' => [CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'],
])->get('http://example.com/users');
2 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
We are using laravel HTTP client to make http requests to communicate with external APIs. Due to IP based rate limitations in some of the external end points, we decided to use different IPs for different requests. Guzzle provides a nice feature (CURLOPT_INTERFACE), which allows you to define outgoing network interface. Anyone can guide us on how to set this parameter in Laravel Http client request.
Thanks in advance...
not sure, but i would try this:
$response = Http::withOptions([
'curl' => [CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'],
])->get('http://example.com/users');
Please or to participate in this conversation.