Finding out actual TCP/IP address

U

UJ

Is there any way for a web service to find out what the TCP/IP address was
that was used to 'call in' to it? I have a C# program that's calls to a web
service and I want the web service to know the actual TCP/IP address that
was used. If I get it from the machine and send it to the webservice via the
program and you are behind a firewall/gateway/hub, you don't get the real
web address. I'd like the real honest to goodness TCP/IP address.

Any ideas?

TIA - Jeff.
 
J

John Saunders

UJ said:
Is there any way for a web service to find out what the TCP/IP address was
that was used to 'call in' to it? I have a C# program that's calls to a
web service and I want the web service to know the actual TCP/IP address
that was used. If I get it from the machine and send it to the webservice
via the program and you are behind a firewall/gateway/hub, you don't get
the real web address. I'd like the real honest to goodness TCP/IP address.

Sorry, it can't be done.

John
 
J

John Saunders

UJ said:
Is there any way for a web service to find out what the TCP/IP address was
that was used to 'call in' to it? I have a C# program that's calls to a
web service and I want the web service to know the actual TCP/IP address
that was used. If I get it from the machine and send it to the webservice
via the program and you are behind a firewall/gateway/hub, you don't get
the real web address. I'd like the real honest to goodness TCP/IP address.

Let me amend my previous reply.

It can be done - if you ask the client to give you its IP address. But you
can't just get it from the network.

John
 
U

UJ

John,
If I get the TCP/IP address at the client end, it will get the local TCP/IP
address right (behind firewall, ....) ? Not the one that it's using over the
network right?

TIA - Jeff.
 
J

John Saunders

UJ said:
John,
If I get the TCP/IP address at the client end, it will get the local
TCP/IP address right (behind firewall, ....) ? Not the one that it's using
over the network right?

Right. And that's as much the "real" IP address as any you're likely to get.

Whether this is useful to you depends on what you're trying to do. If you're
trying to uniquely identify the client, IP address isn't a good way to do
that, as it can change.

John
 
J

John Saunders

Heron said:
this.Context.Request.UserHostAddress

...this maybe, just guessing here :)

Did you read the thread? That property will return the address of the
firewall, NAT box or other Network-layer device. It will not, in general,
return you something of value, depending on what "value" you want. This
value will not be much good at identifying a particular PC if all the PCs in
the company access the Internet through the same firewall, so that they all
have the same address.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top