Struct hyper::server::Server
[-]
[+]
[src]
pub struct Server<L = HttpListener> { // some fields omitted }
A server can listen on a TCP socket.
Once listening, it will create a Request
/Response
pair for each
incoming connection, and hand them to the provided handler.
Methods
impl Server<HttpListener>
fn http(ip: IpAddr, port: Port) -> Server
Creates a new server that will handle HttpStream
s.
fn https(ip: IpAddr, port: Port, cert: Path, key: Path) -> Server
Creates a new server that will handler HttpStreams
s using a TLS connection.
impl<L: NetworkListener<Acceptor=A> + Send, A: NetworkAcceptor<Stream=S> + Send, S: NetworkStream + Clone + Send> Server<L>
fn with_listener(ip: IpAddr, port: Port, listener: L) -> Server<L>
Creates a new server that will handle HttpStream
s.
fn listen_threads<H: Handler>(self, handler: H, threads: usize) -> HttpResult<Listening<Acceptor>>
Binds to a socket, and starts handling connections using a task pool.
fn listen<H: Handler>(self, handler: H) -> HttpResult<Listening<Acceptor>>
Binds to a socket and starts handling connections.