31 lines
457 B
Go
31 lines
457 B
Go
|
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()
|
||
|
}
|