On Tuesday, 07 October, 2014 08:12 PM, Jovan Jovanovic wrote:
> 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
>

I just want to share that yes it is possible, I have a running proxy in 
heroku that runs Restlet proxy and redirects all traffic to a given URL

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=3093682

Reply via email to