Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dviejokfs committed Apr 5, 2022
1 parent f63520b commit ef6a0fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 4 additions & 5 deletions cmd/listen/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@ func (c listenCmd) validate() error {
}

func (c listenCmd) run() error {
hostname := strings.ToLower(shortuuid.New()[:10])
var sni string
tunnelAddress := c.tunnelAddress
tunnelConfig, err := config.NewTunnelConfig()
if err != nil {
return err
}
//tunnelRequestsHost, tunnelRequestsPort, err := net.SplitHostPort(c.tunnelSubdomain)
//if err != nil {
// return err
//}
tunnelKey := fmt.Sprintf("%s_%s", c.forwardTo, c.tunnelAddress)
log.Debugf("tunnelKey: %s", tunnelKey)
cfgItem, err := tunnelConfig.Get(tunnelKey)
if err != nil {
hostname := strings.ToLower(shortuuid.New()[:10])
sni = fmt.Sprintf("%s.%s", hostname, c.tunnelSubdomain)
_, err = tunnelConfig.Add(tunnelKey, config.TunnelConfigItem{
ForwardTo: c.forwardTo,
Expand All @@ -70,6 +66,9 @@ func (c listenCmd) run() error {
log.Errorf("Error starting the tunnel: %s", err)
log.Infof("Retrying in 5 seconds...")
time.Sleep(5 * time.Second)
} else {
log.Infof("Tunnel closed")
break
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/hyperledger/fabric-gateway v1.0.1
github.com/hyperledger/fabric-protos-go v0.0.0-20220315113721-7dc293e117f7
github.com/hyperledger/fabric-sdk-go v1.0.1-0.20220124135247-4f34271d9b0f
github.com/kfsoftware/getout v0.0.5-beta7
github.com/kfsoftware/getout v0.0.5-beta13
github.com/lib/pq v1.10.2
github.com/lithammer/shortuuid/v3 v3.0.7
github.com/mitchellh/mapstructure v1.4.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ github.com/getsentry/raven-go v0.0.0-20180121060056-563b81fc02b7/go.mod h1:KungG
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand All @@ -171,6 +172,7 @@ github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvSc
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
Expand Down Expand Up @@ -339,6 +341,8 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA=
github.com/kfsoftware/getout v0.0.5-beta13 h1:zWnQvGAUMhYmmfjKHleQLbTxa8wL07cGpZCbQ57/2zE=
github.com/kfsoftware/getout v0.0.5-beta13/go.mod h1:/qoSgBQ5RC//wbmf3VsmAScPSHWMVo8SKFV/Mtvd5Qg=
github.com/kfsoftware/getout v0.0.5-beta7 h1:CIExhemI7MaqbbUscmtmjFOOMLo9f+GaLVmis82FX18=
github.com/kfsoftware/getout v0.0.5-beta7/go.mod h1:RErQGJm6Vp3n5zY3rH6Dw0hpmK+rZhicglID9khDtpE=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand Down

0 comments on commit ef6a0fe

Please sign in to comment.