websocket-transport

Crates.iowebsocket-transport
lib.rswebsocket-transport
version0.1.0
sourcesrc
created_at2017-09-07 02:45:53.610812
updated_at2017-09-07 02:45:53.610812
descriptionEasy async WebSocket wrapper which implements Stream + Sink for String
homepagehttps://github.com/spinda/websocket-transport
repositoryhttps://github.com/spinda/websocket-transport
max_upload_size
id30860
size30,555
Michael Smith (spinda)

documentation

https://docs.rs/websocket-transport/0.1.0

README

websocket-transport

Easy async WebSocket wrapper which implements Stream and Sink for String

Crates.io Linux/OSX Build Status Windows Build Status

Documentation

Usage

First, add this to your Cargo.toml:

[dependencies]
websocket-transport = "0.1"

Next, add this to your crate:

extern crate websocket_transport;

use websocket_transport::WsTransport;

Overview

The WsTransport type provides an easy wrapper around an async WebSocket which implements Stream and Sink for String.

This type automatically takes care of:

  • receiving and responding to Pings, as the Stream is polled
  • attempting to convert Binary messages to UTF-8 Strings

It can be wrapped around Client or any other type which implements Stream and Sink for OwnedMessage.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 4

cargo fmt