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
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
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