GithubHelp home page GithubHelp logo

Comments (7)

nabeelamjad avatar nabeelamjad commented on September 8, 2024

Yep sounds good, I'll add a proxy functionality using HTTPClient in the next build (after today's build).

from poke-api.

nabeelamjad avatar nabeelamjad commented on September 8, 2024

Actually it might not even be required, it seems HTTPClient can detect an environment variable to set up a proxy instead.

Example:

2.3.1 :001 > ENV['HTTP_PROXY'] = 'http://username@password:localhost:8080'
 => "http://username@password:localhost:8080"
2.3.1 :002 > HTTPClient.new.proxy
 => #<Addressable::URI:0xd2a1b8 URI:http://username@password:localhost:8080>

It might be easier just to mention this in the readme rather than trying to add another method.

from poke-api.

nabeelamjad avatar nabeelamjad commented on September 8, 2024

I've added a mention in the README and I'll leave this as it is. If there's something else that I've missed please let me know.

from poke-api.

mxgr avatar mxgr commented on September 8, 2024

@nabeelamjad yes that's good way to sort this problem out I didn't see this, but let's say there are 200 accounts logged in the service and we want to use one IP per account - one single proxy won't be sufficient to do so

from poke-api.

mxgr avatar mxgr commented on September 8, 2024

@nabeelamjad So I just tried the http_proxy env var method, setting this up with a major proxy provider authentication, I get this error:
Poke::API::Errors::LoginFailure: Unable to login to GOOGLE => [407 "Proxy Authentication Required" @ /app/vendor/ruby-2.2.0/lib/ruby/2.2.0/net/http/response.rb:119:inerror!']`

Seems to be because:

This happens because Ruby's Open-URI library, which we use to talk to the GitHub API, does not support credentials in the proxy URI. The Ruby maintainers have not been receptive to changing this, as passing credentials in this manner is deprecated by more recent URI RFCs.

Homebrew/legacy-homebrew#32041

I think the only way to get HTTPClient to use a various number of proxies would be through:
@client = HTTPClient.new(proxy) @client.set_proxy_auth(user, password)

from poke-api.

nabeelamjad avatar nabeelamjad commented on September 8, 2024

Oh okay, I see. I'll add it in then for the next build.

from poke-api.

nabeelamjad avatar nabeelamjad commented on September 8, 2024

This has been implemented now, see README under Proxy Support section.

Let me know if you have any issues.

from poke-api.

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.