HTTP proxy support for peer communication

This commit is contained in:
Christophe Dumez
2010-01-15 16:41:39 +00:00
parent c7ca51f950
commit de50346428
4 changed files with 45 additions and 16 deletions

View File

@@ -174,6 +174,7 @@
<option value="none">_((None))</option>
<option value="socks4">_(SOCKS4)</option>
<option value="socks5">_(SOCKS5)</option>
<option value="http">_(HTTP)</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
_(Host:) <input type="text" id="peer_proxy_host_text" />&nbsp;&nbsp;&nbsp;&nbsp;
_(Port:) <input type="text" id="peer_proxy_port_value" style="width: 4em;"/><br/><br/>
@@ -397,6 +398,15 @@
} else {
if(proxy_type_str == "socks4") {
proxy_type = 5;
} else {
if(proxy_type_str == "http") {
if($defined($('peer_proxy_auth_checkbox').get('checked')) && $('peer_proxy_auth_checkbox').get('checked')) {
proxy_type = 3;
proxy_auth_enabled = 1;
} else {
proxy_type = 1;
}
}
}
}
var proxy_ip = $('peer_proxy_host_text').get('value');
@@ -810,6 +820,10 @@ loadPreferences = function() {
case 4: // SOCKS5_PW
$('peer_proxy_type_select').set('value', 'socks5');
break;
case 1: // HTTP
case 3: // HTTP_PW
$('peer_proxy_type_select').set('value', 'http');
break;
default: // NONE
$('peer_proxy_type_select').set('value', 'none');
}