route/cmd/httpagent/main.go

32 lines
547 B
Go
Raw Normal View History

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 (
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,
ServerAddr: *serverAddr,
2017-01-18 09:57:18 +00:00
}
client, err := tunnel.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
client.Start()
}