-
Notifications
You must be signed in to change notification settings - Fork 59
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
Use option proxy even at HeartBeat #78
Comments
Hi @BigOHenry, Thank you for reporting the issue. To be honest, I never thought of using this library through a proxy. So initially I never designed the library to facilitate this functionality. I've labeled your issue as a feature and will work in the upcoming weeks on it. |
Thank you very much :) |
We can use PSR-18 for abstracting the HTTP client ! |
Hey @drupol, I've done it already in my other library dragonbe/hibp, but never got around to implement it here. Do you think you have some time to look into this? |
I personnaly don't need the feature but I can help doing it for sure :-) I'll see if I can give it a try this weekend! |
Here's a first shot: https://gist.github.com/drupol/8e541083763b0f5a4b6d816684f0e0d0 As you can see, you pass the HTTP client in the constructor, and it can be configured at will by the user (proxy, etc etc). Let me know what you think. |
Hi @BigOHenry, I've taken a look at this and there was a major issue in the design of the heartbeat feature. In our current situation we just wanted to make sure we could "reach" the service directly. @drupol I've taken a look at your proposed change, but at this point this library is used in projects that are not yet implementing PSR-18. I do want to rebuild it using PSR-18 in the next major version of VIES, but not for now. I've modified the logic within $vies = new Vies();
$options = [
'proxy_host' => '127.0.0.1',
'proxy_port' => '8888',
];
$vies->setOptions($options);
$heartBeat = new \DragonBe\Vies\HeartBeat('tcp://' . $options['proxy_host'], $options['proxy_port']);
$vies->setHeartBeat($heartBeat);
$isAlive = $vies->getHeartBeat()->isAlive(); As I used a local proxy for testing, I can see the requests being handled through my proxy correctly. @BigOHenry please have a look at PR #101 for my suggested changes and tell me if this will work for you. Once reviewed by @krzaczek we can implement it and release it to the masses. |
Hello mate, It's fine, no worry. Let me know if you need some help for using PSR-18. Thanks for your feedback ! |
Hey @drupol, Now with the "extra" time I got due to "social distancing" and "covid-19 measures" I do have plans to work on a full upgrade of the library so we can make use of PHP 7.4 features and separating logic even further. Also a clean up of repeated logic over the various validators is in the pipeline. More on that once I have decided on the roadmap of the project. |
Hello,
we are using Vies with proxy. Getting data from vies is fine, but HeartBeat does not work.
The text was updated successfully, but these errors were encountered: