         
         if type != PacketType.MESSAGE.rawValue {
             // TODO Handle other packets
-            println(message)
+            if message.hasPrefix("b4") {
+                // binary in base64 string
+                message.removeRange(Range<String.Index>(start: message.startIndex,
+                    end: advance(message.startIndex, 2)))
+            }
+            
+            if let data = NSData(base64EncodedString: message,
+                options: NSDataBase64DecodingOptions.IgnoreUnknownCharacters) {
+                    self.client.parseSocketMessage(data)
+            }
             return
         }
         

        func testLength(length:String, inout n:Int) -> Bool {
            if let num = length.toInt() {
                n = num
                if num != n {
                    return true
                }
            }
            
            return false

                return
            }
            
            // println(data)
            
            if let str = NSString(data: data, encoding: NSUTF8StringEncoding) {
                // println(str)
                
                self?.parsePollingMessage(str)
            }
            
            self?.wait = false
            self?.doPoll()
        }
    }
    
