Browse Source

tcpproxy: display endpoints, not pointers, in ready to proxy string

The switch to *net.SRV for endpoints caused the ready string to emit
pointers instead of endpoint strings.

Fixes #7942
Anthony Romano 8 years ago
parent
commit
5bd9b9614f
1 changed files with 6 additions and 1 deletions
  1. 6 1
      proxy/tcpproxy/userspace.go

+ 6 - 1
proxy/tcpproxy/userspace.go

@@ -82,7 +82,12 @@ func (tp *TCPProxy) Run() error {
 		tp.remotes = append(tp.remotes, &remote{srv: srv, addr: addr})
 		tp.remotes = append(tp.remotes, &remote{srv: srv, addr: addr})
 	}
 	}
 
 
-	plog.Printf("ready to proxy client requests to %+v", tp.Endpoints)
+	eps := []string{}
+	for _, ep := range tp.Endpoints {
+		eps = append(eps, fmt.Sprintf("%s:%d", ep.Target, ep.Port))
+	}
+	plog.Printf("ready to proxy client requests to %+v", eps)
+
 	go tp.runMonitor()
 	go tp.runMonitor()
 	for {
 	for {
 		in, err := tp.Listener.Accept()
 		in, err := tp.Listener.Accept()