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: cmd/simple-tee-proxy.go
+29-7Lines changed: 29 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,30 @@ package main
2
2
3
3
import (
4
4
"flag"
5
+
"fmt"
5
6
"log"
6
7
"net"
7
8
)
8
9
10
+
typemultipleHosts []string
11
+
12
+
func (i*multipleHosts) String() string {
13
+
returnfmt.Sprintf("%s", *i)
14
+
}
15
+
16
+
func (i*multipleHosts) Set(valuestring) error {
17
+
*i=append(*i, value)
18
+
returnnil
19
+
}
20
+
9
21
funcmain() {
10
22
varhostingSidestring
11
23
varforwardSidestring
12
-
varshadowSidestring
24
+
varshadowSidemultipleHosts
13
25
14
26
flag.StringVar(&hostingSide, "hosting", "0.0.0.0:7700", "What the external address is of the proxy")
15
27
flag.StringVar(&forwardSide, "forward", "localhost:8800", "Where to forward all tcp connections to")
16
-
flag.StringVar(&shadowSide, "shadow", "localhost:9900", "Where to send a copy of all connections to, the replies will be ignored, and the proxy will continue working regardless of the shadow side of things")
28
+
flag.Var(&shadowSide, "shadow", "Where to send a copy of all connections to, the replies will be ignored, and the proxy will continue working regardless of the shadow side of things")
0 commit comments