Skip to content
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

Feat/support proxy #505

Merged
merged 5 commits into from
Aug 6, 2020
Merged

Feat/support proxy #505

merged 5 commits into from
Aug 6, 2020

Conversation

aseure
Copy link

@aseure aseure commented Aug 6, 2020

Q A
Bug fix? no
New feature? yes
BC breaks? no
Related Issue N/A
Need Doc update no

Summary

This commit brings support for user-defined proxy addresses, defined by
the HTTP_PROXY or HTTPS_PROXY environment variables, or via the
Config.proxies dictionnary of the form:

Config.proxies = {
    'http: 'https://127.0.0.1:8080',
    'https: 'https://127.0.0.1:8080',
}

This works for both the Requester and the RequesterAsync.

This commit brings support for user-defined proxy addresses, defined by
the `HTTP_PROXY` or `HTTPS_PROXY` environment variables, or via the
`Config.proxies` dictionnary of the form:

```py
Config.proxies = {
    'http: 'https://127.0.0.1:8080',
    'https: 'https://127.0.0.1:8080',
}
```

This works for both the `Requester` and the `RequesterAsync`.
@aseure aseure force-pushed the feat/support-proxy branch 2 times, most recently from 35a813f to 6201a36 Compare August 6, 2020 14:42
@@ -37,7 +37,7 @@ def send(self, request):

try:
response = self._session.send( # type: ignore
r, timeout=requests_timeout
r, timeout=requests_timeout, proxies=request.proxies,
Copy link

@TomKlotzPro TomKlotzPro Aug 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend having this format to have a better readability.

Suggested change
r, timeout=requests_timeout, proxies=request.proxies,
r,
timeout=requests_timeout,
proxies=request.proxies,

Copy link
Author

@aseure aseure Aug 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the recommendation buddy!

Regarding the formatting, I suggest to work on that in a different PR. For now, it seems that the formatting is losely enforced by a (too?) lightweight flake8 configuration. IMHO we should enforce a stricter flake8 or black configuration to avoid any formatting discussion in the future.

Let me know what you think about this, and let's make this happen soon.

TomKlotzPro
TomKlotzPro previously approved these changes Aug 6, 2020
Copy link

@TomKlotzPro TomKlotzPro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot Anthony for working on this 🎉 .
This look good to me. I've left a comment feel free to answer me if you think this isn't relevant.

@aseure aseure merged commit 43d8d67 into master Aug 6, 2020
@aseure aseure deleted the feat/support-proxy branch August 6, 2020 15:41
shortcuts pushed a commit that referenced this pull request Nov 24, 2023
* chore(cts): update dependency on cts generation for java

* chore: remove getPackageDependencies from the base class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants