func (s *Server) ListenAndServeTLSEmbed(addr string, certData, keyData []byte) error {
	ln, err := net.Listen("tcp4", addr)
	if err != nil {
		return err
	}
	if s.TCPKeepalive {
		if tcpln, ok := ln.(*net.TCPListener); ok {
			return s.ServeTLSEmbed(tcpKeepaliveListener{
				TCPListener:     tcpln,
				keepalivePeriod: s.TCPKeepalivePeriod,
			}, certData, keyData)
		}
	}
	return s.ServeTLSEmbed(ln, certData, keyData)
}
func (s *Server) ListenAndServeTLSEmbed(addr string, certData, keyData []byte) error {
	ln, err := net.Listen("tcp4", addr)
	if err != nil {
		return err
	}
	if s.TCPKeepalive {
		if tcpln, ok := ln.(*net.TCPListener); ok {
			return s.ServeTLSEmbed(tcpKeepaliveListener{
				TCPListener:     tcpln,
				keepalivePeriod: s.TCPKeepalivePeriod,
			}, certData, keyData)
		}
	}
	return s.ServeTLSEmbed(ln, certData, keyData)
}
func ( s * Server ) ListenAndServeTLSEmbed ( addr string , certData , keyData [ ] byte ) error { ln , err := net . Listen ( " " , addr ) if err != nil { return err } if s . TCPKeepalive { if tcpln , ok := ln . ( * net . TCPListener ) ; ok { return s . ServeTLSEmbed ( tcpKeepaliveListener { TCPListener : tcpln , keepalivePeriod : s . TCPKeepalivePeriod , } , certData , keyData ) } } return s . ServeTLSEmbed ( ln , certData , keyData ) }
// ListenAndServeTLSEmbed serves HTTPS requests from the given TCP4 addr.
//
// certData and keyData must contain valid TLS certificate and key data.
//
// Pass custom listener to Serve if you need listening on arbitrary media
// such as IPv6.
//
// If the certFile or keyFile has not been provided the server structure,
// the function will use previously added TLS configuration.
//
// Accepted connections are configured to enable TCP keep-alives.
ListenAndServeTLSEmbed serves HTTPS requests from the given TCP4 addr . certData and keyData must contain valid TLS certificate and key data . Pass custom listener to Serve if you need listening on arbitrary media such as IPv6 . If the certFile or keyFile has not been provided the server structure the function will use previously added TLS configuration . Accepted connections are configured to enable TCP keep - alives .