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 |
#78 in WebSocket
6,951 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
~12–22MB
~310K SLoC