配置Netty服务器以接收HTTP响应

配置Netty服务器以接收HTTP响应,netty,Netty,我有一个netty服务器,用于接收http请求和发送http响应。但是,服务器无法接收http响应 最初,我在管道中有以下两个处理程序,它作为一个常规服务器运行良好 org.jboss.netty.handler.codec.http.HttpRequestDecoder org.jboss.netty.handler.codec.http.HttpResponseEncoder 为了收到回复,我添加了 org.jboss.netty.handler.codec.http.HttpRespons

我有一个netty服务器,用于接收http请求和发送http响应。但是,服务器无法接收http响应

最初,我在管道中有以下两个处理程序,它作为一个常规服务器运行良好

org.jboss.netty.handler.codec.http.HttpRequestDecoder org.jboss.netty.handler.codec.http.HttpResponseEncoder

为了收到回复,我添加了

org.jboss.netty.handler.codec.http.HttpResponseDecoder

到管道。但这没有帮助


我需要如何配置服务器以便能够接收http响应

我猜你想做一个代理

使用不同的管道和ClientBootstrap转发消息并添加两个处理程序:

pipeline.addLast("decoder", new HttpResponseDecoder());
pipeline.addLast("encoder", new HttpRequestEncoder());

HTH

您是在尝试编写http服务器还是客户端?它更像是中继服务器。我需要它来接受和发送回复。