#jsonrpc #server #json-rpc #websockets #ws

susy-jsonrpc-ws-server

WebSockets server for JSON-RPC

2 stable releases

✓ Uses Rust 2018 edition

10.1.0 Mar 24, 2019
10.0.1 Mar 25, 2019

#48 in WebSocket

26 downloads per month

MIT license

126KB
3.5K SLoC

susy-jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
susy-jsonrpc-ws-server = "10.0"

main.rs

use susy_jsonrpc_ws_server::*;
use susy_jsonrpc_ws_server::susy_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

~9MB
~169K SLoC