1 files changed, 14 insertions(+), 4 deletions(-)

M cmd/kgp_client/main.go
M cmd/kgp_client/main.go +14 -4
@@ 4,6 4,7 @@ import (
 	"flag"
 	"fmt"
 	"io"
+	"io/ioutil"
 	"log"
 	"net"
 	"os"

          
@@ 41,9 42,9 @@ func ParseAddress(s string) (a Address, 
 const usage = `usage: kgp_client upstream downstream
 
   Example: upstream KGP server is tunnel.example.com:443 and the downstream
-  is the unix socket haproxy.sock:
+  is the unix socket /tmp/haproxy.sock:
 
-  kgp_client tcp://tunnel.example.com:443 unix://path/to/socket`
+  kgp_client tcp://tunnel.example.com:443 unix:///tmp/haproxy.sock`
 
 func main() {
 	var metafn = flag.String("meta", "", "metadata filename, stdin by default")

          
@@ 70,10 71,19 @@ func main() {
 	if *metafn == "" {
 		meta = os.Stdin
 	} else {
-		meta, err := os.Open(*metafn)
+		var err error
+		meta, err = os.Open(*metafn)
 		if err != nil {
 			log.Fatalln(err)
 		}
 	}
-	fmt.Println(upstream, downstream)
+	var m, _ = ioutil.ReadAll(meta)
+	fmt.Println(upstream, downstream, m)
+
+	upconn, err := net.Dial(upstream.Network, upstream.Address)
+	if err != nil {
+		log.Fatalln("error connecting to ", upstream, ": ", err.Error())
+	}
+	msg, err := ioutil.ReadAll(upconn)
+	fmt.Println(msg)
 }