#json-rpc #server #tetsy

tetsy-jsonrpc-ws-server

Tetsy WebSockets server for JSON-RPC

Show the crate…

3 stable releases

15.1.0 Mar 13, 2021
14.2.1 Mar 1, 2021

#19 in #tetsy

Download history 25/week @ 2024-04-07 31/week @ 2024-04-14 39/week @ 2024-04-21 25/week @ 2024-04-28 25/week @ 2024-05-05 30/week @ 2024-05-12 27/week @ 2024-05-19 34/week @ 2024-05-26 32/week @ 2024-06-02 19/week @ 2024-06-09 27/week @ 2024-06-16 29/week @ 2024-06-23 7/week @ 2024-06-30 8/week @ 2024-07-07 27/week @ 2024-07-14 29/week @ 2024-07-21

72 downloads per month
Used in 25 crates (2 directly)

MIT license

140KB
4K SLoC

tetsy-jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
tetsy-jsonrpc-ws-server = "14.2"

main.rs

use tetsy_jsonrpc_ws_server::*;
use tetsy_jsonrpc_ws_server::tetsy_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

~14MB
~262K SLoC