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

susydev-jsonrpc-ws-server

WebSockets server for JSON-RPC

3 stable releases

✓ Uses Rust 2018 edition

11.0.0 Apr 13, 2019
10.1.0 Apr 13, 2019
10.0.1 Mar 25, 2019

31 downloads per month

MIT license

128KB
3.5K SLoC

susydev-jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
susydev-jsonrpc-ws-server = "11.0"

main.rs

use susydev_jsonrpc_ws_server::*;
use susydev_jsonrpc_ws_server::susydev_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
~188K SLoC