在HttpWebRequest的使用客户端的IP地址 [英] Using Client IP address in HttpWebRequest

查看:171
本文介绍了在HttpWebRequest的使用客户端的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的是完全一样的问<一个href=\"http://stackoverflow.com/questions/3345387/how-to-change-originating-ip-in-httpwebrequest\">here,我不明白的回答太好了,因为我的知识,所以也许有人可以帮助我。

What I need is quite the same asked here, I don't understand the answer too well, because of my knowledge, so maybe someone could help me.

我想什么是使用连接的用户的IP地址(客户端IP),使服务器端的HttpWebRequest做的,所以我会抓住用户的IP,并用它来通话。

What I'd like to do is using the connected user's IP address (Client IP) to make the server-side HttpWebRequest, so I would grab the user's IP and make the call with it.

我想获得的是,每一个连接的用户,使HttpWebRequests与他们的IP。

What I'd like to obtain is that every connected user makes HttpWebRequests with their IP.

这可能吗?

如果是这样,我应该怎么编辑code做到这一点?

If it is, how should I edit that code to do this?

感谢。

推荐答案

这是不可能的。我的回答另一个问题是关于选择的IP地址(阅读:网络适配器),它使用一个请求。但是,你不能发明IP地址无中生有,也不能使用IP地址是不是你(在物理,连接到该计算机的意义上)。

This is impossible. My answer to the other question was about selecting which IP Address (read: network adapter) to use for a request. However, you cannot invent IP Addresses out of thin air, nor use IP Addresses that are not yours (in a physical, attached-to-this-computer sense).

现在,在技术上,采用原始套接字,你可以在你的数据包欺骗另一个IP地址。然而,这个问题是返回流量会去到您指定的IP地址,而不是一个你居然有!

Now, technically, using Raw Sockets, you can spoof another IP Address in your packets. However, the problem with that is that the return traffic will go to the IP Address you specify, not the one you actually have!

所以,我的建议是不要任何进一步推行这样的思路,寻找另一种方法做什么,那就是你正在尝试做的。

So, my advice is to not pursue this line of thought any further, and find another way to do whatever it is that you are trying to do.

这篇关于在HttpWebRequest的使用客户端的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆