Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomasf/tfwebsockethandler
WebSocket server implementation for WebAppKit
https://github.com/tomasf/tfwebsockethandler
Last synced: 2 days ago
JSON representation
WebSocket server implementation for WebAppKit
- Host: GitHub
- URL: https://github.com/tomasf/tfwebsockethandler
- Owner: tomasf
- Created: 2011-07-03T00:28:21.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-06-23T18:31:45.000Z (over 12 years ago)
- Last Synced: 2023-04-12T04:03:41.644Z (almost 2 years ago)
- Language: Objective-C
- Homepage:
- Size: 117 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
TFWebSocketHandler is a blocks-based WebSocket server framework for [WebAppKit](http://webappkit.org/). The `TFWebSocketHandler` class is a subclass of `WARequestHandler`, so create one and add it to your application with `addRequestHandler:`. The `connectionHandler` block is called when a client connects. You can then use the `TFWebSocketConnection` object to communicate with the client.
If you are deploying your web app with reverse proxying (and you probably should), you may want to start a separate server (and `WAApplication` object) to run WebSocket on a separate port. The reason is that most reverse proxying servers deal with HTTP on a pure request/repsonse basis and don't work properly with WebSocket traffic.
TFWebSocketHandler supports both the old-style draft 76/00 protocol (`draft-ietf-hybi-thewebsocketprotocol-00`) and the newer masked 07/08 protocol (`draft-ietf-hybi-thewebsocketprotocol-09`). Thus, it works with existing browser implementations (Safari 5, iOS 4.2, Chrome 4) and upcoming ones. Firefox Aurora 6.0a2 has an implementation of '07.
The protocol version to use is detected automatically, so you don't have to do anything special to support both. Do keep in mind that '00 doesn't support some newer features like binary data messages and ping/pong.