     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"

    logger.log("connected");

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

  
  private var logger:IWebSocketLogger;
  private var base64Encoder:Base64Encoder = new Base64Encoder();

  private var useFlashSecureSocket:Boolean = false;
  
  public function WebSocket(
      id:int, url:String, protocols:Array, origin:String,
      proxyHost:String, proxyPort:int,
      cookie:String, headers:String,
      logger:IWebSocketLogger,
      useFlashSecureSocket:Boolean = false) {
    this.logger = logger;
    this.id = id;
    this.url = url;
