diff --git a/mopidy/backends/spotify/session_manager.py b/mopidy/backends/spotify/session_manager.py index dff29fad..130164fb 100644 --- a/mopidy/backends/spotify/session_manager.py +++ b/mopidy/backends/spotify/session_manager.py @@ -36,9 +36,11 @@ class SpotifySessionManager(process.BaseThread, PyspotifySessionManager): full_proxy = '' if config['proxy']['hostname']: full_proxy = config['proxy']['hostname'] - # Add proxy port only if available + # Add proxy port and scheme only if available if config['proxy']['port']: - full_proxy = full_proxy + ':' + str(config['proxy']['port']) + full_proxy += ':' + str(config['proxy']['port']) + if config['proxy']['scheme']: + full_proxy = config['proxy']['scheme'] + "://" + full_proxy PyspotifySessionManager.__init__( self, config['spotify']['username'], config['spotify']['password'], diff --git a/mopidy/config/__init__.py b/mopidy/config/__init__.py index 35a1d8e0..582a1a03 100644 --- a/mopidy/config/__init__.py +++ b/mopidy/config/__init__.py @@ -26,10 +26,12 @@ _audio_schema['mixer_track'] = String(optional=True) _audio_schema['output'] = String() _proxy_schema = ConfigSchema('proxy') +_proxy_schema['scheme'] = String(optional=True, + choices=['', 'https', 'socks4', 'socks5']) _proxy_schema['hostname'] = Hostname(optional=True) +_proxy_schema['port'] = Port() _proxy_schema['username'] = String(optional=True) _proxy_schema['password'] = Secret(optional=True) -_proxy_schema['port'] = Port() # NOTE: if multiple outputs ever comes something like LogLevelConfigSchema #_outputs_schema = config.AudioOutputConfigSchema() diff --git a/mopidy/config/default.conf b/mopidy/config/default.conf index 4a259c49..8d2101fb 100644 --- a/mopidy/config/default.conf +++ b/mopidy/config/default.conf @@ -13,7 +13,8 @@ mixer_track = output = autoaudiosink [proxy] +scheme = hostname = +port = username = password = -port = diff --git a/mopidy/config/types.py b/mopidy/config/types.py index 8309a591..ba8b8f2a 100644 --- a/mopidy/config/types.py +++ b/mopidy/config/types.py @@ -245,7 +245,6 @@ class Port(Integer): return value - class Path(ConfigValue): """File system path