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
2.17k stars 855 forks source link

V2Board "server is not exist" with Vless node #598

Closed JobberRT closed 9 months ago

JobberRT commented 9 months ago

Found a similiar issue here: #527 , but that issue didn't provide detailed info.

Xrayr Vesion

v0.9.1 and v0.9.2 from install script

Xrayr Config(Only the important part)

Nodes:
  -
    PanelType: "NewV2board" # Panel type: SSpanel, NewV2board, V2board, PMpanel, Proxypanel
    ApiConfig:
      ApiHost: "https://xxx.com"
      ApiKey: "abcd1234"
      NodeID: 6
      NodeType: "V2ray" # Node type: V2ray, Trojan, Shadowsocks, Shadowsocks-Plugin
      Timeout: 30 # Timeout for the api request
      EnableVless: true # Enable Vless for V2ray Type

Behavior

executable from install script failed to recognize vless type for V2Board. From code we can see if apiConfig.NodeType is true, then the url param node_type will be vless, otherwise v2ray. https://github.com/XrayR-project/XrayR/blob/561f317e243b56921929a0576d09e6ba61cb52d0/api/newV2board/v2board.go#L61-L65

Using the config above, Xrayr from install script failed to recognize vless and using v2ray as node_type, screenshot from nginx access log. image

But cloning the repo and build Xrayr in local(macOS M1), and run with the same config file will have a correct node_type and sucessfully get the server info from V2Board, screenshot from FiddlerEverywhere and add client.SetProxy("http://localhost:8866") to the code. image

JobberRT commented 9 months ago

self build Xrayr works fine on Linux(same machine that install script failed to start) with the same config file while install script version failed

image
JobberRT commented 9 months ago

Right now I have to override the script version of xrayr executable with my self build one, please check and fix this issue

JobberRT commented 9 months ago

Found the issue.

v0.9.2 is before #534 (cmooit: 911b0c2ff5629ff9af6858fa601eda80b3863022). In this commit, the url param node_type of GetNodeInfo changed from https://github.com/XrayR-project/XrayR/blob/d9971b2181f36c0cf1cfd83a5a759ccc33db5c2b/api/newV2board/v2board.go#L60 to https://github.com/XrayR-project/XrayR/blob/561f317e243b56921929a0576d09e6ba61cb52d0/api/newV2board/v2board.go#L69

which means it will use the vless instead of strings.ToLowerCase("V2ray") // config.yml ApiConfig.NodeType