FQ 您所在的位置:网站首页 fq代理价格查询 FQ

FQ

2024-02-07 22:17| 来源: 网络整理| 查看: 265

# Windows # 1、cmd cmd命令行:(不用socks5)(临时设置)(也可放置环境变量) set http_proxy=http://127.0.0.1:1080 set https_proxy=http://127.0.0.1:1080

恢复

# 恢复 set http_proxy= set https_proxy= # 2、PowerShell

打开 $Profile

code $Profile

编写如下内容

$env:http_proxy="http://127.0.0.1:1080" $env:https_proxy="http://127.0.0.1:1080" # 3、GitBash export http_proxy=socks:*** export https_proxy=socks:**

如果专门针对 git 可使用如下方式

git config --global http.proxy http://127.0.0.1:1080 git config --global https.proxy http://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'

取消代理

git config --global --unset http.proxy git config --global --unset https.proxy # Ubuntu export http_proxy=http://127.0.0.1:1080 # mac # Clash X 代理

终端

Clash X command + C Copy Shell Command 输出为

export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891

在终端的对应 profile 文件,编辑加入对应的内容,我就很随意的加在 bash_profile 了,大雾

export https_proxy=http://127.0.0.1:7890 export http_proxy=http://127.0.0.1:7890 export all_proxy=socks5://127.0.0.1:7891 ##上面的三行命令表示,每次新建一个终端会话时,默认让终端去走代理,这样就不需要每次都复制拷贝一下了,很方便,同时,代理程序去智能分流(国内 IP 直连,国外走代理),避免了连接国内 IP 地址时“绕远”. alias setproxy="export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7891;echo \"Set proxy successfully\" " alias unsetproxy="unset http_proxy;unset https_proxy;unset all_proxy;echo \"Unset proxy successfully\" " alias ipcn="curl myip.ipip.net" alias ip="curl ip.sb" ## 上面这几个 alias 是自定义的命令 ## unsetproxy 取消代理 ## setproxy 设置代理 ## ip & ipcn 查看 终端IP & 实际IP

Git代理配置

Host * ProxyCommand nc -X 5 -x localhost:7891 %h %p ##第一行代表所有的 ssh 的主机 ##第二行代表让所有的 ssh 的主机在连接的时候,通过你本地的端口为 7891 的 socks5 代理去连接,一般来讲,本地的 socks5 都是由FQ工具提供 ##诸如 Surge ClashX 或者 Ssr,所以,7891这个端口需要换成对应的服务端口即可

原文章链接:mac Clash X 代理 终端 (opens new window)

记录我自己放在 .zshrc 里的配置:

# git proxy alias gitproxy="git config --global http.proxy http://127.0.0.1:7890;git config --global https.proxy https://127.0.0.1:7890" alias gitunproxy="git config --global --unset http.proxy;git config --global --unset https.proxy"


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有