title: Websocket : Starscream "masked and rsv data is not currently supported"
body: <p>I am developing an iOS app which required to connect with web socket server.</p>
  <p>I can successfully connect to server but when I send request on it, it drop off the connection.</p>
  <p>I am using <a href="https://github.com/daltoniam/Starscream" rel="nofollow noreferrer">Starscream</a> library for web socket.</p>
  <p>As per server support team:
  <em><strong>it does not support protocol compression, but in the headers below they're requesting &quot;permessage-deflate&quot; from us. We'll accept uncompressed messages just fine (it's just a flag on the packet) but due to the extension they asked for, messages we send out will be compressed with that flag set.</strong></em></p>
  <p>I send request as following using Swift</p>
  <pre><code>let dict = [&quot;Parameter1&quot;:&quot;value1&quot;,&quot;Parameter2&quot;:&quot;value2&quot;]
      
  do {
  
                  let data = try NSJSONSerialization.dataWithJSONObject(dict, options: NSJSONWritingOptions(rawValue: 0))
                  var jsonString: String = String(data: data, encoding: UInt())!
                  self.socket.writeString(jsonString);
              } catch {
                  print(error)
              }
  </code></pre>
  <p>It disconnect with server and print following message.</p>
  <p><em>&quot;websocket is disconnected: Optional(&quot;masked and rsv data is not currently supported&quot;)&quot;</em></p>