Top Description Inners Fields Constructors Methods
io.undertow.server.handlers

public Class ConnectHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.predicate.Predicate, .Predicates, io.undertow.server.HttpHandler, .HttpServerExchange, .HttpUpgradeListener, io.undertow.util.Methods, .SameThreadExecutor, .StatusCodes, .Transfer, org.xnio.ChannelExceptionHandler, .ChannelListener, .ChannelListeners, .IoFuture, .IoUtils, .OptionMap, .Options, .StreamConnection, org.xnio.channels.StreamSinkChannel, java.io.Closeable, .IOException, java.net.InetSocketAddress, java.nio.channels.Channel

Handlers HTTP CONNECT requests, allowing the server to act as a forward proxy.

Warning

Do not enable this without some kind of authentication / IP based restriction scheme in place, as this will allow malicious actors to use your server as an open relay.

Author
Stuart Douglas

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final Predicate
private final HttpHandler

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
handleRequest(final HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowedback to summary
private final Predicate allowed
nextback to summary
private final HttpHandler next

Constructor Detail

ConnectHandlerback to summary
public ConnectHandler(HttpHandler next)
ConnectHandlerback to summary
public ConnectHandler(HttpHandler next, Predicate allowed)

Method Detail

handleRequestback to summary
public void handleRequest(final HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
io.undertow.server.handlers back to summary

private final Class ConnectHandler.ClosingExceptionHandler

extends Object
implements ChannelExceptionHandler<Channel>
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.ConnectHandler.ClosingExceptionHandler
All Implemented Interfaces
org.xnio.ChannelExceptionHandler, java.util.EventListener

Field Summary

Modifier and TypeField and Description
private final Closeable[]

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handleException(Channel
the channel
channel
,
IOException
the exception
exception
)

Implements org.xnio.ChannelExceptionHandler.handleException.

Handle an exception on the channel.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

toCloseback to summary
private final Closeable[] toClose

Constructor Detail

ClosingExceptionHandlerback to summary
private ClosingExceptionHandler(Closeable... toClose)

Method Detail

handleExceptionback to summary
public void handleException(Channel channel, IOException exception)

Implements org.xnio.ChannelExceptionHandler.handleException.

Doc from org.xnio.ChannelExceptionHandler.handleException.

Handle an exception on the channel.

Parameters
channel:Channel

the channel

exception:IOException

the exception

Annotations
@Override