Skip to content

Commit

Permalink
feat(custom): support tcp-client proto for OpenVPN
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Nov 28, 2023
1 parent d537662 commit c326b61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/openvpn/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func extractProto(line string) (protocol string, err error) {
}

switch fields[1] {
case "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6":
case "tcp", "tcp4", "tcp6", "tcp-client", "udp", "udp4", "udp6":
default:
return "", fmt.Errorf("%w: %s", errProtocolNotSupported, fields[1])
}
Expand Down
4 changes: 4 additions & 0 deletions internal/openvpn/extract/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func Test_extractDataFromLine(t *testing.T) {
line: "proto tcp",
protocol: constants.TCP,
},
"tcp-client": {
line: "proto tcp-client",
protocol: "tcp-client",
},
"extract remote error": {
line: "remote bad",
isErr: errHostNotIP,
Expand Down

0 comments on commit c326b61

Please sign in to comment.