Starscream is a conforming WebSocket (RFC 6455) library in Swift. Once imported, you can open a connection to your WebSocket server. Note that socket is probably best as a property, so it doesn't get deallocated right after being setup. After you are connected, there is either a delegate or closure you can use for process WebSocket events. The writeData method gives you a simple way to send Data (binary) data to the server. The writeString method is the same as writeData, but sends text/string. The writePing method is the same as write, but sends a ping control frame. Starscream will automatically respond to incoming ping control frames so you do not need to manually send pongs. You can override the default websocket headers, add your own custom ones and set a timeout. Update docs on how to load certificates and public keys into an app bundle, use the builtin pinner and TrustKit.

Features

  • Conforms to all of the base Autobahn test suite
  • Everything happens in the background, thanks to GCD
  • TLS/WSS support
  • Compression Extensions support
  • Connect to the WebSocket server
  • Starscream is nonblocking

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow Starscream

Starscream Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Starscream!

Additional Project Details

Operating Systems

Apple iPhone, Mac

Programming Language

Swift

Related Categories

Swift Frameworks, Swift Libraries, Swift WebSocket Servers

Registered

2021-08-12