WinDivert: redirect to proxy server listening only loopback interface

trying to implement a transparent proxy server just like in this post , but I have a "proxy" listening only on the loopback interface. As soon as I installed DstAddr in loopback, the 2nd packet of TCP message was not received

... iphdr->DstAddr = htonl(INADDR_LOOPBACK); tcphdr->DstPort = ProxyPort; addr->Direction = WINDIVERT_DIRECTION_INBOUND; ... 

but it works if DstAddr = address_of_network_interface_packet_captured_from.

Also tried changing addr :

  addr->IfIdx = 1; addr->SubIfIdx = 0; 

without any effect.

Is there any way to implement such a configuration?

+7
wfp transparentproxy
source share
1 answer

As in the original linked message, there is no code that processes the return path (i.e., connection-> proxy is processed, but proxy-> connection is not). This explains why SYNACK never accepted.

For redirection to a local proxy server, see the sample program streamdump .

0
source share

All Articles