mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 07:26:39 -04:00
hotfix(openvpn): fix support for tcp-client
- always use `proto tcp-client` when using TCP - parses `tcp-client` (on top of `tcp`, `tcp4`, `tcp6`) as meaning TCP - Fix #3302
This commit is contained in:
@@ -65,7 +65,11 @@ func OpenVPNConfig(provider OpenVPNProviderSettings,
|
||||
lines.add("handshake-window", "10") // default is 60 seconds which is too long
|
||||
lines.add("dev", settings.Interface)
|
||||
lines.add("verb", fmt.Sprint(*settings.Verbosity))
|
||||
lines.add("proto", connection.Protocol)
|
||||
protocol := connection.Protocol
|
||||
if protocol == constants.TCP {
|
||||
protocol = "tcp-client"
|
||||
}
|
||||
lines.add("proto", protocol)
|
||||
lines.add("remote", connection.IP.String(), fmt.Sprint(connection.Port))
|
||||
|
||||
if *settings.User != "" {
|
||||
|
||||
@@ -25,7 +25,7 @@ func ExtractProto(b []byte) (tcp, udp bool, err error) {
|
||||
s = strings.TrimSpace(s)
|
||||
s = strings.ToLower(s)
|
||||
switch s {
|
||||
case "tcp", "tcp4", "tcp6":
|
||||
case "tcp", "tcp4", "tcp6", "tcp-client":
|
||||
return true, false, nil
|
||||
case "udp", "udp4", "udp6":
|
||||
return false, true, nil
|
||||
|
||||
Reference in New Issue
Block a user