24 stable releases (8 major)

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

#78 in WebSocket

Download history 2933/week @ 2024-07-22 1900/week @ 2024-07-29 1816/week @ 2024-08-05 3934/week @ 2024-08-12 2238/week @ 2024-08-19 2226/week @ 2024-08-26 2505/week @ 2024-09-02 1929/week @ 2024-09-09 1934/week @ 2024-09-16 2768/week @ 2024-09-23 1913/week @ 2024-09-30 250/week @ 2024-10-07 1760/week @ 2024-10-14 1679/week @ 2024-10-21 1930/week @ 2024-10-28 1570/week @ 2024-11-04

6,951 downloads per month
Used in 22 crates (6 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

~12–22MB
~310K SLoC