示例#1
0
文件: http.go 项目: smillaedler/lab
func init() {
	flag.Parse()
	if *htstart {
		log.Printf("starting http://%s/\n", *htaddr)
		lab.Register("htmod", htmod.New(*htaddr))
	}
}
示例#2
0
文件: http.go 项目: napsy/lab
func init() {
	lab.LoadConf()
	if !(*useHttp || *useHttps) {
		return
	}
	conf := htmod.Config{
		Https: *useHttps,
		Addr:  *htaddr,
	}
	if conf.Https {
		conf.KeyFile = *keyFile
		conf.CertFile = *certFile
		conf.CAFile = *cacertFile
		log.Printf("starting https://%s/\n", conf.Addr)
	} else {
		log.Printf("starting http://%s/\n", conf.Addr)
	}
	lab.Register("htmod", htmod.New(conf))
}