Alignak-monitoring-contrib / alignak-app

Desktop application in system tray for Alignak users.
GNU Affero General Public License v3.0
6 stars 2 forks source link

Proxy management #274

Closed algorys closed 6 years ago

algorys commented 6 years ago

In case a user uses a proxy, there is no way in App to manage it.

According to the documentation of the requests library, a simple definition of the environment variables could be enough to make the client understand that there is a proxy. (See Requests: proxies)

So, App could:

A rapid test (under Linux):

# Just before login to backend client
import os
os.environ['HTTP_PROXY'] = 'http://10.0.0.1'

# Log output
[2018-03-15,17:05:52]-urllib3.connectionpool: [WARNING] Retrying (Retry(total=4, connect=5, read=5, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError("<urllib3.connection.HTTPConnection object at 0x7f5164b37128>: Failed to establish a new connection: [Errno 110] Connexion terminée par expiration du délai d'attente",))': http://demo.alignak.net:6000/login

Because proxy is not here.

mohierf commented 6 years ago

Some remarks:

algorys commented 6 years ago

This answer on SO is very well explain: proxies-with-python-requests-module

mohierf commented 6 years ago

Defining a HTTP_PROXY environment variable (Linux or Windows) seems to make the Alignak App use a proxy server to connect the backend 😉

mohierf commented 6 years ago

User authentication is a must-have !

algorys commented 6 years ago

@mohierf yes. I think we need to integrate it in client.

See https://github.com/Alignak-monitoring-contrib/alignak-backend-client/pull/72

algorys commented 6 years ago

Done.