Skip to content

Commit 287db0c

Browse files
committed
Bumped v0.3.3
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 4a55293 commit 287db0c

File tree

8 files changed

+15
-22
lines changed

8 files changed

+15
-22
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.3.2
2+
VERSION = 0.3.3
33

44
publish:
55
git tag v$(VERSION)

cmd/ps.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package cmd
22

33
import (
4+
"os"
5+
"time"
6+
47
"github.com/hako/durafmt"
58
"github.com/jedib0t/go-pretty/table"
69
"github.com/labstack/gommon/log"
710
"github.com/labstack/tunnel-client/daemon"
811
"github.com/spf13/cobra"
9-
"os"
10-
"time"
1112
)
1213

1314
var psCmd = &cobra.Command{
@@ -23,6 +24,7 @@ func psRPC() {
2324
if err != nil {
2425
log.Fatal(err)
2526
}
27+
defer c.Close()
2628
req := new(daemon.PSRequest)
2729
rep := new(daemon.PSReply)
2830
err = c.Call("Daemon.PS", req, rep)

cmd/rm.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"errors"
5+
56
"github.com/labstack/gommon/log"
67
"github.com/labstack/tunnel-client/daemon"
78
"github.com/spf13/cobra"
@@ -21,6 +22,7 @@ var rmCmd = &cobra.Command{
2122
if err != nil {
2223
log.Fatal(err)
2324
}
25+
defer c.Close()
2426
rep := new(daemon.RMReply)
2527
err = c.Call("Daemon.RM", daemon.RMRequest{
2628
Name: args[0],

cmd/start.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"errors"
5+
56
"github.com/labstack/gommon/log"
67
"github.com/labstack/tunnel-client/daemon"
78

@@ -24,6 +25,7 @@ var startCmd = &cobra.Command{
2425
if err != nil {
2526
log.Fatal(err)
2627
}
28+
defer c.Close()
2729
rep := new(daemon.StartReply)
2830
s.Start()
2931
err = c.Call("Daemon.Start", &daemon.StartRequest{
@@ -42,5 +44,5 @@ var startCmd = &cobra.Command{
4244
func init() {
4345
rootCmd.AddCommand(startCmd)
4446
startCmd.PersistentFlags().StringVarP(&name, "configuration", "c", "", "configuration name from the console")
45-
startCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", daemon.ProtocolHTTP, "tunnel protocol (http, tcp, tls)")
47+
startCmd.PersistentFlags().StringVarP(&protocol, "protocol", "p", daemon.ProtocolHTTPS, "tunnel protocol (https, tcp, tls)")
4648
}

cmd/stop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"errors"
5+
56
"github.com/labstack/gommon/log"
67
"github.com/labstack/tunnel-client/daemon"
78
"github.com/spf13/cobra"
@@ -21,6 +22,7 @@ var stopCmd = &cobra.Command{
2122
if err != nil {
2223
log.Fatal(err)
2324
}
25+
defer c.Close()
2426
rep := new(daemon.StopReply)
2527
err = c.Call("Daemon.Stop", daemon.StopRequest{
2628
Name: args[0],

cmd/version.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*
2-
Copyright © 2019 NAME HERE <EMAIL ADDRESS>
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
161
package cmd
172

183
import (
@@ -22,7 +7,7 @@ import (
227
)
238

249
const (
25-
version = "v0.3.2"
10+
version = "v0.3.3"
2611
)
2712

2813
var versionCmd = &cobra.Command{

daemon/daemon.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type (
4848
)
4949

5050
const (
51-
ProtocolHTTP = "http"
51+
ProtocolHTTPS = "https"
5252
ProtocolTCP = "tcp"
5353
ProtocolTLS = "tls"
5454

daemon/tunnel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func newTunnel(req *StartRequest) (t *Tunnel, err error) {
116116
if err != nil {
117117
return nil, fmt.Errorf("failed to parse target address: %v", err)
118118
}
119-
if t.Protocol != ProtocolHTTP {
119+
if t.Protocol != ProtocolHTTPS {
120120
t.RemotePort = 0
121121
}
122122
tunnels[t.Name] = t

0 commit comments

Comments
 (0)