diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3602ea09..80fa2e52 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,25 +19,25 @@ jobs: matrix: job: - { name: 'hiddify-core-android', os: 'ubuntu-latest', target: 'android' } - # - { name: 'hiddify-core-linux-amd64', os: 'ubuntu-20.04', target: 'linux-amd64' } - # - { name: "hiddify-core-windows-amd64", os: 'ubuntu-latest', target: 'windows-amd64', aarch: 'x64' } - # - { name: "hiddify-core-macos-universal", os: 'macos-12', target: 'macos-universal' } - # - { name: "hiddify-core-ios", os: "macos-12", target: "ios" } - # # linux custom - # - {name: hiddify-cli-linux-amd64, goos: linux, goarch: amd64, goamd64: v1, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-amd64-v3, goos: linux, goarch: amd64, goamd64: v3, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-386, goos: linux, goarch: 386, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-arm64, goos: linux, goarch: arm64, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-armv5, goos: linux, goarch: arm, goarm: 5, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-armv6, goos: linux, goarch: arm, goarm: 6, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-armv7, goos: linux, goarch: arm, goarm: 7, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mips-softfloat, goos: linux, goarch: mips, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mips-hardfloat, goos: linux, goarch: mips, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mipsel-softfloat, goos: linux, goarch: mipsle, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mipsel-hardfloat, goos: linux, goarch: mipsle, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mips64, goos: linux, goarch: mips64, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-mips64el, goos: linux, goarch: mips64le, target: 'linux-custom', os: 'ubuntu-20.04'} - # - {name: hiddify-cli-linux-s390x, goos: linux, goarch: s390x, target: 'linux-custom', os: 'ubuntu-20.04'} + - { name: 'hiddify-core-linux-amd64', os: 'ubuntu-20.04', target: 'linux-amd64' } + - { name: "hiddify-core-windows-amd64", os: 'ubuntu-latest', target: 'windows-amd64', aarch: 'x64' } + - { name: "hiddify-core-macos-universal", os: 'macos-12', target: 'macos-universal' } + - { name: "hiddify-core-ios", os: "macos-12", target: "ios" } + # linux custom + - {name: hiddify-cli-linux-amd64, goos: linux, goarch: amd64, goamd64: v1, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-amd64-v3, goos: linux, goarch: amd64, goamd64: v3, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-386, goos: linux, goarch: 386, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-arm64, goos: linux, goarch: arm64, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-armv5, goos: linux, goarch: arm, goarm: 5, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-armv6, goos: linux, goarch: arm, goarm: 6, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-armv7, goos: linux, goarch: arm, goarm: 7, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mips-softfloat, goos: linux, goarch: mips, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mips-hardfloat, goos: linux, goarch: mips, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mipsel-softfloat, goos: linux, goarch: mipsle, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mipsel-hardfloat, goos: linux, goarch: mipsle, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mips64, goos: linux, goarch: mips64, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-mips64el, goos: linux, goarch: mips64le, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: hiddify-cli-linux-s390x, goos: linux, goarch: s390x, target: 'linux-custom', os: 'ubuntu-20.04'} runs-on: ${{ matrix.job.os }} env: diff --git a/config/option.go b/config/option.go index c0582b97..9734304c 100644 --- a/config/option.go +++ b/config/option.go @@ -6,13 +6,14 @@ import ( ) type ConfigOptions struct { - EnableFullConfig bool `json:"enable-full-config"` - LogLevel string `json:"log-level"` - EnableClashApi bool `json:"enable-clash-api"` - ClashApiPort uint16 `json:"clash-api-port"` - ClashApiSecret string `json:"web-secret"` - Region string `json:"region"` - BlockAds bool `json:"block-ads"` + EnableFullConfig bool `json:"enable-full-config"` + LogLevel string `json:"log-level"` + EnableClashApi bool `json:"enable-clash-api"` + ClashApiPort uint16 `json:"clash-api-port"` + ClashApiSecret string `json:"web-secret"` + Region string `json:"region"` + BlockAds bool `json:"block-ads"` + UseXrayCoreWhenPossible bool `json:"use-xray-core-when-possible"` // GeoIPPath string `json:"geoip-path"` // GeoSitePath string `json:"geosite-path"` Rules []Rule `json:"rules"` diff --git a/config/parser.go b/config/parser.go index d504054b..2e937277 100644 --- a/config/parser.go +++ b/config/parser.go @@ -61,7 +61,7 @@ func ParseConfigContent(contentstr string, debug bool, configOpt *ConfigOptions, return patchConfig(newContent, "SingboxParser", configOpt) } - v2rayStr, err := ray2sing.Ray2Singbox(string(content)) + v2rayStr, err := ray2sing.Ray2Singbox(string(content), configOpt.UseXrayCoreWhenPossible) if err == nil { return patchConfig([]byte(v2rayStr), "V2rayParser", configOpt) } diff --git a/go.mod b/go.mod index 73ef1f4d..0092650f 100644 --- a/go.mod +++ b/go.mod @@ -128,4 +128,4 @@ replace github.com/sagernet/wireguard-go => github.com/hiddify/wireguard-go v0.0 replace github.com/bepass-org/warp-plus => github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d -// replace github.com/hiddify/ray2sing => github.com/hiddify/ray2sing v0.0.0-20240802071553-e5ba91dc16e6 +replace github.com/hiddify/ray2sing => github.com/hiddify/ray2sing v0.0.0-20240806191321-60866735d9ec diff --git a/go.sum b/go.sum index fa7d5378..97ce1bef 100644 --- a/go.sum +++ b/go.sum @@ -104,8 +104,8 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hiddify/hiddify-sing-box v1.8.9-0.20240806124804-ee348999b0bd h1:k27QSXPpQbBxfQ4NWdOB3ckTX8p9L4sg4zvmcGB+nVY= github.com/hiddify/hiddify-sing-box v1.8.9-0.20240806124804-ee348999b0bd/go.mod h1:2wBDpGJbCEPXFy8jHkFbD2TAwxxUjKoMLXF2HTzhHfU= -github.com/hiddify/ray2sing v0.0.0-20240804185422-f340989b59a0 h1:O/BeurchSCEmZxRbnQNcv7+8dwNxkfMU6hGVNwzDo0A= -github.com/hiddify/ray2sing v0.0.0-20240804185422-f340989b59a0/go.mod h1:Qp3mFdKsJZ5TwBYLREgWp8n2O6dgmNt3aAoX+xpvnsM= +github.com/hiddify/ray2sing v0.0.0-20240806191321-60866735d9ec h1:pcmZoNGZBwsWEhPmstTunTSahm2O6yVj4cdOmorBkLk= +github.com/hiddify/ray2sing v0.0.0-20240806191321-60866735d9ec/go.mod h1:Qp3mFdKsJZ5TwBYLREgWp8n2O6dgmNt3aAoX+xpvnsM= github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d h1:vRGKh9ou+/vQGfVYa8MczhbIVjHxlP52OWwrDWO77RA= github.com/hiddify/warp-plus v0.0.0-20240717223357-4f3122e0d11d/go.mod h1:uSRUbr1CcvFrEV69FTvuJFwpzEmwO8N4knb6+Zq3Ys4= github.com/hiddify/wireguard-go v0.0.0-20240727191222-383c1da14ff1 h1:xdbHlZtzs+jijAxy85qal835GglwmjohA/srHT8gm9s=