24 stable releases (8 major)
18.0.0 | Jul 20, 2021 |
---|---|
17.1.0 | Jun 7, 2021 |
17.0.0 | Jan 20, 2021 |
16.0.0 | Dec 14, 2020 |
10.1.0 | Feb 13, 2019 |
#15 in #json-rpc-server
8,667 downloads per month
Used in 22 crates
(6 directly)
140KB
4K
SLoC
jsonrpc-ws-server
WebSockets server for JSON-RPC 2.0.
Example
Cargo.toml
[dependencies]
jsonrpc-ws-server = "15.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
~11–22MB
~314K SLoC