Files
natpass/code/client/main.go
T
2021-08-12 15:15:22 +08:00

34 lines
520 B
Go

package main
import (
"crypto/tls"
"flag"
"fmt"
"natpass/code/client/client"
"natpass/code/client/global"
"natpass/code/network"
"os"
"github.com/lwch/runtime"
)
func main() {
conf := flag.String("conf", "", "configure file path")
flag.Parse()
if len(*conf) == 0 {
fmt.Println("missing -conf param")
os.Exit(1)
}
cfg := global.LoadConf(*conf)
conn, err := tls.Dial("tcp", cfg.Server, nil)
runtime.Assert(err)
c := network.NewConn(conn)
defer c.Close()
cli := client.New(cfg, c)
cli.Run()
}