📈 GH Trending Explorer 🎲 Surprise me

← all repos

facebookincubator / SocketRocket

git clone https://github.com/facebookincubator/SocketRocket.git 0.7.1 · 2y ago 🔥 on GitHub Trending today

A conforming Objective-C WebSocket client library.

+0
stars, 24h · #620
+0
stars, 7 days · #1,660
—
stars, 30 days
9.6k
★ total
2.0k
forks · 169 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguageObjective-C
License—
Created2012-01-30 (14y ago)
Last push10mo ago
Watchers331
OwnerOrganization

Seen on GitHub Trending

  • 2026-10-20 — #16 daily in objective-c
  • 2026-10-20 — #15 weekly in objective-c

Links

README excerpt
# SocketRocket
![Platforms][platforms-svg]
[![License][license-svg]][license-link]
[![Podspec][podspec-svg]][podspec-link]
[![Carthage Compatible][carthage-svg]](carthage-link)
[![Build Status][build-status-svg]][build-status-link]
A conforming WebSocket (RFC 6455) client library for iOS, macOS, tvOS and visionOS.
Test results for SocketRocket here.
You can compare to what modern browsers look like here.
SocketRocket currently conforms to all core ~300 of Autobahn's fuzzing tests 
(aside from two UTF-8 ones where it is merely *non-strict* tests 6.4.2 and 6.4.4).
## Features/Design
- TLS (wss) support, including self-signed certificates.
- Seems to perform quite well.
- Supports HTTP Proxies.
- Supports IPv4/IPv6.
- Supports SSL certificate pinning.
- Sends `ping` and can process `pong` events.
- Asynchronous and non-blocking. Most of the work is done on a background thread.
- Supports iOS, macOS, tvOS.
## Installing
There are a few options. Choose one, or just figure it out:
- **CocoaPods**
 Add the following line to your Podfile:
 [code] 
 Run `pod install`, and you are all set.
- **Carthage**
 Add the following line to your Cartfile:
 [code] 
 Run `carthage update`, and you should now have the latest version of `SocketRocket` in your `Carthage` folder.
- **Using SocketRocket as a sub-project**
 You can also include `SocketRocket` as a subproject inside of your application if you'd prefer, although we do not recommend this, as it will increase your indexing time significantly. To do so, just drag and drop the `SocketRocket.xcodeproj` file into your workspace.
## API
### `SRWebSocket`
The Web Socket.
#### Note:
`SRWebSocket` will retain itself between `-(void)open` and when it closes, errors, or fails.
This is similar to how `NSURLConnection` behaves (unlike `NSURLConnection`, `SRWebSocket` won't retain the delegate).
#### Interface
 [code] 
### `SRWebSocketDelegate`
You implement this
 [code] 
## Testing
Included are setup scripts for the python testing environment.
It comes packaged with vitualenv so all the dependencies are installed in userland.
To run the short test from the command line, run:
 [code] 
To run all the tests, run:
 [code] 
The short tests don't include the performance tests
(the test harness is actually the bottleneck, not SocketRocket).
The first time this is run, it may take a while to install the dependencies. It will be smooth sailing after that. 
You can also run tests inside Xcode, which runs the same thing, but makes it easier to debug.
- Choose the `SocketRocketTests` target
- Make sure your running destination is either your Mac or any Simulator
- Run the test action (`⌘+U`)
### TestChat Demo Application
SocketRocket includes a demo app, TestChat.
It will "chat" with a listening websocket on port 9900.
#### TestChat Server
The sever takes a message and broadcasts it to all other connected clients.
It requires some dependencies though to run. 
We also want to reuse the virtualenv we made when we ran the tests. 
If you