trace.go 396 B

12345678910111213141516171819
  1. // +build go1.8
  2. package websocket
  3. import (
  4. "crypto/tls"
  5. "net/http/httptrace"
  6. )
  7. func doHandshakeWithTrace(trace *httptrace.ClientTrace, tlsConn *tls.Conn, cfg *tls.Config) error {
  8. if trace.TLSHandshakeStart != nil {
  9. trace.TLSHandshakeStart()
  10. }
  11. err := doHandshake(tlsConn, cfg)
  12. if trace.TLSHandshakeDone != nil {
  13. trace.TLSHandshakeDone(tlsConn.ConnectionState(), err)
  14. }
  15. return err
  16. }