netflie / whatsapp-cloud-api

The first PHP API to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform
https://netflie.es/portfolio/whatsapp-business-cloud-api-php-sdk/
MIT License
449 stars 163 forks source link

Setting a proxy #107

Closed KhawlahElshah closed 1 year ago

KhawlahElshah commented 1 year ago

Hello,

I need to set the proxy on each API request, how can I access the request so I can set the proxy header?

like this https://docs.guzzlephp.org/en/stable/request-options.html#proxy

Thank you.

aalbarca commented 1 year ago

Hi @KhawlahElshah

When you create an instance of the class you can pass through the constructor an array of options. One of those options is client_handler where you can pass your own implementation of a Guzzle client.

The client must implement the ClientHandler interface https://github.com/netflie/whatsapp-cloud-api/blob/main/src/Http/ClientHandler.php

Thanks.