route/cmd/httpagent/main.go

31 lines
457 B
Go
Raw Normal View History

2017-01-18 09:57:18 +00:00
package main
import (
"flag"
"log"
"github.com/koding/tunnel"
)
var (
token = flag.String("token", "", "Service identifier token")
backend = flag.String("backend", "127.0.0.1:9090", "backend TCP/HTTP server")
)
func main() {
flag.Parse()
cfg := &tunnel.ClientConfig{
Identifier: *token,
LocalAddr: *backend,
ServerAddr: "127.0.0.1:9234",
}
client, err := tunnel.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
client.Start()
}