SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
15.51k stars 1.9k forks source link

vless ws tls error #1795

Closed DgithubA closed 4 weeks ago

DgithubA commented 1 month ago

Operating system

Windows

System version

windows 11

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

sing-box version 1.9.0

Environment: go1.22.3 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 5ff7006326e8a876d33d92b26ebd2671cdd48b9f
CGO: disabled

Description

i use vless ws tls i its didnt work and not connect to server.

log:

+0330 2024-05-27 19:35:41 ERROR [2598137143 538ms] inbound/http[http]: process connection from 127.0.0.1:42444: unexpected HTTP response status: 404
+0330 2024-05-27 19:35:41 ERROR [824222885 212ms] inbound/http[http]: process connection from 127.0.0.1:42450: unexpected HTTP response status: 404
+0330 2024-05-27 19:35:43 ERROR [408676090 4.65s] inbound/http[http]: process connection from 127.0.0.1:42422: unexpected HTTP response status: 404
+0330 2024-05-27 19:35:43 ERROR [2890060476 790ms] inbound/http[http]: process connection from 127.0.0.1:42461: unexpected HTTP response status: 404
+0330 2024-05-27 19:35:44 ERROR [2242653156 1.19s] inbound/http[http]: process connection from 127.0.0.1:42464: unexpected HTTP response status: 404

and sime time is:

inbound/http[http]: connection closed: process connection from 127.0.0.1:21775: Post "http://91.108.56.158/api": EOF

or

inbound/http[http]: connection closed: process connection from 127.0.0.1:21767: download: ws closed: 1005  | upload: io: read/write on closed pipe | Post "http://91.108.56.158/api": EOF

config:

{
  "log": {
    "level": "debug",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "tag": "remote",
        "address": "tcp://8.8.8.8",
        "detour": "direct"
      },
      {
        "tag": "local",
        "address": "223.5.5.5",
        "detour": "direct"
      },
      {
        "tag": "block",
        "address": "rcode://success"
      }
    ],
    "rules": [
      {
        "server": "local",
        "rule_set": [
          "geosite-ir"
        ]
      },
      {
        "server": "block",
        "rule_set": [
          "geosite-category-ads-all"
        ]
      }
    ]
  },
  "inbounds": [
    {
      "type": "socks",
      "tag": "socks",
      "listen": "::",
      "listen_port": 10806,
      "sniff": true,
      "sniff_override_destination": true
    },
    {
      "type": "http",
      "tag": "http",
      "listen": "::",
      "listen_port": 10807,
      "sniff": true,
      "sniff_override_destination": true
    }
  ],
  "outbounds": [
    {
      "type": "vless",
      "tag": "proxy",
      "server": "104.21.65.13",//cloud-flare ip
      "server_port": 443,
      "uuid": "e0ba05f5-1bc4-4302-875b-69b77c694c2a",
      "packet_encoding": "xudp",//i change it to other options,no difference.
      "tls": {
        "enabled": true,
        "server_name": "no.block.domain.ir",
        "insecure": false,
        "alpn": [
          "h2",
          "http/1.1"
        ],
        "utls": {
          "enabled": true,
          "fingerprint": "randomized"
        }
      },
      "transport": {
        "type": "ws",
        "path": "/somthing?ed=2048",
        "max_early_data": 0,
        "early_data_header_name": "Sec-WebSocket-Protocol",//i change it to empty,no difference.
        "headers": {
          "Host": "no.block.domain.ir"
        }
      }
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "dns",
      "tag": "dns_out"
    }
  ],
  "route": {
    "rules": [
      {
        "outbound": "dns_out",
        "protocol": [
          "dns"
        ]
      },
      {
        "outbound": "direct",
        "rule_set": [
          "geoip-ir",
          "geosite-ir"
        ]
      },
      {
        "outbound": "block",
        "rule_set": [
          "geosite-category-ads-all"
        ]
      },
      {
        "outbound": "proxy",
        "port_range": [
          "0:65535"
        ]
      }
    ],
    "rule_set": [
      {
        "tag": "geosite-ir",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ir.srs",
        "download_detour": "direct"
      },
      {
        "tag": "geoip-ir",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-ir.srs",
        "download_detour": "direct"
      },
      {
        "tag": "geosite-category-ads-all",
        "type": "remote",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
        "download_detour": "direct"
      }
    ]
  },
  "experimental": {
    "cache_file": {
      "enabled": true
    }
  }
}

Reproduction

$ .\sing-box.exe run -c .\test.json

Logs

No response

Supporter

Integrity requirements

dyhkwong commented 4 weeks ago

AFAIK vless ws does not support alpn h2.