public class CorsHandler extends ChannelDuplexHandler
This handler can be configured using one or more CorsConfig, please
refer to this class for details about the configuration options available.
ChannelHandler.Sharable| Constructor and Description |
|---|
CorsHandler(CorsConfig config)
Creates a new instance with a single
CorsConfig. |
CorsHandler(List<CorsConfig> configList,
boolean isShortCircuit)
Creates a new instance with the specified config list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(ChannelHandlerContext ctx,
Object msg)
Calls
ChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline. |
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise)
Calls
ChannelOutboundInvoker.write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline. |
bind, close, connect, deregister, disconnect, flush, readchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexceptionCaught, handlerAdded, handlerRemovedpublic CorsHandler(CorsConfig config)
CorsConfig.public CorsHandler(List<CorsConfig> configList, boolean isShortCircuit)
configList - List of CorsConfigisShortCircuit - Same as CorsConfig.isShortCircuit() but applicable to all supplied configs.public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ChannelInboundHandlerAdapterChannelHandlerContext.fireChannelRead(Object) to forward
to the next ChannelInboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.channelRead in interface ChannelInboundHandlerchannelRead in class ChannelInboundHandlerAdapterExceptionpublic void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
ChannelDuplexHandlerChannelOutboundInvoker.write(Object, ChannelPromise) to forward
to the next ChannelOutboundHandler in the ChannelPipeline.
Sub-classes may override this method to change behavior.write in interface ChannelOutboundHandlerwrite in class ChannelDuplexHandlerctx - the ChannelHandlerContext for which the write operation is mademsg - the message to writepromise - the ChannelPromise to notify once the operation completesException - thrown if an error occursCopyright © 2008–2025 The Netty Project. All rights reserved.