-
Notifications
You must be signed in to change notification settings - Fork 96
No support for HTTP proxies #48
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
Comments
Hi @willemstuursma, thanks for opening an issue. I think we could potentially add this as an option and to use something like We'll review this some more and see if we can change some code soon. Or, should you have the inclination, we'd love to see a pull request. |
Hello, I managed to successfully post messages to the Messagebird API from behind a proxy. I modified the "performHttpRequest" in "HttpClient.php" to let cUrl use the "CURLOPT_PROXY" option. The problem is that it seems I do not get the same response I would get when using no proxy. The "processRequest" in "Base.php" throws an error because the response is not valid JSON.
When i dump the response, I get the following data:
Any idea how to fix this, or where to search? Like I said, the messages are successfully posted and also texted to the mobile numbers. I'm only missing the correct response. |
@CoonHouse could it be that the proxy is filtering the content when sending back the response? The headers you've sent seem to be good (and it even has |
@samwierema I can imagine this is not really high on your list but I would like to use it behind a proxy as well. If there was some way to access the CURL handler before doing the requests everyone could just add their own configuration tweaks (i.e. SSL options, proxy, timeouts etc). That will solve more then this issue alone. |
@Matthijsvdorp, I have this working behind a proxy by modifying the source. I am not at the code right now, so I can not share my solution right now. And i made it work for my situation and did not test all other possible situations that might occur!! If you are interested, I will look into it and share you my modifications. Best Regards, Wilco |
Please do. Thanks. |
@CoonHouse I got it working as well but by changing a file in my |
Add additional HTTP options to HttpClient [#48]
Hi @willemstuursma, thanks for opening this issue - version 1.10.0 has just been released and you should now be able to use proxies with the MessageBird client. HTTP options, and therefore proxies, can be set as follows: $httpClient = new HttpClient(Client::endpoint);
$httpClient->addHttpOption(CURLOPT_PROXY, 'YOUR_PROXY');
$client = new Client('YOUR_ACCESS_KEY', $httpClient);
// Do something with $client... Please do not hesitate to let me know if you have any questions about this! |
We would like to connect to the MessageBird API using an HTTP proxy.
Unfortunately there is no option available to set this.
The text was updated successfully, but these errors were encountered: