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

#44 in WebSocket

Download history 11/week @ 2019-01-12 10/week @ 2019-01-19 5/week @ 2019-01-26 3/week @ 2019-02-02 7/week @ 2019-02-09 6/week @ 2019-02-16 1/week @ 2019-02-23 11/week @ 2019-03-02 5/week @ 2019-03-09 1/week @ 2019-03-16 30/week @ 2019-03-23 1/week @ 2019-03-30 5/week @ 2019-04-06 1/week @ 2019-04-13 5/week @ 2019-04-20

122 downloads per month

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

~9MB
~169K SLoC