Giter VIP home page Giter VIP logo

v2bx's Introduction

V2bX

A V2board node server based on multi core, modified from XrayR.
一个基于多种内核的V2board节点服务端,修改自XrayR,支持V2ay,Trojan,Shadowsocks协议。

注意: 本项目需要V2board版本 >= 1.7.0

特点

  • 永久开源且免费。
  • 支持Vmess/Vless, Trojan, Shadowsocks, Hysteria多种协议。
  • 支持Vless和XTLS等新特性。
  • 支持单实例对接多节点,无需重复启动。
  • 支持限制在线IP。
  • 支持限制Tcp连接数。
  • 支持节点端口级别、用户级别限速。
  • 配置简单明了。
  • 修改配置自动重启实例。
  • 支持多种内核,易扩展。
  • 支持条件编译,可仅编译需要的内核。

功能介绍

功能 v2ray trojan shadowsocks hysteria
自动申请tls证书
自动续签tls证书
在线人数统计
审计规则
自定义DNS
在线IP数限制
连接数限制
跨节点IP数限制
按照用户限速
动态限速(未测试)

TODO

  • 重新实现动态限速
  • 重新实现在线IP同步(跨节点在线IP限制)
  • 完善使用文档

软件安装

一键安装

wget -N https://raw.githubusercontents.com/InazumaV/V2bX-script/master/install.sh && bash install.sh

手动安装

手动安装教程(过时待更新)

构建

# 通过-tags选项指定要编译的内核, 可选 xray, sing
go build -o V2bX -ldflags '-s -w' -gcflags="all=-trimpath=${PWD}" -asmflags="all=-trimpath=${PWD} -tags "xray sing"

配置文件及详细使用教程

详细使用教程

免责声明

  • 此项目用于本人自用,因此本人不能保证向后兼容性。
  • 由于本人能力有限,不能保证所有功能的可用性,如果出现问题请在Issues反馈。
  • 本人不对任何人使用本项目造成的任何后果承担责任。
  • 本人比较多变,因此本项目可能会随想法或思路的变动随性更改项目结构或大规模重构代码,若不能接受请勿使用。

Thanks

Stars 增长记录

Stargazers over time

v2bx's People

Contributors

dependabot[bot] avatar riolurs avatar stitchrs avatar yuzuki616 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

v2bx's Issues

V2B 配置 的Hy 无法启动.

描述该错误
启动报错
复现

V2bX start

环境和版本
Debian 11 x86 V2b 1.7.4 hy 一键脚本
V2bX
日志和错误
image


Aug 08 15:22:06 JP31N systemd[1]: Started V2bX Service.
Aug 08 15:22:07 JP31N V2bX[14543]: V2bX v2.0.4 (A V2board backend based on multi core)
Aug 08 15:22:07 JP31N V2bX[14543]: Supported cores: hy, xray
Aug 08 15:22:07 JP31N V2bX[14543]: This version need V2board version >= 1.7.0.
Aug 08 15:22:07 JP31N V2bX[14543]: The version have many changed for config, please check your config file
Aug 08 15:22:07 JP31N V2bX[14543]: time="2023-08-08T15:22:07+08:00" level=info msg="Start V2bX..."
Aug 08 15:22:07 JP31N V2bX[14543]: time="2023-08-08T15:22:07+08:00" level=fatal msg="Failed to parse the resolve preference" error="invalid preference: udp://8.8.8.8:53"
Aug 08 15:22:07 JP31N systemd[1]: V2bX.service: Main process exited, code=exited, status=1/FAILURE
Aug 08 15:22:07 JP31N systemd[1]: V2bX.service: Failed with result 'exit-code'.

额外的内容
config.yml

CoreConfig:
  Type: "hy"
  XrayConfig:
    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" # Panel type: SSpanel, V2board, NewV2board, PMpanel, Proxypanel, V2RaySocks
    ApiConfig:
      ApiHost: "https://p.baidu.com" 
      ApiKey: "123.12321312312"
      NodeID: 1  
      NodeType: hysteria # 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
      # XrayOptions:
      #   EnableDNS: false # Use custom DNS config, Please ensure that you set the dns.json well
      #   DNSType: AsIs # AsIs, UseIP, UseIPv4, UseIPv6, DNS strategy
      #   EnableTFO: false # Enable TCP Fast Open
      #   EnableProxyProtocol: false # Only works for WebSocket and TCP
      #   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 disable
      HyOptions:
        Resolver: "udp://8.8.8.8:53" # DNS resolver address
        ResolvePreference: "4" # DNS IPv4/IPv6 preference. Available options: "64" (IPv6 first, fallback to IPv4), "46" (IPv4 first, fallback to IPv6), "6" (IPv6 only), "4" (IPv4 only)
        SendDevice: "eth0" # Bind device for outbound connections (usually requires root)
      CertConfig:
        CertMode: http # Option about how to get certificate: none, file, http, tls, dns. Choose "none" will forcedly disable the tls config.
        CertDomain: "11.baidu.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.key
        Provider: cloudflare # DNS cert provider, Get the full support list here: https://go-acme.github.io/lego/dns/
        Email: [email protected]

我提供了类似 xray 的 docker-compose 部署方式

# Build go
FROM golang:1.21-alpine AS builder
WORKDIR /app
ENV CGO_ENABLED=0
ENV version=v3.0.0
RUN  apk --update --no-cache add tzdata ca-certificates git
RUN  git clone https://github.com/InazumaV/V2bX.git . &&git checkout v3.0.0 && \
     go build -v -o V2bX -tags "sing xray with_reality_server with_quic" -trimpath -ldflags "-X 'github.com/InazumaV/V2bX/cmd.version=$version' -s -w -buildid="


# Release
FROM  alpine
# 安装必要的工具包
RUN  apk --update --no-cache add tzdata ca-certificates git \
    && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN mkdir /etc/V2bX
COPY --from=builder /app/V2bX /usr/local/bin
COPY --from=builder /app/example /etc/V2bX
RUN  mv /etc/V2bX/config.json /etc/V2bX/config.json

ENTRYPOINT [ "V2bX", "server"]
~                               

提供的 yml

version: '3.8'
services:
  xrayr:
    build:
      context: ./
      dockerfile: Dockerfile
    volumes:
      - ./config:/etc/V2bX # 映射配置文件夹
    restart: always
    network_mode: host

再执行启动之后报错了

报错如下:

xrayr_1  | V2bX 1.7.2 (A V2board backend based on multi core) 
xrayr_1  | Supported cores: sing, xray
xrayr_1  | This version need V2board version >= 1.7.0.
xrayr_1  | The version have many changed for config, please check your config file
xrayr_1  | time="2023-10-19T13:12:09+08:00" level=panic msg="Failed to understand Routing config  Please check: https://xtls.github.io/config/routing.html" err="infra/conf: invalid field rule > infra/conf: failed to parse domain rule: geosite:netflix > infra/conf: failed to load geosite: NETFLIX > infra/conf: failed to load file: geosite.dat > infra/conf: failed to open file: geosite.dat > open geosite.dat: no such file or directory"
xrayr_1  | panic: (*logrus.Entry) 0xc0010fd030
xrayr_1  | 
xrayr_1  | goroutine 1 [running]:
xrayr_1  | github.com/sirupsen/logrus.(*Entry).log(0xc0010fcfc0, 0x0, {0xc000100900, 0x5d})
xrayr_1  |      github.com/sirupsen/[email protected]/entry.go:260 +0x491
xrayr_1  | github.com/sirupsen/logrus.(*Entry).Log(0xc0010fcfc0, 0x0, {0xc000e3f8a0?, 0x3308ae0?, 0xc00013b620?})
xrayr_1  |      github.com/sirupsen/[email protected]/entry.go:304 +0x48
xrayr_1  | github.com/sirupsen/logrus.(*Entry).Panic(...)
xrayr_1  |      github.com/sirupsen/[email protected]/entry.go:342
xrayr_1  | github.com/InazumaV/V2bX/core/xray.getCore(0xc00013b1a0)
xrayr_1  |      github.com/InazumaV/V2bX/core/xray/xray.go:92 +0x667
xrayr_1  | github.com/InazumaV/V2bX/core/xray.New(0x2c4d8e0?)
xrayr_1  |      github.com/InazumaV/V2bX/core/xray/xray.go:39 +0x17
xrayr_1  | github.com/InazumaV/V2bX/core.NewCore({0xc0010f9620?, 0x35bc810?, 0xc000e3fc38?})
xrayr_1  |      github.com/InazumaV/V2bX/core/core.go:23 +0x56
xrayr_1  | github.com/InazumaV/V2bX/cmd.serverHandle(0xc0010f0d00?, {0x5e7ac40?, 0x4?, 0x35970b7?})
xrayr_1  |      github.com/InazumaV/V2bX/cmd/server.go:69 +0x299
xrayr_1  | github.com/spf13/cobra.(*Command).execute(0x5e13ca0, {0x5e7ac40, 0x0, 0x0})
xrayr_1  |      github.com/spf13/[email protected]/command.go:944 +0x863
xrayr_1  | github.com/spf13/cobra.(*Command).ExecuteC(0x5e14540)
xrayr_1  |      github.com/spf13/[email protected]/command.go:1068 +0x3a5
xrayr_1  | github.com/spf13/cobra.(*Command).Execute(...)
xrayr_1  |      github.com/spf13/[email protected]/command.go:992
xrayr_1  | github.com/InazumaV/V2bX/cmd.Run()
xrayr_1  |      github.com/InazumaV/V2bX/cmd/cmd.go:15 +0x1a
xrayr_1  | main.main()
xrayr_1  |      github.com/InazumaV/V2bX/main.go:6 +0xf
  • 这是我 route 配置
{
  "domainStrategy": "rules",
  "rules": [
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "cloudflare-warp",
      "domain": [
        "geosite:netflix",
        "geosite:disney",
        "geosite:openai",
        "domain:openai.com",
        "domain:ai.com",
        "domain:azureedge.net",
        "domain:cdn.auth0.com",
        "domain:sentry.io",
        "domain:intercomcdn.com",
        "domain:intercom.io",
        "domain:google-analytics.com",
        "domain:identrust.com",
        "domain:challenges.cloudflare.com",
        "domain:ingest.sentry.io"
      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "Direct",
      "domain": [



        "geosite:cn"

      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "domain": [
        "geosite:geolocation-!cn",
        "domain:googleapis.cn",
        "domain:gstatic.com",
        "domain:cp.cloudflare.com",
        "dns.google"
      ],
      "outboundTag": "IPv*_out"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "domain": [
        "geosite:geolocation-!cn",
        "domain:googleapis.cn",
        "domain:gstatic.com",
        "domain:cp.cloudflare.com",
        "dns.google"
      ],
      "outboundTag": "IPv*_out"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "IP*_out",
      "network": "udp,tcp"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "blocked",
      "protocol": [
        "bittorrent"
      ],
      "ip": [
      
      ],
      "domain": [
        "geosite:category-ads-all"
      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "Reject",
      "domain": [
       "geosite:category-ads-all",
      "geosite:category-porn"
      ]
    }
  ]
}
  • 这是我的 config.json的配置
{
  "domainStrategy": "rules",
  "rules": [
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "cloudflare-warp",
      "domain": [
        "geosite:netflix",
        "geosite:disney",
        "geosite:openai",
        "domain:openai.com",
        "domain:ai.com",
        "domain:azureedge.net",
        "domain:cdn.auth0.com",
        "domain:sentry.io",
        "domain:intercomcdn.com",
        "domain:intercom.io",
        "domain:google-analytics.com",
        "domain:identrust.com",
        "domain:challenges.cloudflare.com",
        "domain:ingest.sentry.io"
      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "Direct",
      "domain": [



        "geosite:cn"

      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "domain": [
        "geosite:geolocation-!cn",
        "domain:googleapis.cn",
        "domain:gstatic.com",
        "domain:cp.cloudflare.com",
        "dns.google"
      ],
      "outboundTag": "IPv*_out"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "domain": [
        "geosite:geolocation-!cn",
        "domain:googleapis.cn",
        "domain:gstatic.com",
        "domain:cp.cloudflare.com",
        "dns.google"
      ],
      "outboundTag": "IPv*_out"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "IP*_out",
      "network": "udp,tcp"
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "blocked",
      "protocol": [
        "bittorrent"
      ],
      "ip": [
      
      ],
      "domain": [
        "geosite:category-ads-all"
      ]
    },
    {
      "type": "field",
"domainMatcher": "hybrid",
      "outboundTag": "Reject",
      "domain": [
       "geosite:category-ads-all",
      "geosite:category-porn"
      ]
    }
  ]
}
[root@host-by config]# cat config.json 
{
    "Log": {
    "Level": "error",
    "Output": ""
  },
  "Cores": [
    {
      "Type": "xray",
      "Log": {
        // 同 Xray-core log 部分配置

        "Level": "error"
      },
      // 静态资源文件目录
      "AssetPath": "",
      // DNS配置文件目录
      "DnsConfigPath": "/etc/V2bX/dns.json",
      // 路由配置文件目录
      "RouteConfigPath": "/etc/V2bX/route.json",
      // 本地策略相关配置
      "ConnectionConfig": {
        // 详见 https://xtls.github.io/config/policy.html#levelpolicyobject

        "handshake": 4,
        "connIdle": 300,
        "uplinkOnly": 2,
        "downlinkOnly": 5,
        "statsUserUplink": false,
        "statsUserDownlink": false,
        "bufferSize": 4
      },
      // Inbound配置文件目录
     "InboundConfigPath": "/etc/V2bX/custom_inbound.json",
      // Outbound配置文件目录
      "OutboundConfigPath": "/etc/V2bX/custom_outbound.json"
    }
  ],
  "ApiHost": "",
  "ApiKey": "",
  "NodeID": 1,
  "NodeType": "trojan",
  "Timeout": 30,
  "ListenIP": "0.0.0.0",
  "SendIP": "0.0.0.0",
  "EnableProxyProtocol": false,
  "EnableTFO": true,
  "DNSType": "UseIP",
      // 证书相关配置
      "CertConfig": {
        // 证书申请模式,none、http、dns、self
        "CertMode": "tls",

        "RejectUnknownSni": true,

        // 证书域名
        "CertDomain": "",

        // 证书文件目录
        "CertFile": "/etc/V2bX/cert/ss.cert",

        // 密钥文件目录
        "KeyFile": "/etc/V2bX/cert/ss.key",

        // 申请证书时使用的用户邮箱
        "Email": "w",

        // DNS解析提供者
        "Provider": "cloudflare",

        // DNS解析提供者的环境变量,详见 https://go-acme.github.io/lego/dns/
        "DNSEnv": {
          "CLOUDFLARE_EMAIL": "w",
          "CLOUDFLARE_API_KEY": ""
        }
      }
}

你好,方便联系下吗,

描述您想要的功能

合作,技术付费

描述您考虑过的替代方案

可否帮个忙,指导一二, 付费咨询,
或者我们合作,用你的服务器这写
可以留个联系方式,[email protected] v 13718004099

附加上下文

在此处添加有关功能请求的任何其他上下文或截图。

hysteria什么时候可以用呀

描述您想要的功能
hysteria协议
清晰简洁的功能描述。
hysteria协议现在好想对接V2board没办法订阅
描述您考虑过的替代方案
暂时没有就是特别喜欢hysteria协议
是否有任何替代方案可以解决这个问题?

附加上下文

在此处添加有关功能请求的任何其他上下文或截图。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.