SagerNet / sing-box

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

VMess HTTP, sing-box client 无法连接至 xray server #393

Closed SimonTLS closed 1 year ago

SimonTLS commented 1 year ago

Welcome

Description of the problem

VMess HTTP, sing-box client 无法连接至 xray server sing-box client 报错 connect: connection refused. xray server 报错 invalid request, failed to read request header.

Version of sing-box

```console $ sing-box version [1.2-beta5](https://github.com/SagerNet/sing-box/releases/tag/v1.2-beta5) ```

Server and client configuration file

```console xray server config { "log": { "loglevel": "debug" }, "inbounds": [ { "listen": "0.0.0.0", "port": 2052, "protocol": "vmess", "settings": { "clients": [ { "id": "994434d1-71f2-4d42-95a9-b5049d4e2cb0", "email": "", "alterId": 0 } ] }, "streamSettings": { "network": "tcp", "security": "none", "tcpSettings": { "header": { "type": "http", "request": { "method": "GET", "path": [ "/test" ], "headers": { "Host": [ "1.1.1.1" ] } } } } } } ], "outbounds": [ { "protocol": "freedom", "settings": {} }, { "protocol": "blackhole", "settings": {}, "tag": "blocked" } ] } sing-box client config { "log": { "disabled": false, "level": "debug", "timestamp": true }, "dns": { "servers": [ { "tag": "local", "address": "tls://1.12.12.12", "detour": "direct" } ], "rules": [], "strategy": "ipv4_only" }, "inbounds": [ { "type": "mixed", "tag": "mixed-in", "listen": "127.0.0.1", "listen_port": 7890, "sniff": true, "sniff_override_destination": false } ], "outbounds": [ { "type": "vmess", "tag": "proxy", "server": "1.1.1.1", "server_port": 2052, "uuid": "994434d1-71f2-4d42-95a9-b5049d4e2cb0", "security": "auto", "alter_id": 0, "packet_encoding": "xudp", "transport": { "type": "http", "host": "1.1.1.1", "path": "/test", "method": "GET", "headers": {} } }, { "type": "direct", "tag": "direct" }, { "type": "block", "tag": "block" }, { "type": "dns", "tag": "dns-out" } ], "route": { "rules": [ { "protocol": "dns", "outbound": "dns-out" } ], "auto_detect_interface": true }, "experimental": { "clash_api": { "external_controller": "127.0.0.1:9090", "external_ui": "yacd", "secret": "" } } } ```

Server and client log file

```console xray server log 2023/03/01 05:40:11 [Info] [3456884623] app/proxyman/inbound: connection ends > proxy/vmess/inbound: invalid request from xxxx:50603 > proxy/vmess/encoding: failed to read request header > read tcp 172.26.26.178:2052->222.71.135.34:50603: i/o timeout 2023/03/01 05:40:11 xxxx:50603 rejected proxy/vmess/encoding: failed to read request header > read tcp 172.26.26.178:2052->xxxx:50603: i/o timeout sing-box client log +0800 2023-03-01 13:39:06 INFO sing-box started (0.00s) +0800 2023-03-01 13:39:10 INFO outbound/vmess[proxy]: outbound connection to www.gstatic.com:80 ```
nekohasekai commented 1 year ago

sing-box v2ray transport 中 HTTP 部分是真正的 HTTP,而不是 TCP + 伪装为 HTTP 的请求头,所以没有计划解决这个问题。

SimonTLS commented 1 year ago

非常感谢解答!