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

#59 in WebSocket

Download history 5785/week @ 2020-11-07 5977/week @ 2020-11-14 6179/week @ 2020-11-21 7431/week @ 2020-11-28 6177/week @ 2020-12-05 6772/week @ 2020-12-12 4477/week @ 2020-12-19 4033/week @ 2020-12-26 8481/week @ 2021-01-02 7975/week @ 2021-01-09 8449/week @ 2021-01-16 8445/week @ 2021-01-23 8228/week @ 2021-01-30 7716/week @ 2021-02-06 8483/week @ 2021-02-13 9871/week @ 2021-02-20

27,315 downloads per month
Used in 28 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
~238K SLoC