chika0801 / sing-box-examples

sing-box 配置示例
https://github.com/SagerNet/sing-box
1.65k stars 276 forks source link

Hello! After running the same service node using the command line, some websites cannot be accessed and opened, but after running using V2rayN, the website can be accessed. #64

Closed zhouxinghong closed 9 months ago

zhouxinghong commented 9 months ago

Hello! After running the same service node using the command line, some websites cannot be accessed and opened, but after running using V2rayN, the website can be accessed. Is this a missing configuration? Or what is the reason?

Windows10 19044 x64 SingBox 1.6 beta2

zhouxinghong commented 9 months ago

This problem has been bothering me and I hope you can help me! Thank you very much.

zhouxinghong commented 9 months ago

The following blocked situations occur: image Using the same node running V2rayN will not block successful access. What is the reason for this?

zhouxinghong commented 9 months ago

The website said my connection was not secure and that's why it was blocked. . . how to solve this problem?

zhouxinghong commented 9 months ago

image

chika0801 commented 9 months ago

你要发你的配置,详细描述一下,看了你现在的内容,我帮不上你。

zhouxinghong commented 9 months ago

Hello! I don't have any special configuration. I just added the service node according to the configuration file you provided.

zhouxinghong commented 9 months ago
{
    "log": {
        "level": "info",
        "timestamp": true
    },
    "dns": {
        "servers": [
            {
                "tag": "dns_proxy",
                "address": "https://1.1.1.1/dns-query",
                "address_resolver": "dns_resolver",
                "strategy": "ipv4_only", // 若服务端准备好了IPv6,可改为 prefer_ipv6
                "detour": "proxy"
            },
            {
                "tag": "dns_direct",
                "address": "h3://dns.alidns.com/dns-query",
                "address_resolver": "dns_resolver",
                "strategy": "ipv4_only", // 若客户端准备好了IPv6,可改为 prefer_ipv6
                "detour": "direct"
            },
            {
                "tag": "dns_block",
                "address": "rcode://refused"
            },
            {
                "tag": "dns_fakeip",
                "address": "fakeip",
                "strategy": "ipv4_only"
            },
            {
                "tag": "dns_resolver",
                "address": "223.5.5.5",
                "strategy": "ipv4_only",
                "detour": "direct"
            }
        ],
        "rules": [
            {
                "outbound": ["any"],
                "server": "dns_resolver"
            },
            {
                "geosite": ["category-ads-all"],
                "server": "dns_block",
                "disable_cache": true
            },
            {
                "type": "logical",
                "mode": "and",
                "rules": [
                    {
                        "geosite": ["geolocation-!cn"]
                    },
                    {
                        "query_type": ["A", "AAAA"]
                    }
                ],
                "server": "dns_fakeip"
            },
            {
                "geosite": ["geolocation-!cn"],
                "server": "dns_proxy"
            },
            {
                "geosite": ["cn", "private"],
                "server": "dns_direct"
            },
            {
                "query_type": ["A", "AAAA"],
                "server": "dns_fakeip"
            }
        ],
        "independent_cache": true,
        "fakeip": {
            "enabled": true,
            "inet4_range": "198.18.0.0/15",
            "inet6_range": "fc00::/18"
        }
    },
    "route": {
        "geoip": {
            "download_url": "https://github.com/soffchen/sing-geoip/releases/latest/download/geoip.db",
            "download_detour": "proxy"
        },
        "geosite": {
            "download_url": "https://github.com/soffchen/sing-geosite/releases/latest/download/geosite.db",
            "download_detour": "proxy"
        },
        "rules": [
            {
                "protocol": "dns",
                "outbound": "dns-out"
            },
            {
                "process_name": [
                    // 直连的 Windows 可执行程序
                    "xray.exe",
                    "hysteria.exe",
                    "tuic.exe",
                    "tuic-client.exe",
                    "juicity.exe",
                    "juicity-client.exe"
                ],
                "outbound": "direct"
            },
            {
                "protocol": ["quic"],
                "outbound": "block"
            },
            {
                "geosite": ["geolocation-!cn"],
                "outbound": "proxy"
            },
            {
                "type": "logical",
                "mode": "and",
                "rules": [
                    {
                        "geosite": ["cn"]
                    },
                    {
                        "geoip": ["cn"]
                    }
                ],
                "outbound": "direct"
            },
            {
                "geosite": ["private"],
                "outbound": "direct"
            },
            {
                "geoip": ["cn", "private"],
                "outbound": "direct"
            }
        ],
        "auto_detect_interface": true
    },
    "inbounds": [
        {
            "type": "tun",
            "tag": "tun-in",
            "inet4_address": "172.19.0.1/30",
            "inet6_address": "fdfe:dcba:9876::1/126",
            "auto_route": true,
            "strict_route": true,
            "stack": "system",
            "sniff": true,
            "sniff_override_destination": false
        }
    ],
    "outbounds": [
        {
            "type": "vmess",
            "tag": "proxy",
            "server": "de.relay-idc.top", 
            "server_port": 28336,
            "uuid": "9854272-8645-4613-7458-fda5827c75fb",
            "security": "auto",
            "alter_id": 0,
            "transport": {
                "type": "ws",
                "path": "/gitee",
                "headers": {
                    "Host": "de.relay-idc.top"
                }
            }
        }
    ],
    "ntp": {
        "enabled": true,
        "server": "time.apple.com",
        "server_port": 123,
        "interval": "30m",
        "detour": "direct"
    },
    "experimental": {
        "clash_api": {
            "external_controller": "127.0.0.1:9090",
            "store_fakeip": true
        }
    }
}
chika0801 commented 9 months ago

https://github.com/chika0801/sing-box-examples/blob/main/Tun/Example_of_use_in_non-mainland_China.json

You use the configurations in the link above and try it out, those sites that won't open will open properly.

zhouxinghong commented 9 months ago

I did no special configuration, just added service nodes. . . The following error occurs. . . +0800 2023-10-22 23:29:53 ERROR [144406818 1ms] inbound/tun[tun-in]: name error

chika0801 commented 9 months ago

I cannot continue to help you find out why. There is a lot of inconvenience in typing to communicate. Some of the possible causes, when communicated by typing, I can't guess the cause.

zhouxinghong commented 9 months ago

Some nodes cannot connect to the network in the command line, but they can be connected to the network in V2rayN or Clash for Windows... Below is the error I get after running it in the command line. . .

+0800 2023-10-23 06:26:03 ERROR dns: exchange failed for dns.msftncsi.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:03 ERROR dns: exchange failed for dns.msftncsi.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:03 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:03 INFO outbound/vless[proxy]: outbound connection to 1.1.1.1:443
+0800 2023-10-23 06:26:04 ERROR dns: exchange failed for www.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:04 ERROR dns: exchange failed for www.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:04 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:06 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:06 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:07 ERROR dns: exchange failed for dns.msftncsi.com. IN A: Post "https://1.1.1.1/dns-query": tls: failed to verify certificate: x509: cannot validate certificate for 1.1.1.1 because it doesn't contain any IP SANs
+0800 2023-10-23 06:26:07 ERROR dns: exchange failed for dns.msftncsi.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:07 INFO outbound/vless[proxy]: outbound connection to 1.1.1.1:443
+0800 2023-10-23 06:26:07 INFO outbound/vless[proxy]: outbound connection to 1.1.1.1:443
+0800 2023-10-23 06:26:08 ERROR dns: exchange failed for www.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:08 ERROR dns: exchange failed for www.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:10 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:10 ERROR dns: exchange failed for play.google.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:10 INFO [3316969241 700ms] outbound/vless[proxy]: outbound connection to 1.1.1.1:443
+0800 2023-10-23 06:26:11 ERROR [3316969241 1.37s] dns: exchange failed for dns.msftncsi.com. IN A: Post "https://1.1.1.1/dns-query": remote error: tls: handshake failure
+0800 2023-10-23 06:26:15 ERROR [3316969241 5.72s] inbound/tun[tun-in]: read tcp6 [fdfe:dcba:9876::1]:7620->[fdfe:dcba:9876::2]:10006: wsarecv: An established connection was aborted by the software in your host machine.
+0800 2023-10-23 06:26:15 ERROR [741131235 49.14s] inbound/tun[tun-in]: read tcp4 172.xx.x.x:xxxx->172.xx.x.x:xxxx: wsarecv: An established connection was aborted by the software in your host machine.
+0800 2023-10-23 06:26:15 ERROR [4122296663 59.19s] inbound/tun[tun-in]: read tcp6 [fdfe:dcba:9876::1]:7620->[fdfe:dcba:9876::2]:10003: wsarecv: An established connection was aborted by the software in your host machine.
chika0801 commented 9 months ago

Some nodes cannot connect to the network in the command line, but they can be connected to the network in V2rayN or Clash for Windows...

You use v2rayN, which is a GUI for the configuration generator

You use Clash for Windows, if you are changing the clash configuration format by hand, you also need some corresponding know-how

You use sing-box.exe to run the configuration is also a hand change configuration, why some at this time does not pass, other can pass, others really can not help you, you also need to check yourself, research the configuration of which did not fill in, against the documentation of the sing-box to see, you ask me, I can not help you.

chika0801 commented 9 months ago

I can't test your configuration from me, simply because there is a risk of exposing my IP address.

I found that in the client configuration you gave

"path": "https://www.udomain.hk/sc/customer/case-study?_gl=1*1hsw0b

Are you sure this "path" is also a string of URLs in your server configuration? I was under the impression that it should be something like /abcd1234.

chika0801 commented 9 months ago

You can find a test VPS and for the sake of communication, paste how the server side and the client side configuration you used for testing were filled out.

chika0801 commented 9 months ago

I can only look at each profile you post and check if something is incorrect in my experience.

chika0801 commented 9 months ago
                "headers": {
                    "Host": "cf-wkrs-pages-vless-aoy.pages.dev"
                }

This parameter, usually the client does not need to write, may write will not affect the client can eventually connect to the successful server.

zhouxinghong commented 9 months ago

I can't test your configuration from me, simply because there is a risk of exposing my IP address.

I found that in the client configuration you gave

"path": "https://www.udomain.hk/sc/customer/case-study?_gl=1*1hsw0b

Are you sure this "path" is also a string of URLs in your server configuration? I was under the impression that it should be something like /abcd1234.

OK Yes!


Here are the original nodes:

vless://884f9b2c-767-44dd-7767-3e39ce93bb39@104.20.156.248:2087?encryption=none&type=ws&security=tls&path=https%3A%2F%2Fwww.udogfdsdsggfain.hk%2Fsc%2Fcustomer%2Fcase-study%3F_gl%3D1%2A1hsw0bx%2A_ga%2Amtewmje1mze2mc4xnjkgfgixntu2%2A_ga_4n38ns1xjw%2Amty5ndi0mzgxmi40ljaumty5dsdsndi0mzgxdsdsmi4wljgfgma..%26_ga%3D2.870817676716.1167407679.1694209387-1102153160.1692976776&host=cf-wkrs-pages-vless-aoy.pages.dev&sni=cf-wkrs-pages-vless-aoy.pages.dev#US_youtube%656gfgfggfggfgf_7

path

path=https%3A%2F%2Fwww.udkjkjkkain.hk%2Fsc%2Fcustomer%2Fcase-study%3F_gl%3D1%2A1hsw0bx%2A_ga%2Amfdfdmje1mze2mc4xnjkyotixntu2%2A_ga_4n38ns1xjw%2Amty5ndi0mzgwqxmi40ljaumty5ndi0mzfdfdmi4wljaugfgfggma..%26_ga%3D2.870898981167400509.1699766689809387-1102153160.1699898976789956

Can you try the above original node?

chika0801 commented 9 months ago

vless://884f9b2c-f0c5-44dd-a68e-3e39ce93bb39@104.20.156.248:2087......

I checked the link above, and it's from a person named US_youtube@资源分享师_7. Names like this are typically used online to share free public resource nodes. I don't want to provide assistance for why I can't use such nodes.

If you use these free nodes, and you can't access some websites, it means that the hosts of these nodes have blocked certain websites on their servers.

Please don't ask me about these kinds of nodes again, as I don't want to provide assistance for such matters.

zhouxinghong commented 9 months ago

OK! Thank you very much for telling me the real cause of the problem. I will try not to use such non-profit service nodes in the future. 👍😜

At the same time, I also hope that this project will develop better and better! 👍👍 I wish you all the best! 🎉😜Thank you again for your attentive help! 😊👏

chika0801 commented 9 months ago

You said from the start that you were using these free nodes, and I might have guessed the likely reason.

zhouxinghong commented 9 months ago

terribly sorry! 😂 But it needs to be noted: your network tool is designed very well! Very nice👍👏😜 Thank you for your attentive help! 🎉