Home / Companies / Stream / Blog / Post Details
Content Deep Dive

Swift WebSockets: Starscream or URLSession in 2021?

Blog post from Stream

Post Details
Company
Date Published
Author
Matheus C.
Word Count
1,047
Language
English
Hacker News Points
-
Summary

The standardization of the WebSocket protocol in 2011 revolutionized the creation of applications like online games and real-time chats by eliminating the need for manual data refreshes. For Swift programmers targeting Apple platforms, two main libraries facilitate connection to a WebSocket server: Starscream and Apple's URLSession. Starscream, a legacy library, supports older operating systems and has proven reliability but increases binary size and shows signs of decreased maintenance. In contrast, URLSession benefits from being part of Apple's maintained system, ensuring minimal binary size increase and regular updates, though it lacks support for older systems and has reliability issues due to its recent incorporation of WebSocket support. Choosing between them depends on factors such as system version support, app requirements like size optimization, and the need for reliable, time-tested functionality.