PROXY --> socks4/5/https_proxy两大类代理协议
ssr_local 本机或者同一个局域网,不要跨公网网络
ssr_server 是在一个合适的公网网络
web/app ssr_local ssr_server
=====================================================================================
listening
listening
connect ------ PROXY -----> accept
<-------------
request ---PROXY connect--> recv
----- https_connect --> SSL_Accept
connect_real_server
<----------------------
<----------------- send
relay --PROXY ------> recv
-----https_data SSL_Read
-->send real_server
<--recv real_server
<----https_data SSL_Write
relay <--PROXY ------- send
=====================================================================================
socks5
和socks5h
的区别是:socks5h
的域名解析在scoks5代理服务器中。
socks4a
和socks4
的区别是:socks4a
的域名解析在scoks4代理服务器中。
export ALL_PROXY=socks5h://username:password@127.0.0.1:1080
export ALL_PROXY=socks4://username:password@127.0.0.1:1080
export ALL_PROXY=socks4a://username:password@127.0.0.1:1080
set http_proxy=socks5h://username:password@127.0.0.1:1080
set https_proxy=socks5h://username:password@127.0.0.1:1080
curl支持https\socks4\socks4a\socks5\socks5h
wget支持https
curl -L -k -v -o a.html --socks5 username:123456@127.0.0.1:1080 https://www.bing.com/
curl -k -v -o a.html -x 127.0.0.1:1080 https://www.bing.com/
wget -e "https_proxy=http://127.0.0.1:1080" https://download.virtualbox.org/virtualbox/7.0.20/VirtualBox-7.0.20-163906-OSX.dmg
二选一即可
git config --global http.proxy socks5h://username:password@127.0.0.1:1080
git config --global https.proxy socks5h://username:password@127.0.0.1:1080
git config --global http.proxy socks4a://username:password@127.0.0.1:1080
git config --global https.proxy socks4a://username:password@127.0.0.1:1080
安装nmap-ncat,配合使用ncat命令,可以支持ssh协议的git仓库.
配置~/.ssh/config
文件,二选一即可.
HostName ***
User git
IdentityFile ~/.ssh/***
ProxyCommand ncat --proxy 127.0.0.1:1080 --proxy-type http %h %p
HostName ***
User git
IdentityFile ~/.ssh/***
ProxyCommand ncat --proxy 127.0.0.1:1080 --proxy-type socks4 %h %p
设置系统代理环境变量即可使用。
设置系统代理环境变量即可使用。
curl -X POST -d'u=xiaochd&p=123456' -H 'SSR_VER:1' -H 'SSR_TYPE:0' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Content-Length:18' -k -v -o a.html https://msock.duckdns.org/msock/data
curl -X POST -d'h=www.google.com&p=443' -H 'SSR_VER:1' -H 'SSR_TYPE:1' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Content-Length:21' -k -v -o a.html https://msock.duckdns.org/msock/data
curl -X POST -d'xxxxx' -H 'SSR_VER:1' -H 'SSR_TYPE:2' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Content-Length:21' -k -v -o a.html https://msock.duckdns.org/msock/data
letsencrypt是一个可以免费使用SSL/TLS域名证书的结构,每次签发的证书有效期是90天。
pip3 install certbot
使用命令行申请证书
certbot certonly --manual -d '{Domain Name}'
修改dns解析,内容是由certbot
工具限定的。
_acme-challenge TXT类型
增加一个http的请求文件,并且文件内容是由certbot
工具限定的。
请求的URL格式为:
http://{hostname}/.well-known/acme-challenge/*
实际的文件路径为:
{ROOT}/.well-known/acme-challenge/*