Skip to content

Commit

Permalink
added diverter option to ziti tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszSki committed Sep 7, 2024
1 parent a11e8b4 commit 1271544
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ziti/tunnel/tproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package tunnel

import (
"fmt"

"github.com/openziti/ziti/tunnel/intercept/tproxy"
"github.com/spf13/cobra"
)
Expand All @@ -38,6 +39,7 @@ func NewTProxyCmd() *cobra.Command {
PostRun: rootPostRun,
}
runTProxyCmd.PersistentFlags().String("lanIf", "", "if specified, INPUT rules for intercepted service addresses are assigned to this interface ")
runTProxyCmd.PersistentFlags().String("diverter", "", "if specified, use external tproxy configuration utility instead of internal iptables implementation")
return runTProxyCmd
}

Expand All @@ -47,8 +49,12 @@ func runTProxy(cmd *cobra.Command, _ []string) error {
if err != nil {
return err
}
diverter, err := cmd.Flags().GetString("diverter")
if err != nil {
return err
}

interceptor, err = tproxy.New(tproxy.Config{LanIf: lanIf})
interceptor, err = tproxy.New(tproxy.Config{LanIf: lanIf, Diverter: diverter})
if err != nil {
return fmt.Errorf("failed to initialize tproxy interceptor: %v", err)
}
Expand Down

0 comments on commit 1271544

Please sign in to comment.