Skip to content

Commit 5cca647

Browse files
committed
Bumped v0.5.2
Signed-off-by: Vishal Rana <[email protected]>
1 parent 0e2dd46 commit 5cca647

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
IMAGE = labstack/tunnel
2-
VERSION = 0.5.1
2+
VERSION = 0.5.2
33

44
publish:
55
git tag v$(VERSION)

cmd/root.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ import (
44
"errors"
55
"fmt"
66
"github.com/labstack/tunnel-client/daemon"
7+
"net"
78
"os"
89
"path/filepath"
10+
"strings"
911

1012
"github.com/spf13/cobra"
1113

@@ -34,9 +36,14 @@ var rootCmd = &cobra.Command{
3436
defer c.Close()
3537
rep := new(daemon.ConnectReply)
3638
s.Start()
39+
addr := args[0]
40+
_, _, err = net.SplitHostPort(addr)
41+
if err != nil && strings.Contains(err.Error(), "missing port") {
42+
addr = ":" + addr
43+
}
3744
err = c.Call("Server.Connect", &daemon.ConnectRequest{
3845
Name: name,
39-
Address: args[0],
46+
Address: addr,
4047
Protocol: daemon.Protocol(protocol),
4148
}, rep)
4249
if err != nil {

daemon/connection.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ RECONNECT:
214214
// Remote listener
215215
l, err := sc.Listen("tcp", fmt.Sprintf("%s:%d", c.RemoteHost, c.RemotePort))
216216
if err != nil {
217-
log.Fatalf("failed to listen on remote host: %v", err)
217+
log.Errorf("failed to listen on remote host: %v", err)
218+
return
218219
}
219220
// Note: Don't close the listener as it prevents closing the underlying connection
220221

0 commit comments

Comments
 (0)