         for i in 0 ..< 4 {
             keyb[i] = arc4random()
         }
-        let rkey = Data(bytes: UnsafePointer(keyb), count: 16).base64EncodedString(options: NSData.Base64EncodingOptions(rawValue: 0))
+        let rkey = Data(bytes: keyb, count: 16).base64EncodedString(options: NSData.Base64EncodingOptions(rawValue: 0))
         reqs += "Sec-WebSocket-Key: \(rkey)\r\n"
         reqs += "\r\n"
         var header = [UInt8]()

    var windowBits = 0
    var strm = z_stream()
    var tInput = [[UInt8]]()
    var inflateEnd : [UInt8] = [0x00, 0x00, 0xFF, 0xFF]
    var bufferSize = windowBufferSize
    var buffer = malloc(windowBufferSize)
    init?(windowBits : Int){

        if ret != 0 {
            return nil
        }

        var inflateEndBytes : [UInt8] = [0x00, 0x00, 0xFF, 0xFF]
        inflateEndSize = inflateEndBytes.count
        inflateEnd = UnsafeMutablePointer<UInt8>.allocate(capacity: inflateEndSize)
        inflateEnd.initialize(from: &inflateEndBytes, count: inflateEndSize)
    }
    deinit{
        _ = inflateEndG(&strm)
        free(buffer)
        inflateEnd.deallocate()
    }
    func inflate(_ bufin : UnsafePointer<UInt8>, length : Int, final : Bool) throws -> (p : UnsafeMutablePointer<UInt8>, n : Int){
        var buf = buffer
