XrayR-project / XrayR

A Xray backend framework that can easily support many panels. 一个基于Xray的后端框架,支持V2ay,Trojan,Shadowsocks协议,极易扩展,支持多面板对接
https://xrayr-project.github.io/XrayR-doc/
Mozilla Public License 2.0
1.9k stars 783 forks source link

对接 SSPanel Vmess tcp+http 节点报错 #583

Closed rapidacc closed 6 months ago

rapidacc commented 6 months ago

SSPanel Custom Config , from https://wiki.sspanel.org/#/custom-config?id=tcphttp%e7%a4%ba%e4%be%8b

{
    "offset_port_node": "12345",
    "network": "tcp",
    "security": "none",
    "header": {
        "type": "http",
        "request": {
            "path": ["/"],
              "headers": {
                "Host": ["www.baidu.com"]
            }
        },
        "response": {}
    }
}

XrayR logs:

XrayR 0.9.2 (A Xray backend that supports many panels) 
time="2024-01-15T00:07:25+08:00" level=info msg="Start the panel.."
time="2024-01-15T00:07:26+08:00" level=panic msg="infra/conf: Failed to build TCP config. > infra/conf: invalid TCP header config > json: cannot unmarshal array into Go struct field Authenticator.response of type conf.AuthenticatorResponse" Host="https://xxx.com" ID=2 Type=V2ray
panic: (*logrus.Entry) 0xc0002ef730

goroutine 1 [running]:
github.com/sirupsen/logrus.(*Entry).log(0xc0003ded20, 0x0, {0xc00055a240, 0xbd})
        github.com/sirupsen/logrus@v1.9.3/entry.go:260 +0x491
github.com/sirupsen/logrus.(*Entry).Log(0xc0003ded20, 0x0, {0xc000a8f9b0?, 0x3?, 0x3?})
        github.com/sirupsen/logrus@v1.9.3/entry.go:304 +0x48
github.com/sirupsen/logrus.(*Entry).Panic(...)
        github.com/sirupsen/logrus@v1.9.3/entry.go:342
github.com/XrayR-project/XrayR/service/controller.(*Controller).Start(0xc0001618c0)
        github.com/XrayR-project/XrayR/service/controller/controller.go:95 +0x285
github.com/XrayR-project/XrayR/panel.(*Panel).Start(0xc0000f4180)
        github.com/XrayR-project/XrayR/panel/panel.go:209 +0x5d6
github.com/XrayR-project/XrayR/cmd.run()
        github.com/XrayR-project/XrayR/cmd/root.go:106 +0x1b3
github.com/XrayR-project/XrayR/cmd.glob..func1(0xc000354500?, {0x374324d?, 0x4?, 0x374314d?})
        github.com/XrayR-project/XrayR/cmd/root.go:27 +0x13
github.com/spf13/cobra.(*Command).execute(0x5ef67c0, {0xc000104910, 0x2, 0x2})
        github.com/spf13/cobra@v1.8.0/command.go:987 +0xaa3
github.com/spf13/cobra.(*Command).ExecuteC(0x5ef67c0)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/XrayR-project/XrayR/cmd.Execute(...)
        github.com/XrayR-project/XrayR/cmd/root.go:120
main.main()
        github.com/XrayR-project/XrayR/main.go:10 +0x1a
rapidacc commented 6 months ago

SSPanel Webapi 返回的节点信息 json 如下

{
  "ret": 1,
  "data": {
    "node_group": 1,
    "node_class": 1,
    "node_speedlimit": 30,
    "traffic_rate": 1,
    "sort": 11,
    "server": "ip.address",
    "custom_config": {
      "offset_port_node": "12345",
      "network": "tcp",
      "security": "none",
      "header": {
        "type": "http",
        "request": {
          "path": [
            "/"
          ],
          "headers": {
            "Host": [
              "www.baidu.com"
            ]
          }
        },
        "response": []
      }
    },
    "type": "SSPanel-UIM",
    "version": "2023.6"
  }
}
Septrum101 commented 6 months ago

SSpanel return an error format about "response": [], you can goto panel group for helping.