summaryrefslogtreecommitdiffstats
path: root/socks.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-12 19:46:10 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2005-12-12 19:46:10 +0000
commitf214bb2115994cc6b4123f3d06db0452f17f2e99 (patch)
tree7a09094e169f4097ceb033204c171eba2a51ae59 /socks.c
parentdf5722cc68307206c5edcc94fd7ae333d3212b59 (diff)
downloadopenvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.tar.gz
openvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.tar.xz
openvpn-f214bb2115994cc6b4123f3d06db0452f17f2e99.zip
Added --auto-proxy directive to auto-detect HTTP or SOCKS
proxy settings (currently Windows only). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@850 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'socks.c')
-rw-r--r--socks.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/socks.c b/socks.c
index 66cf209..cc9d82f 100644
--- a/socks.c
+++ b/socks.c
@@ -60,10 +60,25 @@ struct socks_proxy_info *
new_socks_proxy (const char *server,
int port,
bool retry,
+ struct auto_proxy_info *auto_proxy_info,
struct gc_arena *gc)
{
struct socks_proxy_info *p;
+
+ if (auto_proxy_info)
+ {
+ if (!server)
+ {
+ if (!auto_proxy_info->socks.server)
+ return NULL;
+
+ server = auto_proxy_info->socks.server;
+ port = auto_proxy_info->socks.port;
+ }
+ }
+
ALLOC_OBJ_CLEAR_GC (p, struct socks_proxy_info, gc);
+
ASSERT (server);
ASSERT (legal_ipv4_port (port));