public void sendRedirect(ChannelHandlerContext ctx, String newUri) {
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.FOUND);
response.headers().set(HttpHeaders.Names.LOCATION, newUri);
// Close the connection as soon as the error message is sent.
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
}
NettyHttpFileHandler.java 文件源码
java
阅读 29
收藏 0
点赞 0
评论 0
项目:TFWebSock
作者:
评论列表
文章目录