Web Connection
Is there a server request ip address function?
Gravatar is a globally recognized avatar based on your email address. Is there a server request ip address function?
  RESCUECOM
  All
  Mar 6, 2019 @ 03:40pm

Does west-wind web connect have a function to tell which IP Address the request is coming from?

Not the ip address of the user, but the ip address of the server making the web connect function request?

Gravatar is a globally recognized avatar based on your email address. re: Is there a server request ip address function?
  Rick Strahl
  RESCUECOM
  Mar 6, 2019 @ 06:13pm

Yes...

Try:

Request.ServerVariables("LOCAL_ADDR")

Note if you have IPv6 enabled that IP address may be a IPv6 format. To fix that you have to change the adapter to only use IPv4 - otherwise you get the v6 ip.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Is there a server request ip address function?
  RESCUECOM
  Rick Strahl
  Mar 6, 2019 @ 06:27pm

Hello Rick,

When I ask for the value of Request.ServerVariables("LOCAL_ADDR") it is empty.

Any suggestions?

Thank you,

David

Gravatar is a globally recognized avatar based on your email address. re: Is there a server request ip address function?
  Rick Strahl
  RESCUECOM
  Mar 6, 2019 @ 06:34pm

What version of IIS and Web Connection and are you running the .NET Module? I believe the variable is not automatically picked up in the ISAPI handler especially not in older versions. I do believe LOCAL_ADDR is one of the variables picked up in newer versions.

On older versions you can do the following in wc.ini (only if running ISAPI) adding an extra server variable to be picked up:

[Extra Server Variables]
Var1=LOCAL_ADDR

+++ Rick ---

© 1996-2019