Skip to Content
author's profile photo Former Member
Former Member

Help from the Sample code for Reverse Proxy Filter

Hi everyone,

I'm still struggling on configuring the reverse proxy. In the pdf file for "How to configure the Reverse Proxy Filter for SAP EP 6.0 SP2" I don't know how should i write the code underneath this comment for the provided sample Java Code for the Reverse Proxy Filter:

"/TODO: Enter the code that determinese whether the filter should be activated or not according to request/"

Can anyone help me in this? Maybe help me by writing a template of what the syntax needs to be.

In addition for the Request Wrapper Implementation what needs to go in those brackets?

In the ResponseWrapper Implementation, do you set the redirectURL string to the host name and port you wish to send the redirection too?

Regards,

Jin Bae

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2005 at 06:29 PM

    Hi.

    My personal experience is, that filter itself is helpful is you want to manipulate HTTP requests/responses, ending in the same server. That means it is not right reverse proxy. If you want a serious (self-written) proxy, you can directly start writing servlet. The tactique is very similar. If you want a reverse proxy for productive environment, try using Apache (or IIS), the appropriate note is mentioned

    Now to your questions.

    In my opinion, the first TODO can help to activate or not to activate filter in conditions when filter mapping (see chapter 3.1) does not suffice. Example (a little bit naive and hard to maintain):

    you use filter only for extranet users, so you will filter according to IP address:

    if (!request.getRemoteAddr().startsWith("158.226.") {

    active = true;

    }

    RequestWrapper&ResponseWrapper are helpful, if you want to manipulate headers and content of transfered HTML, e.g. change URLs. For serious proxy you cannot use HttpServletResponse.sendRedirect(), as it sends the given URL back to client. You can use RequestDispatcher.forward(), but it is done automatically by filter-stuff.

    Regards,

    Pavol

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.