MCPcopy Create free account
hub / github.com/koding/kite / main

Function main

tunnelproxy/tunnelproxy/main.go:12–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10)
11
12func main() {
13 var (
14 publicKeyFile = flag.String("public-key", "", "")
15 privateKeyFile = flag.String("private-key", "", "")
16 ip = flag.String("ip", "0.0.0.0", "")
17 port = flag.Int("port", 3999, "")
18 publicHost = flag.String("public-host", "127.0.0.1:3999", "")
19 version = flag.String("version", "0.0.1", "")
20 )
21
22 flag.Parse()
23
24 if *publicKeyFile == "" {
25 log.Fatalln("no -public-key given")
26 }
27
28 if *privateKeyFile == "" {
29 log.Fatalln("no -private-key given")
30 }
31
32 publicKey, err := ioutil.ReadFile(*publicKeyFile)
33 if err != nil {
34 log.Fatalln("cannot read public key file")
35 }
36
37 privateKey, err := ioutil.ReadFile(*privateKeyFile)
38 if err != nil {
39 log.Fatalln("cannot read private key file")
40 }
41
42 conf := config.MustGet()
43 conf.IP = *ip
44 conf.Port = *port
45
46 t := tunnelproxy.New(conf, *version, string(publicKey), string(privateKey))
47 t.PublicHost = *publicHost
48
49 t.Run()
50}

Callers

nothing calls this directly

Calls 2

StringMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected