Show the crate…
3 stable releases
15.1.0 | Mar 13, 2021 |
---|---|
14.2.1 | Mar 1, 2021 |
#19 in #tetsy
72 downloads per month
Used in 25 crates
(2 directly)
140KB
4K
SLoC
tetsy-jsonrpc-ws-server
WebSockets server for JSON-RPC 2.0.
Example
Cargo.toml
[dependencies]
tetsy-jsonrpc-ws-server = "14.2"
main.rs
use tetsy_jsonrpc_ws_server::*;
use tetsy_jsonrpc_ws_server::tetsy_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
~14MB
~262K SLoC