1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-05 11:24:15 +00:00

- Added SOCKS5 proxy for http connections to Web UI too

This commit is contained in:
Christophe Dumez 2010-01-07 20:40:39 +00:00
parent 296acf820c
commit 447efc52d8

View File

@ -156,6 +156,7 @@
_(Type:) <select id ="http_proxy_type_select" onchange="updateHTTPProxySettings();"> _(Type:) <select id ="http_proxy_type_select" onchange="updateHTTPProxySettings();">
<option value="none">_((None))</option> <option value="none">_((None))</option>
<option value="http">_(HTTP)</option> <option value="http">_(HTTP)</option>
<option value="socks5">_(SOCKS5)</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp; </select>&nbsp;&nbsp;&nbsp;&nbsp;
_(Host:) <input type="text" id="http_proxy_host_text" />&nbsp;&nbsp;&nbsp;&nbsp; _(Host:) <input type="text" id="http_proxy_host_text" />&nbsp;&nbsp;&nbsp;&nbsp;
_(Port:) <input type="text" id="http_proxy_port_value" style="width: 4em;"/><br/><br/> _(Port:) <input type="text" id="http_proxy_port_value" style="width: 4em;"/><br/><br/>
@ -368,6 +369,15 @@
} else { } else {
http_proxy_type = 1; http_proxy_type = 1;
} }
} else {
if(http_proxy_type_str == "socks5") {
if($defined($('http_proxy_auth_checkbox').get('checked')) && $('http_proxy_auth_checkbox').get('checked')) {
http_proxy_type = 4;
http_proxy_auth_enabled = 1;
} else {
http_proxy_type = 2;
}
}
} }
var http_proxy_ip = $('http_proxy_host_text').get('value'); var http_proxy_ip = $('http_proxy_host_text').get('value');
var http_proxy_port = $('http_proxy_port_value').get('value'); var http_proxy_port = $('http_proxy_port_value').get('value');
@ -820,6 +830,10 @@ loadPreferences = function() {
case 3: // HTTP_PW case 3: // HTTP_PW
$('http_proxy_type_select').set('value', 'http'); $('http_proxy_type_select').set('value', 'http');
break; break;
case 2: // SOCKS5
case 4: // SOCKS5_PW
$('http_proxy_type_select').set('value', 'socks5');
break;
default: // NONE default: // NONE
$('http_proxy_type_select').set('value', 'none'); $('http_proxy_type_select').set('value', 'none');
} }