Skip to content

proxy SOCKS5 schema support #1064

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

Closed
llegolas opened this issue Jan 30, 2020 · 10 comments
Closed

proxy SOCKS5 schema support #1064

llegolas opened this issue Jan 30, 2020 · 10 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@llegolas
Copy link

What is the feature and why do you need it:
It would be nice if the client supports socks5 proxy to be on par with the kubectl which respects and uses properly env. proxy var of the sort of http_proxy=socks5://.....

Describe the solution you'd like to see:
it would be sufficient if the code checks for the proxy schema in configuration.proxy and use urllib3.contrib.socks.SOCKProxyManager instead of urllib3.ProxyManager accordingly.

@llegolas llegolas added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 30, 2020
@llegolas
Copy link
Author

Perhaps something like

        # https pool manager
        if configuration.proxy:
            if configuration.proxy.split(':')[0].lower() == 'socks5':
                self.pool_manager = urllib3.contrib.socks.SOCKSProxyManager(
                    num_pools=pools_size,
                    maxsize=maxsize,
                    cert_reqs=cert_reqs,
                    ca_certs=ca_certs,
                    cert_file=configuration.cert_file,
                    key_file=configuration.key_file,
                    proxy_url=configuration.proxy,
                    **addition_pool_args
                )

vs.

        if configuration.proxy:
            self.pool_manager = urllib3.ProxyManager(
                num_pools=pools_size,
                maxsize=maxsize,
                cert_reqs=cert_reqs,
                ca_certs=ca_certs,
                cert_file=configuration.cert_file,
                key_file=configuration.key_file,
                proxy_url=configuration.proxy,
                **addition_pool_args
            )
        else:

in rest.py

@roycaihw
Copy link
Member

roycaihw commented Mar 9, 2020

The rest client is auto generated by openapi-generator. Would you mind file a feature request in that repo?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 7, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 7, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tlianza
Copy link

tlianza commented Apr 13, 2021

I can't quite see in the code (in kube_config.py) how you'd pass a proxy server in such that it would ever get set. In other words, even with no changes to the openapi-generator, how could you ever get if configuration.proxy: to be true in the current k8s client?

@jlonganecker
Copy link

Can we now use the new version of open api generator. Looks like they merged in support for SOCKS5 proxies:

OpenAPITools/openapi-generator@2ca9586

@christophetd
Copy link

Confirming that this would be a great feature to have. If kubectl supports it then the K8s client should as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants