A HREF rewrite PROXY

Splash Forums Rewrite Users A HREF rewrite PROXY

This topic contains 2 replies, has 2 voices, and was last updated by  anderskristian 7 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #26593


    I have made a rewrite-war PROXY that uses


    And it works perfect.
    My observation is that http://otherhost:port sometimes makes ..
    The developers have hardcoded their own host into the links.
    Therefore I need to replace the output stream:

    stream "http://otherhost:port/xxx" with "./xxx" 

    to bring the
    request back to my proxy server.
    Question 1: Has Direction.isOutbound() anything to do with this ?

    Question 2: Does rewrite contains such filter stream/writers ?


    Yes, changing the URLs of a rendered HTML page is possible using outbound rewrites.

    However, this only works, if the URLs are passed through HttpServletResponse.encodeURL(). If the URLs are hardcoded in the HTML page, things are getting more difficult. To modify these URLs, you will have to buffer the response created by the Servlet and postprocess it. There is some support for this in Rewrite. Have a look at the rewrite-transform-* modules. They are used to (for example) minify JS and CSS files. This is basically the same thing as modifying parts of the HTML page. You will have to implement your own Transformer for this. Have a look at the showcase app for transformations for examples:




    Thanks again Christian
    I get it.
    HttpServletResponse.encodeURL() must be used to enable outbound
    I will try Transformer.
    Actually Transformer could find links and parse them through HttpServletResponse.encodeURL() …
    I will take a look

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.