2018-10-06 19:27:35 +00:00
|
|
|
package main
|
2018-05-01 23:45:06 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"gopkg.in/urfave/cli.v2"
|
|
|
|
|
|
|
|
"github.com/cloudflare/cloudflared/hello"
|
|
|
|
)
|
|
|
|
|
2018-10-06 19:27:35 +00:00
|
|
|
|
2018-05-01 23:45:06 +00:00
|
|
|
func helloWorld(c *cli.Context) error {
|
|
|
|
address := fmt.Sprintf(":%d", c.Int("port"))
|
|
|
|
listener, err := hello.CreateTLSListener(address)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
defer listener.Close()
|
|
|
|
err = hello.StartHelloWorldServer(logger, listener, nil)
|
|
|
|
return err
|
|
|
|
}
|