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

#85 in WebSocket

Download history 2374/week @ 2024-09-19 2368/week @ 2024-09-26 1204/week @ 2024-10-03 1036/week @ 2024-10-10 1694/week @ 2024-10-17 1724/week @ 2024-10-24 1715/week @ 2024-10-31 1054/week @ 2024-11-07 809/week @ 2024-11-14 1840/week @ 2024-11-21 2012/week @ 2024-11-28 2240/week @ 2024-12-05 4084/week @ 2024-12-12 1500/week @ 2024-12-19 652/week @ 2024-12-26 1770/week @ 2025-01-02

8,645 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–23MB
~313K SLoC