Hi,
Because I want to make every computer which has different proxy setting(or none setting) can run my program, I would like to know how to set proxy in my python program. Or it will produce error: HTTPSConnectionPool(host='git.XXXX.com', port=443): Max retries exceeded with url: /rest/api/1.0/projects/xxx/repos/ooo/tags?limit=1000 (Caused by ProtocolError('Connection aborted.', error(10054, 'An existing connection was forcibly closed by the remote host')))
I think this error is caused by proxy because after I set proxy on some computer, it works.
I use Bitbucket Server and atlassian-python-api module.
My program is as following:
--------------------------------------------------------------------------------------------
from atlassian import Bitbucket
...
bbucket = Bitbucket(url='https://git.XXXX.com', username=username, password=password)
tag = bbucket.get_tags('xxx', 'ooo')
...
--------------------------------------------------------------------------------------------
Is there any methods or other ways can help me? Something like: bitbucket.proxies = {'http':proxy_setting, 'https':proxy_setting}? or command setting?
Thanks a lot.
how do you do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
proxy_setting = http://<username>:<password>@proxy:<portNumber>
bbucket = Bitbucket(url='https://...', username=username, password=password)
bbucket._session.proxies = {'http': proxy_setting, 'https': proxy_setting}
I set it like this and it works. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.