aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/openvpn-client-export.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/openvpn-client-export/openvpn-client-export.inc')
-rwxr-xr-xconfig/openvpn-client-export/openvpn-client-export.inc24
1 files changed, 16 insertions, 8 deletions
diff --git a/config/openvpn-client-export/openvpn-client-export.inc b/config/openvpn-client-export/openvpn-client-export.inc
index d79c42c3..06a0928c 100755
--- a/config/openvpn-client-export/openvpn-client-export.inc
+++ b/config/openvpn-client-export/openvpn-client-export.inc
@@ -226,11 +226,15 @@ function openvpn_client_export_config($srvid, $usrid, $crtid, $useaddr, $quotese
}
if (!empty($proxy)) {
- if ($proto == "udp") {
- $input_errors[] = "This server uses UDP protocol and cannot communicate with HTTP proxy.";
- return;
+ if ($proxy['proxy_type'] == "http") {
+ if ($proto == "udp") {
+ $input_errors[] = "This server uses UDP protocol and cannot communicate with HTTP proxy.";
+ return;
+ }
+ $conf .= "http-proxy {$proxy['ip']} {$proxy['port']} ";
}
- $conf .= "http-proxy {$proxy['ip']} {$proxy['port']} ";
+ if ($proxy['proxy_type'] == "socks")
+ $conf .= "socks-proxy {$proxy['ip']} {$proxy['port']} ";
if ($proxy['proxy_authtype'] != "none") {
if (!isset($proxy['passwdfile']))
$proxy['passwdfile'] = openvpn_client_export_prefix($srvid, $usrid, $crtid) . "-proxy";
@@ -745,11 +749,15 @@ function openvpn_client_export_sharedkey_config($srvid, $useaddr, $proxy, $zipco
$conf .= "ping-timer-rem\n";
if (!empty($proxy)) {
- if ($proto == "udp") {
- $input_errors[] = "This server uses UDP protocol and cannot communicate with HTTP proxy.";
- return;
+ if ($proxy['proxy_type'] == "http") {
+ if ($proto == "udp") {
+ $input_errors[] = "This server uses UDP protocol and cannot communicate with HTTP proxy.";
+ return;
+ }
+ $conf .= "http-proxy {$proxy['ip']} {$proxy['port']} ";
}
- $conf .= "http-proxy {$proxy['ip']} {$proxy['port']} ";
+ if ($proxy['proxy_type'] == "socks")
+ $conf .= "socks-proxy {$proxy['ip']} {$proxy['port']} ";
if ($proxy['proxy_authtype'] != "none") {
if (!isset($proxy['passwdfile']))
$proxy['passwdfile'] = openvpn_client_export_prefix($srvid) . "-proxy";