 /*
-* SwiftWebSocket (websocket.swift)
-*
-* Copyright (C) Josh Baker. All Rights Reserved.
-* Contact: @tidwall, joshbaker77@gmail.com
-*
-* This software may be modified and distributed under the terms
-* of the MIT license.  See the LICENSE file for details.
-*
-*/
+ * SwiftWebSocket (websocket.swift)
+ *
+ * Copyright (C) Josh Baker. All Rights Reserved.
+ * Contact: @tidwall, joshbaker77@gmail.com
+ *
+ * This software may be modified and distributed under the terms
+ * of the MIT license.  See the LICENSE file for details.
+ *
+ */
 
 import Foundation
-import zlib
 
 private let windowBufferSize = 0x2000
 

        free(buffer)
    }
    /*func deflate(_ bufin : UnsafePointer<UInt8>, length : Int, final : Bool) -> (p : UnsafeMutablePointer<UInt8>, n : Int, err : NSError?){
        return (nil, 0, nil)
    }*/
}

/// WebSocketDelegate is an Objective-C alternative to WebSocketEvents and is used to delegate the events for the WebSocket connection.

            }
            req.setValue(val, forHTTPHeaderField: "Sec-WebSocket-Extensions")
        }

        let security: TCPConnSecurity
        let port : Int
        if req.url!.scheme == "wss" {
            port = req.url!.port ?? 443
            security = .negoticatedSSL
        } else {
            port = req.url!.port ?? 80
            security = .none
        }

        var path = CFURLCopyPath(req.url! as CFURL) as String
        if path == "" {
            path = "/"
        }
