Request.Url.Port gives the wrong port

I was provided with a Live IP from my support http://201.121.152.168:68/ something like http://201.121.152.168:68/ . Now, under normal conditions, you think this is a port. However, when I do Request.Host, I get 201.121.152.168 , and when I do Request.Port, I get 80 . So where does number 68 go? He does not go to either the Master or the port. That's why my whole application crashes. Can anyone suggest what is going wrong and how can I fix it?

What am I missing here?

Update: If I make request.Headers["Host"].ToString() , I get the full host with ie 201.121.152.168:68 port

+4
source share
1 answer

I would suggest that your support team corrected port 68 on your firewall to point to an internal border of 80. So from your server’s point of view, the request comes to port 80. Perhaps this is the case?

UrlReferrer will give you the correct port, as far as I know, because it is sent from a browser (which sees a URL with port 68).

+5
source

All Articles