24 stable releases (8 major)

new 18.0.0 Jul 20, 2021
17.1.0 Jun 7, 2021
17.0.0 Jan 20, 2021
16.0.0 Dec 14, 2020
10.1.0 Feb 13, 2019

#66 in WebSocket

Download history 9185/week @ 2021-04-04 8449/week @ 2021-04-11 8040/week @ 2021-04-18 7861/week @ 2021-04-25 7609/week @ 2021-05-02 8883/week @ 2021-05-09 9655/week @ 2021-05-16 10551/week @ 2021-05-23 10363/week @ 2021-05-30 11593/week @ 2021-06-06 10629/week @ 2021-06-13 9692/week @ 2021-06-20 8956/week @ 2021-06-27 12053/week @ 2021-07-04 10146/week @ 2021-07-11 11025/week @ 2021-07-18

41,847 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
~250K SLoC