Struct ethcore_dapps::ServerBuilder
[−]
[src]
pub struct ServerBuilder<T: Fetch = FetchClient> { /* fields omitted */ }
Webapps HTTP+RPC server build.
Methods
impl ServerBuilder
[src]
fn new<P: AsRef<Path>>(dapps_path: P,
registrar: Arc<ContractClient>,
remote: Remote)
-> Self
registrar: Arc<ContractClient>,
remote: Remote)
-> Self
Construct new dapps server
impl<T: Fetch> ServerBuilder<T>
[src]
fn fetch<X: Fetch>(self, fetch: X) -> ServerBuilder<X>
Set a fetch client to use.
fn sync_status(self, status: Arc<SyncStatus>) -> Self
Change default sync status.
fn web_proxy_tokens(self, tokens: Arc<WebProxyTokens>) -> Self
Change default web proxy tokens validator.
fn signer_address(self, signer_address: Option<(String, u16)>) -> Self
Change default signer port.
fn allowed_hosts(self, allowed_hosts: Option<Vec<String>>) -> Self
Change allowed hosts.
None
- All hosts are allowed
Some(whitelist)
- Allow only whitelisted hosts (+ listen address)
fn extra_dapps<P: AsRef<Path>>(self, extra_dapps: &[P]) -> Self
Change extra dapps paths (apart from dapps_path
)
fn start_unsecured_http(self,
addr: &SocketAddr,
handler: RpcHandler<Metadata>)
-> Result<Server, ServerError>
addr: &SocketAddr,
handler: RpcHandler<Metadata>)
-> Result<Server, ServerError>
Asynchronously start server with no authentication,
returns result with Server
handle on success or an error.
fn start_basic_auth_http(self,
addr: &SocketAddr,
username: &str,
password: &str,
handler: RpcHandler<Metadata>)
-> Result<Server, ServerError>
addr: &SocketAddr,
username: &str,
password: &str,
handler: RpcHandler<Metadata>)
-> Result<Server, ServerError>
Asynchronously start server with HTTP Basic Authentication
,
return result with Server
handle on success or an error.