Starting a web socket server on iOS (with Starscream?)

3.4k views Asked by At

I'm trying to build an iOS app that serves up frames from the camera over a web socket. Starscream seems to be the library of choice for web sockets on iOS. All the Starscream examples I can find (e.g. here or here) start with a line like this one:

socket = WebSocket(url: URL(string: "ws://localhost:8080/")!)

I.e. they assume that we are opening a connection to a server, and after that we can send and receive data over the web socket. What I need is the other way around, I will be serving the data over a web socket and a client will connect to me so that I can send the data over a web socket.

Is that possible in iOS, potentially using Starscream? How?

0

There are 0 answers