Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid protocol报错如何解决 #486

Open
zohar-fzh opened this issue Feb 10, 2023 · 3 comments
Open

invalid protocol报错如何解决 #486

zohar-fzh opened this issue Feb 10, 2023 · 3 comments

Comments

@zohar-fzh
Copy link

简单描述这个 Bug


zox@a:~/Documents/trojan$ ./trojan-go -config config.json 
[INFO]  2023/02/10 16:35:49 trojan-go v0.10.6 initializing
[INFO]  2023/02/10 16:35:49 adapter listening on tcp/udp: 127.0.0.1:1080
[INFO]  2023/02/10 16:35:49 cert is unspecified, using default ca list
[INFO]  2023/02/10 16:35:49 geoip:cn loaded
[INFO]  2023/02/10 16:35:49 geoip:private loaded
[INFO]  2023/02/10 16:35:49 geosite:geolocation-!cn loaded
[INFO]  2023/02/10 16:35:49 geosite:cn loaded
[INFO]  2023/02/10 16:35:49 geosite:private loaded
[INFO]  2023/02/10 16:35:49 geosite:category-ads loaded
[INFO]  2023/02/10 16:35:49 router client created
[ERROR] 2023/02/10 16:36:07 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:07 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:07 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:07 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:08 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:09 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:09 github.com/p4gefau1t/trojan-go/tunnel/http.(*Server).acceptLoop.func1:server.go:146 http failed to read http response | unexpected EOF
[ERROR] 2023/02/10 16:36:09 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 invalid protocol
[ERROR] 2023/02/10 16:36:09 github.com/p4gefau1t/trojan-go/tunnel/http.(*Server).acceptLoop.func1:server.go:146 http failed to read http response | unexpected EOF

如何复现这个 Bug

{
    "run_type": "client",
    "local_addr": "127.0.0.1",
    "local_port": 1080,
    "remote_addr": "xxx",
    "remote_port": 443,
    "password": [
        "xxx"
    ],
    "ssl": {
        "sni": "xxx"
    },
    "mux": {
        "enabled": true
    },
    "router": {
        "enabled": true,
        "bypass": [
            "geoip:cn",
            "geoip:private",
            "geosite:cn",
            "geosite:private"
        ],
        "block": [
            "geosite:category-ads"
        ],
        "proxy": [
            "geosite:geolocation-!cn"
        ],
        "default_policy": "proxy",
        "geoip": "./geoip.dat",
        "geosite": "./geosite.dat"
    }
}
@zohar-fzh
Copy link
Author

zohar-fzh commented Feb 10, 2023

简易模式的输出是这样

zox@a:~/Documents/trojan$ ./trojan-go -client -remote xxx:443 -local 127.0.0.1:1080 -password xxx
[INFO]  2023/02/10 17:36:30 easy mode enabled, trojan-go will NOT use the config file
[INFO]  2023/02/10 17:36:30 generated config:
[INFO]  2023/02/10 17:36:30 {"run_type":"client","local_addr":"127.0.0.1","local_port":1080,"remote_addr":"fanzhanhao.tech","remote_port":443,"password":["trojan"]}
[INFO]  2023/02/10 17:36:30 adapter listening on tcp/udp: 127.0.0.1:1080
[WARN]  2023/02/10 17:36:30 tls sni is unspecified
[INFO]  2023/02/10 17:36:30 cert is unspecified, using default ca list
[ERROR] 2023/02/10 17:36:46 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:46 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:47 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:47 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:47 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:47 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 298 B
[ERROR] 2023/02/10 17:36:48 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:48 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:49 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
nhao.tech:443 -local 127.0.0.1:1080 -password trojan
[INFO]  2023/02/10 17:36:30 easy mode enabled, trojan-go will NOT use the config file
[INFO]  2023/02/10 17:36:30 generated config:
[INFO]  2023/02/10 17:36:30 {"run_type":"client","local_addr":"127.0.0.1","local_port":1080,"remote_addr":"fanzhanhao.tech","remote_port":443,"password":["trojan"]}
[INFO]  2023/02/10 17:36:30 adapter listening on tcp/udp: 127.0.0.1:1080
[WARN]  2023/02/10 17:36:30 tls sni is unspecified
[INFO]  2023/02/10 17:36:30 cert is unspecified, using default ca list
[ERROR] 2023/02/10 17:36:46 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:46 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:47 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:47 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:47 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:47 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 298 B
[ERROR] 2023/02/10 17:36:48 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe
[INFO]  2023/02/10 17:36:48 connection to detectportal.firefox.com:80 closed sent: 0 B recv: 216 B
[ERROR] 2023/02/10 17:36:49 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayConnLoop.func1.1:proxy.go:80 io: read/write on closed pipe

@zohar-fzh zohar-fzh reopened this Feb 10, 2023
@zohar-fzh
Copy link
Author

问题出在多路复用mux功能、mux关闭后报错消失,设为ture后这个报错就又出现了。

@dachengxiaoai
Copy link

我的配置mux 是关闭的 但是为什么还是报错呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants