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 HttpStreams.

fn https(ip: IpAddr, port: Port, cert: Path, key: Path) -> Server

Creates a new server that will handler HttpStreamss 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 HttpStreams.

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.