Giter VIP home page Giter VIP logo

Comments (9)

DragonBe avatar DragonBe commented on July 19, 2024 1

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.

from vies.

drupol avatar drupol commented on July 19, 2024 1

We can use PSR-18 for abstracting the HTTP client !

from vies.

BigOHenry avatar BigOHenry commented on July 19, 2024

Thank you very much :)

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

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?

from vies.

drupol avatar drupol commented on July 19, 2024

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!

from vies.

drupol avatar drupol commented on July 19, 2024

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.

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

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 DragonBe\Vies\Heartbeat a little bit so you can provide it with your custom proxy settings.

$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.

VIES Service over Proxy

@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.

from vies.

drupol avatar drupol commented on July 19, 2024

Hello mate,

It's fine, no worry. Let me know if you need some help for using PSR-18.

Thanks for your feedback !

from vies.

DragonBe avatar DragonBe commented on July 19, 2024

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.

from vies.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.