OSS TanbouSign in with GitHub

connect RFC 6455 WebSockets in Swift and handle text, binary, TLS/WSS, and compression events

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
8,641
Primary language
Swift
License
Apache-2.0
Repository last updated
May 16, 2024
On this page

Overview

Starscream is a Swift WebSocket client library conforming to RFC 6455. It provides nonblocking background processing, TLS/WSS, RFC 7692 compression, and delegate or closure handling for text, binary, ping, pong, connection, and error events.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Handle connection and message lifecycle through WebSocketEvent

Create a WebSocket from URLRequest, call connect, and receive connected, disconnected, text, binary, ping/pong, and error events through didReceive or onEvent. The socket instance must remain retained while the connection is active.

Sources: [2]

Configure TLS/WSS, headers, compression, and callback queues

The client supports custom headers and protocols, timeouts, certificate pinning hooks, RFC 7692 compression, and a configurable callback queue while network processing itself remains on background threads.

Sources: [2]

Best fit

Fits chat and realtime applications that need bidirectional communication

It is useful when an iOS client needs continuous server events plus bidirectional text or binary frames rather than request/response HTTP alone.

Sources: [2]

Before adoption

The latest release is from 2024, so verify it with current Swift and Xcode

The latest GitHub release is 4.0.8 from March 2024 and Package.swift uses Swift tools 5.3. The repository was last pushed in May 2024, so current Swift/Xcode builds, concurrency behavior, and TLS configuration should be verified before adoption.

Sources: [4][3][1]

Official sources

  1. [1]daltoniam/Starscream — GitHub repository(2026-10-06)
  2. [2]Starscream 4.0.8 — README(2026-10-06)
  3. [3]Starscream 4.0.8 — Package.swift(2026-10-06)
  4. [4]Starscream 4.0.8 release(2026-10-06)
  5. [5]Starscream Apache-2.0 license(2026-10-06)
Supplemental curator note

Starscream fits iOS chat and realtime applications that need bidirectional WebSocket communication. Its latest release and last repository push are from 2024, so test it with current Swift/Xcode, concurrency, and TLS settings before adoption.

Try it in 3 steps

  1. 1

    Add Starscream 4.0.8 with SwiftPM

    Pin the latest GitHub release and verify compatibility with the current Swift/Xcode toolchain in CI.

    .package(url: "https://github.com/daltoniam/Starscream.git", exact: "4.0.8")
  2. 2

    Create and connect a WebSocket

    Retain the socket instance and connect to a WSS endpoint.

    import Starscream var request = URLRequest(url: URL(string: "wss://example.com/socket")!) request.timeoutInterval = 5 let socket = WebSocket(request: request) socket.connect()
  3. 3

    Handle text and binary events with onEvent

    Read the WebSocketEvent stream and process the text and binary cases needed by the application.

    socket.onEvent = { event in switch event { case .text(let value): print(value) case .binary(let data): print(data.count) default: break } }
Check the official README

Growth

Growth trends · Last 30 days

8,641 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
26

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • starscream
  • swift
  • websocket-client
  • osx
  • websocket
  • websockets
  • protocol
Stars
8,641
Forks
1,257
Watchers
132
Open issues
146
Contributors
100
Owner type
User
Primary language
Swift
License
Apache-2.0
Repository last updated
May 16, 2024
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?