Skip to content

Instantly share code, notes, and snippets.

@dreamlu
Last active April 19, 2024 05:44
Show Gist options
  • Save dreamlu/cf7cbc0b8329ac145fa44342d6a1c01d to your computer and use it in GitHub Desktop.
Save dreamlu/cf7cbc0b8329ac145fa44342d6a1c01d to your computer and use it in GitHub Desktop.
windows终端翻墙,简易方式
环境:shadowsocks、windows
本地ss端口设置(这里1080)
cmd命令行:(不用socks5)(临时设置)(也可放置环境变量)
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
ps:一定要用cmd命令行,千万别用powershell !!!
简易测试命令:curl https://www.google.com(别用ping)
@sushengbuhuo
Copy link

git bash use export

@mohuilin
Copy link

mohuilin commented Oct 3, 2019

Good job!

@ShotoZhao
Copy link

可以,解决了,tks。

@Henry-ZHR
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

Copy link

ghost commented Jul 9, 2020

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

it works, thanks

@Dingzhenpiyi
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

Good job!

@YunMengs
Copy link

YunMengs commented Sep 3, 2020

刚刚发现PowerShell 走的是网络层!正好能被SSR、SS或V2Ray代理,不用手动设置了!至于CMD,那似乎有坑,我设置了代理也没用,在windows上推荐使用PowerShell。
至于Linux和Mac的shell则需要手动设置代理

@zhaopan
Copy link

zhaopan commented Nov 13, 2020

GitBash

git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'

@huweige
Copy link

huweige commented Dec 4, 2020

good job

@cnscorpions
Copy link

git bash use export

thank you, it works

@cnscorpions
Copy link

if you guys use socks instead, just configure as follows:
export http_proxy=socks:***
export https_proxy=socks:**

it works in git bash 😁

@Liuhaai
Copy link

Liuhaai commented Jun 7, 2021

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

🐂🐸

@Kaier33
Copy link

Kaier33 commented Jun 24, 2021

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

nice, it works

@wjl-simon
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

感谢大佬

@jchang98
Copy link

jchang98 commented Sep 7, 2021

感谢

@inix
Copy link

inix commented Sep 25, 2021

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

🐂🐸

感谢

@TNTSAYou
Copy link

解决了,舒坦

@xiangshu233
Copy link

@inix 大佬请问具体怎么配置的呀,试了很多方法都不行
image
我的 shadowsocks 端口也是 1080的,求大佬解惑
安装 scoop 还是报错,但是 curl https://www.google.com 测试命令却没有问题

@kakarrot0109
Copy link

SSR 如何设置WINDOWS终端代理呀?

@kakarrot0109
Copy link

刚刚发现PowerShell 走的是网络层!正好能被SSR、SS或V2Ray代理,不用手动设置了!至于CMD,那似乎有坑,我设置了代理也没用,在windows上推荐使用PowerShell。 至于Linux和Mac的shell则需要手动设置代理

为什么我开启SSR 在PowerShell里 ping www.github.com 还是超时呀

@lausannel
Copy link

刚刚发现PowerShell 走的是网络层!正好能被SSR、SS或V2Ray代理,不用手动设置了!至于CMD,那似乎有坑,我设置了代理也没用,在windows上推荐使用PowerShell。 至于Linux和Mac的shell则需要手动设置代理

为什么我开启SSR 在PowerShell里 ping www.github.com 还是超时呀

因为Ping使用的是ICMP协议,SSR应该只能代理sock5和http协议

@cnscorpions
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

这个的确可用,不过要使用正确的本地端口,如果使用v2rayN的话,可以在app界面底部看到socks5和http端口

@Tb5821
Copy link

Tb5821 commented Oct 29, 2022

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

这个的确可用,不过要使用正确的本地端口,如果使用v2rayN的话,可以在app界面底部看到socks5和http端口

确实要写对端口才行,感谢

@zhyonc
Copy link

zhyonc commented Nov 4, 2022

@inix 大佬请问具体怎么配置的呀,试了很多方法都不行 image 我的 shadowsocks 端口也是 1080的,求大佬解惑 安装 scoop 还是报错,但是 curl https://www.google.com 测试命令却没有问题

以管理员模式写入

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

以非管理员模式安装
iwr -useb get.scoop.sh | iex

@yindec
Copy link

yindec commented May 1, 2023

感谢大佬

@Zhu-Ying-Jie
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

thx, it's work

@Rainlt
Copy link

Rainlt commented Dec 6, 2023

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

very good!

@viktor-yang
Copy link

如果你设置代理后遇到类似错误

VPN cause "ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True.
你可以设置

set no_proxy=localhost, 127.0.0.1, ::1

参考:AUTOMATIC1111/stable-diffusion-webui#9089

@piczi
Copy link

piczi commented Jan 12, 2024

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

it works, thank you!

@Colorfu1
Copy link

PowerShell 的:

$env:http_proxy="http://127.0.0.1:1080"
$env:https_proxy="http://127.0.0.1:1080"

亲测可用

记得要把端口换成自己代理设置的端口,可能每个人代理用的端口不一样,需要自己看一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment