Is it possible for MacOS App to act as web socket server?

I use to develop for IOS and currently handling MacOS development for the first time. I use websocket in my app before acting as clients. However, I never had to make a websocket server using swift.

I was wondering if it is possible to let my Mac App to act as a web socket server to receive informations from web socket clients? I have been trying to find resources, but most of them are about making clients instead of server. I would appreciate any help on finding resources to help me build this feature.

Thank you

Answered by mikeyh in 721450022

thank you I will look at these

Network framework is covered in the following WWDC sessions (which I'm rewatching as about to start work on the network server part of an app):

Have you looked at SwiftNIO?

https://github.com/apple/swift-nio/tree/main/Sources/NIOWebSocketServer

Or if macOS only are your looking at the Network framework and NWProtocolWebSocket?

https://developer.apple.com/documentation/network

Accepted Answer

thank you I will look at these

Network framework is covered in the following WWDC sessions (which I'm rewatching as about to start work on the network server part of an app):

Is it possible for MacOS App to act as web socket server?
 
 
Q