shadowsocks / go-shadowsocks2

Modern Shadowsocks in Go
Apache License 2.0
4.45k stars 1.39k forks source link

failed to start with v2ray-plugin && without "-verbose" flag #155

Closed NotRealMe closed 4 years ago

NotRealMe commented 4 years ago

start program with v2ray-plugin and without -verbose flag :

go-shadowsocks2 -s "ss://chacha20-ietf-poly1305:JustPassWD@:xxxxx" -plugin v2ray-plugin -plugin-opts "server;fast-open;host=example.com;path=/haha"

this will cause program exit with code 2(P.S. if start with a -verbose flag, it just works fine)

After some investigation, I find out program exit at https://github.com/shadowsocks/go-shadowsocks2/blob/3ebf4506d479f51f83bf934c513943adb42ab6b7/plugin.go#L89

and if I delete the if warp(also with an empty return) in

https://github.com/shadowsocks/go-shadowsocks2/blob/3ebf4506d479f51f83bf934c513943adb42ab6b7/log.go#L22

or change this line : https://github.com/shadowsocks/go-shadowsocks2/blob/3ebf4506d479f51f83bf934c513943adb42ab6b7/log.go#L26

to

return len(p), nil

shadowsocks can works fine with v2ray-plugin and without -verbose flag enable.

lixin9311 commented 4 years ago

Thank you for reporting. Fixed in https://github.com/shadowsocks/go-shadowsocks2/commit/a57bc393e43ae203c928cf72a32dbe33340f0fcd .