Windows XP 透明代理
我有一个在 Windows XP 下运行的实验性 TCP/IP 堆栈。该堆栈使用 LSP 和 NDIS IM 绕过 Windows TCP/IP 堆栈。我现在需要为此提供代理服务,以支持想要使用实验堆栈的其他平台。代理必须对客户端透明(无客户端配置)。我想在用户模式下运行此代理服务,在该模式下,我使用正常的 Windows TCP/IP 与客户端建立 TCP 连接,并通过实验堆栈以另一种方式建立 TCP 连接。一旦以这种方式连接,代理只需在两者之间读取/写入。我正在努力解决的问题是如何从客户端获取发往某个地址/端口的传入数据包并将其重定向到我的代理,同时仍然保留原始目标地址/端口的信息,以便代理可以转发数据包到正确的目的地。我将不胜感激对此的任何想法。谢谢...
I have an experimental TCP/IP stack running under Windows XP. This stack bypasses the Windows TCP/IP stack using a LSP and a NDIS IM. I now have a requirement to provide a proxy service for this to support other platforms that want to use the experimental stack. The proxy must be transparent to the clients (no client configuration). I want to run this proxy service in user mode where I have a TCP connection towards the client using normal Windows TCP/IP and a TCP connection the other way through the experimental stack. Once connected this way, the proxy just reads/writes between the two. The problem I am wrestling with is how to take an incoming packet from the client that is destined to some address/port and redirect it to my proxy while still maintaining the knowledge of the original destination address/port, so the proxy can forward the packets to the proper destination. I would appreciate any ideas on this. Thanks...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发送一系列目的地,按时间倒序阅读[我希望这个词在这种情况下有效]顺序。每次从节点读取消息时,该节点都会删除零处的元素并将所有其他元素向前移动。 。 。 。我认为这是一个相当简单的问题。 。 。
详细信息:我在第一份工作中使用过类似的系统。发送机器只会知道目的地,它会连同目的地端口和 IP 一起发送。然后我们称其为“邮递员”服务器,检查哪些服务器可用,即。伪代码:
我喜欢用 python 编码,所以我讨厌声明变量 [抱歉] 我希望你能理解
nodes = postman.checkAvailableNodes()\\这将返回一个矩阵,其中每个元素包含网络上任何可用节点上的 IP 地址和可用端口
\\循环遍历所有可用的目的地并映射到目的地服务器的路由
对于节点中的 n:
nodeArray2 = n[0].checkavailablenodes()
如果长度(nodeArray2)> 0:
对于 nodeArray2 中的 x:
。 。 。 .
无论如何。 。获得目标节点和端口后,将 IP 和端口号添加到名为目的的数组中,每次经过服务器时该数组都会减少一个元素,最终到达服务器
send an array of destinations, reading in reverse chronological[i hope this word works in this context] order. and everytime the message gets read from a node, that node deletes the element at zero and shifts all the other elements forward. . . . this was a fairly simple question i think. . .
in detail: i worked on a similar system at my first job. the sending machine will only know the destination, it gets sent with the destination port and IP. then lets call it a "postman" server checks which servers are available ie. pseudocode:
i love coding in python so i hate declaring variables [sorry] i hope you can comprehend
nodes = postman.checkAvailableNodes()\\this will return a matrix with each element containing an ipaddress and available port on whichever available node on the network
\\loop through all available destinations and map a route to the destination server
for n in nodes:
nodeArray2 = n[0].checkavailablenodes()
if length(nodeArray2) > 0:
for x in nodeArray2:
. . . .
anyways. . .once you get the destination node and port, you add the IPs and port numbers to an array called destinations, which will reduce by one element everytime you pass through a server and eventually you'll reach the server