Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - HttpContext.Current.Request.UserHostAddress issue

 
Thread Tools Search this Thread
Old 04-11-2005, 08:47 PM   #1
Default HttpContext.Current.Request.UserHostAddress issue


hi all

This problem is odd. in a web service, I try to get the client's IP address
from the HttpContext object, but it seems to fail to get the proper IP, now
in this development environment, we are working on the client site, I don't
really have a clear understanding of their network layout, but it is
possible that their are using a proxy server to do all Http requset thus the
IP in the context is the proxy server IP, any inside?


Kevin




Kevin Yu
  Reply With Quote
Old 04-11-2005, 09:11 PM   #2
Karl Seguin
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue
yes..very possible/likely...ASP.Net can only show what's available in the
HTTPHeaders....so proxies/routers can certainly effect this and many other
fields..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kevin Yu" <> wrote in message
news:...
> hi all
>
> This problem is odd. in a web service, I try to get the client's IP

address
> from the HttpContext object, but it seems to fail to get the proper IP,

now
> in this development environment, we are working on the client site, I

don't
> really have a clear understanding of their network layout, but it is
> possible that their are using a proxy server to do all Http requset thus

the
> IP in the context is the proxy server IP, any inside?
>
>
> Kevin
>
>





Karl Seguin
  Reply With Quote
Old 04-11-2005, 09:25 PM   #3
Kevin Yu
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue
what happened is all web app use a sign on portal which authenticate user
then redirect them to the appropriate application and the login portal is
hosted on the web farm, I guess that's what cause the problem.

I guess there is no way I can get the proper IP in this kind of setup.



"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:...
> yes..very possible/likely...ASP.Net can only show what's available in the
> HTTPHeaders....so proxies/routers can certainly effect this and many other
> fields..
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is
> annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
> "Kevin Yu" <> wrote in message
> news:...
> > hi all
> >
> > This problem is odd. in a web service, I try to get the client's IP

> address
> > from the HttpContext object, but it seems to fail to get the proper IP,

> now
> > in this development environment, we are working on the client site, I

> don't
> > really have a clear understanding of their network layout, but it is
> > possible that their are using a proxy server to do all Http requset thus

> the
> > IP in the context is the proxy server IP, any inside?
> >
> >
> > Kevin
> >
> >

>
>





Kevin Yu
  Reply With Quote
Old 04-12-2005, 02:56 AM   #4
WJ
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue

"Kevin Yu" <> wrote in message
news:...
>
> I guess there is no way I can get the proper IP in this kind of setup.
>


Absolutely not ! This also will make life a little bit harder for hackers.
They can still get to the real meat, but it will be harder.

John




WJ
  Reply With Quote
Old 04-12-2005, 06:23 PM   #5
Kevin Yu
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue

"WJ" <> wrote in message
news:...
>
> "Kevin Yu" <> wrote in message
> news:...
> >
> > I guess there is no way I can get the proper IP in this kind of setup.
> >

>
> Absolutely not ! This also will make life a little bit harder for hackers.
> They can still get to the real meat, but it will be harder.


How in .NET? I mean the HttpContext doesn't even contain the source IP (I
guess it's the proxy IP)





>
> John
>
>





Kevin Yu
  Reply With Quote
Old 04-12-2005, 08:13 PM   #6
WJ
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue

"Kevin Yu" <> wrote in message
news:...
> How in .NET? I mean the HttpContext doesn't even contain the source IP (I
> guess it's the proxy IP)
>


Asp.net will return the Proxy IP, not the original IP. If your server
exposes directly to outside without middle man then yes, you can see my true
IP. Otherwise, the packet is intercepted at the DMZ and all you see is your
company agent. I am not a network expert, but I think, they may be able to
arrange some kinds of special exception for your application ? You may ask
your network technician to see if this can be done.

John




WJ
  Reply With Quote
Old 04-12-2005, 09:53 PM   #7
Joerg Jooss
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue
WJ wrote:

>
> "Kevin Yu" <> wrote in message
> news:...
> > How in .NET? I mean the HttpContext doesn't even contain the source
> > IP (I guess it's the proxy IP)
> >

>
> Asp.net will return the Proxy IP, not the original IP. If your server
> exposes directly to outside without middle man then yes, you can see
> my true IP. Otherwise, the packet is intercepted at the DMZ and all
> you see is your company agent. I am not a network expert, but I
> think, they may be able to arrange some kinds of special exception
> for your application ? You may ask your network technician to see if
> this can be done.


Don't forget that proxies may a X-Forwarded-For or similar header
contains the original IP.

Cheers,
--
http://www.joergjooss.de
mailto:news-


Joerg Jooss
  Reply With Quote
Old 04-13-2005, 05:13 PM   #8
Kevin Yu
 
Posts: n/a
Default Re: HttpContext.Current.Request.UserHostAddress issue

"WJ" <> wrote in message
news:...
>
> "Kevin Yu" <> wrote in message
> news:...
> > How in .NET? I mean the HttpContext doesn't even contain the source IP

(I
> > guess it's the proxy IP)
> >

>
> Asp.net will return the Proxy IP, not the original IP. If your server
> exposes directly to outside without middle man then yes, you can see my

true
> IP. Otherwise, the packet is intercepted at the DMZ and all you see is

your
> company agent.


so that's what happen, I checked the network environment documentation. they
do have a
DMZ setup here. so I guess it's almost impossible to get correct source IP
then. it's their
security measure, we as developer need to follow the rules/regulations.


I am not a network expert, but I think, they may be able to
> arrange some kinds of special exception for your application ? You may ask
> your network technician to see if this can be done.
>


I don't think it's up to the network technician to decide that, it's all
politic here.



> John
>
>





Kevin Yu
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital DIGEST - LIVE UPDATE Issue 41 Ablang DVD Video 0 01-05-2004 11:54 PM
Re: odd motherboard issue hootnholler A+ Certification 0 12-19-2003 06:34 AM
Digital DIGEST - LIVE UPDATE Issue 40 Ablang DVD Video 0 12-15-2003 02:45 PM
Digital DIGEST - LIVE UPDATE Issue 39 Ablang DVD Video 0 11-29-2003 02:17 AM
Digital DIGEST - LIVE UPDATE Issue 38 Ablang DVD Video 0 11-09-2003 01:31 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46