Search code examples
httpnionettyrouter

Connect to external HTTP server from Netty


I need some help with understanding how to write HTTP router, which recognizes HTTP header as routing criteria. I found the link https://github.com/cgbystrom/netty-tools/blob/master/src/main/java/se/cgbystrom/netty/http/router/RouterHandler.java which seems to do the routing itself. But now it is not clear, how to

  • connect to another HTTP server
  • send HTTP request
  • wait for HTTP response
  • forward the HTTP response to client

can somebody please give me some explanations?


Solution

  • http://static.netty.io/3.5/xref/org/jboss/netty/example/proxy/package-summary.html

    the example of proxy server in Netty, essentially what I wanted