Using ethcore http server

This commit is contained in:
Tomasz Drwięga
2016-06-01 18:00:40 +02:00
parent 1fd9110829
commit a7a2b55362
10 changed files with 66 additions and 115 deletions

View File

@@ -10,8 +10,8 @@ build = "build.rs"
[dependencies]
log = "0.3"
jsonrpc-core = { git = "https://github.com/ethcore/jsonrpc-core.git" }
jsonrpc-http-server = { path = "../../../workspace/jsonrpc-http-server" }
jsonrpc-core = "2.0"
jsonrpc-http-server = { git = "https://github.com/ethcore/jsonrpc-http-server.git" }
hyper = { default-features = false, git = "https://github.com/ethcore/hyper" }
url = "1.0"
rustc-serialize = "0.3"

View File

@@ -23,14 +23,14 @@ pub fn rpc(handler: Arc<IoHandler>, panic_handler: Arc<Mutex<Option<Box<Fn() ->
Box::new(RpcEndpoint {
handler: handler,
panic_handler: panic_handler,
cors_domain: Some(AccessControlAllowOrigin::Null)
cors_domain: vec![AccessControlAllowOrigin::Null],
})
}
struct RpcEndpoint {
handler: Arc<IoHandler>,
panic_handler: Arc<Mutex<Option<Box<Fn() -> () + Send>>>>,
cors_domain: Option<AccessControlAllowOrigin>,
cors_domain: Vec<AccessControlAllowOrigin>,
}
impl Endpoint for RpcEndpoint {