livekit / client-sdk-swift

LiveKit Swift Client SDK. Easily build live audio or video experiences into your mobile app, game or website.
https://livekit.io
Apache License 2.0
174 stars 84 forks source link

WebSocket class delegate extension #354

Open afgarcia86 opened 4 months ago

afgarcia86 commented 4 months ago

Is your feature request related to a problem? Please describe.

We would like to enable mutual TLS for our LiveKit connections.

Describe the solution you'd like A clear and concise description of what you want to happen.

We have been successfully able to do this for our API calls by setting the following URLSessionDelegate method:

func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge) async -> (URLSession.AuthChallengeDisposition, URLCredential?) {}

And handling the challenges ie inserting our certificates and verifying the servers certs.

My understanding is that the URLSessionWebSocketDelegate inherits the URLSessionDelegate so I believe if we are able to set that method on the Websocket class we will be able to do this.

Is that something that can be done today or is it a significant lift? I am newer to swift but I would be happy to work on a PR with some guidance.