We need to talk about Websockets
summary
Explains why WebSockets (RFC6455) cut latency by keeping a persistent TLS-encrypted TCP connection instead of repeating HTTP headers and cookies, and shows concrete tooling: URLSession WebSocketTask (iOS 13+), Starscream, and SwiftNIO plus Network.framework and Vapor for servers. Demo compares Starscream vs URLSession usage and highlights that receive must be re-called, ping/pong heartbeats and proper close codes are required, and that pre‑iOS13 CFNetwork is flaky; sample app and proxy debugging (Charles) are open sourced.
AI-written summary · about
chapters (20)
- 0:00Introduction and speaker
- 1:15What are WebSockets
- 3:28Why WebSockets matter
- 5:17WebSocket protocol basics
- 8:11WebSocket connection process
- 10:17WebSocket message framing
- 12:09Ping pong and connection health
- 13:36WebSocket libraries overview
- 14:21Starscream library demo
- 17:22Apple's Network framework
- 19:28URLSession WebSocketTask
- 21:44Server-side WebSocket options
- 23:51Vapor WebSocket implementation
- 26:07GraphQL subscriptions
- 29:28Xcode on iPhones concept
- 30:18Live WebSocket demo
- 34:51Implementation recap
- 35:36Debugging WebSocket tools
- 36:50Pros and cons summary
- 38:21Resources and closing
related talks
05mSwift Superpowers #2
22mEvent driven networking for Swift
20mKick your 3rd party networking library to the curb
21mSwift NIO, Vapor, and Server Concurrency
01h 14mWebSocket: How, When and What It Costs
01h 01mPractical Patterns with the Networking TS
37mHow does Server Side Swift Workout in the Real World?
23mThe Short and Happy Lives of TCP and HTTP Requests
