2017-01-18 09:57:18 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"log"
|
|
|
|
|
2017-01-22 17:37:35 +00:00
|
|
|
"git.xeserv.us/xena/route/lib/tunnel"
|
2017-01-18 09:57:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2017-01-22 17:48:37 +00:00
|
|
|
token = flag.String("token", "", "Service identifier token")
|
|
|
|
backend = flag.String("backend", "127.0.0.1:9090", "backend TCP/HTTP server")
|
|
|
|
serverAddr = flag.String("server", "127.0.0.1:9234", "frontend HTTP server")
|
2017-01-18 09:57:18 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
cfg := &tunnel.ClientConfig{
|
|
|
|
Identifier: *token,
|
|
|
|
LocalAddr: *backend,
|
2017-01-22 17:48:37 +00:00
|
|
|
ServerAddr: *serverAddr,
|
2017-01-18 09:57:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
client, err := tunnel.NewClient(cfg)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
client.Start()
|
|
|
|
}
|