本來使用trojan,試用trojan-go,將trojan的config file,cp去/etc/trojan-go的路徑,用trojan-go執行它,能成功,但當按照trojan-go文檔,加上websocket後,卻報錯了:
Loaded: loaded (/lib/systemd/system/trojan-go.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2020-06-01 08:36:16 HKT; 2s ago
Docs: https://github.com/p4gefau1t/trojan-go
Process: 6936 ExecStart=/usr/bin/trojan-go/trojan-go -config /etc/trojan-go/config.json (code=exited, status=23)
Main PID: 6936 (code=exited, status=23)
Jun 01 08:36:16 ubuntu systemd[1]: Started Trojan-Go - An unidentifiable mechanism that helps you bypass GFW.
Jun 01 08:36:16 ubuntu trojan-go[6936]: [INFO] 2020/06/01 08:36:16 Trojan-Go v0.5.1
Jun 01 08:36:16 ubuntu trojan-go[6936]: [INFO] 2020/06/01 08:36:16 Loading config file from /etc/trojan-go/config.json
Jun 01 08:36:16 ubuntu trojan-go[6936]: [ERROR] 2020/06/01 08:36:16 github.com/p4gefau1t/trojan-go/proxy.(*proxyOption).Handle:option.go:38 Failed to parse config file | inval>
Jun 01 08:36:16 ubuntu systemd[1]: trojan-go.service: Main process exited, code=exited, status=23/n/a
Jun 01 08:36:16 ubuntu systemd[1]: trojan-go.service: Failed with result ```
最奇怪的是,當我在config.json裡刪除websocket的代碼,restart trojan-go service,仍然會報錯,我要把原本trojan的config.json,再cp一次去/etc/trojan-go,才能再次正常啟動。
{
"run_type": "server",
"local_addr": "::",
"local_port": 443,
"remote_addr": "::",
"remote_port": 80,
"password": [
"password1",
"password2"
],
"log_level": 0,
"ssl": {
"cert": "/path/fullchain.cer",
"key": "/path/cert.key",
"key_password": "",
"cipher": "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384",
"cipher_tls13":"TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
"prefer_server_cipher": true,
"alpn": [
"http/1.1",
"h2"
],
"reuse_session": true,
"session_ticket": false,
"session_timeout": 600,
"plain_http_response": "",
"curves": "secp384r1",
"dhparam": "/etc/nginx/ssl/dhparam.pem"
},
"tcp": {
"prefer_ipv4": false,
"no_delay": true,
"keep_alive": true,
"reuse_port": false,
"fast_open": true,
"fast_open_qlen": 20
},
"mysql": {
"enabled": false,
"server_addr": "127.0.0.1",
"server_port": 3306,
"database": "trojan",
"username": "trojan",
"password": ""
}
}