public final class ProxyServer
extends java.lang.Object
An example to demonstrate how to write a simple HTTP proxy.
The intent here is NOT to prescribe how to write a fully functional proxy, which would otherwise require
setting appropriate request headers, do appropriate routing on the origin endpoints, etc. Instead, it is to
demonstrate how to write a server that forwards the received request, as is to another server using an RxNetty
client.
This example starts an embedded target server, which is a simple HTTP server that returns a response with HTTP
status of 200 and a content of "Hello World!" for every request it recieves. The proxy server then forwards all
received requests to this target server preserving all the request and response headers as well as content. It
adds an additional response header "X-Proxied-By" with a value "RxNetty" to demonstrate that the response is a
proxied response.