Where socket.headers from version 3.0.0? )
https://github.com/daltoniam/Starscream#custom-headers
It has been replaced by URLRequest in the init. I felt that was more inline with standard Apple APIs.
For the lazy (which includes me so ... no shame 馃槃 )
Find in your code where you call
socket = WebSocket(url: serverUrl, protocols: proto)
socket.headers = headers
Replace with:
var request = URLRequest(url: serverUrl)
request.timeoutInterval = 5
for (key,value) in headers {
request.setValue(value, forHTTPHeaderField: key)
}
socket = WebSocket(request: request, protocols: proto)
Most helpful comment
For the lazy (which includes me so ... no shame 馃槃 )
Find in your code where you call
socket = WebSocket(url: serverUrl, protocols: proto) socket.headers = headersReplace with:
var request = URLRequest(url: serverUrl) request.timeoutInterval = 5 for (key,value) in headers { request.setValue(value, forHTTPHeaderField: key) } socket = WebSocket(request: request, protocols: proto)