-
Notifications
You must be signed in to change notification settings - Fork 27
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
Connection through proxy #66
Comments
did you already try the following? garth.configure(proxies={"https": "https://myproxy"}) |
Yes, sure. Without doing this the the valuable "parent: Optional[Session] = None" will not have any info about proxy or certificate check. So it is mandatory.
req = Request(
But if you modify your code like I said before (OAUTH_CONSUMER = requests.get(OAUTH_CONSUMER_URL, proxies=parent.proxies, verify=parent.verify).json()), the proxies will contains a dictionary with your proxy settings. |
Interesting ... I'll try to reproduce and make the change. I'll get to it this weekend. |
Hello!
First of all I would like to say thank you for you package! It's very usefull for me! Great job.
I use it from my working place and my organization uses proxy to connect users to the internet. I was unable to connect. The reason was in sso.py module. It will not pass any http.Client configuration during requests.get(OAUTH_CONSUMER_URL).json(). So I modified this part of code to this:
OAUTH_CONSUMER = requests.get(OAUTH_CONSUMER_URL, proxies=parent.proxies, verify=parent.verify).json()
Everything works for me now. Maybe it could be the case for other users behind a proxy.
class GarminOAuth1Session(OAuth1Session):
def init(
self,
/,
parent: Optional[Session] = None,
**kwargs,
):
global OAUTH_CONSUMER
if not OAUTH_CONSUMER:
OAUTH_CONSUMER = requests.get(OAUTH_CONSUMER_URL).json()
super().init(
OAUTH_CONSUMER["consumer_key"],
OAUTH_CONSUMER["consumer_secret"],
**kwargs,
)
if parent is not None:
self.mount("https://", parent.adapters["https://"])
self.proxies = parent.proxies
self.verify = parent.verify
The text was updated successfully, but these errors were encountered: