-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2 cannot access Windows proxy #4402
Comments
You might be able to use your Window's IP address as described here instead of If it were me I'd do the socks proxy WSL-side. Try setting up the socks proxy entirely in your WSL 2 distro, and point your WSL2-side Heads up the devs recently added tunneling Do the profanity in 官话, that way it slips by. Bonne chance. |
Thanks for first.
still not work. I give up and spin another shadowsocks server in WSL2, and it works.
|
That's exactly the right idea. I'm sure it can be made to work like that with enough effort. It should anyway, since doing a remote socks proxy server is a common enough scenario. But the smarter play was to give up. :) |
emmmmmm, and what's this meaning?
sorry, my english is very bad. 🤣 |
The mother f--ker is frowned upon and should probably be edited in your post. But if it translates into Mandarin well, no one will over here will notice. |
OK, got it. |
Is there any place we can check to know when the |
|
Hi folks, just found another workaround: If you have installed export http_proxy=http://host.docker.internal:1080 and it just works! I have no idea about the VM's networking, but |
I didn't understand why my computer does not work when using |
@Rsweater If you cannot access |
|
@solider245 分两种情况 (仅适用于 WSL2 环境下的 git 配置) ① HTTP 访问 git,命令行: ② SSH 访问 git,编辑
In English: HOW TO CONFIG GIT WITH PROXY IN WSL2 a) You access git via HTTP: Shell command b) You access git via SSH: edit file
|
connect-proxy我没用过。proxychains4可以用不?理论上效果应该是一样的吧? |
@solider245 不需要, In English: You don't need |
请问下,这个如何设置使用git的时候自动使用proxychains呢?我现在已经可以完美实现git的时候加上proxychains前缀了。 |
sudo git config --global http.proxy socks5://172.23.144.1:10808 "Sudo" should be added, otherwise it will not take effect. |
thank you!
caowent <[email protected]> 于2020年8月14日周五 下午5:03写道:
|
You can refer to this blog(Chinese version) to set WSL2 proxy. |
This worked for me. Thank you! |
I followed this blog and I got this:
Is this normal? |
It is abnormal. If you are using V2RayN for proxy, I think that you mistake the socks port and HTTP port. |
用clash for windows改半天出不来, 默默打开了软路由里的clash |
Just a kind reminder that when LAN support of V2Ray is turned on, it will pick up another listening port to accept LAN connection and you need to ensure you are using the right port inside wsl2. In my case the default port of socks is 1080 and the listening port for LAN is 1082. |
This link is helpful to me: https://stackoverflow.com/a/72650246/15231300 |
这里是一个更好的简易解决方案:WSL Proxy Configuration 2024 New Solution (using v2rayN as an example) - Simple and Effective WSL2中使用 网上可找到的教程多为修改DNS服务器地址、通过局域网实现proxy,如: 但上述方案实现困难,稍有不慎(如Windows防火墙等配置不正确)就会前功尽弃。且新版WSL设置proxy环境变量后,会提示: 本文提出一种WSL配置网络实现代理的新解决方案,使用网络镜像极大简化了繁琐复杂的操作流程,同时给出v2rayN配置示例,无需修改DNS和防火墙,也无需开启局域网共享,可放心操作。 |
Sorry I am late. In windows WSL2, instead of function proxy {
export http_proxy=socks5://172.19.48.1:7890; export https_proxy=socks5://172.19.48.1:7890; export all_proxy=socks5://172.19.48.1:7890;
export HTTP_PROXY=socks5://172.19.48.1:7890; export HTTPS_PROXY=socks5://172.19.48.1:7890; export ALL_PROXY=socks5://172.19.48.1:7890;
echo -e "proxy on"
}
function unproxy {
unset http_proxy https_proxy all_proxy
unset HTTP_PROXY HTTPS_PROXY ALL_PROXY
echo -e "proxy off"
}
function proxygit {
git config --global https.proxy socks5://172.19.48.1:7890
git config --global http.proxy socks5://172.19.48.1:7890
git config --global ssh.proxy socks5://172.19.48.1:7890
echo -e "git: proxy on"
}
function unproxygit {
git config --global --unset https.proxy
git config --global --unset http.proxy
git config --global --unset ssh.proxy
echo -e "git: proxy off"
} ref: HTTPS_PROXY vs https_proxy Replace the $ cat /etc/resolv.conf # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.19.48.1 So the host IP is : Also ensure the proxy software allows connections from LAN. Maybe trying to restart the proxy software helps too. |
Your Windows build number: Microsoft Windows [版本 10.0.18956.1000]
What you're doing and what's happening:
I come from China, because of GFW, I cannot access the API of Hacker News, so I have to start a proxy. I use shadowsocks to start a proxy on port 10808, it workd fine, I can access Google.com.
I can access sites like Google and hacker news, with
netstata -an
in power shell:then I set the proxy:
and I want use this proxy in my WSL2, it shows in WSL2, the port is free for use
The text was updated successfully, but these errors were encountered: