# Proxy ## Install trojan ``` apt install trojan ``` 编辑 `/etc/trojan/config.json`配置文件 ```json { "run_type": "client", "local_addr": "127.0.0.1", "local_port": 1080, "remote_addr": "hk3.cf4589a1-71ec-429f-b46a-892af2259b8e.yiyuan.cyou", "remote_port": 443, "password": [ "22b49ebb-0cc4-4b1a-bf38-a35c6c751f94" ], "log_level": 1, "ssl": { "verify": false, "verify_hostname": false, "cert": "", "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-SHA:AES256-SHA:DES-CBC3-SHA", "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384", "sni": "13-251-128-188.nhost.00cdn.com", "alpn": [ "h2", "http/1.1" ], "reuse_session": true, "session_ticket": false, "curves": "" }, "tcp": { "no_delay": true, "keep_alive": true, "reuse_port": false, "fast_open": false, "fast_open_qlen": 20 } } ``` ## Use proxy ### curl ```bash curl ip.sb --socks5 127.0.0.1:1080 curl google.com --socks5 127.0.0.1:1080 curl google.com -x socks5://127.0.0.1:1080 ``` ### global ```bash export ALL_PROXY="socks5://127.0.0.1:1080" # export all_proxy="socks5://127.0.0.1:1080" export http_proxy=http://192.168.41.217:10811 export https_proxy=http://192.168.41.217:10811 unset ALL_PROXY # unset all_proxy unset http_proxy unset https_proxy ``` ### git ```bash 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 git config --global user.name crj1998 git config --global user.email crj1998@sjtu.edu.cn ```