Comments (7)
Yep sounds good, I'll add a proxy functionality using HTTPClient in the next build (after today's build).
from poke-api.
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.
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.
@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.
@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:in
error!']`
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.
Oh okay, I see. I'll add it in then for the next build.
from poke-api.
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)
- Does not re-set api_url HOT 5
- syntax error in gpsoauth HOT 1
- Encryption HOT 5
- Is it possible to set the location to a specific latitude and longitude? HOT 1
- Revamp README into a proper Wiki HOT 1
- get_map_objects always returns with empty pokemon arrays HOT 5
- Trying to understand fetch_ticket HOT 7
- Whats the difference between wild and catchable pokemons? HOT 11
- Locating pokestops
- Update signature and allow custom data HOT 6
- Getting unknown type: size_t input_size HOT 1
- Unkown proto fault when using @client.call or @client.login method HOT 8
- gpsoauth is not compatible with ruby 2.0.0 HOT 16
- undefined method `to_h' for [["error", "invalid_grant"]]:Array HOT 6
- Create a chat at Gitter? HOT 2
- 403 HOT 2
- Any chance of a 0.43.x API update? HOT 2
- S2 geometry library porting HOT 1
- wrong S2 cell ID for given latitude and longitude HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poke-api.