private final String serverName;
public HttpListenerService(String name, final String serverName, OptionMap listenerOptions, OptionMap socketOptions, boolean certificateForwarding, boolean proxyAddressForwarding) {
super(name, listenerOptions, socketOptions);
this.serverName = serverName;
addWrapperHandler(new HandlerWrapper() {
@Override
public HttpHandler wrap(final HttpHandler handler) {
httpUpgradeHandler.setNonUpgradeHandler(handler);
return httpUpgradeHandler;
}
});
if (certificateForwarding) {
addWrapperHandler(new HandlerWrapper() {
@Override
public HttpHandler wrap(HttpHandler handler) {
return new SSLHeaderHandler(handler);
}
});
}
if (proxyAddressForwarding) {
addWrapperHandler(new HandlerWrapper() {
@Override
public HttpHandler wrap(HttpHandler handler) {
return new ProxyPeerAddressHandler(handler);
}
});