3 stable releases

✓ Uses Rust 2018 edition

10.1.0 Feb 13, 2019
10.0.1 Jan 31, 2019

#17 in WebSocket

Download history 152/week @ 2019-01-30 581/week @ 2019-02-06

286 downloads per month

MIT license

126KB
3.5K SLoC

jsonrpc-ws-server

WebSockets server for JSON-RPC 2.0.

Documentation

Example

Cargo.toml

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

main.rs

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
~162K SLoC