HttpHandler
public class NameVirtualHostHandler extends Object implements HttpHandler
HttpHandler
that implements virtual hosts based on the Host:
http header
header.Constructor | Description |
---|---|
NameVirtualHostHandler() |
Modifier and Type | Method | Description |
---|---|---|
NameVirtualHostHandler |
addHost(String host,
HttpHandler handler) |
|
HttpHandler |
getDefaultHandler() |
|
Map<String,HttpHandler> |
getHosts() |
|
void |
handleRequest(HttpServerExchange exchange) |
Handle the request.
|
NameVirtualHostHandler |
removeHost(String host) |
|
NameVirtualHostHandler |
setDefaultHandler(HttpHandler defaultHandler) |
public void handleRequest(HttpServerExchange exchange) throws Exception
HttpHandler
handleRequest
in interface HttpHandler
exchange
- the HTTP request/response exchangeException
public HttpHandler getDefaultHandler()
public Map<String,HttpHandler> getHosts()
public NameVirtualHostHandler setDefaultHandler(HttpHandler defaultHandler)
public NameVirtualHostHandler addHost(String host, HttpHandler handler)
public NameVirtualHostHandler removeHost(String host)
Copyright © 2018. All rights reserved.