fscarmen / sing-box

Sing-box 全家桶 --- 一键多协议脚本
1.27k stars 276 forks source link

iPv6 is hardcoded in Configuration files #28

Closed davidohne closed 10 months ago

davidohne commented 10 months ago

Hi! Thank you for your fabioulous script. Unfortunately in the inbounds ipv6 is hardcoded, when adding "listen: "::"". Here in europe ipv6 is not that common and there are providers where you can't use it. I had to manually change it to "listen: "0.0.0.0" otherwise the vps is not lisiting on ipv4.

Also I can't make vless and vmess work with cloudflare (with Clash Verge). All others are working. Perhaps you can send some more detailed cloudflare settings, but I think I made all right. Added the Origin Rule to the server ports and tried to enable/disable to cloudflare proxy. Doesnt work. Also sing-box is not listing on the vless and vmess ports on the vps? Is that normal?

Will have to test some more things. shadow, xtls, trojan are working.

fscarmen commented 10 months ago

Listen

"listen: "::" supports IPv4 only. My test vps is IPv4 only.

Here is my steps:

1. Install script

 This project is designed to add sing-box support for multiple protocols to VPS, details: [https://github.com/fscarmen/sing-box]
 Script Features:
         • Deploy multiple protocols with one click, there is always one for you!
         • Custom ports for nat machine with limited open ports.
         • Built-in warp chained proxy to unlock chatGPT.
         • No domain name is required.
         • Support system: Ubuntu, Debian, CentOS, Alpine and Arch Linux 3.
         • Support architecture: AMD,ARM and s390x

======================================================================================================================

 Version: v1.1.1
 New features: 1. XTLS + REALITY remove flow: xtls-reality-vision to support multiplexing and TCP brutal (requires reinstallation); 2. Clash meta add multiplexing parameter.
 System infomation:
         Operating System: Debian GNU/Linux 11 (bullseye)
         Kernel: 5.10.0-26-cloud-amd64
         Architecture: amd64v3
         Virtualization: kvm 
         IPv4: 34.172.218.144  United States  Google LLC 
         IPv6:      
         Sing-box: Not install    

======================================================================================================================

 1.  Install script 
 2.  Upgrade kernel, turn on BBR, change Linux system (sb -b) 
 3.  Install ArgoX scripts (argo + xray) [https://github.com/fscarmen/argox] 
 4.  Install sba scripts (argo + sing-box) [https://github.com/fscarmen/sba] 
 5.  Install TCP brutal 
 0 .  Exit 

 Choose: 
 Please enter the correct number [0-5] 
 This project is designed to add sing-box support for multiple protocols to VPS, details: [https://github.com/fscarmen/sing-box]
 Script Features:
         • Deploy multiple protocols with one click, there is always one for you!
         • Custom ports for nat machine with limited open ports.
         • Built-in warp chained proxy to unlock chatGPT.
         • No domain name is required.
         • Support system: Ubuntu, Debian, CentOS, Alpine and Arch Linux 3.
         • Support architecture: AMD,ARM and s390x

======================================================================================================================

 Version: v1.1.1
 New features: 1. XTLS + REALITY remove flow: xtls-reality-vision to support multiplexing and TCP brutal (requires reinstallation); 2. Clash meta add multiplexing parameter.
 System infomation:
         Operating System: Debian GNU/Linux 11 (bullseye)
         Kernel: 5.10.0-26-cloud-amd64
         Architecture: amd64v3
         Virtualization: kvm 
         IPv4: 34.172.218.144  United States  Google LLC 
         IPv6:      
         Sing-box: Not install    

======================================================================================================================

 1.  Install script 
 2.  Upgrade kernel, turn on BBR, change Linux system (sb -b) 
 3.  Install ArgoX scripts (argo + xray) [https://github.com/fscarmen/argox] 
 4.  Install sba scripts (argo + sing-box) [https://github.com/fscarmen/sba] 
 5.  Install TCP brutal 
 0 .  Exit 

 Choose: 1

 Select more protocols to install (e.g. hgbd):
 a. all (default) 
 b. XTLS + reality 
 c. hysteria2 
 d. tuic 
 e. shadowTLS 
 f. shadowsocks 
 g. trojan 
 h. vmess + ws (DNS your own domain in Cloudflare is required.) 
 i. vless + ws + tls (DNS your own domain in Cloudflare is required.) 
 j. H2 + reality 
 k. gRPC + reality 

 Choose: hi

 The order of the selected protocols and ports is as follows: 
 1 . vmess + ws 
 2 . vless + ws + tls 

 Please enter the starting port number. Must be 1000 - 65520, consecutive 2 free ports are required (Default is: 8881): 

 Please enter VPS IP (Default is: 34.172.218.144): 

 Please enter the VMESS domain name: vmess-test.formyvmess.tk

 Please enter the VLESS domain name: vless-test.formyvmess.tk

 1. cn.azhz.eu.org 
 2. www.who.int 
 3. cdn.anycast.eu.org 
 4. 443.cf.bestl.de 
 5. cfip.gay 

 Please select or enter the preferred domain, the default is cn.azhz.eu.org: 

 Please enter UUID (Default is a5ae4985-8e31-46fb-9d73-79713990d57a): 

 Please enter the node name. (Default is debian): 
Created symlink /etc/systemd/system/multi-user.target.wants/sing-box.service → /etc/systemd/system/sing-box.service.

 Sing-box open successful 

*******************************************
┌────────────────┐
│                │
│     V2rayN     │
│                │
└────────────────┘

----------------------------
vmess://eyAidiI6ICIyIiwgInBzIjogImRlYmlhbiB2bWVzcyB3cyIsICJhZGQiOiAiY24uYXpoei5ldS5vcmciLCAicG9ydCI6ICI4MCIsICJpZCI6ICJhNWFlNDk4NS04ZTMxLTQ2ZmItOWQ3My03OTcxMzk5MGQ1N2EiLCAiYWlkIjogIjAiLCAic2N5IjogIm5vbmUiLCAibmV0IjogIndzIiwgInR5cGUiOiAibm9uZSIsICJob3N0IjogInZtZXNzLXRlc3QuZm9ybXl2bWVzcy50ayIsICJwYXRoIjogIi9hNWFlNDk4NS04ZTMxLTQ2ZmItOWQ3My03OTcxMzk5MGQ1N2Etdm1lc3MiLCAidGxzIjogIiIsICJzbmkiOiAiIiwgImFscG4iOiAiIiB9

Please set the ip [34.172.218.144] to domain [vmess-test.formyvmess.tk], and set the origin rule to [8881] in Cloudflare.

----------------------------
vless://a5ae4985-8e31-46fb-9d73-79713990d57a@cn.azhz.eu.org:443?encryption=none&security=tls&sni=vless-test.formyvmess.tk&type=ws&host=vless-test.formyvmess.tk&path=%2Fa5ae4985-8e31-46fb-9d73-79713990d57a-vless%3Fed%3D2048#debian vless ws

Please set the ip [34.172.218.144] to domain [vless-test.formyvmess.tk], and set the origin rule to [8882] in Cloudflare.

*******************************************
┌────────────────┐
│                │
│  Shadowrocket  │
│                │
└────────────────┘
----------------------------

----------------------------
vmess://bm9uZTphNWFlNDk4NS04ZTMxLTQ2ZmItOWQ3My03OTcxMzk5MGQ1N2FAY24uYXpoei5ldS5vcmc6ODAK?remarks=debian%20vmess%20ws&obfsParam=vmess-test.formyvmess.tk&path=/a5ae4985-8e31-46fb-9d73-79713990d57a-vmess&obfs=websocket&alterId=0

Please set the ip [34.172.218.144] to domain [vmess-test.formyvmess.tk], and set the origin rule to [8881] in Cloudflare.

----------------------------
vless://YXV0bzphNWFlNDk4NS04ZTMxLTQ2ZmItOWQ3My03OTcxMzk5MGQ1N2FAY24uYXpoei5ldS5vcmc6NDQz?remarks=debian%20vless%20ws&obfsParam=vless-test.formyvmess.tk&path=/a5ae4985-8e31-46fb-9d73-79713990d57a-vless?ed=2048&obfs=websocket&tls=1&peer=vless-test.formyvmess.tk&allowInsecure=1

Please set the ip [34.172.218.144] to domain [vless-test.formyvmess.tk], and set the origin rule to [8882] in Cloudflare.

*******************************************
┌────────────────┐
│                │
│   Clash Meta   │
│                │
└────────────────┘
----------------------------

- {name: "debian vmess ws", type: vmess, server: cn.azhz.eu.org, port: 80, uuid: a5ae4985-8e31-46fb-9d73-79713990d57a, udp: true, tls: false, alterId: 0, cipher: none, skip-cert-verify: true, network: ws, ws-opts: { path: "/a5ae4985-8e31-46fb-9d73-79713990d57a-vmess", headers: { Host: vmess-test.formyvmess.tk, max-early-data: 2048, early-data-header-name: Sec-WebSocket-Protocol} }, smux: { enabled: true, protocol: 'h2mux', padding: true, max-connections: '8', min-streams: '16', statistic: true, only-tcp: false } }

Please set the ip [34.172.218.144] to domain [vmess-test.formyvmess.tk], and set the origin rule to [8881] in Cloudflare.

- {name: "debian vless ws", type: vless, server: cn.azhz.eu.org, port: 443, uuid: a5ae4985-8e31-46fb-9d73-79713990d57a, udp: true, tls: true, servername: vless-test.formyvmess.tk, network: ws, skip-cert-verify: true, ws-opts: { path: "/a5ae4985-8e31-46fb-9d73-79713990d57a-vless?ed=2048", headers: { Host: vless-test.formyvmess.tk } }, smux: { enabled: true, protocol: 'h2mux', padding: true, max-connections: '8', min-streams: '16', statistic: true, only-tcp: false } }

Please set the ip [34.172.218.144] to domain [vless-test.formyvmess.tk], and set the origin rule to [8882] in Cloudflare.

*******************************************
┌────────────────┐
│                │
│    NekoBox     │
│                │
└────────────────┘
----------------------------
vmess://eyJhZGQiOiJjbi5hemh6LmV1Lm9yZyIsImFpZCI6IjAiLCJob3N0Ijoidm1lc3MtdGVzdC5mb3JteXZtZXNzLnRrIiwiaWQiOiJhNWFlNDk4NS04ZTMxLTQ2ZmItOWQ3My03OTcxMzk5MGQ1N2EiLCJuZXQiOiJ3cyIsInBhdGgiOiIvYTVhZTQ5ODUtOGUzMS00NmZiLTlkNzMtNzk3MTM5OTBkNTdhLXZtZXNzIiwicG9ydCI6IjgwIiwicHMiOiJkZWJpYW4gdm1lc3Mgd3MiLCJzY3kiOiJub25lIiwic25pIjoiIiwidGxzIjoiIiwidHlwZSI6IiIsInYiOiIyIn0K

Please set the ip [34.172.218.144] to domain [vmess-test.formyvmess.tk], and set the origin rule to [8881] in Cloudflare.
----------------------------
vless://a5ae4985-8e31-46fb-9d73-79713990d57a@cn.azhz.eu.org:443?security=tls&sni=vless-test.formyvmess.tk&type=ws&path=/a5ae4985-8e31-46fb-9d73-79713990d57a-vless?ed%3D2048&host=vless-test.formyvmess.tk&encryption=none#debian%20vless%20ws

Please set the ip [34.172.218.144] to domain [vless-test.formyvmess.tk], and set the origin rule to [8882] in Cloudflare.

*******************************************
┌────────────────┐
│                │
│    Sing-box    │
│                │
└────────────────┘
----------------------------
{
  "outbounds":[
      {
        "type": "vmess",
        "tag": "debian vmess ws",
        "server":"cn.azhz.eu.org",
        "server_port":80,
        "uuid":"a5ae4985-8e31-46fb-9d73-79713990d57a",
        "transport": {
          "type":"ws",
          "path":"/a5ae4985-8e31-46fb-9d73-79713990d57a-vmess",
          "headers": {
            "Host": "vmess-test.formyvmess.tk"
          },
          "max_early_data":2048,
          "early_data_header_name":"Sec-WebSocket-Protocol"
        },
        "multiplex": {
          "enabled":true,
          "protocol":"h2mux",
          "max_streams":16,
          "padding": true
        }
      },
      {
        "type": "vless",
        "tag": "debian vless ws",
        "server":"cn.azhz.eu.org",
        "server_port":443,
        "uuid":"a5ae4985-8e31-46fb-9d73-79713990d57a",
        "tls": {
          "enabled":true,
          "server_name":"vless-test.formyvmess.tk",
          "utls": {
            "enabled":true,
            "fingerprint":"chrome"
          }
        },
        "transport": {
          "type":"ws",
          "path":"/a5ae4985-8e31-46fb-9d73-79713990d57a-vless",
          "headers": {
            "Host": "vless-test.formyvmess.tk"
          },
          "max_early_data":2048,
          "early_data_header_name":"Sec-WebSocket-Protocol"
        },
        "multiplex": {
          "enabled":true,
          "protocol":"h2mux",
          "max_streams":16,
          "padding": true
        }
      }
  ]
}

 The full template can be found at: https://t.me/ztvps/37

 Please set the ip [34.172.218.144] to domain [vmess-test.formyvmess.tk], and set the origin rule to [8881] in Cloudflare.

 Please set the ip [34.172.218.144] to domain [vless-test.formyvmess.tk], and set the origin rule to [8882] in Cloudflare.

 The script runs today: 99. Total: 8058 

 Create shortcut [ sb ] successfully. 

image image image

2. Setting the dns and origin rules

image

image image

3. V2rayN test

image
davidohne commented 10 months ago

Thank you for your fast reply! It works now... I was so intelligent to change the TLS_Server to www.gstatic.com...... When deploying, I still get this message. I feel a little bit dumb, but I don't know how to fix it..


----------------------------
The contents of the Hysteria2 configuration file need to be updated for the hysteria2 kernel.

server: ":8882"
auth: 

bandwidth:
  up: 200 mbps
  down: 1000 mbps

obfs:
  type: salamander
  salamander:
    password: 

tls:
  insecure: true

socks5:
  listen: 127.0.0.1:8882

----------------------------
The contents of the Tuic configuration file need to be updated for the sing_box kernel.

{
    "log":{
        "level":"info"
    },
    "inbounds":[
        {
            "domain_strategy":"",
            "listen":"127.0.0.1",
            "listen_port":8883,
            "sniff":true,
            "sniff_override_destination":false,
            "type":"mixed"
        }
    ],
    "outbounds":[
        {
            "congestion_control":"bbr",
            "domain_strategy":"",
            "heartbeat":"10s",
            "password":"",
            "server":"",
            "server_port":8883,
            "tag": "proxy",
            "tls":{
                "alpn":[
                    "h3",
                    "spdy/3.1"
                ],
                "certificate":"",
                "disable_sni":false,
                "enabled":true,
                "insecure":true,
                "server_name":""
            },
            "type":"tuic",
            "udp_relay_mode":"native",
            "uuid":"",
            "zero_rtt_handshake":false
        }
    ]
}

----------------------------
The contents of the ShadowTLS configuration file need to be updated for the sing_box kernel.

{
  "log":{
      "level":"info"
  },
  "inbounds":[
      {
          "domain_strategy":"",
          "listen":"127.0.0.1",
          "listen_port":8884,
          "sniff":true,
          "sniff_override_destination":false,
          "tag": "ShadowTLS",
          "type":"mixed"
      }
  ],
  "outbounds":[
      {
          "detour":"shadowtls-out",
          "domain_strategy":"",
          "method":"",
          "password":"",
          "type":"shadowsocks",
          "udp_over_tcp": false,
          "multiplex": {
            "enabled": true,
            "protocol": "h2mux",
            "max_connections": 8,
            "min_streams": 16,
            "padding": true
          }
      },
      {
          "domain_strategy":"",
          "password":"",
          "server":"",
          "server_port":8884,
          "tag": "shadowtls-out",
          "tls":{
              "enabled":true,
              "server_name":"",
              "utls": {
                "enabled": true,
                "fingerprint": "chrome"
              }
          },
          "multiplex":{
            "enabled":true,
            "padding":true
          },
          "type":"shadowtls",
          "version":3
      }
  ]
}```
fscarmen commented 10 months ago
image
davidohne commented 10 months ago
image

How to find out which domain can be used for cdn and which not? Why is who.int working and gstatic.com not?

fscarmen commented 10 months ago

How to find out which domain can be used for cdn and which not? Why is who.int working and gstatic.com not?

The domain must be hosted on cloudflare and be a anycast domain.

  1. The domain must be hosted on cloudflare:

https://icook.tw/cdn-cgi/trace

  1. It is a anycast domain.

https://ping.sx/ping?t=icook.tw