refactor TLS

This commit is contained in:
smallnest
2017-10-22 17:11:34 +08:00
parent 6801261c2d
commit f0db5e94b5
5 changed files with 40 additions and 24 deletions

View File

@@ -62,7 +62,9 @@ type Server struct {
inShutdown int32
onShutdown []func()
// BlockCrypt for kcp.BlockCrypt, QUICConfig for quic TlsConfig, etc.
// TLSConfig for creating tls tcp connection.
TLSConfig *tls.Config
// BlockCrypt for kcp.BlockCrypt
Options map[string]interface{}
// // use for KCP
// KCPConfig KCPConfig
@@ -82,16 +84,6 @@ func NewServer(options map[string]interface{}) *Server {
}
}
// // KCPConfig is config of KCP.
// type KCPConfig struct {
// BlockCrypt kcp.BlockCrypt
// }
// // QUICConfig is config of QUIC.
// type QUICConfig struct {
// TlsConfig *tls.Config
// }
// Address returns listened address.
func (s *Server) Address() net.Addr {
if s.ln == nil {