SockJS server
SockJS server for for Actix framework.
- API Documentation
- Cargo package: sockjs
- SockJS is built with Actix web
- Minimum supported Rust version: 1.21 or later
Actix SockJS is licensed under the Apache-2.0 license.
Usage
To use sockjs
, add this to your Cargo.toml
:
[]
= "0.2"
Supported transports
- websocket
- xhr-streaming
- xhr-polling
- iframe-xhr-polling
- iframe-eventsource (EventSource used from an iframe via postMessage)
- iframe-htmlfile (HtmlFile used from an iframe via postMessage.)
- jsonp-polling
Simple chat example
extern crate actix;
extern crate actix_web;
extern crate sockjs;
use *;
use *;
use ;
;
/// `SockJSContext` context is required for sockjs session
/// Session has to implement `Default` trait
/// Sockjs session trait
/// Session has to be able to handle `sockjs::Message` messages