16 stable releases (4 major)

✓ Uses Rust 2018 edition

14.0.6 Feb 7, 2020
14.0.5 Nov 28, 2019
14.0.3 Oct 25, 2019
13.2.0 Sep 13, 2019
10.1.0 Feb 13, 2019

#46 in WebSocket

Download history 3820/week @ 2019-11-01 3774/week @ 2019-11-08 3071/week @ 2019-11-15 3012/week @ 2019-11-22 3427/week @ 2019-11-29 3898/week @ 2019-12-06 2543/week @ 2019-12-13 1340/week @ 2019-12-20 1206/week @ 2019-12-27 2135/week @ 2020-01-03 2320/week @ 2020-01-10 1781/week @ 2020-01-17 1771/week @ 2020-01-24 2113/week @ 2020-01-31 2510/week @ 2020-02-07

10,576 downloads per month
Used in 12 crates (4 directly)

MIT license

135KB
3.5K SLoC

jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
jsonrpc-ws-server = "14.0"

main.rs

use jsonrpc_ws_server::*;
use jsonrpc_ws_server::jsonrpc_core::*;

fn main() {
	let mut io = IoHandler::new();
	io.add_method("say_hello", |_params| {
		Ok(Value::String("hello".into()))
	});

	let server = ServerBuilder::new(io)
		.start(&"0.0.0.0:3030".parse().unwrap())
		.expect("Server must start with no issues");

	server.wait().unwrap()
}

lib.rs:

WebSockets server.

Dependencies

~9MB
~203K SLoC