title: How to connect with Socket.io? Swift 4
body: <p>I have read the <a href="https://github.com/socketio/socket.io-client-swift" rel="nofollow noreferrer">latest documentation</a> of <strong>Socket.io</strong> for Swift. And there is an example of a new connection:</p>
  
  <pre><code>let manager = SocketManager(socketURL: URL(string: "http://localhost:8080")!, config: [.log(true), .compress])
  let socket = manager.defaultSocket
  </code></pre>
  
  <p>So I have created a class <strong>SocketIOManager</strong>, like this:</p>
  
  <pre><code>class SocketIOManager: NSObject {
  
      static let manager = SocketManager(socketURL: URL(string: "myurl.com:443"))
      static let socket = manager.defaultSocket
  
      class func connectSocket(){
          socket.connect()
      }
  
      class func reciveMessage(){    
              socket.on("new-message-mob") { (dataArray, ack) in
                  print(dataArray.count)
              }
      }
  }
  </code></pre>
  
  <p>And then I just invoke the method <strong>SocketIOManager.connectSocket()</strong> in my ViewController. But the server produce the error. I don't develop the server side. I just need to know - did I create connection properly? How do you connect to socket through Socket.io these days?</p>
  
  <p>P.S Server error - jwt must be provided (it seems like no token, but there is). </p>
  
  <p><strong>UPDATE (with dummy values):</strong></p>
  
  <p>I'm passing token like this:</p>
  
  <pre><code>static let manager = SocketManager(socketURL: URL(string: "https://myurl:443?token=\(token)")!)
  static let socket = manager.defaultSocket
  </code></pre>