22 stable releases (7 major)

17.0.0 Jan 20, 2021
16.0.0 Dec 14, 2020
15.1.0 Sep 30, 2020
14.2.0 Jun 3, 2020
10.1.0 Feb 13, 2019

#69 in WebSocket

Download history 8799/week @ 2021-01-21 8035/week @ 2021-01-28 7909/week @ 2021-02-04 7792/week @ 2021-02-11 10478/week @ 2021-02-18 9975/week @ 2021-02-25 8837/week @ 2021-03-04 11974/week @ 2021-03-11 9786/week @ 2021-03-18 10201/week @ 2021-03-25 8423/week @ 2021-04-01 8782/week @ 2021-04-08 8476/week @ 2021-04-15 8103/week @ 2021-04-22 7343/week @ 2021-04-29 6771/week @ 2021-05-06

32,924 downloads per month
Used in 36 crates (7 directly)

MIT license

140KB
4K SLoC

jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
jsonrpc-ws-server = "15.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

~11MB
~239K SLoC