You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tcp.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,3 +29,17 @@ This allows you to use UDP most of the time, but fall back to TCP on the rare oc
29
29
30
30
Note that you will need to configure client connections manually. At this time it is not possible to generate a client config that will automatically fall back to the TCP connection.
31
31
32
+
## Forward HTTP/HTTPS connection to another TCP port
33
+
You might run into cases where you want your OpenVPN server listening on TCP port 443 to allow connection behind a restricted network, but you already have a webserver on your host running on that port. OpenVPN has a built-in option named `port-share` that allow you to proxy incoming traffic that isn't OpenVPN protocol to another host and port.
34
+
35
+
First, change the listening port of your existing webserver (for instance from 443 to 4433).
36
+
37
+
Then initialize the data container by specifying the TCP protocol, port 443 and the port-share option:
38
+
39
+
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig \
40
+
-u tcp://VPN.SERVERNAME.COM:443 \
41
+
-e 'port-share VPN.SERVERNAME.COM 4433'
42
+
43
+
Then proceed to initialize the pki, create your users and start the container as usual.
44
+
45
+
This will proxy all non OpenVPN traffic incoming on TCP port 443 to TCP port 4433 on the same host. This is currently only designed to work with HTTP or HTTPS protocol.
0 commit comments