title: How to connect Socket in Swift 4
body: <p>I want to connect my app to the socket here is the code :-</p>
  
  <pre><code>  import UIKit
    import SocketIO
  
   class SocketIOManager: NSObject {
  static let manager = SocketManager(socketURL: URL(string: "myURL")!)
  static let socket = manager.defaultSocket
  
  
  class func connectSocket() {
      let token = UserDefaults.standard.getAccessToken()
  
      self.manager.config = SocketIOClientConfiguration(
          arrayLiteral: .connectParams(["token": token]), .secure(true) // problem is here in passing token value
          )
          socket.connect()
  }
  
  class func receiveMsg() {
      socket.on("new message here") { (dataArray, ack) in
  
          print(dataArray.count)
  
      }
  }
  }
  </code></pre>
  
  <p>I created a new class SocketIOManager.swift and I invoke my function in view controller </p>
  
  <pre><code>  SocketIOManager.connectSocket()
  </code></pre>
  
  <p>and I am not using the localhost url but still my app is not connected to the socket I think I followed this  <a href="https://stackoverflow.com/questions/49491357/how-to-connect-with-socket-io-swift-4">How to connect with Socket.io? Swift 4</a><a href="https://i.stack.imgur.com/hJkoX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hJkoX.png" alt="enter image description here"></a> and I also add App Transport Security in info.plist. Any help? The problem is when I am passing the token value it gives me error otherwise it is working properly. Should I need to pass token when using socket?</p>