cancel
Showing results for 
Search instead for 
Did you mean: 

Getting client IP-address (working with Web Dispatcher !)

Former Member
0 Kudos

Hi all,

hopefully someone can help me here. Getting the client's IP-address from the http-request has been discussed here, however I have one specialty:

We are working with the SAP Web Dispatcher.!

Doing this the "request->get_header_field( '~remote_addr' )." returns always the IP-address of the Web-Dispatcher!

Anyone knows if there is a way to get the ip-address of the real "client" ??

Thanks in advance

Stefan Hester

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Eddy,

I have just tried the header field "x-forwarded-for"

and it is empty. If I remember correctly, I have seen this somewhere here in the forum. I think this was related to a Web Application Firewall/Reverse Proxy, which forwarded the client ip-address to the WAS using this additional header field... !?

In my case, it would be the SAP Web Dispatcher itself which needs to add an additional header with the client ip-address. Unfortunately I haven't been able to find anthing on this issue. If it exists, it is hidden pretty good (if it is in the documentation at all). If not, I may wonder who decided to ignore the client's ip-address...

Regards,

Stefan

eddy_declercq
Active Contributor
0 Kudos

Hi,

Check this help.

http://help.sap.com/saphelp_nw2004s/helpdata/en/de/89023c59698908e10000000a11402f/frameset.htm

You'll see that there is a param wdisp/add_xforwardedfor_header

which

"The parameter determines whether the SAP Web dispatcher includes the IP address of the client in the header field x-forwarded-for. If it does, the application on the application server can read the route that the request has taken. If the parameter has the value false, the Web dispatcher leaves the header field unchanged."

Together with the forwarder field that I've mentioned earlier, this should achieve things you need.

Eddy

Answers (4)

Answers (4)

Former Member
0 Kudos

Yes, this sounds very much like exactly what I was looking for. If this works as described, this should be it.

I haven't been able to test this, because I have now idea how to change the parameters of the Web Dispatcher and my colleague is on vacation.

Thanks a lot.

Regards,

Stefan

Former Member
0 Kudos

Hi Stefan,

I have a similar requirement. Can you please let me know what you did to resolve this issue?

Regards,

Vishal

Former Member
0 Kudos

Hi,

Eddy gave the solution : You have to set the parameter wdisp/add_xforwardedfor_header in the web dispatcher profile.

Regards,

Olivier

Former Member
0 Kudos

Thanks Olivier for you quick reply ..... We have already Done that, but not sure where can we check the client IP on SAP server. SM04 shows the entry for Web dispatcher. Can you please advice on this.

Alternatively, We can see the incoming hits on Web Dispatcher at Active Connections of Web Dispatcher Admin page. We will try to capture that info for our use.

Regards,

Vishal

Former Member
0 Kudos

Hi,

With the parameter set, you will be able to generate ICM HTTP logs with the browser IP address or you can program a specific abap program to display it.

You will never see the information automagically in SM04. SM04 "does not know" that it is called through the ICM and webgui...

Regards,

Olivier

Former Member
0 Kudos

Hi,

Raja: I used HTTP-Watch, but as far as I can see there is not information at all in the request about the client IP-address

Dezso: sorry, WAS 6.20 (with 6.40 kernel), so I won't be able to use the recording.

I cannot believe that I am the only one trying to get the client-ip...

Thanks and Regards,

Stefan Hester

eddy_declercq
Active Contributor
0 Kudos

Hi,

Did you use

client_ip = request->get_header_field( 'x-forwarded-for' ).

already?

Eddy

former_member191062
Active Contributor
0 Kudos

Hello,

if you have WebAS > 640 you can also try the Recording:

/people/dezso.pap/blog/2006/04/05/icf-recording--a-possibility-for-analysing

Here you can check evrything what arries to the server.

Check also the view option "in new session".

Regards,

Dezso

athavanraja
Active Contributor
0 Kudos

may be you can try HTTP watch tools to watch whats being transported the HTTP reader

http://www.httpwatch.com/viewer.htm#ggviewer-offsite-nav-10167408

Regards

Raja