4 releases (breaking)

0.4.0 Dec 7, 2018
0.3.0 Oct 15, 2018
0.2.0 Oct 11, 2018
0.1.2 Oct 6, 2018

#27 in WebSocket

Download history 43/week @ 2018-10-16 15/week @ 2018-10-23 21/week @ 2018-10-30 23/week @ 2018-11-06 22/week @ 2018-11-13 9/week @ 2018-11-20 21/week @ 2018-11-27 50/week @ 2018-12-04 14/week @ 2018-12-11 79/week @ 2018-12-18 2/week @ 2018-12-25 6/week @ 2019-01-01 14/week @ 2019-01-08 16/week @ 2019-01-15 3/week @ 2019-01-22

122 downloads per month
Used in 5 crates (1 directly)

MIT license

121KB
3K SLoC

jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

[dependencies]
jsonrpc-ws-server = { git = "https://github.com/paritytech/jsonrpc" }

main.rs

extern crate jsonrpc_ws_server;

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

~8.5MB
~161K SLoC