示例#1
0
文件: conn.go 项目: wjybluse/fproxy
//NewSSLClient ...
func NewSSLClient(host string) *SSLClient {
	conn, err := tls.Dial("tcp", host, p.NewSSLConfig())
	if err != nil {
		logger.Errorf("Error:--->cannnot create client %s\n", err)
		return nil
	}
	return &SSLClient{*conn}
}
示例#2
0
文件: server.go 项目: wjybluse/fproxy
func newServer(vpsConfig *c.RemoteConfig) *pserver {
	host := vpsConfig.Host + ":" + strconv.Itoa(vpsConfig.Port)
	ts, err := tls.Listen("tcp", host, c.NewSSLConfig())
	if err != nil {
		logger.Errorf("create server failed %s", err)
		return nil
	}
	return &pserver{ts}
}