Hi everybody,
after a lot of tries to build a proxy server I found it really easy using
Restlet. Although I have an obvious issue after setting all the traffic from
Chrome to go through my proxy, I get redirection loop (as also the routed URL
is trying to go through proxy). Here is the code that I am using:
public static void main(String[] args) throws Exception {
Component component = new Component();
component.getClients().add(Protocol.HTTP);
component.getServers().add(Protocol.HTTP, 8111);
Application application = new RestletProxy();
component.getDefaultHost().attachDefault(application);
component.start();
}
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
String target = "http://www.google.com";
Redirector redirector = new Redirector(getContext(), target);
router.attachDefault(redirector);
return router;
}
So I am just trying to redirect every single request to google. Is it possible
using restlet?
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3089543