How to send all WSL traffic through a proxy in host machine

I am using a SSH tunnel to connect to the internet on my host Windows machine. I am using proxifier to send all my traffic though port 1080 which is the proxy port. However, proxifier or selecting the proxy using windows "Proxy Settings" in settings menu doesn't seem to route WSL traffic though the proxy..

My question is how can I route WSL traffic through the proxy.

I also tried letting port 1080 though firewall (both inbound and outbound) and trying to send wsl data though proxychains to socks5 <host_IP> 1080. That didn't work either...


Solution 1:

The poster has indicated the the free HAProxy seems to have the needed functionality:

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and powers quite a number of the world's most visited ones. Over the years it has become the de-facto standard opensource load balancer, is now shipped with most mainstream Linux distributions, and is often deployed by default in cloud platforms. Since it does not advertise itself, we only know it's used when the admins report it :-)