e1732a364fed / v2ray_simple

a verysimple proxy
MIT License
529 stars 105 forks source link

[Bug] 单独配置的[[fallback]]无法正确回落 #252

Open HeXis-YS opened 1 year ago

HeXis-YS commented 1 year ago

Describe the bug【描述 bug】 当回落以[[fallback]]形式单独配置时,被verysimple忽略,导致无法正常回落。 当回落以fallback=形式在[[listen]]内配置时,可以正常回落。

To Reproduce【如何复现该bug】 按提供的配置文件运行verysimple,然后访问8443端口。

Expected behavior【预期的行为】 应该能够访问verysimple回落后的服务。

Envs (please complete the following information):【系统环境】 Clear Linux 38630, Kernel 6.2.1 verysimple 1088b279ef77e4c34405ead8913588aaa83f425e

Config file 【配置文件,客户端服务端配置都提供】

不能正常回落的配置 ```toml [app] loglevel = 0 logfile = "/root/tmp/vs_log" [[listen]] tag = "vless-tcp-in" protocol = "vlesss" uuid = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" ip = "0.0.0.0" port = 8443 version = 0 sniffing.enabled = false cert = "/usr/local/etc/xray/cert.pem" key = "/usr/local/etc/xray/cert.key" extra.tls_minVersion = "1.3" alpn = ["h2"] [[fallback]] from = ["vless-tcp-in"] dest = "/dev/shm/h2c.sock" ```
可以正常回落的配置 ```toml [app] loglevel = 0 logfile = "/root/tmp/vs_log" [[listen]] tag = "vless-tcp-in" protocol = "vlesss" uuid = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" ip = "0.0.0.0" port = 8443 version = 0 fallback = "/dev/shm/h2c.sock" sniffing.enabled = false cert = "/usr/local/etc/xray/cert.pem" key = "/usr/local/etc/xray/cert.key" extra.tls_minVersion = "1.3" alpn = ["h2"] ```

Debug Log 【Debug日志, 客户端 和 服务端 的 日志 都提供】

异常回落日志 ```json {"L":"INFO ","T":"230301 034029.828","M":"Program started","loglvl":0} {"L":"INFO ","T":"230301 034029.830","M":"zap log init complete.","logfile":"/root/tmp/vs_log"} {"L":"INFO ","T":"230301 034029.831","M":"verysimple v1.2.5-1088b279ef77e4c34405ead8913588aaa83f425e, go1.20.1 linux amd64, with advLayer packages: [grpcSimple ws] \n"} {"L":"INFO ","T":"230301 034029.833","M":"Working at","dir":"/root/tmp/fallback"} {"L":"DEBUG","T":"230301 034029.834","M":"All Given Flags","flags":{"c":"my string representation"}} {"L":"INFO ","T":"230301 034029.836","M":"Options","Log Level":"debug","UseReadv":true} {"L":"INFO ","T":"230301 034029.838","M":"Starting..."} {"L":"INFO ","T":"230301 034029.840","M":"Listening","tag":"vless-tcp-in","protocol":"tls+vless","listen_addr":"0.0.0.0:8443","defaultClient":"dual+direct","dial_addr":""} {"L":"INFO ","T":"230301 034035.304","M":"New Accepted Conn","connid":833076,"from":"1.2.3.4:54190","handler":"tls+vless://0.0.0.0:8443#vless-tcp-in"} {"L":"WARN ","T":"230301 034035.555","M":"Failed handshakeInserver","connid":833076,"handler":"0.0.0.0:8443","client RemoteAddr":"1.2.3.4:54190","error":" [ Vless Invalid version , Detail: invalid data, Data: 80 ] , with Buffer,len 148"} {"L":"WARN ","T":"230301 034035.557","M":"Invalid request and no matched fallback, hung up","connid":833076,"client RemoteAddr":"1.2.3.4:54190"} {"L":"INFO ","T":"230301 034038.905","M":"Program got close signal."} {"L":"INFO ","T":"230301 034038.907","M":"Stopping..."} ```
正常回落日志 ```json {"L":"INFO ","T":"230301 034111.605","M":"Program started","loglvl":0} {"L":"INFO ","T":"230301 034111.607","M":"zap log init complete.","logfile":"/root/tmp/vs_log"} {"L":"INFO ","T":"230301 034111.609","M":"verysimple v1.2.5-1088b279ef77e4c34405ead8913588aaa83f425e, go1.20.1 linux amd64, with advLayer packages: [grpcSimple ws] \n"} {"L":"INFO ","T":"230301 034111.610","M":"Working at","dir":"/root/tmp/fallback"} {"L":"DEBUG","T":"230301 034111.611","M":"All Given Flags","flags":{"c":"my string representation"}} {"L":"INFO ","T":"230301 034111.613","M":"Options","Log Level":"debug","UseReadv":true} {"L":"INFO ","T":"230301 034111.616","M":"Starting..."} {"L":"INFO ","T":"230301 034111.618","M":"Listening","tag":"vless-tcp-in","protocol":"tls+vless","listen_addr":"0.0.0.0:8443","defaultClient":"dual+direct","dial_addr":""} {"L":"INFO ","T":"230301 034114.790","M":"New Accepted Conn","connid":649965,"from":"1.2.3.4:54034","handler":"tls+vless://0.0.0.0:8443#vless-tcp-in"} {"L":"WARN ","T":"230301 034115.080","M":"Failed handshakeInserver","connid":649965,"handler":"0.0.0.0:8443","client RemoteAddr":"1.2.3.4:54034","error":" [ Vless Invalid version , Detail: invalid data, Data: 80 ] , with Buffer,len 148"} {"L":"DEBUG","T":"230301 034115.082","M":"Fallback to default setting","addr":"/dev/shm/h2c.sock"} {"L":"DEBUG","T":"230301 034115.084","M":"Default Route","connid":649965,"source":"/dev/shm/h2c.sock","client":"dual+direct","addr":""} {"L":"INFO ","T":"230301 034115.086","M":"Request","connid":649965,"Fallback from":"1.2.3.4:54034","Target":"unix://%2Fdev%2Fshm%2Fh2c.sock","through":"dual+direct://"} {"L":"DEBUG","T":"230301 034115.088","M":"handshake client with first payload","connid":649965,"len":148} {"L":"DEBUG","T":"230301 034115.090","M":"TryCopy","id":649965,"from":"*net.UnixConn","->":"*tlsLayer.conn"} {"L":"DEBUG","T":"230301 034115.092","M":"copying with readv","id":649965} {"L":"DEBUG","T":"230301 034115.090","M":"TryCopy","id":649965,"from":"*tlsLayer.conn","->":"*net.UnixConn"} {"L":"DEBUG","T":"230301 034115.095","M":"copying with classic method","id":649965} {"L":"INFO ","T":"230301 034118.125","M":"Program got close signal."} {"L":"INFO ","T":"230301 034118.126","M":"Stopping..."} ```

Other 【其他】

【注意,配置文件和客户端服务端配置 太长的话,前后加上三个 `, 如 ```】

SakuraSakuraSakuraChan commented 1 year ago

这流量不是h2吧,感觉没必要加alpn