开发者

Socket change in LSP

开发者 https://www.devze.com 2023-01-26 12:26 出处:网络
Is it possible to change the destination socket (IP and port) of the outgoing packets using LSP (Layered Service Provider) in Windows?

Is it possible to change the destination socket (IP and port) of the outgoing packets using LSP (Layered Service Provider) in Windows?

For example, I want to redirect all HTTP packets to a proxy server (given IP/port). This way I can create "system-wide" proxy for Windows.

I tried to include a call to WSPSendTo inside the function WSPSend to do the redirection. These two functions take the same parameters except that WSPSendTo takes two more parameters (const struct sockaddr FAR *, and int).

开发者_StackOverflow社区

The problem is that the traffic has not been directed to the proxy specified in the code. I verified this using wireshark!


You can't change the destination of a TCP socket once it has been connected, which is why calling WSPSendTo (with non NULL lpTo) has no effect. You should look at WSPConnect instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号