So if we try to use localhost as a proxy server we get url parse exception:
File "/usr/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py", line 187, in parse_url
raise LocationParseError(url)
requests.packages.urllib3.exceptions.LocationParseError: Failed to parse: archive.ubuntu.com:8000:8000
In our case http:// localhost: 80 is not a valid proxy server. /github. com/openstack/ fuel-library/ commit/ d60233a0cba912f aa2170f9f897936 0ff0740c55 /bugs.launchpad .net/fuel/ +bug/1270187)
Besides that we have apache redirect to Fuel Web interface on port 80
(https:/
https:/
So if we try to use localhost as a proxy server we get url parse exception:
File "/usr/lib/ python2. 7/site- packages/ requests/ packages/ urllib3/ util/url. py", line 187, in parse_url ror(url) packages. urllib3. exceptions. LocationParseEr ror: Failed to parse: archive. ubuntu. com:8000: 8000
raise LocationParseEr
requests.
Some examples (localhost as a proxy):
[root@fuel ~]# curl -x localhost:80 -I http:// example. com /example. com:8443/
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:06:34 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: https:/
Content-Type: text/html; charset=iso-8859-1
[root@fuel ~]# curl -x localhost:80 -I http:// example. com/test example. com:8000/ test
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:52:03 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: http://
Content-Type: text/html; charset=iso-8859-1
[root@fuel ~]# curl -x localhost:80 -I http:// example. com:8000/ test example. com:8000:8000/test
HTTP/1.1 301 Moved Permanently
Date: Wed, 02 Mar 2016 07:54:33 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Location: http://
Content-Type: text/html; charset=iso-8859-1
Example for some valid proxy:
[root@fuel ~]# curl -x 195.154.231.43:80 -I http:// example. com b1-4fa73693161c 7"
HTTP/1.1 200 OK
Date: Wed, 02 Mar 2016 08:32:25 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Wed, 28 May 2014 10:38:19 GMT
ETag: "bc0b89-
Accept-Ranges: bytes
Content-Length: 177
Vary: Accept-Encoding
Content-Type: text/html
X-Pad: avoid browser bug
So, I think that we have to add some function that will check 'validity' of proxy server
before creating any get request through.