v2board面板使用xrayR后端docker方式对接v2ray节点教程

简介

之前我们介绍过v2ray的后端对接脚本程序Aurora、v2ray-poseidon、soga,这三种,也就soga的社区版还算良

心一点,有效用户可以达到88个(有效用户讲的是你面板里的所有活跃用户的,也就是说,数量到了之后,可能会出现

未知的问题),我们这里就不讲上面那三种常见的对接了,这里主要讲的是免费开源的后端xrayR的对接,采用docker

方式部署配置

 

前端

v2board的面板之后,选择节点管理 >> 点+号 >> v2ray,进行增加一个v2ray的节点

节点名称,节点标签这个自定义随意填写,权限组事先添加好(这个影响哪些权限组可以看到节点)

节点地址配置上域名地址

TLS选择支持

连接端口和服务端口(443,8443配置的TLS,如果其他端口TLS选择不支持即可)

传输协议选websocket

{
  "path": "/ivpsr"
}

系统配置 >>  节点  >>  通讯秘钥, 这里的秘钥我们要复制出来记住等下配置config.yml会用到

 

后端

更新

这里以Debian / Ubuntu的方式进行配置,先更新系统

apt-get update && apt-get install wget curl git -y

docker和docker-compose安装

首先安装docker和docker-compose

#安装docker
curl -fsSL https://get.docker.com | bash -s docker

#安装docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# 给docker-compose赋予权限
chmod +x /usr/local/bin/docker-compose

XrayR后端安装

我使用Docker-compose来安装XrayR,先克隆XrayR的项目过来

git clone https://github.com/XrayR-project/XrayR-release

进入XrayR的目录

cd XrayR-release

编辑配置文件

vi /XrayR-release/config/config.yml

配置config.yml文件,记得格式一定要严谨些,多了空格有时候都会报错无法启动

Log:
  Level: warning # Log level: none, error, warning, info, debug 
  AccessPath: # /etc/XrayR/access.Log
  ErrorPath: # /etc/XrayR/error.log
DnsConfigPath: # /etc/XrayR/dns.json # Path to dns config, check https://xtls.github.io/config/dns.html for help
RouteConfigPath: # /etc/XrayR/route.json # Path to route config, check https://xtls.github.io/config/routing.html for help
InboundConfigPath: # /etc/XrayR/custom_inbound.json # Path to custom inbound config, check https://xtls.github.io/config/inbound.html for help
OutboundConfigPath: # /etc/XrayR/custom_outbound.json # Path to custom outbound config, check https://xtls.github.io/config/outbound.html for help
ConnectionConfig:
  Handshake: 4 # Handshake time limit, Second
  ConnIdle: 30 # Connection idle time limit, Second
  UplinkOnly: 2 # Time limit when the connection downstream is closed, Second
  DownlinkOnly: 4 # Time limit when the connection is closed after the uplink is closed, Second
  BufferSize: 64 # The internal cache size of each connection, kB
Nodes:
  -
    PanelType: "选NewV2board或者v2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
    ApiConfig:
      ApiHost: "配置的面板网址"
      ApiKey: "配置通讯秘钥"
      NodeID: 10
      NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin
      Timeout: 30 # Timeout for the api request
      EnableVless: false # Enable Vless for V2ray Type
      EnableXTLS: false # Enable XTLS for V2ray and Trojan
      SpeedLimit: 0 # Mbps, Local settings will replace remote settings, 0 means disable
      DeviceLimit: 0 # Local settings will replace remote settings, 0 means disable
      RuleListPath: # /etc/XrayR/rulelist Path to local rulelist file
    ControllerConfig:
      ListenIP: 0.0.0.0 # IP address you want to listen
      SendIP: 0.0.0.0 # IP address you want to send pacakage
      UpdatePeriodic: 60 # Time to update the nodeinfo, how many sec.
      EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
      DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy
      EnableProxyProtocol: false # Only works for WebSocket and TCP
      AutoSpeedLimitConfig:
        Limit: 0 # Warned speed. Set to 0 to disable AutoSpeedLimit (mbps)
        WarnTimes: 0 # After (WarnTimes) consecutive warnings, the user will be limited. Set to 0 to punish overspeed user immediately.
        LimitSpeed: 0 # The speedlimit of a limited user (unit: mbps)
        LimitDuration: 0 # How many minutes will the limiting last (unit: minute)
      GlobalDeviceLimitConfig:
        Enable: false # Enable the global device limit of a user
        RedisAddr: 127.0.0.1:6379 # The redis server address
        RedisPassword: YOUR PASSWORD # Redis password
        RedisDB: 0 # Redis DB
        Timeout: 5 # Timeout for redis request
        Expiry: 60 # Expiry time (second)
      EnableFallback: false # Only support for Trojan and Vless
      FallBackConfigs:  # Support multiple fallbacks
        -
          SNI: # TLS SNI(Server Name Indication), Empty for any
          Alpn: # Alpn, Empty for any
          Path: # HTTP PATH, Empty for any
          Dest: 80 # Required, Destination of fallback, check https://xtls.github.io/config/features/fallback.html for details.
          ProxyProtocolVer: 0 # Send PROXY protocol version, 0 for dsable
      CertConfig:
        CertMode: 方式DNS或者HTTP、如果不采用TLS这里选none也可以 # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
        CertDomain: "uscn2.huoche888.xyz" # Domain to cert
        CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
        KeyFile: /etc/XrayR/cert/node1.test.com.key
        Provider: 配置DNS的服务商名 # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
        Email: 配置邮箱
        DNSEnv: # DNS ENV option used by DNS provider
          配置DNS服务商_EMAIL: 配置DNS服务商注册的邮箱账号填这
          配置DNS服务商_API_KEY: 配置服务商API填这
  # -
  #   PanelType: "NewV2board" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
  #   ApiConfig:
  #     ApiHost: "http://127.0.0.1:668"
  #     ApiKey: "123"
  #     NodeID: 4
  #     NodeType: Shadowsocks # Node type: V2ray, Shadowsocks, Trojan
  #     Timeout: 30 # Timeout for the api request
  #     EnableVless: false # Enable Vless for V2ray Type
  #     EnableXTLS: false # Enable XTLS for V2ray and Trojan
  #     SpeedLimit: 0 # Mbps, Local settings will replace remote settings
  #     DeviceLimit: 0 # Local settings will replace remote settings
  #   ControllerConfig:
  #     ListenIP: 0.0.0.0 # IP address you want to listen
  #     UpdatePeriodic: 10 # Time to update the nodeinfo, how many sec.
  #     EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
  #     CertConfig:
  #       CertMode: dns # Option about how to get certificate: none, file, http, dns
  #       CertDomain: "node1.test.com" # Domain to cert
  #       CertFile: /etc/XrayR/cert/node1.test.com.cert # Provided if the CertMode is file
  #       KeyFile: /etc/XrayR/cert/node1.test.com.pem
  #       Provider: alidns # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
  #       Email: test@me.com
  #       DNSEnv: # DNS ENV option used by DNS provider
  #         ALICLOUD_ACCESS_KEY: aaa
  #         ALICLOUD_SECRET_KEY: bbb

 

启动XrayR

完成配置文件的填写后,启动docker,这时候面板的灯应该就会亮了

docker-compose up -d

如果报错可以看下日志文件的报错信息检查一下

docker-compose logs

 

更新XrayR

如果需要更新XrayR的话,docker-compose使用下方的两条命令就能实现更新、删除容器并重启。更新之后

config.yml文件不会被更新覆盖,

提示:请在 docker-compose.yml 所在的目录下执行:

docker-compose pull
docker-compose up -d

 

阅读剩余
THE END