Example #1
0
func main() {
	conf = utils.ParseSeverConf()

	//TODO check conf

	for _, serverInfo := range conf.Server {
		if serverInfo.Timeout <= 0 {
			serverInfo.Timeout = 30
		}
		listen(serverInfo)
	}
}
Example #2
0
func main() {

	conf := utils.ParseSeverConf()
	for _, s := range conf.Server {
		se := &server{
			address: fmt.Sprintf("%s:%d", s.Address, s.Port),
			cg:      mika.NewCryptoGenerator(s.Method, s.Password),
		}
		servers = append(servers, se)
	}

	if len(servers) <= 0 {
		utils.Fatalf("Please configure server")
	}

	for _, localConf := range conf.Local {
		tcpServe(localConf)
	}
}