All Projects → snapview → Tungstenite Rs

snapview / Tungstenite Rs

Licence: other
Lightweight stream-based WebSocket implementation for Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Tungstenite Rs

D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (-23.23%)
Mutual labels:  websockets
Swell
Swell: API development tool that enables developers to test endpoints served over streaming technologies including Server-Sent Events (SSE), WebSockets, HTTP2, GraphQL, and gRPC.
Stars: ✭ 517 (-14.83%)
Mutual labels:  websockets
Gwsocket
fast, standalone, language-agnostic WebSocket server RFC6455 compliant
Stars: ✭ 550 (-9.39%)
Mutual labels:  websockets
Php Websocket
Simple WebSocket server implemented in PHP.
Stars: ✭ 473 (-22.08%)
Mutual labels:  websockets
Script Server
Web UI for your scripts with execution management
Stars: ✭ 506 (-16.64%)
Mutual labels:  websockets
Multi V2ray
v2ray/xray多用户管理部署程序
Stars: ✭ 5,382 (+786.66%)
Mutual labels:  websockets
Wsify
Just a tiny, simple and real-time self-hosted pub/sub messaging service
Stars: ✭ 452 (-25.54%)
Mutual labels:  websockets
Mock Socket
Javascript mocking library for WebSockets and Socket.IO
Stars: ✭ 598 (-1.48%)
Mutual labels:  websockets
Humblenet
a cross-platform networking library that works in the browser
Stars: ✭ 515 (-15.16%)
Mutual labels:  websockets
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (-12.36%)
Mutual labels:  websockets
Remote retro
Free, world-class retrospectives
Stars: ✭ 474 (-21.91%)
Mutual labels:  websockets
Vue Socket.io Extended
✌️⚡️ Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
Stars: ✭ 506 (-16.64%)
Mutual labels:  websockets
Pyptt
支援 PTT 還有 PTT2 的 PTT API
Stars: ✭ 527 (-13.18%)
Mutual labels:  websockets
Aws Iot Chat Example
💬 Chat application using AWS IoT platform via MQTT over the WebSocket protocol
Stars: ✭ 474 (-21.91%)
Mutual labels:  websockets
Wrench
A simple PHP WebSocket implementation for PHP 7.1
Stars: ✭ 559 (-7.91%)
Mutual labels:  websockets
Simple Websockets Chat App
This SAM application provides the Lambda functions, DynamoDB table, and roles to allow you to build a simple chat application based on API Gateway's new WebSocket-based API feature.
Stars: ✭ 454 (-25.21%)
Mutual labels:  websockets
Seasocks
Simple, small, C++ embeddable webserver with WebSockets support
Stars: ✭ 517 (-14.83%)
Mutual labels:  websockets
Lhttp
go websocket, a better way to buid your IM server
Stars: ✭ 603 (-0.66%)
Mutual labels:  websockets
Pup
The Ultimate Boilerplate for Products.
Stars: ✭ 563 (-7.25%)
Mutual labels:  websockets
Rockgo
A developing game server framework,based on Entity Component System(ECS).
Stars: ✭ 532 (-12.36%)
Mutual labels:  websockets

Tungstenite

Lightweight stream-based WebSocket implementation for Rust.

use std::net::TcpListener;
use std::thread::spawn;
use tungstenite::server::accept;

/// A WebSocket echo server
fn main () {
    let server = TcpListener::bind("127.0.0.1:9001").unwrap();
    for stream in server.incoming() {
        spawn (move || {
            let mut websocket = accept(stream.unwrap()).unwrap();
            loop {
                let msg = websocket.read_message().unwrap();

                // We do not want to send back ping/pong messages.
                if msg.is_binary() || msg.is_text() {
                    websocket.write_message(msg).unwrap();
                }
            }
        });
    }
}

Take a look at the examples section to see how to write a simple client/server.

NOTE: tungstenite-rs is more like a barebone to build reliable modern networking applications using WebSockets. If you're looking for a modern production-ready "batteries included" WebSocket library that allows you to efficiently use non-blocking sockets and do "full-duplex" communication, take a look at tokio-tungstenite.

MIT licensed Apache-2.0 licensed Crates.io Build Status

Documentation

Introduction

This library provides an implementation of WebSockets, RFC6455. It allows for both synchronous (like TcpStream) and asynchronous usage and is easy to integrate into any third-party event loops including MIO. The API design abstracts away all the internals of the WebSocket protocol but still makes them accessible for those who wants full control over the network.

Why Tungstenite?

It's formerly WS2, the 2nd implementation of WS. WS2 is the chemical formula of tungsten disulfide, the tungstenite mineral.

Features

Tungstenite provides a complete implementation of the WebSocket specification. TLS is supported on all platforms using native-tls or rustls available through the native-tls and rustls-tls feature flags.

There is no support for permessage-deflate at the moment. It's planned.

Testing

Tungstenite is thoroughly tested and passes the Autobahn Test Suite for WebSockets. It is also covered by internal unit tests as well as possible.

Contributing

Please report bugs and make feature requests here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].