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

Cannot operate through a proxy #45

Open
JPvRiel opened this issue Aug 16, 2016 · 2 comments
Open

Cannot operate through a proxy #45

JPvRiel opened this issue Aug 16, 2016 · 2 comments
Labels

Comments

@JPvRiel
Copy link

JPvRiel commented Aug 16, 2016

Looks like a well written tool, but not designed to deal with a proxy use case? I.e. assumes open internet access?

With my http_proxy env variables set, it failed to work

$ apt-select
Getting list of mirrors...done.
Testing latency to mirror(s)
[0/3] 0%    connection to ubuntu.mirror.neology.co.za: timed out
[1/3] 33%   connection to ftp.leg.uct.ac.za: timed out
[2/3] 66%   connection to archive.ubuntu.com: timed out
[3/3] 100%
Cannot connect to any mirrors in ['http://ubuntu.mirror.neology.co.za/ubuntu/', 'http://ftp.leg.uct.ac.za/ubuntu/', 'http://archive.ubuntu.com/ubuntu/']

the problem is that in mirrors.py, the __tcp_ping() function cannot work via an HTTP proxy.

So this would entail quite a bit of rework.

  • detect if using a proxy
  • skip or implement an alternate measure of RTT through HTTP proxy
  • simplest may be to skip RTT testing if we use a proxy and rank purely based on bandwidth tests?

(If I find some spare time, I'll try hack at it and submit a PR)

@jblakeman
Copy link
Owner

I've proposed in #46 that the latency testing be moved from TCP sockets to using HTTP and FTP connections. I haven't tested these methods behind a proxy yet, but plan to do so as I'm guessing it will solve this issue.

@jblakeman jblakeman added the bug label Aug 21, 2016
@martin68
Copy link

martin68 commented Sep 25, 2019

@JPvRiel Someone told me it is a pity that apt-select does not support proxy setting. Since this issue is open for 3 years without a fix, if you want proxy support you can try my similar project: https://github.com/martin68/apt-smart which uses urlopen method in The Python Standard Library, you can set Environment Variables to make apt-smart connect via HTTP proxy, e.g. in terminal type:
export {http,https,ftp}_proxy='http://user:[email protected]:1080'
These will not persist however (no longer active after you close the terminal), so you may wish to add the line to your ~/.bashrc"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants