sing-box
官网
{
"log": {
"disabled": false,
"level": "debug",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "alidns",
"address": "223.5.5.5",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "ggdns",
"address": "8.8.8.8",
"strategy": "ipv4_only",
"detour": "ss-out"
}
],
"rules": [
{
"outbound": "direct",
"server": "alidns"
},
{
"domain": [
"ipinfo.io",
"google.com"
],
"server": "ggdns"
}
],
"disable_cache": true,
"disable_expire": true
},
"inbounds": [
{
"type": "http",
"tag": "http-in",
"listen": "127.0.0.1",
"listen_port": 12345
}
],
"outbounds": [
{
"type": "shadowsocks",
"tag": "ss-out",
"server": "",
"server_port": ,
"method": "aes-128-gcm",
"password": ""
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"inbound": "http-in",
"ip_version": 4,
"network": [
"tcp"
],
"outbound": "ss-out"
},
{
"protocol": "dns",
"outbound": "dns-out"
}
],
"auto_detect_interface": true,
"final": "ss-out"
},
"experimental": {}
}
以上配置对外暴露了12345为http代理,出站使用ss服务器进行出站
{
"log": {
"disabled": false,
"level": "debug",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "alidns",
"address": "223.5.5.5",
"strategy": "ipv4_only",
"detour": "direct"
},
{
"tag": "ggdns",
"address": "8.8.8.8",
"strategy": "ipv4_only",
"detour": "ss-out"
}
],
"rules": [
{
"outbound": "direct",
"server": "alidns"
},
{
"domain": [
"ipinfo.io",
"google.com"
],
"server": "ggdns"
}
],
"disable_cache": true,
"disable_expire": true
},
"inbounds": [
{
"type": "http",
"tag": "http-in",
"listen": "127.0.0.1",
"listen_port": 12345
}
],
"outbounds": [
{
"type": "trojan",
"tag": "trojan-out",
"server": "",
"server_port": ,
"password": "",
"tls": {
"enabled": true,
"server_name": "",
"insecure": true
}
},
{
"type": "direct",
"tag": "direct"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"inbound": "http-in",
"ip_version": 4,
"network": [
"tcp"
],
"outbound": "trojan-out"
},
{
"protocol": "dns",
"outbound": "dns-out"
}
],
"auto_detect_interface": true,
"final": "trojan-out"
},
"experimental": {}
}
以上配置对外暴露了12345为http代理,出站使用trojan服务器进行出站
设置docker代理
官方教程
mkdir -p /etc/systemd/system/docker.service.d/
cat <<EOF> /etc/systemd/system/docker.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://127.0.0.1:12345"
Environment="HTTPS_PROXY=http://127.0.0.1:12345"
EOF
systemctl restart docker
docker info | grep -i proxy