title: Swift-NIO secured websocket server
body: <p>I am trying to create websocket server and client in my iOS app, which i successfully managed to do with the help of sample implementation here. (<a href="https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketServer" rel="nofollow noreferrer">https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketServer</a>) - so current working situation is, i run the websocket server when app launches and then I load the client in a webview which can connect to it. </p>
  
  <p>Now my problem is I want my server to secured websocket server (Basically connect to the websocket server from a HTTPS html page)</p>
  
  <p>I am new to network programming and Swift-nio documentation is lacking to say the least. As far as I understand I could use (<a href="https://github.com/apple/swift-nio-transport-services" rel="nofollow noreferrer">https://github.com/apple/swift-nio-transport-services</a>) </p>
  
  <p>I found this thread which is exactly what I need - <a href="https://github.com/apple/swift-nio-transport-services/issues/39" rel="nofollow noreferrer">https://github.com/apple/swift-nio-transport-services/issues/39</a> - I could disable the TLS authentication as I dont care in my usecase as long as I could get the websocket connected. </p>
  
  <p>So my question is how to I extend my client (<a href="https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketClient" rel="nofollow noreferrer">https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketClient</a>) and server (<a href="https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketServer" rel="nofollow noreferrer">https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketServer</a>) to use swift-nio-transport-service.</p>
  
  <p>I could add the <code>NIOSSLContext</code> and stuff but I think I need to add the <code>EventLoopGroup</code> and new <code>bootstrap</code> methods. I know the answers is right there.... but I just cannot seem to pinpoint it. </p>
  
  <p>Any pointer would be appreciated. </p>
  
  <p>Thanks. </p>