title: Websocket connection issue in iOS?
body: <p>I am using web socket connection in my app. When I am trying to establish the web socket connection and it's not connected. I am using the Starscream for making the web socket connection. I've tried with many test WS Url for testing and none of the url is working. Currently I am testing in simulator. Are there any proxy issues or firewall issue?. </p>
  
  <pre><code>class ViewController: UIViewController, WebSocketDelegate {
  var socket: WebSocket!
  
  override func viewDidLoad() {
      super.viewDidLoad()
      let urlString = "wss://echo.websocket.org" // testing url 
  
      var request = URLRequest(url: URL(string: urlString)!)
      request.timeoutInterval = 30
      socket = WebSocket(request: request)
      socket.delegate = self
      socket.pongDelegate = self as? WebSocketPongDelegate
       socket.connect()
  }
  
  // MARK: Websocket Delegate Methods.
  // Never call this method
  func websocketDidConnect(socket: WebSocketClient) {
      print("websocket is connected")
  }
  
  func websocketDidDisconnect(socket: WebSocketClient, error: Error?) {
      if let e = error as? WSError {
          print("websocket is disconnected: \(e.message)")
      } else if let e = error {
          print("websocket is disconnected: \(e.localizedDescription)")
      } else {
           print("websocket disconnected")
      }
  }
  
  func websocketDidReceiveMessage(socket: WebSocketClient, text: String) {
      print("Received text: \(text)")
  }
  
  func websocketDidReceiveData(socket: WebSocketClient, data: Data) {
      print("Received data: \(data.count)")
  }
  
  }
  </code></pre>