   private var tlsSocket:TLSSocket;
   private var tlsConfig:TLSConfig;
   private var socket:Socket;
+  private var secureSocket:SecureSocket;
   
   private var acceptedProtocol:String;
   private var expectedDigest:String;

    logger.log("connected");

    if (scheme == "wss") {
      logger.log("starting SSL/TLS");
      tlsSocket.startTLS(rawSocket, host, tlsConfig);
    }
    
    var defaultPort:int = scheme == "wss" ? 443 : 80;

    this.origin = origin;
    this.requestedProtocols = protocols;
    this.cookie = cookie;
    this.useFlashSecureSocket = useFlashSecureSocket;
    // if present and not the empty string, headers MUST end with \r\n
    // headers should be zero or more complete lines, for example
    // "Header1: xxx\r\nHeader2: yyyy\r\n"
