GithubHelp home page GithubHelp logo

doytsujin / rust-websocket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from websockets-rs/rust-websocket

0.0 1.0 0.0 21.91 MB

A WebSocket (RFC6455) library written in Rust

Home Page: http://websockets-rs.github.io/rust-websocket/

License: MIT License

Rust 98.35% Shell 1.65%

rust-websocket's Introduction

Rust-WebSocket Build Status docs.rs

Note: Maintainership of this project is slugglish. You may want to use tungstenite or tokio-tungstenite instead.

Rust-WebSocket is a WebSocket (RFC6455) library written in Rust.

Rust-WebSocket provides a framework for dealing with WebSocket connections (both clients and servers). The library is currently in an experimental state, but provides functionality for both normal and secure WebSockets, a message level API supporting fragmentation, a data frame level API, and the ability to extend and customize behaviour.

Installation

To add a library release version from crates.io to a Cargo project, add this to the 'dependencies' section of your Cargo.toml:

websocket = "0.24.0"

To add the library's Git repository to a Cargo project, add this to your Cargo.toml:

[dependencies.websocket]

git = "https://github.com/websockets-rs/rust-websocket.git"

Optionally add extern crate websocket; to your project.

Note that 0.24.0 is the last version of rust-websocket that supports some very old Rust versions (I'm not sure which exactly, maybe 1.28).

Usage

The library can be compiled with tests and benches and some extra capabilities on Rust nightly. To enable the nightly features, use cargo --features nightly ....

See the documentation for the latest release of the library here, and also the examples, which are located in /examples and can be run with:

cargo run --example server

And in a separate terminal:

cargo run --example client

Testing

The library can be tested using cargo test to run tests and cargo bench to run bench tests.

A number of tests are included, which ensure core WebSocket functionality works as expected. These tests are not yet comprehensive, and are still being worked on.

Autobahn TestSuite

Rust-WebSocket uses the Autobahn TestSuite to test conformance to RFC6455. If you have Autobahn TestSuite installed you can run these tests yourself using the commands:

wstest -m fuzzingserver
cargo run --example autobahn-client

To test the client implementation, and

wstest -m fuzzingclient
cargo run --example autobahn-server

To test the server implementation. The spec files are available here.

The results of these tests are available here.

Contributing

Before you make a PR be sure to run all the tests!

# install
rustup component add rustfmt-preview
rustup component add clippy-preview

# test
cargo +nightly fmt -- --check
cargo +nightly clippy --all-features -- -D clippy::all
cargo test --features nightly
cargo bench --features nightly
./scripts/build-all.sh

License

The MIT License (MIT)

Copyright (c) 2014-2015 Cyderize

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

rust-websocket's People

Contributors

cyderize avatar illegalprime avatar vi avatar kpp avatar overdrivenpotato avatar surdus avatar bentheelder avatar bgdncz avatar spinda avatar peterw-lwl avatar x1957 avatar sterlingjensen avatar therustmonk avatar timvisee avatar simonsapin avatar tomaka avatar nashenas88 avatar ashfordneil avatar fuchsnj avatar janhohenheim avatar nox avatar mbrubeck avatar mikeswoods avatar najamelan avatar paul-andre avatar sgrif avatar shahn avatar scips avatar thombles avatar walfie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.