I would like to use a proxy on windows such as burp or ZAP while running an application in WSL with python requests. I'm running into a bunch of errors right now:
Failed to establish a new connection: [Errno 111] Connection refused
Using python requests with the windows proxy would work (ie. {"http": constants.PROXY, "https": constants.PROXY}
) where constants.PROXY = '127.0.0.1:8080'
which is the proxy listening on windows
Found an answer to this: https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig
TLDR: I had to make a .wslconfig
file in my Windows home directory (through PowerShell), and in it I put:
[wsl2]
networkingMode=mirrored