aboutsummaryrefslogtreecommitdiff
path: root/src/openvpn/tun.c
diff options
context:
space:
mode:
authorArne Schwabe2021-04-16 13:09:55 +0200
committerGert Doering2021-04-18 16:19:58 +0200
commit8d109f68fd277b3e00ba7bef61a172b4130c35b8 (patch)
tree1f294b033b2d7f575782848f35ab5ffbc4e14848 /src/openvpn/tun.c
parentc7f95891a4a0aabb64e7d4f3200525c1a2fcf433 (diff)
downloadopenvpn-8d109f68fd277b3e00ba7bef61a172b4130c35b8.zip
openvpn-8d109f68fd277b3e00ba7bef61a172b4130c35b8.tar.gz
Add parsing of dhcp-option PROXY_HTTP
This adds support for setting a HTTP proxy that should be used after connecting to a VPN. The syntax has been picked to have compatibility with OpenVPN3. Otherwise I would have used HTTP-PROXY instead. Since this option requires an additional argument compared to the existing dhcp-option keywords, move checking the number of arguments to the individual keywords. Signed-off-by: Arne Schwabe <arne@rfc2549.org> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20210416110955.1162574-1-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22129.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'src/openvpn/tun.c')
-rw-r--r--src/openvpn/tun.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 2385377..2c1b270 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -1870,6 +1870,13 @@ open_tun(const char *dev, const char *dev_type, const char *dev_node, struct tun
management_android_control(management, "DNSDOMAIN", tt->options.domain);
}
+ if (tt->options.http_proxy)
+ {
+ struct buffer buf = alloc_buf_gc(strlen(tt->options.http_proxy) + 20, &gc);
+ buf_printf(&buf, "%s %d", tt->options.http_proxy, tt->options.http_proxy_port);
+ management_android_control(management, "HTTPPROXY", BSTR(&buf));
+ }
+
int android_method = managment_android_persisttun_action(management);
/* Android 4.4 workaround */