mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-23 01:56:48 +08:00
Compare commits
96 Commits
fallback-h
...
v24.9.7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3d9137cb6f | ||
![]() |
6838a0ae55 | ||
![]() |
3971532798 | ||
![]() |
d36e027a50 | ||
![]() |
f357245f93 | ||
![]() |
c0a98f74fc | ||
![]() |
9a953c070f | ||
![]() |
ab3c00e96b | ||
![]() |
f1c439c2aa | ||
![]() |
6baad79f98 | ||
![]() |
98e85b7f3c | ||
![]() |
002d08bf83 | ||
![]() |
8674ed5a0d | ||
![]() |
815a959c96 | ||
![]() |
1cfed96aba | ||
![]() |
592c2daf58 | ||
![]() |
5d7dfbbcac | ||
![]() |
3dd3bf94d4 | ||
![]() |
c0c23fdfeb | ||
![]() |
34e0a2fb41 | ||
![]() |
83eef6bc1f | ||
![]() |
2be03c56cb | ||
![]() |
790f908f0b | ||
![]() |
0df7fa23f8 | ||
![]() |
41d03d1856 | ||
![]() |
160316d53c | ||
![]() |
1562e1ffb9 | ||
![]() |
11b04807b9 | ||
![]() |
b612da26eb | ||
![]() |
030c9efc8c | ||
![]() |
08d1840344 | ||
![]() |
f0547bc04d | ||
![]() |
498d8eb3cc | ||
![]() |
0c7303960a | ||
![]() |
513182adf3 | ||
![]() |
a3b306aaa4 | ||
![]() |
f650d87083 | ||
![]() |
85e2ebc6f7 | ||
![]() |
9e93c19161 | ||
![]() |
96e8b8b279 | ||
![]() |
1a95add8e3 | ||
![]() |
ac628a9427 | ||
![]() |
4a1c0d7124 | ||
![]() |
661cb901de | ||
![]() |
c6d9d430bf | ||
![]() |
1dfec5056d | ||
![]() |
2a5eb3db7d | ||
![]() |
4c9e4b9de7 | ||
![]() |
644901d1a5 | ||
![]() |
7e24239c9a | ||
![]() |
4b7947cca9 | ||
![]() |
4c82ef8a1b | ||
![]() |
30af792777 | ||
![]() |
33daa0c94b | ||
![]() |
70383c50cc | ||
![]() |
521d8ef6a1 | ||
![]() |
4531a7e228 | ||
![]() |
a342db3e28 | ||
![]() |
60553a6c26 | ||
![]() |
59f6685774 | ||
![]() |
4cb2a128db | ||
![]() |
8a4217fdf5 | ||
![]() |
7cf5ee8afd | ||
![]() |
2becdd6414 | ||
![]() |
edae38c620 | ||
![]() |
36f427f22b | ||
![]() |
c27d652d80 | ||
![]() |
0f65aa8ed8 | ||
![]() |
22535d8643 | ||
![]() |
529f206d33 | ||
![]() |
964859b4bc | ||
![]() |
8deb953aec | ||
![]() |
a0040f13dd | ||
![]() |
d8994b7603 | ||
![]() |
b277bacdf6 | ||
![]() |
9288a7c0dc | ||
![]() |
c40fc44a34 | ||
![]() |
02cd3b8c74 | ||
![]() |
a7e198e1e2 | ||
![]() |
9e6d7a3cb0 | ||
![]() |
a4bc422ed1 | ||
![]() |
59819e2a1b | ||
![]() |
573fb4f643 | ||
![]() |
558cfcc507 | ||
![]() |
39675b7ef7 | ||
![]() |
16de0937a8 | ||
![]() |
c69d38ae82 | ||
![]() |
73a001dd7a | ||
![]() |
c8f6ba9ff0 | ||
![]() |
308f0c64c3 | ||
![]() |
ce637c0c23 | ||
![]() |
0d130a0489 | ||
![]() |
01a3b4912b | ||
![]() |
b8c0768b16 | ||
![]() |
4c51636788 | ||
![]() |
1113ee7fa2 |
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
12
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -13,16 +13,14 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- label: I searched issues and did not find any similar issues.
|
- label: I searched issues and did not find any similar issues.
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
- label: The problem can be successfully reproduced in the latest Release
|
||||||
attributes:
|
required: true
|
||||||
label: Version
|
|
||||||
description: Version of Xray-core
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Description
|
label: Description
|
||||||
description: Please provide a detailed description of the error. And the information you think valuable.
|
description: |-
|
||||||
|
Please provide a detailed description of the error. And the information you think valuable.
|
||||||
|
If the problem occurs after the update, please provide the **specific** version
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
14
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
14
.github/ISSUE_TEMPLATE/bug_report_zh.yml
vendored
@@ -11,18 +11,16 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- label: 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
|
- label: 我提供了完整的配置文件和日志,而不是出于自己的判断只给出截取的部分。
|
||||||
required: true
|
required: true
|
||||||
- label: 我搜索了issues,没有发现已提出的类似问题。
|
- label: 我搜索了 issues, 没有发现已提出的类似问题。
|
||||||
|
required: true
|
||||||
|
- label: 问题在 Release 最新的版本上可以成功复现
|
||||||
required: true
|
required: true
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: 版本
|
|
||||||
description: 使用的Xray-core版本
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: 描述
|
label: 描述
|
||||||
description: 请提供错误的详细描述。以及你认为有价值的信息。
|
description: |-
|
||||||
|
请提供错误的详细描述。以及你认为有价值的信息。
|
||||||
|
如果问题在更新后出现,请提供**具体**出现问题的版本号。
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
4
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
contact_links:
|
||||||
|
- name: Community Support and Questions
|
||||||
|
url: https://github.com/XTLS/Xray-core/discussions
|
||||||
|
about: Please ask and answer questions there. The issue tracker is for issues with core.
|
28
.github/docker/Dockerfile
vendored
28
.github/docker/Dockerfile
vendored
@@ -2,21 +2,27 @@
|
|||||||
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
FROM --platform=$BUILDPLATFORM golang:alpine AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
ARG TARGETOS TARGETARCH
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
|
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build -o xray -trimpath -ldflags "-s -w -buildid=" ./main
|
||||||
|
ADD https://github.com/v2fly/geoip/releases/latest/download/geoip.dat /v2fly/geoip.dat
|
||||||
|
ADD https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat /v2fly/geosite.dat
|
||||||
|
ADD https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat /loyalsoldier/geoip.dat
|
||||||
|
ADD https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat /loyalsoldier/geosite.dat
|
||||||
|
|
||||||
FROM --platform=${TARGETPLATFORM} alpine:latest
|
# chainguard/static contains only tzdata and ca-certificates, can be built with multiarch static binaries.
|
||||||
WORKDIR /root
|
FROM --platform=linux/amd64 chainguard/static:latest
|
||||||
|
WORKDIR /var/log/xray
|
||||||
COPY .github/docker/files/config.json /etc/xray/config.json
|
COPY .github/docker/files/config.json /etc/xray/config.json
|
||||||
COPY --from=build /src/xray /usr/bin/xray
|
COPY --from=build --chmod=755 /src/xray /usr/bin/xray
|
||||||
RUN set -ex \
|
|
||||||
&& apk add --no-cache tzdata ca-certificates \
|
|
||||||
&& mkdir -p /var/log/xray /usr/share/xray \
|
|
||||||
&& chmod +x /usr/bin/xray \
|
|
||||||
&& wget -O /usr/share/xray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat \
|
|
||||||
&& wget -O /usr/share/xray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
|
|
||||||
|
|
||||||
|
USER root
|
||||||
|
WORKDIR /root
|
||||||
VOLUME /etc/xray
|
VOLUME /etc/xray
|
||||||
ENV TZ=Asia/Shanghai
|
ARG TZ=Asia/Shanghai
|
||||||
|
ENV TZ=$TZ
|
||||||
ENTRYPOINT [ "/usr/bin/xray" ]
|
ENTRYPOINT [ "/usr/bin/xray" ]
|
||||||
CMD [ "-config", "/etc/xray/config.json" ]
|
CMD [ "-config", "/etc/xray/config.json" ]
|
||||||
|
|
||||||
|
ARG flavor=v2fly
|
||||||
|
COPY --from=build --chmod=644 /$flavor /usr/share/xray
|
||||||
|
42
.github/workflows/docker.yml
vendored
42
.github/workflows/docker.yml
vendored
@@ -19,7 +19,20 @@ jobs:
|
|||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ghcr.io/${{ github.repository_owner }}/xray-core
|
images: ghcr.io/${{ github.repository_owner }}/xray-core
|
||||||
flavor: latest=true
|
flavor: latest=auto
|
||||||
|
tags: |
|
||||||
|
type=sha
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
- name: Docker metadata Loyalsoldier flavor
|
||||||
|
id: loyalsoldier
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ github.repository_owner }}/xray-core
|
||||||
|
flavor: |
|
||||||
|
latest=auto
|
||||||
|
suffix=-ls,onlatest=true
|
||||||
tags: |
|
tags: |
|
||||||
type=sha
|
type=sha
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
@@ -31,18 +44,33 @@ jobs:
|
|||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- # Add support for more platforms with QEMU (optional)
|
|
||||||
# https://github.com/docker/setup-qemu-action
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
linux/loong64
|
||||||
|
linux/riscv64
|
||||||
|
provenance: false
|
||||||
file: .github/docker/Dockerfile
|
file: .github/docker/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
- name: Build and push Loyalsoldier flavor
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm64
|
||||||
|
linux/loong64
|
||||||
|
linux/riscv64
|
||||||
|
provenance: false
|
||||||
|
file: .github/docker/Dockerfile
|
||||||
|
build-args: flavor=loyalsoldier
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
${{ steps.loyalsoldier.outputs.tags }}
|
||||||
|
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -78,12 +78,15 @@ jobs:
|
|||||||
# Include amd64 on all platforms.
|
# Include amd64 on all platforms.
|
||||||
goos: [windows, freebsd, openbsd, linux, darwin]
|
goos: [windows, freebsd, openbsd, linux, darwin]
|
||||||
goarch: [amd64, 386]
|
goarch: [amd64, 386]
|
||||||
|
gotoolchain: [""]
|
||||||
|
patch-assetname: [""]
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
# Exclude i386 on darwin
|
# Exclude i386 on darwin
|
||||||
- goarch: 386
|
- goarch: 386
|
||||||
goos: darwin
|
goos: darwin
|
||||||
include:
|
include:
|
||||||
# BEIGIN MacOS ARM64
|
# BEGIN MacOS ARM64
|
||||||
- goos: darwin
|
- goos: darwin
|
||||||
goarch: arm64
|
goarch: arm64
|
||||||
# END MacOS ARM64
|
# END MacOS ARM64
|
||||||
@@ -152,6 +155,16 @@ jobs:
|
|||||||
goarch: arm
|
goarch: arm
|
||||||
goarm: 7
|
goarm: 7
|
||||||
# END OPENBSD ARM
|
# END OPENBSD ARM
|
||||||
|
# BEGIN Windows 7
|
||||||
|
- goos: windows
|
||||||
|
goarch: amd64
|
||||||
|
gotoolchain: 1.21.4
|
||||||
|
patch-assetname: win7-64
|
||||||
|
- goos: windows
|
||||||
|
goarch: 386
|
||||||
|
gotoolchain: 1.21.4
|
||||||
|
patch-assetname: win7-32
|
||||||
|
# END Windows 7
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -164,16 +177,17 @@ jobs:
|
|||||||
- name: Checkout codebase
|
- name: Checkout codebase
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Show workflow information
|
- name: Show workflow information
|
||||||
run: |
|
run: |
|
||||||
export _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$GOMIPS\"].friendlyName" -r < .github/build/friendly-filenames.json)
|
_NAME=${{ matrix.patch-assetname }}
|
||||||
|
[ -n "$_NAME" ] || _NAME=$(jq ".[\"$GOOS-$GOARCH$GOARM$GOMIPS\"].friendlyName" -r < .github/build/friendly-filenames.json)
|
||||||
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, GOMIPS: $GOMIPS, RELEASE_NAME: $_NAME"
|
echo "GOOS: $GOOS, GOARCH: $GOARCH, GOARM: $GOARM, GOMIPS: $GOMIPS, RELEASE_NAME: $_NAME"
|
||||||
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
|
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version: ${{ matrix.gotoolchain || '1.23' }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Get project dependencies
|
- name: Get project dependencies
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version: '1.23'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- name: Restore Cache
|
- name: Restore Cache
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
|
4
Makefile
4
Makefile
@@ -3,13 +3,13 @@ NAME = xray
|
|||||||
VERSION=$(shell git describe --always --dirty)
|
VERSION=$(shell git describe --always --dirty)
|
||||||
|
|
||||||
# NOTE: This MAKEFILE can be used to build Xray-core locally and in Automatic workflows. It is \
|
# NOTE: This MAKEFILE can be used to build Xray-core locally and in Automatic workflows. It is \
|
||||||
provided for convinience in automatic building and functions as a part of it.
|
provided for convenience in automatic building and functions as a part of it.
|
||||||
# NOTE: If you need to modify this file, please be aware that:\
|
# NOTE: If you need to modify this file, please be aware that:\
|
||||||
- This file is not the main Makefile; it only accepts environment variables and builds the \
|
- This file is not the main Makefile; it only accepts environment variables and builds the \
|
||||||
binary.\
|
binary.\
|
||||||
- Automatic building expects the correct binaries to be built by this Makefile. If you \
|
- Automatic building expects the correct binaries to be built by this Makefile. If you \
|
||||||
intend to propose a change to this Makefile, carefully review the file below and ensure \
|
intend to propose a change to this Makefile, carefully review the file below and ensure \
|
||||||
that the change will not accidently break the automatic building:\
|
that the change will not accidentally break the automatic building:\
|
||||||
.github/workflows/release.yml \
|
.github/workflows/release.yml \
|
||||||
Otherwise it is recommended to contact the project maintainers.
|
Otherwise it is recommended to contact the project maintainers.
|
||||||
|
|
||||||
|
19
README.md
19
README.md
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
[README](https://github.com/XTLS/Xray-core#readme) is open, so feel free to submit your project [here](https://github.com/XTLS/Xray-core/pulls).
|
[README](https://github.com/XTLS/Xray-core#readme) is open, so feel free to submit your project [here](https://github.com/XTLS/Xray-core/pulls).
|
||||||
|
|
||||||
|
## Donation & NFTs
|
||||||
|
|
||||||
|
[Announcement of NFTs by Project X](https://github.com/XTLS/Xray-core/discussions/3633)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[Mozilla Public License Version 2.0](https://github.com/XTLS/Xray-core/blob/main/LICENSE)
|
[Mozilla Public License Version 2.0](https://github.com/XTLS/Xray-core/blob/main/LICENSE)
|
||||||
@@ -18,6 +22,8 @@
|
|||||||
|
|
||||||
[Project X Channel](https://t.me/projectXtls)
|
[Project X Channel](https://t.me/projectXtls)
|
||||||
|
|
||||||
|
[Project VLESS](https://t.me/projectVless) (non-Chinese)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
- Linux Script
|
- Linux Script
|
||||||
@@ -27,8 +33,7 @@
|
|||||||
- [ghcr.io/xtls/xray-core](https://ghcr.io/xtls/xray-core) (**Official**)
|
- [ghcr.io/xtls/xray-core](https://ghcr.io/xtls/xray-core) (**Official**)
|
||||||
- [teddysun/xray](https://hub.docker.com/r/teddysun/xray)
|
- [teddysun/xray](https://hub.docker.com/r/teddysun/xray)
|
||||||
- Web Panel
|
- Web Panel
|
||||||
- [X-UI-English](https://github.com/NidukaAkalanka/x-ui-english), [3X-UI](https://github.com/MHSanaei/3x-ui), [X-UI](https://github.com/alireza0/x-ui), [X-UI](https://github.com/diditra/x-ui)
|
- [3X-UI](https://github.com/MHSanaei/3x-ui), [X-UI](https://github.com/alireza0/x-ui), [Xray-UI](https://github.com/qist/xray-ui)
|
||||||
- [Xray-UI](https://github.com/qist/xray-ui), [X-UI](https://github.com/sing-web/x-ui)
|
|
||||||
- [Hiddify](https://github.com/hiddify/hiddify-config)
|
- [Hiddify](https://github.com/hiddify/hiddify-config)
|
||||||
- [Marzban](https://github.com/Gozargah/Marzban)
|
- [Marzban](https://github.com/Gozargah/Marzban)
|
||||||
- [Libertea](https://github.com/VZiChoushaDui/Libertea)
|
- [Libertea](https://github.com/VZiChoushaDui/Libertea)
|
||||||
@@ -67,13 +72,10 @@
|
|||||||
- [luci-app-xray](https://github.com/yichya/luci-app-xray) ([openwrt-xray](https://github.com/yichya/openwrt-xray))
|
- [luci-app-xray](https://github.com/yichya/luci-app-xray) ([openwrt-xray](https://github.com/yichya/openwrt-xray))
|
||||||
- Windows
|
- Windows
|
||||||
- [v2rayN](https://github.com/2dust/v2rayN)
|
- [v2rayN](https://github.com/2dust/v2rayN)
|
||||||
- [NekoRay](https://github.com/Matsuridayo/nekoray)
|
|
||||||
- [Furious](https://github.com/LorenEteval/Furious)
|
- [Furious](https://github.com/LorenEteval/Furious)
|
||||||
- [HiddifyN](https://github.com/hiddify/HiddifyN)
|
|
||||||
- [Invisible Man - Xray](https://github.com/InvisibleManVPN/InvisibleMan-XRayClient)
|
- [Invisible Man - Xray](https://github.com/InvisibleManVPN/InvisibleMan-XRayClient)
|
||||||
- Android
|
- Android
|
||||||
- [v2rayNG](https://github.com/2dust/v2rayNG)
|
- [v2rayNG](https://github.com/2dust/v2rayNG)
|
||||||
- [HiddifyNG](https://github.com/hiddify/HiddifyNG)
|
|
||||||
- [X-flutter](https://github.com/XTLS/X-flutter)
|
- [X-flutter](https://github.com/XTLS/X-flutter)
|
||||||
- iOS & macOS arm64
|
- iOS & macOS arm64
|
||||||
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
||||||
@@ -85,7 +87,6 @@
|
|||||||
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
||||||
- Linux
|
- Linux
|
||||||
- [v2rayA](https://github.com/v2rayA/v2rayA)
|
- [v2rayA](https://github.com/v2rayA/v2rayA)
|
||||||
- [NekoRay](https://github.com/Matsuridayo/nekoray)
|
|
||||||
- [Furious](https://github.com/LorenEteval/Furious)
|
- [Furious](https://github.com/LorenEteval/Furious)
|
||||||
|
|
||||||
## Others that support VLESS, XTLS, REALITY, XUDP, PLUX...
|
## Others that support VLESS, XTLS, REALITY, XUDP, PLUX...
|
||||||
@@ -98,21 +99,15 @@
|
|||||||
- [XTLS/libXray](https://github.com/XTLS/libXray)
|
- [XTLS/libXray](https://github.com/XTLS/libXray)
|
||||||
- [xtlsapi](https://github.com/hiddify/xtlsapi)
|
- [xtlsapi](https://github.com/hiddify/xtlsapi)
|
||||||
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite)
|
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite)
|
||||||
- [XrayKit](https://github.com/arror/XrayKit)
|
|
||||||
- [Xray-core-python](https://github.com/LorenEteval/Xray-core-python)
|
- [Xray-core-python](https://github.com/LorenEteval/Xray-core-python)
|
||||||
- [xray-api](https://github.com/XVGuardian/xray-api)
|
- [xray-api](https://github.com/XVGuardian/xray-api)
|
||||||
- [XrayR](https://github.com/XrayR-project/XrayR)
|
- [XrayR](https://github.com/XrayR-project/XrayR)
|
||||||
- [XrayR-release](https://github.com/XrayR-project/XrayR-release)
|
- [XrayR-release](https://github.com/XrayR-project/XrayR-release)
|
||||||
- [XrayR-V2Board](https://github.com/missuo/XrayR-V2Board)
|
- [XrayR-V2Board](https://github.com/missuo/XrayR-V2Board)
|
||||||
- [Clash.Meta](https://github.com/MetaCubeX/Clash.Meta)
|
- [Clash.Meta](https://github.com/MetaCubeX/Clash.Meta)
|
||||||
- [Clash Verge](https://github.com/zzzgydi/clash-verge)
|
|
||||||
- [clashN](https://github.com/2dust/clashN)
|
- [clashN](https://github.com/2dust/clashN)
|
||||||
- [Clash Meta for Android](https://github.com/MetaCubeX/ClashMetaForAndroid)
|
- [Clash Meta for Android](https://github.com/MetaCubeX/ClashMetaForAndroid)
|
||||||
- [meta_for_ios](https://t.me/meta_for_ios)
|
|
||||||
- [sing-box](https://github.com/SagerNet/sing-box)
|
- [sing-box](https://github.com/SagerNet/sing-box)
|
||||||
- [installReality](https://github.com/BoxXt/installReality)
|
|
||||||
- [sbox-reality](https://github.com/Misaka-blog/sbox-reality)
|
|
||||||
- [sing-box-for-ios](https://github.com/SagerNet/sing-box-for-ios)
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/commander/config.proto
|
// source: app/commander/config.proto
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@ func file_app_commander_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_app_commander_config_proto_goTypes = []interface{}{
|
var file_app_commander_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.app.commander.Config
|
(*Config)(nil), // 0: xray.app.commander.Config
|
||||||
(*ReflectionConfig)(nil), // 1: xray.app.commander.ReflectionConfig
|
(*ReflectionConfig)(nil), // 1: xray.app.commander.ReflectionConfig
|
||||||
(*serial.TypedMessage)(nil), // 2: xray.common.serial.TypedMessage
|
(*serial.TypedMessage)(nil), // 2: xray.common.serial.TypedMessage
|
||||||
@@ -186,7 +186,7 @@ func file_app_commander_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_commander_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_commander_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -198,7 +198,7 @@ func file_app_commander_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_commander_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_commander_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ReflectionConfig); i {
|
switch v := v.(*ReflectionConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/dispatcher/config.proto
|
// source: app/dispatcher/config.proto
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ func file_app_dispatcher_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_app_dispatcher_config_proto_goTypes = []interface{}{
|
var file_app_dispatcher_config_proto_goTypes = []any{
|
||||||
(*SessionConfig)(nil), // 0: xray.app.dispatcher.SessionConfig
|
(*SessionConfig)(nil), // 0: xray.app.dispatcher.SessionConfig
|
||||||
(*Config)(nil), // 1: xray.app.dispatcher.Config
|
(*Config)(nil), // 1: xray.app.dispatcher.Config
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ func file_app_dispatcher_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_dispatcher_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dispatcher_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SessionConfig); i {
|
switch v := v.(*SessionConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -170,7 +170,7 @@ func file_app_dispatcher_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dispatcher_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dispatcher_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/dns/config.proto
|
// source: app/dns/config.proto
|
||||||
|
|
||||||
@@ -658,7 +658,7 @@ func file_app_dns_config_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_app_dns_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
var file_app_dns_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||||
var file_app_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_app_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_app_dns_config_proto_goTypes = []interface{}{
|
var file_app_dns_config_proto_goTypes = []any{
|
||||||
(DomainMatchingType)(0), // 0: xray.app.dns.DomainMatchingType
|
(DomainMatchingType)(0), // 0: xray.app.dns.DomainMatchingType
|
||||||
(QueryStrategy)(0), // 1: xray.app.dns.QueryStrategy
|
(QueryStrategy)(0), // 1: xray.app.dns.QueryStrategy
|
||||||
(*NameServer)(nil), // 2: xray.app.dns.NameServer
|
(*NameServer)(nil), // 2: xray.app.dns.NameServer
|
||||||
@@ -698,7 +698,7 @@ func file_app_dns_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*NameServer); i {
|
switch v := v.(*NameServer); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -710,7 +710,7 @@ func file_app_dns_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dns_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -722,7 +722,7 @@ func file_app_dns_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dns_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*NameServer_PriorityDomain); i {
|
switch v := v.(*NameServer_PriorityDomain); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -734,7 +734,7 @@ func file_app_dns_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dns_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*NameServer_OriginalRule); i {
|
switch v := v.(*NameServer_OriginalRule); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -746,7 +746,7 @@ func file_app_dns_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dns_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config_HostMapping); i {
|
switch v := v.(*Config_HostMapping); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/dns/fakedns/fakedns.proto
|
// source: app/dns/fakedns/fakedns.proto
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ func file_app_dns_fakedns_fakedns_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_dns_fakedns_fakedns_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_app_dns_fakedns_fakedns_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_app_dns_fakedns_fakedns_proto_goTypes = []interface{}{
|
var file_app_dns_fakedns_fakedns_proto_goTypes = []any{
|
||||||
(*FakeDnsPool)(nil), // 0: xray.app.dns.fakedns.FakeDnsPool
|
(*FakeDnsPool)(nil), // 0: xray.app.dns.fakedns.FakeDnsPool
|
||||||
(*FakeDnsPoolMulti)(nil), // 1: xray.app.dns.fakedns.FakeDnsPoolMulti
|
(*FakeDnsPoolMulti)(nil), // 1: xray.app.dns.fakedns.FakeDnsPoolMulti
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ func file_app_dns_fakedns_fakedns_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_dns_fakedns_fakedns_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_fakedns_fakedns_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*FakeDnsPool); i {
|
switch v := v.(*FakeDnsPool); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -190,7 +190,7 @@ func file_app_dns_fakedns_fakedns_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_dns_fakedns_fakedns_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_dns_fakedns_fakedns_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*FakeDnsPoolMulti); i {
|
switch v := v.(*FakeDnsPoolMulti); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -62,7 +62,7 @@ func NewServer(dest net.Destination, dispatcher routing.Dispatcher, queryStrateg
|
|||||||
dest.Network = net.Network_UDP
|
dest.Network = net.Network_UDP
|
||||||
}
|
}
|
||||||
if dest.Network == net.Network_UDP { // UDP classic DNS mode
|
if dest.Network == net.Network_UDP { // UDP classic DNS mode
|
||||||
return NewClassicNameServer(dest, dispatcher), nil
|
return NewClassicNameServer(dest, dispatcher, queryStrategy), nil
|
||||||
}
|
}
|
||||||
return nil, errors.New("No available name server could be created from ", dest).AtWarning()
|
return nil, errors.New("No available name server could be created from ", dest).AtWarning()
|
||||||
}
|
}
|
||||||
@@ -85,12 +85,12 @@ func NewClient(
|
|||||||
return errors.New("failed to create nameserver").Base(err).AtWarning()
|
return errors.New("failed to create nameserver").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priotize local domains with specific TLDs or without any dot to local DNS
|
// Prioritize local domains with specific TLDs or those without any dot for the local DNS
|
||||||
if _, isLocalDNS := server.(*LocalNameServer); isLocalDNS {
|
if _, isLocalDNS := server.(*LocalNameServer); isLocalDNS {
|
||||||
ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...)
|
ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...)
|
||||||
ns.OriginalRules = append(ns.OriginalRules, localTLDsAndDotlessDomainsRule)
|
ns.OriginalRules = append(ns.OriginalRules, localTLDsAndDotlessDomainsRule)
|
||||||
// The following lines is a solution to avoid core panics(rule index out of range) when setting `localhost` DNS client in config.
|
// The following lines is a solution to avoid core panics(rule index out of range) when setting `localhost` DNS client in config.
|
||||||
// Because the `localhost` DNS client will apend len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule.
|
// Because the `localhost` DNS client will append len(localTLDsAndDotlessDomains) rules into matcherInfos to match `geosite:private` default rule.
|
||||||
// But `matcherInfos` has no enough length to add rules, which leads to core panics (rule index out of range).
|
// But `matcherInfos` has no enough length to add rules, which leads to core panics (rule index out of range).
|
||||||
// To avoid this, the length of `matcherInfos` must be equal to the expected, so manually append it with Golang default zero value first for later modification.
|
// To avoid this, the length of `matcherInfos` must be equal to the expected, so manually append it with Golang default zero value first for later modification.
|
||||||
// Related issues:
|
// Related issues:
|
||||||
|
@@ -259,7 +259,7 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, clientIP n
|
|||||||
})
|
})
|
||||||
|
|
||||||
// forced to use mux for DOH
|
// forced to use mux for DOH
|
||||||
// dnsCtx = session.ContextWithMuxPrefered(dnsCtx, true)
|
// dnsCtx = session.ContextWithMuxPreferred(dnsCtx, true)
|
||||||
|
|
||||||
var cancel context.CancelFunc
|
var cancel context.CancelFunc
|
||||||
dnsCtx, cancel = context.WithDeadline(dnsCtx, deadline)
|
dnsCtx, cancel = context.WithDeadline(dnsCtx, deadline)
|
||||||
|
@@ -24,29 +24,31 @@ import (
|
|||||||
// ClassicNameServer implemented traditional UDP DNS.
|
// ClassicNameServer implemented traditional UDP DNS.
|
||||||
type ClassicNameServer struct {
|
type ClassicNameServer struct {
|
||||||
sync.RWMutex
|
sync.RWMutex
|
||||||
name string
|
name string
|
||||||
address *net.Destination
|
address *net.Destination
|
||||||
ips map[string]*record
|
ips map[string]*record
|
||||||
requests map[uint16]*dnsRequest
|
requests map[uint16]*dnsRequest
|
||||||
pub *pubsub.Service
|
pub *pubsub.Service
|
||||||
udpServer *udp.Dispatcher
|
udpServer *udp.Dispatcher
|
||||||
cleanup *task.Periodic
|
cleanup *task.Periodic
|
||||||
reqID uint32
|
reqID uint32
|
||||||
|
queryStrategy QueryStrategy
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClassicNameServer creates udp server object for remote resolving.
|
// NewClassicNameServer creates udp server object for remote resolving.
|
||||||
func NewClassicNameServer(address net.Destination, dispatcher routing.Dispatcher) *ClassicNameServer {
|
func NewClassicNameServer(address net.Destination, dispatcher routing.Dispatcher, queryStrategy QueryStrategy) *ClassicNameServer {
|
||||||
// default to 53 if unspecific
|
// default to 53 if unspecific
|
||||||
if address.Port == 0 {
|
if address.Port == 0 {
|
||||||
address.Port = net.Port(53)
|
address.Port = net.Port(53)
|
||||||
}
|
}
|
||||||
|
|
||||||
s := &ClassicNameServer{
|
s := &ClassicNameServer{
|
||||||
address: &address,
|
address: &address,
|
||||||
ips: make(map[string]*record),
|
ips: make(map[string]*record),
|
||||||
requests: make(map[uint16]*dnsRequest),
|
requests: make(map[uint16]*dnsRequest),
|
||||||
pub: pubsub.NewService(),
|
pub: pubsub.NewService(),
|
||||||
name: strings.ToUpper(address.String()),
|
name: strings.ToUpper(address.String()),
|
||||||
|
queryStrategy: queryStrategy,
|
||||||
}
|
}
|
||||||
s.cleanup = &task.Periodic{
|
s.cleanup = &task.Periodic{
|
||||||
Interval: time.Minute,
|
Interval: time.Minute,
|
||||||
@@ -239,6 +241,10 @@ func (s *ClassicNameServer) findIPsForDomain(domain string, option dns_feature.I
|
|||||||
// QueryIP implements Server.
|
// QueryIP implements Server.
|
||||||
func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, option dns_feature.IPOption, disableCache bool) ([]net.IP, error) {
|
func (s *ClassicNameServer) QueryIP(ctx context.Context, domain string, clientIP net.IP, option dns_feature.IPOption, disableCache bool) ([]net.IP, error) {
|
||||||
fqdn := Fqdn(domain)
|
fqdn := Fqdn(domain)
|
||||||
|
option = ResolveIpOptionOverride(s.queryStrategy, option)
|
||||||
|
if !option.IPv4Enable && !option.IPv6Enable {
|
||||||
|
return nil, dns_feature.ErrEmptyResponse
|
||||||
|
}
|
||||||
|
|
||||||
if disableCache {
|
if disableCache {
|
||||||
errors.LogDebug(ctx, "DNS cache is disabled. Querying IP for ", domain, " at ", s.name)
|
errors.LogDebug(ctx, "DNS cache is disabled. Querying IP for ", domain, " at ", s.name)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/log/command/config.proto
|
// source: app/log/command/config.proto
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ func file_app_log_command_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_log_command_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_app_log_command_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_app_log_command_config_proto_goTypes = []interface{}{
|
var file_app_log_command_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.app.log.command.Config
|
(*Config)(nil), // 0: xray.app.log.command.Config
|
||||||
(*RestartLoggerRequest)(nil), // 1: xray.app.log.command.RestartLoggerRequest
|
(*RestartLoggerRequest)(nil), // 1: xray.app.log.command.RestartLoggerRequest
|
||||||
(*RestartLoggerResponse)(nil), // 2: xray.app.log.command.RestartLoggerResponse
|
(*RestartLoggerResponse)(nil), // 2: xray.app.log.command.RestartLoggerResponse
|
||||||
@@ -195,7 +195,7 @@ func file_app_log_command_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_log_command_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_log_command_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -207,7 +207,7 @@ func file_app_log_command_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_log_command_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_log_command_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RestartLoggerRequest); i {
|
switch v := v.(*RestartLoggerRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -219,7 +219,7 @@ func file_app_log_command_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_log_command_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_log_command_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RestartLoggerResponse); i {
|
switch v := v.(*RestartLoggerResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.27.0
|
// - protoc v5.27.0
|
||||||
// source: app/log/command/config.proto
|
// source: app/log/command/config.proto
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
LoggerService_RestartLogger_FullMethodName = "/xray.app.log.command.LoggerService/RestartLogger"
|
LoggerService_RestartLogger_FullMethodName = "/xray.app.log.command.LoggerService/RestartLogger"
|
||||||
@@ -38,8 +38,9 @@ func NewLoggerServiceClient(cc grpc.ClientConnInterface) LoggerServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) {
|
func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RestartLoggerResponse)
|
out := new(RestartLoggerResponse)
|
||||||
err := c.cc.Invoke(ctx, LoggerService_RestartLogger_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, LoggerService_RestartLogger_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -48,20 +49,24 @@ func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *RestartLogg
|
|||||||
|
|
||||||
// LoggerServiceServer is the server API for LoggerService service.
|
// LoggerServiceServer is the server API for LoggerService service.
|
||||||
// All implementations must embed UnimplementedLoggerServiceServer
|
// All implementations must embed UnimplementedLoggerServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility.
|
||||||
type LoggerServiceServer interface {
|
type LoggerServiceServer interface {
|
||||||
RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error)
|
RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error)
|
||||||
mustEmbedUnimplementedLoggerServiceServer()
|
mustEmbedUnimplementedLoggerServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedLoggerServiceServer must be embedded to have forward compatible implementations.
|
// UnimplementedLoggerServiceServer must be embedded to have
|
||||||
type UnimplementedLoggerServiceServer struct {
|
// forward compatible implementations.
|
||||||
}
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedLoggerServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedLoggerServiceServer) RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) {
|
func (UnimplementedLoggerServiceServer) RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method RestartLogger not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method RestartLogger not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerServiceServer() {}
|
func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerServiceServer() {}
|
||||||
|
func (UnimplementedLoggerServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeLoggerServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeLoggerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to LoggerServiceServer will
|
// Use of this interface is not recommended, as added methods to LoggerServiceServer will
|
||||||
@@ -71,6 +76,13 @@ type UnsafeLoggerServiceServer interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) {
|
func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedLoggerServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
s.RegisterService(&LoggerService_ServiceDesc, srv)
|
s.RegisterService(&LoggerService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/log/config.proto
|
// source: app/log/config.proto
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ func file_app_log_config_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_app_log_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_app_log_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_app_log_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_app_log_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_app_log_config_proto_goTypes = []interface{}{
|
var file_app_log_config_proto_goTypes = []any{
|
||||||
(LogType)(0), // 0: xray.app.log.LogType
|
(LogType)(0), // 0: xray.app.log.LogType
|
||||||
(*Config)(nil), // 1: xray.app.log.Config
|
(*Config)(nil), // 1: xray.app.log.Config
|
||||||
(log.Severity)(0), // 2: xray.common.log.Severity
|
(log.Severity)(0), // 2: xray.common.log.Severity
|
||||||
@@ -233,7 +233,7 @@ func file_app_log_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_log_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -30,8 +30,8 @@ func New(ctx context.Context, config *Config) (*Instance, error) {
|
|||||||
}
|
}
|
||||||
log.RegisterHandler(g)
|
log.RegisterHandler(g)
|
||||||
|
|
||||||
// start logger instantly on inited
|
// Start logger instantly on initialization
|
||||||
// other modules would log during init
|
// Other modules would log during initialization
|
||||||
if err := g.startInternal(); err != nil {
|
if err := g.startInternal(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/metrics/config.proto
|
// source: app/metrics/config.proto
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ func file_app_metrics_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_metrics_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_app_metrics_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_app_metrics_config_proto_goTypes = []interface{}{
|
var file_app_metrics_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.app.metrics.Config
|
(*Config)(nil), // 0: xray.app.metrics.Config
|
||||||
}
|
}
|
||||||
var file_app_metrics_config_proto_depIdxs = []int32{
|
var file_app_metrics_config_proto_depIdxs = []int32{
|
||||||
@@ -115,7 +115,7 @@ func file_app_metrics_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_metrics_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_metrics_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/observatory/burst/config.proto
|
// source: app/observatory/burst/config.proto
|
||||||
|
|
||||||
@@ -211,7 +211,7 @@ func file_app_observatory_burst_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_observatory_burst_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_app_observatory_burst_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_app_observatory_burst_config_proto_goTypes = []interface{}{
|
var file_app_observatory_burst_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.core.app.observatory.burst.Config
|
(*Config)(nil), // 0: xray.core.app.observatory.burst.Config
|
||||||
(*HealthPingConfig)(nil), // 1: xray.core.app.observatory.burst.HealthPingConfig
|
(*HealthPingConfig)(nil), // 1: xray.core.app.observatory.burst.HealthPingConfig
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,7 @@ func file_app_observatory_burst_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_observatory_burst_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_burst_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -242,7 +242,7 @@ func file_app_observatory_burst_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_burst_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_burst_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*HealthPingConfig); i {
|
switch v := v.(*HealthPingConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -209,7 +209,7 @@ func (h *HealthPing) PutResult(tag string, rtt time.Duration) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
// validity is 2 times to sampling period, since the check are
|
// validity is 2 times to sampling period, since the check are
|
||||||
// distributed in the time line randomly, in extreme cases,
|
// distributed in the time line randomly, in extreme cases,
|
||||||
// previous checks are distributed on the left, and latters
|
// Previous checks are distributed on the left, and later ones
|
||||||
// on the right
|
// on the right
|
||||||
validity := h.Settings.Interval * time.Duration(h.Settings.SamplingCount) * 2
|
validity := h.Settings.Interval * time.Duration(h.Settings.SamplingCount) * 2
|
||||||
r = NewHealthPingResult(h.Settings.SamplingCount, validity)
|
r = NewHealthPingResult(h.Settings.SamplingCount, validity)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/observatory/command/command.proto
|
// source: app/observatory/command/command.proto
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ func file_app_observatory_command_command_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_observatory_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_app_observatory_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_app_observatory_command_command_proto_goTypes = []interface{}{
|
var file_app_observatory_command_command_proto_goTypes = []any{
|
||||||
(*GetOutboundStatusRequest)(nil), // 0: xray.core.app.observatory.command.GetOutboundStatusRequest
|
(*GetOutboundStatusRequest)(nil), // 0: xray.core.app.observatory.command.GetOutboundStatusRequest
|
||||||
(*GetOutboundStatusResponse)(nil), // 1: xray.core.app.observatory.command.GetOutboundStatusResponse
|
(*GetOutboundStatusResponse)(nil), // 1: xray.core.app.observatory.command.GetOutboundStatusResponse
|
||||||
(*Config)(nil), // 2: xray.core.app.observatory.command.Config
|
(*Config)(nil), // 2: xray.core.app.observatory.command.Config
|
||||||
@@ -220,7 +220,7 @@ func file_app_observatory_command_command_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_observatory_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_command_command_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetOutboundStatusRequest); i {
|
switch v := v.(*GetOutboundStatusRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -232,7 +232,7 @@ func file_app_observatory_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_command_command_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetOutboundStatusResponse); i {
|
switch v := v.(*GetOutboundStatusResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -244,7 +244,7 @@ func file_app_observatory_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_command_command_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.27.0
|
// - protoc v5.27.0
|
||||||
// source: app/observatory/command/command.proto
|
// source: app/observatory/command/command.proto
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ObservatoryService_GetOutboundStatus_FullMethodName = "/xray.core.app.observatory.command.ObservatoryService/GetOutboundStatus"
|
ObservatoryService_GetOutboundStatus_FullMethodName = "/xray.core.app.observatory.command.ObservatoryService/GetOutboundStatus"
|
||||||
@@ -38,8 +38,9 @@ func NewObservatoryServiceClient(cc grpc.ClientConnInterface) ObservatoryService
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error) {
|
func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetOutboundStatusResponse)
|
out := new(GetOutboundStatusResponse)
|
||||||
err := c.cc.Invoke(ctx, ObservatoryService_GetOutboundStatus_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, ObservatoryService_GetOutboundStatus_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -48,20 +49,24 @@ func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Context, in *Ge
|
|||||||
|
|
||||||
// ObservatoryServiceServer is the server API for ObservatoryService service.
|
// ObservatoryServiceServer is the server API for ObservatoryService service.
|
||||||
// All implementations must embed UnimplementedObservatoryServiceServer
|
// All implementations must embed UnimplementedObservatoryServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility.
|
||||||
type ObservatoryServiceServer interface {
|
type ObservatoryServiceServer interface {
|
||||||
GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error)
|
GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error)
|
||||||
mustEmbedUnimplementedObservatoryServiceServer()
|
mustEmbedUnimplementedObservatoryServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedObservatoryServiceServer must be embedded to have forward compatible implementations.
|
// UnimplementedObservatoryServiceServer must be embedded to have
|
||||||
type UnimplementedObservatoryServiceServer struct {
|
// forward compatible implementations.
|
||||||
}
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedObservatoryServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedObservatoryServiceServer) GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error) {
|
func (UnimplementedObservatoryServiceServer) GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetOutboundStatus not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetOutboundStatus not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedObservatoryServiceServer) mustEmbedUnimplementedObservatoryServiceServer() {}
|
func (UnimplementedObservatoryServiceServer) mustEmbedUnimplementedObservatoryServiceServer() {}
|
||||||
|
func (UnimplementedObservatoryServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeObservatoryServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeObservatoryServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to ObservatoryServiceServer will
|
// Use of this interface is not recommended, as added methods to ObservatoryServiceServer will
|
||||||
@@ -71,6 +76,13 @@ type UnsafeObservatoryServiceServer interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RegisterObservatoryServiceServer(s grpc.ServiceRegistrar, srv ObservatoryServiceServer) {
|
func RegisterObservatoryServiceServer(s grpc.ServiceRegistrar, srv ObservatoryServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedObservatoryServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
s.RegisterService(&ObservatoryService_ServiceDesc, srv)
|
s.RegisterService(&ObservatoryService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/observatory/config.proto
|
// source: app/observatory/config.proto
|
||||||
|
|
||||||
@@ -536,7 +536,7 @@ func file_app_observatory_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_observatory_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
var file_app_observatory_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
var file_app_observatory_config_proto_goTypes = []interface{}{
|
var file_app_observatory_config_proto_goTypes = []any{
|
||||||
(*ObservationResult)(nil), // 0: xray.core.app.observatory.ObservationResult
|
(*ObservationResult)(nil), // 0: xray.core.app.observatory.ObservationResult
|
||||||
(*HealthPingMeasurementResult)(nil), // 1: xray.core.app.observatory.HealthPingMeasurementResult
|
(*HealthPingMeasurementResult)(nil), // 1: xray.core.app.observatory.HealthPingMeasurementResult
|
||||||
(*OutboundStatus)(nil), // 2: xray.core.app.observatory.OutboundStatus
|
(*OutboundStatus)(nil), // 2: xray.core.app.observatory.OutboundStatus
|
||||||
@@ -560,7 +560,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_observatory_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ObservationResult); i {
|
switch v := v.(*ObservationResult); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -572,7 +572,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*HealthPingMeasurementResult); i {
|
switch v := v.(*HealthPingMeasurementResult); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -584,7 +584,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OutboundStatus); i {
|
switch v := v.(*OutboundStatus); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -596,7 +596,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ProbeResult); i {
|
switch v := v.(*ProbeResult); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -608,7 +608,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Intensity); i {
|
switch v := v.(*Intensity); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -620,7 +620,7 @@ func file_app_observatory_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_observatory_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_observatory_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/policy/config.proto
|
// source: app/policy/config.proto
|
||||||
|
|
||||||
@@ -570,7 +570,7 @@ func file_app_policy_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_policy_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
var file_app_policy_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||||
var file_app_policy_config_proto_goTypes = []interface{}{
|
var file_app_policy_config_proto_goTypes = []any{
|
||||||
(*Second)(nil), // 0: xray.app.policy.Second
|
(*Second)(nil), // 0: xray.app.policy.Second
|
||||||
(*Policy)(nil), // 1: xray.app.policy.Policy
|
(*Policy)(nil), // 1: xray.app.policy.Policy
|
||||||
(*SystemPolicy)(nil), // 2: xray.app.policy.SystemPolicy
|
(*SystemPolicy)(nil), // 2: xray.app.policy.SystemPolicy
|
||||||
@@ -606,7 +606,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_policy_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Second); i {
|
switch v := v.(*Second); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -618,7 +618,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Policy); i {
|
switch v := v.(*Policy); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -630,7 +630,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SystemPolicy); i {
|
switch v := v.(*SystemPolicy); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -642,7 +642,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -654,7 +654,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Policy_Timeout); i {
|
switch v := v.(*Policy_Timeout); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -666,7 +666,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Policy_Stats); i {
|
switch v := v.(*Policy_Stats); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -678,7 +678,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Policy_Buffer); i {
|
switch v := v.(*Policy_Buffer); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -690,7 +690,7 @@ func file_app_policy_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_policy_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_policy_config_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SystemPolicy_Stats); i {
|
switch v := v.(*SystemPolicy_Stats); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/proxyman/command/command.proto
|
// source: app/proxyman/command/command.proto
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ func file_app_proxyman_command_command_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
|
var file_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
|
||||||
var file_app_proxyman_command_command_proto_goTypes = []interface{}{
|
var file_app_proxyman_command_command_proto_goTypes = []any{
|
||||||
(*AddUserOperation)(nil), // 0: xray.app.proxyman.command.AddUserOperation
|
(*AddUserOperation)(nil), // 0: xray.app.proxyman.command.AddUserOperation
|
||||||
(*RemoveUserOperation)(nil), // 1: xray.app.proxyman.command.RemoveUserOperation
|
(*RemoveUserOperation)(nil), // 1: xray.app.proxyman.command.RemoveUserOperation
|
||||||
(*AddInboundRequest)(nil), // 2: xray.app.proxyman.command.AddInboundRequest
|
(*AddInboundRequest)(nil), // 2: xray.app.proxyman.command.AddInboundRequest
|
||||||
@@ -858,7 +858,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_proxyman_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddUserOperation); i {
|
switch v := v.(*AddUserOperation); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -870,7 +870,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveUserOperation); i {
|
switch v := v.(*RemoveUserOperation); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -882,7 +882,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddInboundRequest); i {
|
switch v := v.(*AddInboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -894,7 +894,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddInboundResponse); i {
|
switch v := v.(*AddInboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -906,7 +906,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveInboundRequest); i {
|
switch v := v.(*RemoveInboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -918,7 +918,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveInboundResponse); i {
|
switch v := v.(*RemoveInboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -930,7 +930,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AlterInboundRequest); i {
|
switch v := v.(*AlterInboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -942,7 +942,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AlterInboundResponse); i {
|
switch v := v.(*AlterInboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -954,7 +954,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[8].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddOutboundRequest); i {
|
switch v := v.(*AddOutboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -966,7 +966,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[9].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddOutboundResponse); i {
|
switch v := v.(*AddOutboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -978,7 +978,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[10].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveOutboundRequest); i {
|
switch v := v.(*RemoveOutboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -990,7 +990,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[11].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveOutboundResponse); i {
|
switch v := v.(*RemoveOutboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1002,7 +1002,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[12].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AlterOutboundRequest); i {
|
switch v := v.(*AlterOutboundRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1014,7 +1014,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[13].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AlterOutboundResponse); i {
|
switch v := v.(*AlterOutboundResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1026,7 +1026,7 @@ func file_app_proxyman_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_command_command_proto_msgTypes[14].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.27.0
|
// - protoc v5.27.0
|
||||||
// source: app/proxyman/command/command.proto
|
// source: app/proxyman/command/command.proto
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HandlerService_AddInbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AddInbound"
|
HandlerService_AddInbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AddInbound"
|
||||||
@@ -48,8 +48,9 @@ func NewHandlerServiceClient(cc grpc.ClientConnInterface) HandlerServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error) {
|
func (c *handlerServiceClient) AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(AddInboundResponse)
|
out := new(AddInboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_AddInbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_AddInbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -57,8 +58,9 @@ func (c *handlerServiceClient) AddInbound(ctx context.Context, in *AddInboundReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error) {
|
func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RemoveInboundResponse)
|
out := new(RemoveInboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_RemoveInbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_RemoveInbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -66,8 +68,9 @@ func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *RemoveInbo
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error) {
|
func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(AlterInboundResponse)
|
out := new(AlterInboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_AlterInbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_AlterInbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -75,8 +78,9 @@ func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *AlterInboun
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error) {
|
func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(AddOutboundResponse)
|
out := new(AddOutboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_AddOutbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_AddOutbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -84,8 +88,9 @@ func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *AddOutboundR
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error) {
|
func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RemoveOutboundResponse)
|
out := new(RemoveOutboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_RemoveOutbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_RemoveOutbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -93,8 +98,9 @@ func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in *RemoveOut
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error) {
|
func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(AlterOutboundResponse)
|
out := new(AlterOutboundResponse)
|
||||||
err := c.cc.Invoke(ctx, HandlerService_AlterOutbound_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, HandlerService_AlterOutbound_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -103,7 +109,7 @@ func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *AlterOutbo
|
|||||||
|
|
||||||
// HandlerServiceServer is the server API for HandlerService service.
|
// HandlerServiceServer is the server API for HandlerService service.
|
||||||
// All implementations must embed UnimplementedHandlerServiceServer
|
// All implementations must embed UnimplementedHandlerServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility.
|
||||||
type HandlerServiceServer interface {
|
type HandlerServiceServer interface {
|
||||||
AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error)
|
AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error)
|
||||||
RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error)
|
RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error)
|
||||||
@@ -114,9 +120,12 @@ type HandlerServiceServer interface {
|
|||||||
mustEmbedUnimplementedHandlerServiceServer()
|
mustEmbedUnimplementedHandlerServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedHandlerServiceServer must be embedded to have forward compatible implementations.
|
// UnimplementedHandlerServiceServer must be embedded to have
|
||||||
type UnimplementedHandlerServiceServer struct {
|
// forward compatible implementations.
|
||||||
}
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedHandlerServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedHandlerServiceServer) AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error) {
|
func (UnimplementedHandlerServiceServer) AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method AddInbound not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AddInbound not implemented")
|
||||||
@@ -137,6 +146,7 @@ func (UnimplementedHandlerServiceServer) AlterOutbound(context.Context, *AlterOu
|
|||||||
return nil, status.Errorf(codes.Unimplemented, "method AlterOutbound not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method AlterOutbound not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedHandlerServiceServer) mustEmbedUnimplementedHandlerServiceServer() {}
|
func (UnimplementedHandlerServiceServer) mustEmbedUnimplementedHandlerServiceServer() {}
|
||||||
|
func (UnimplementedHandlerServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeHandlerServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeHandlerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to HandlerServiceServer will
|
// Use of this interface is not recommended, as added methods to HandlerServiceServer will
|
||||||
@@ -146,6 +156,13 @@ type UnsafeHandlerServiceServer interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) {
|
func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedHandlerServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
s.RegisterService(&HandlerService_ServiceDesc, srv)
|
s.RegisterService(&HandlerService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/proxyman/config.proto
|
// source: app/proxyman/config.proto
|
||||||
|
|
||||||
@@ -920,7 +920,7 @@ func file_app_proxyman_config_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_app_proxyman_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
var file_app_proxyman_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||||
var file_app_proxyman_config_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
var file_app_proxyman_config_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||||
var file_app_proxyman_config_proto_goTypes = []interface{}{
|
var file_app_proxyman_config_proto_goTypes = []any{
|
||||||
(KnownProtocols)(0), // 0: xray.app.proxyman.KnownProtocols
|
(KnownProtocols)(0), // 0: xray.app.proxyman.KnownProtocols
|
||||||
(AllocationStrategy_Type)(0), // 1: xray.app.proxyman.AllocationStrategy.Type
|
(AllocationStrategy_Type)(0), // 1: xray.app.proxyman.AllocationStrategy.Type
|
||||||
(*InboundConfig)(nil), // 2: xray.app.proxyman.InboundConfig
|
(*InboundConfig)(nil), // 2: xray.app.proxyman.InboundConfig
|
||||||
@@ -968,7 +968,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_proxyman_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*InboundConfig); i {
|
switch v := v.(*InboundConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -980,7 +980,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AllocationStrategy); i {
|
switch v := v.(*AllocationStrategy); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -992,7 +992,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SniffingConfig); i {
|
switch v := v.(*SniffingConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1004,7 +1004,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ReceiverConfig); i {
|
switch v := v.(*ReceiverConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1016,7 +1016,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*InboundHandlerConfig); i {
|
switch v := v.(*InboundHandlerConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1028,7 +1028,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OutboundConfig); i {
|
switch v := v.(*OutboundConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1040,7 +1040,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SenderConfig); i {
|
switch v := v.(*SenderConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1052,7 +1052,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*MultiplexingConfig); i {
|
switch v := v.(*MultiplexingConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1064,7 +1064,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[8].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AllocationStrategy_AllocationStrategyConcurrency); i {
|
switch v := v.(*AllocationStrategy_AllocationStrategyConcurrency); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1076,7 +1076,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_proxyman_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_app_proxyman_config_proto_msgTypes[9].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AllocationStrategy_AllocationStrategyRefresh); i {
|
switch v := v.(*AllocationStrategy_AllocationStrategyRefresh); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/reverse/config.proto
|
// source: app/reverse/config.proto
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ func file_app_reverse_config_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_app_reverse_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_app_reverse_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_app_reverse_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
var file_app_reverse_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||||
var file_app_reverse_config_proto_goTypes = []interface{}{
|
var file_app_reverse_config_proto_goTypes = []any{
|
||||||
(Control_State)(0), // 0: xray.app.reverse.Control.State
|
(Control_State)(0), // 0: xray.app.reverse.Control.State
|
||||||
(*Control)(nil), // 1: xray.app.reverse.Control
|
(*Control)(nil), // 1: xray.app.reverse.Control
|
||||||
(*BridgeConfig)(nil), // 2: xray.app.reverse.BridgeConfig
|
(*BridgeConfig)(nil), // 2: xray.app.reverse.BridgeConfig
|
||||||
@@ -362,7 +362,7 @@ func file_app_reverse_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_reverse_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_reverse_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Control); i {
|
switch v := v.(*Control); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -374,7 +374,7 @@ func file_app_reverse_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_reverse_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_reverse_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*BridgeConfig); i {
|
switch v := v.(*BridgeConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -386,7 +386,7 @@ func file_app_reverse_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_reverse_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_reverse_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*PortalConfig); i {
|
switch v := v.(*PortalConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -398,7 +398,7 @@ func file_app_reverse_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_reverse_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_reverse_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/router/command/command.proto
|
// source: app/router/command/command.proto
|
||||||
|
|
||||||
@@ -1019,7 +1019,7 @@ func file_app_router_command_command_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 16)
|
||||||
var file_app_router_command_command_proto_goTypes = []interface{}{
|
var file_app_router_command_command_proto_goTypes = []any{
|
||||||
(*RoutingContext)(nil), // 0: xray.app.router.command.RoutingContext
|
(*RoutingContext)(nil), // 0: xray.app.router.command.RoutingContext
|
||||||
(*SubscribeRoutingStatsRequest)(nil), // 1: xray.app.router.command.SubscribeRoutingStatsRequest
|
(*SubscribeRoutingStatsRequest)(nil), // 1: xray.app.router.command.SubscribeRoutingStatsRequest
|
||||||
(*TestRouteRequest)(nil), // 2: xray.app.router.command.TestRouteRequest
|
(*TestRouteRequest)(nil), // 2: xray.app.router.command.TestRouteRequest
|
||||||
@@ -1072,7 +1072,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_router_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RoutingContext); i {
|
switch v := v.(*RoutingContext); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1084,7 +1084,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SubscribeRoutingStatsRequest); i {
|
switch v := v.(*SubscribeRoutingStatsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1096,7 +1096,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*TestRouteRequest); i {
|
switch v := v.(*TestRouteRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1108,7 +1108,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*PrincipleTargetInfo); i {
|
switch v := v.(*PrincipleTargetInfo); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1120,7 +1120,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OverrideInfo); i {
|
switch v := v.(*OverrideInfo); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1132,7 +1132,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*BalancerMsg); i {
|
switch v := v.(*BalancerMsg); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1144,7 +1144,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetBalancerInfoRequest); i {
|
switch v := v.(*GetBalancerInfoRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1156,7 +1156,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetBalancerInfoResponse); i {
|
switch v := v.(*GetBalancerInfoResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1168,7 +1168,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[8].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OverrideBalancerTargetRequest); i {
|
switch v := v.(*OverrideBalancerTargetRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1180,7 +1180,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[9].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OverrideBalancerTargetResponse); i {
|
switch v := v.(*OverrideBalancerTargetResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1192,7 +1192,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[10].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddRuleRequest); i {
|
switch v := v.(*AddRuleRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1204,7 +1204,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[11].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*AddRuleResponse); i {
|
switch v := v.(*AddRuleResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1216,7 +1216,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[12].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveRuleRequest); i {
|
switch v := v.(*RemoveRuleRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1228,7 +1228,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[13].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RemoveRuleResponse); i {
|
switch v := v.(*RemoveRuleResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1240,7 +1240,7 @@ func file_app_router_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_command_command_proto_msgTypes[14].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.27.0
|
// - protoc v5.27.0
|
||||||
// source: app/router/command/command.proto
|
// source: app/router/command/command.proto
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
RoutingService_SubscribeRoutingStats_FullMethodName = "/xray.app.router.command.RoutingService/SubscribeRoutingStats"
|
RoutingService_SubscribeRoutingStats_FullMethodName = "/xray.app.router.command.RoutingService/SubscribeRoutingStats"
|
||||||
@@ -31,7 +31,7 @@ const (
|
|||||||
//
|
//
|
||||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||||
type RoutingServiceClient interface {
|
type RoutingServiceClient interface {
|
||||||
SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error)
|
SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RoutingContext], error)
|
||||||
TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error)
|
TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error)
|
||||||
GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error)
|
GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error)
|
||||||
OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error)
|
OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error)
|
||||||
@@ -47,12 +47,13 @@ func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient {
|
|||||||
return &routingServiceClient{cc}
|
return &routingServiceClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) {
|
func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[RoutingContext], error) {
|
||||||
stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, opts...)
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
x := &routingServiceSubscribeRoutingStatsClient{stream}
|
x := &grpc.GenericClientStream[SubscribeRoutingStatsRequest, RoutingContext]{ClientStream: stream}
|
||||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -62,26 +63,13 @@ func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *Su
|
|||||||
return x, nil
|
return x, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoutingService_SubscribeRoutingStatsClient interface {
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||||
Recv() (*RoutingContext, error)
|
type RoutingService_SubscribeRoutingStatsClient = grpc.ServerStreamingClient[RoutingContext]
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type routingServiceSubscribeRoutingStatsClient struct {
|
|
||||||
grpc.ClientStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *routingServiceSubscribeRoutingStatsClient) Recv() (*RoutingContext, error) {
|
|
||||||
m := new(RoutingContext)
|
|
||||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return m, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) {
|
func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RoutingContext)
|
out := new(RoutingContext)
|
||||||
err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -89,8 +77,9 @@ func (c *routingServiceClient) TestRoute(ctx context.Context, in *TestRouteReque
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) {
|
func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetBalancerInfoResponse)
|
out := new(GetBalancerInfoResponse)
|
||||||
err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -98,8 +87,9 @@ func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalan
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) {
|
func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(OverrideBalancerTargetResponse)
|
out := new(OverrideBalancerTargetResponse)
|
||||||
err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -107,8 +97,9 @@ func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *O
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) {
|
func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(AddRuleResponse)
|
out := new(AddRuleResponse)
|
||||||
err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -116,8 +107,9 @@ func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) {
|
func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(RemoveRuleResponse)
|
out := new(RemoveRuleResponse)
|
||||||
err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -126,9 +118,9 @@ func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleReq
|
|||||||
|
|
||||||
// RoutingServiceServer is the server API for RoutingService service.
|
// RoutingServiceServer is the server API for RoutingService service.
|
||||||
// All implementations must embed UnimplementedRoutingServiceServer
|
// All implementations must embed UnimplementedRoutingServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility.
|
||||||
type RoutingServiceServer interface {
|
type RoutingServiceServer interface {
|
||||||
SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error
|
SubscribeRoutingStats(*SubscribeRoutingStatsRequest, grpc.ServerStreamingServer[RoutingContext]) error
|
||||||
TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
|
TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
|
||||||
GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error)
|
GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error)
|
||||||
OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error)
|
OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error)
|
||||||
@@ -137,11 +129,14 @@ type RoutingServiceServer interface {
|
|||||||
mustEmbedUnimplementedRoutingServiceServer()
|
mustEmbedUnimplementedRoutingServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.
|
// UnimplementedRoutingServiceServer must be embedded to have
|
||||||
type UnimplementedRoutingServiceServer struct {
|
// forward compatible implementations.
|
||||||
}
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedRoutingServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error {
|
func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, grpc.ServerStreamingServer[RoutingContext]) error {
|
||||||
return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented")
|
return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) {
|
func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) {
|
||||||
@@ -160,6 +155,7 @@ func (UnimplementedRoutingServiceServer) RemoveRule(context.Context, *RemoveRule
|
|||||||
return nil, status.Errorf(codes.Unimplemented, "method RemoveRule not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method RemoveRule not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {}
|
func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {}
|
||||||
|
func (UnimplementedRoutingServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to RoutingServiceServer will
|
// Use of this interface is not recommended, as added methods to RoutingServiceServer will
|
||||||
@@ -169,6 +165,13 @@ type UnsafeRoutingServiceServer interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) {
|
func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedRoutingServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
s.RegisterService(&RoutingService_ServiceDesc, srv)
|
s.RegisterService(&RoutingService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,21 +180,11 @@ func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.
|
|||||||
if err := stream.RecvMsg(m); err != nil {
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &routingServiceSubscribeRoutingStatsServer{stream})
|
return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &grpc.GenericServerStream[SubscribeRoutingStatsRequest, RoutingContext]{ServerStream: stream})
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoutingService_SubscribeRoutingStatsServer interface {
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||||
Send(*RoutingContext) error
|
type RoutingService_SubscribeRoutingStatsServer = grpc.ServerStreamingServer[RoutingContext]
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
type routingServiceSubscribeRoutingStatsServer struct {
|
|
||||||
grpc.ServerStream
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *routingServiceSubscribeRoutingStatsServer) Send(m *RoutingContext) error {
|
|
||||||
return x.ServerStream.SendMsg(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _RoutingService_TestRoute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(TestRouteRequest)
|
in := new(TestRouteRequest)
|
||||||
|
@@ -272,7 +272,7 @@ func TestServiceSubscribeSubsetOfFields(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSerivceTestRoute(t *testing.T) {
|
func TestServiceTestRoute(t *testing.T) {
|
||||||
c := stats.NewChannel(&stats.ChannelConfig{
|
c := stats.NewChannel(&stats.ChannelConfig{
|
||||||
SubscriberLimit: 1,
|
SubscriberLimit: 1,
|
||||||
BufferSize: 16,
|
BufferSize: 16,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/router/config.proto
|
// source: app/router/config.proto
|
||||||
|
|
||||||
@@ -1275,7 +1275,7 @@ func file_app_router_config_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_app_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
var file_app_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||||
var file_app_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
var file_app_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||||
var file_app_router_config_proto_goTypes = []interface{}{
|
var file_app_router_config_proto_goTypes = []any{
|
||||||
(Domain_Type)(0), // 0: xray.app.router.Domain.Type
|
(Domain_Type)(0), // 0: xray.app.router.Domain.Type
|
||||||
(Config_DomainStrategy)(0), // 1: xray.app.router.Config.DomainStrategy
|
(Config_DomainStrategy)(0), // 1: xray.app.router.Config.DomainStrategy
|
||||||
(*Domain)(nil), // 2: xray.app.router.Domain
|
(*Domain)(nil), // 2: xray.app.router.Domain
|
||||||
@@ -1333,7 +1333,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Domain); i {
|
switch v := v.(*Domain); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1345,7 +1345,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*CIDR); i {
|
switch v := v.(*CIDR); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1357,7 +1357,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GeoIP); i {
|
switch v := v.(*GeoIP); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1369,7 +1369,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GeoIPList); i {
|
switch v := v.(*GeoIPList); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1381,7 +1381,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GeoSite); i {
|
switch v := v.(*GeoSite); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1393,7 +1393,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GeoSiteList); i {
|
switch v := v.(*GeoSiteList); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1405,7 +1405,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*RoutingRule); i {
|
switch v := v.(*RoutingRule); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1417,7 +1417,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*BalancingRule); i {
|
switch v := v.(*BalancingRule); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1429,7 +1429,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[8].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*StrategyWeight); i {
|
switch v := v.(*StrategyWeight); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1441,7 +1441,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[9].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*StrategyLeastLoadConfig); i {
|
switch v := v.(*StrategyLeastLoadConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1453,7 +1453,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[10].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1465,7 +1465,7 @@ func file_app_router_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
file_app_router_config_proto_msgTypes[11].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Domain_Attribute); i {
|
switch v := v.(*Domain_Attribute); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -1478,11 +1478,11 @@ func file_app_router_config_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{
|
file_app_router_config_proto_msgTypes[6].OneofWrappers = []any{
|
||||||
(*RoutingRule_Tag)(nil),
|
(*RoutingRule_Tag)(nil),
|
||||||
(*RoutingRule_BalancingTag)(nil),
|
(*RoutingRule_BalancingTag)(nil),
|
||||||
}
|
}
|
||||||
file_app_router_config_proto_msgTypes[11].OneofWrappers = []interface{}{
|
file_app_router_config_proto_msgTypes[11].OneofWrappers = []any{
|
||||||
(*Domain_Attribute_BoolValue)(nil),
|
(*Domain_Attribute_BoolValue)(nil),
|
||||||
(*Domain_Attribute_IntValue)(nil),
|
(*Domain_Attribute_IntValue)(nil),
|
||||||
}
|
}
|
||||||
|
@@ -95,7 +95,7 @@ func TestStatsChannel(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStatsChannelUnsubcribe(t *testing.T) {
|
func TestStatsChannelUnsubscribe(t *testing.T) {
|
||||||
c := NewChannel(&ChannelConfig{Blocking: true})
|
c := NewChannel(&ChannelConfig{Blocking: true})
|
||||||
common.Must(c.Start())
|
common.Must(c.Start())
|
||||||
defer c.Close()
|
defer c.Close()
|
||||||
@@ -203,7 +203,7 @@ func TestStatsChannelBlocking(t *testing.T) {
|
|||||||
|
|
||||||
// Test blocking channel publishing
|
// Test blocking channel publishing
|
||||||
go func() {
|
go func() {
|
||||||
// Dummy messsage with no subscriber receiving, will block broadcasting goroutine
|
// Dummy message with no subscriber receiving, will block broadcasting goroutine
|
||||||
c.Publish(context.Background(), nil)
|
c.Publish(context.Background(), nil)
|
||||||
|
|
||||||
<-pauseCh
|
<-pauseCh
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/stats/command/command.proto
|
// source: app/stats/command/command.proto
|
||||||
|
|
||||||
@@ -565,7 +565,7 @@ func file_app_stats_command_command_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_stats_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
var file_app_stats_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
|
||||||
var file_app_stats_command_command_proto_goTypes = []interface{}{
|
var file_app_stats_command_command_proto_goTypes = []any{
|
||||||
(*GetStatsRequest)(nil), // 0: xray.app.stats.command.GetStatsRequest
|
(*GetStatsRequest)(nil), // 0: xray.app.stats.command.GetStatsRequest
|
||||||
(*Stat)(nil), // 1: xray.app.stats.command.Stat
|
(*Stat)(nil), // 1: xray.app.stats.command.Stat
|
||||||
(*GetStatsResponse)(nil), // 2: xray.app.stats.command.GetStatsResponse
|
(*GetStatsResponse)(nil), // 2: xray.app.stats.command.GetStatsResponse
|
||||||
@@ -597,7 +597,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_stats_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetStatsRequest); i {
|
switch v := v.(*GetStatsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -609,7 +609,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Stat); i {
|
switch v := v.(*Stat); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -621,7 +621,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*GetStatsResponse); i {
|
switch v := v.(*GetStatsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -633,7 +633,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*QueryStatsRequest); i {
|
switch v := v.(*QueryStatsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -645,7 +645,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[4].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*QueryStatsResponse); i {
|
switch v := v.(*QueryStatsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -657,7 +657,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[5].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SysStatsRequest); i {
|
switch v := v.(*SysStatsRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -669,7 +669,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[6].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SysStatsResponse); i {
|
switch v := v.(*SysStatsResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -681,7 +681,7 @@ func file_app_stats_command_command_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_command_command_proto_msgTypes[7].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.3.0
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
// - protoc v5.27.0
|
// - protoc v5.27.0
|
||||||
// source: app/stats/command/command.proto
|
// source: app/stats/command/command.proto
|
||||||
|
|
||||||
@@ -15,8 +15,8 @@ import (
|
|||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.32.0 or later.
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion7
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StatsService_GetStats_FullMethodName = "/xray.app.stats.command.StatsService/GetStats"
|
StatsService_GetStats_FullMethodName = "/xray.app.stats.command.StatsService/GetStats"
|
||||||
@@ -42,8 +42,9 @@ func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) {
|
func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(GetStatsResponse)
|
out := new(GetStatsResponse)
|
||||||
err := c.cc.Invoke(ctx, StatsService_GetStats_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, StatsService_GetStats_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -51,8 +52,9 @@ func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStatsRequest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *statsServiceClient) QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) {
|
func (c *statsServiceClient) QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(QueryStatsResponse)
|
out := new(QueryStatsResponse)
|
||||||
err := c.cc.Invoke(ctx, StatsService_QueryStats_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, StatsService_QueryStats_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -60,8 +62,9 @@ func (c *statsServiceClient) QueryStats(ctx context.Context, in *QueryStatsReque
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) {
|
func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
out := new(SysStatsResponse)
|
out := new(SysStatsResponse)
|
||||||
err := c.cc.Invoke(ctx, StatsService_GetSysStats_FullMethodName, in, out, opts...)
|
err := c.cc.Invoke(ctx, StatsService_GetSysStats_FullMethodName, in, out, cOpts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -70,7 +73,7 @@ func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysStatsReques
|
|||||||
|
|
||||||
// StatsServiceServer is the server API for StatsService service.
|
// StatsServiceServer is the server API for StatsService service.
|
||||||
// All implementations must embed UnimplementedStatsServiceServer
|
// All implementations must embed UnimplementedStatsServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility.
|
||||||
type StatsServiceServer interface {
|
type StatsServiceServer interface {
|
||||||
GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error)
|
GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error)
|
||||||
QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error)
|
QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error)
|
||||||
@@ -78,9 +81,12 @@ type StatsServiceServer interface {
|
|||||||
mustEmbedUnimplementedStatsServiceServer()
|
mustEmbedUnimplementedStatsServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedStatsServiceServer must be embedded to have forward compatible implementations.
|
// UnimplementedStatsServiceServer must be embedded to have
|
||||||
type UnimplementedStatsServiceServer struct {
|
// forward compatible implementations.
|
||||||
}
|
//
|
||||||
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||||
|
// pointer dereference when methods are called.
|
||||||
|
type UnimplementedStatsServiceServer struct{}
|
||||||
|
|
||||||
func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) {
|
func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented")
|
||||||
@@ -92,6 +98,7 @@ func (UnimplementedStatsServiceServer) GetSysStats(context.Context, *SysStatsReq
|
|||||||
return nil, status.Errorf(codes.Unimplemented, "method GetSysStats not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetSysStats not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer() {}
|
func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer() {}
|
||||||
|
func (UnimplementedStatsServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
// UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeStatsServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to StatsServiceServer will
|
// Use of this interface is not recommended, as added methods to StatsServiceServer will
|
||||||
@@ -101,6 +108,13 @@ type UnsafeStatsServiceServer interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) {
|
func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedStatsServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
s.RegisterService(&StatsService_ServiceDesc, srv)
|
s.RegisterService(&StatsService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: app/stats/config.proto
|
// source: app/stats/config.proto
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ func file_app_stats_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_app_stats_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_app_stats_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_app_stats_config_proto_goTypes = []interface{}{
|
var file_app_stats_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.app.stats.Config
|
(*Config)(nil), // 0: xray.app.stats.Config
|
||||||
(*ChannelConfig)(nil), // 1: xray.app.stats.ChannelConfig
|
(*ChannelConfig)(nil), // 1: xray.app.stats.ChannelConfig
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ func file_app_stats_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_app_stats_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -185,7 +185,7 @@ func file_app_stats_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_app_stats_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_app_stats_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ChannelConfig); i {
|
switch v := v.(*ChannelConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -18,7 +18,7 @@ func TestStatsCounter(t *testing.T) {
|
|||||||
common.Must(err)
|
common.Must(err)
|
||||||
|
|
||||||
if v := c.Add(1); v != 1 {
|
if v := c.Add(1); v != 1 {
|
||||||
t.Fatal("unpexcted Add(1) return: ", v, ", wanted ", 1)
|
t.Fatal("unexpected Add(1) return: ", v, ", wanted ", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if v := c.Set(0); v != 1 {
|
if v := c.Set(0); v != 1 {
|
||||||
|
@@ -106,7 +106,7 @@ func TestMultiBufferReadAllToByte(t *testing.T) {
|
|||||||
common.Must(err)
|
common.Must(err)
|
||||||
|
|
||||||
if l := len(b); l != 8*1024 {
|
if l := len(b); l != 8*1024 {
|
||||||
t.Error("unexpceted length from ReadAllToBytes", l)
|
t.Error("unexpected length from ReadAllToBytes", l)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -139,7 +139,7 @@ func TestMultiBufferCopy(t *testing.T) {
|
|||||||
mb.Copy(lbdst)
|
mb.Copy(lbdst)
|
||||||
|
|
||||||
if d := cmp.Diff(lb, lbdst); d != "" {
|
if d := cmp.Diff(lb, lbdst); d != "" {
|
||||||
t.Error("unexpceted different from MultiBufferCopy ", d)
|
t.Error("unexpected different from MultiBufferCopy ", d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -41,8 +41,8 @@ type BufferedReader struct {
|
|||||||
Reader Reader
|
Reader Reader
|
||||||
// Buffer is the internal buffer to be read from first
|
// Buffer is the internal buffer to be read from first
|
||||||
Buffer MultiBuffer
|
Buffer MultiBuffer
|
||||||
// Spliter is a function to read bytes from MultiBuffer
|
// Splitter is a function to read bytes from MultiBuffer
|
||||||
Spliter func(MultiBuffer, []byte) (MultiBuffer, int)
|
Splitter func(MultiBuffer, []byte) (MultiBuffer, int)
|
||||||
}
|
}
|
||||||
|
|
||||||
// BufferedBytes returns the number of bytes that is cached in this reader.
|
// BufferedBytes returns the number of bytes that is cached in this reader.
|
||||||
@@ -59,7 +59,7 @@ func (r *BufferedReader) ReadByte() (byte, error) {
|
|||||||
|
|
||||||
// Read implements io.Reader. It reads from internal buffer first (if available) and then reads from the underlying reader.
|
// Read implements io.Reader. It reads from internal buffer first (if available) and then reads from the underlying reader.
|
||||||
func (r *BufferedReader) Read(b []byte) (int, error) {
|
func (r *BufferedReader) Read(b []byte) (int, error) {
|
||||||
spliter := r.Spliter
|
spliter := r.Splitter
|
||||||
if spliter == nil {
|
if spliter == nil {
|
||||||
spliter = SplitBytes
|
spliter = SplitBytes
|
||||||
}
|
}
|
||||||
|
@@ -151,7 +151,7 @@ func LogInfo(ctx context.Context, msg ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LogInfoInner(ctx context.Context, inner error, msg ...interface{}) {
|
func LogInfoInner(ctx context.Context, inner error, msg ...interface{}) {
|
||||||
doLog(ctx, inner, log.Severity_Debug, msg...)
|
doLog(ctx, inner, log.Severity_Info, msg...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogWarning(ctx context.Context, msg ...interface{}) {
|
func LogWarning(ctx context.Context, msg ...interface{}) {
|
||||||
@@ -159,7 +159,7 @@ func LogWarning(ctx context.Context, msg ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LogWarningInner(ctx context.Context, inner error, msg ...interface{}) {
|
func LogWarningInner(ctx context.Context, inner error, msg ...interface{}) {
|
||||||
doLog(ctx, inner, log.Severity_Debug, msg...)
|
doLog(ctx, inner, log.Severity_Warning, msg...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogError(ctx context.Context, msg ...interface{}) {
|
func LogError(ctx context.Context, msg ...interface{}) {
|
||||||
@@ -167,7 +167,7 @@ func LogError(ctx context.Context, msg ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LogErrorInner(ctx context.Context, inner error, msg ...interface{}) {
|
func LogErrorInner(ctx context.Context, inner error, msg ...interface{}) {
|
||||||
doLog(ctx, inner, log.Severity_Debug, msg...)
|
doLog(ctx, inner, log.Severity_Error, msg...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func doLog(ctx context.Context, inner error, severity log.Severity, msg ...interface{}) {
|
func doLog(ctx context.Context, inner error, severity log.Severity, msg ...interface{}) {
|
||||||
|
@@ -31,6 +31,8 @@ type AccessMessage struct {
|
|||||||
|
|
||||||
func (m *AccessMessage) String() string {
|
func (m *AccessMessage) String() string {
|
||||||
builder := strings.Builder{}
|
builder := strings.Builder{}
|
||||||
|
builder.WriteString("from")
|
||||||
|
builder.WriteByte(' ')
|
||||||
builder.WriteString(serial.ToString(m.From))
|
builder.WriteString(serial.ToString(m.From))
|
||||||
builder.WriteByte(' ')
|
builder.WriteByte(' ')
|
||||||
builder.WriteString(string(m.Status))
|
builder.WriteString(string(m.Status))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/log/log.proto
|
// source: common/log/log.proto
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ func file_common_log_log_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_log_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_common_log_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_common_log_log_proto_goTypes = []interface{}{
|
var file_common_log_log_proto_goTypes = []any{
|
||||||
(Severity)(0), // 0: xray.common.log.Severity
|
(Severity)(0), // 0: xray.common.log.Severity
|
||||||
}
|
}
|
||||||
var file_common_log_log_proto_depIdxs = []int32{
|
var file_common_log_log_proto_depIdxs = []int32{
|
||||||
|
@@ -22,7 +22,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ClientManager struct {
|
type ClientManager struct {
|
||||||
Enabled bool // wheather mux is enabled from user config
|
Enabled bool // whether mux is enabled from user config
|
||||||
Picker WorkerPicker
|
Picker WorkerPicker
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -118,6 +118,9 @@ func (w *ServerWorker) handleStatusKeepAlive(meta *FrameMetadata, reader *buf.Bu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata, reader *buf.BufferedReader) error {
|
func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata, reader *buf.BufferedReader) error {
|
||||||
|
// deep-clone outbounds because it is going to be mutated concurrently
|
||||||
|
// (Target and OriginalTarget)
|
||||||
|
ctx = session.ContextCloneOutbounds(ctx)
|
||||||
errors.LogInfo(ctx, "received request for ", meta.Target)
|
errors.LogInfo(ctx, "received request for ", meta.Target)
|
||||||
{
|
{
|
||||||
msg := &log.AccessMessage{
|
msg := &log.AccessMessage{
|
||||||
@@ -170,7 +173,7 @@ func (w *ServerWorker) handleStatusNew(ctx context.Context, meta *FrameMetadata,
|
|||||||
b.Release()
|
b.Release()
|
||||||
mb = nil
|
mb = nil
|
||||||
}
|
}
|
||||||
errors.LogInfoInner(ctx, err,"XUDP hit ", meta.GlobalID)
|
errors.LogInfoInner(ctx, err, "XUDP hit ", meta.GlobalID)
|
||||||
}
|
}
|
||||||
if mb != nil {
|
if mb != nil {
|
||||||
ctx = session.ContextWithTimeoutOnly(ctx, true)
|
ctx = session.ContextWithTimeoutOnly(ctx, true)
|
||||||
|
124
common/mux/server_test.go
Normal file
124
common/mux/server_test.go
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
package mux_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/xtls/xray-core/common"
|
||||||
|
"github.com/xtls/xray-core/common/buf"
|
||||||
|
"github.com/xtls/xray-core/common/mux"
|
||||||
|
"github.com/xtls/xray-core/common/net"
|
||||||
|
"github.com/xtls/xray-core/common/session"
|
||||||
|
"github.com/xtls/xray-core/features/routing"
|
||||||
|
"github.com/xtls/xray-core/transport"
|
||||||
|
"github.com/xtls/xray-core/transport/pipe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func newLinkPair() (*transport.Link, *transport.Link) {
|
||||||
|
opt := pipe.WithoutSizeLimit()
|
||||||
|
uplinkReader, uplinkWriter := pipe.New(opt)
|
||||||
|
downlinkReader, downlinkWriter := pipe.New(opt)
|
||||||
|
|
||||||
|
uplink := &transport.Link{
|
||||||
|
Reader: uplinkReader,
|
||||||
|
Writer: downlinkWriter,
|
||||||
|
}
|
||||||
|
|
||||||
|
downlink := &transport.Link{
|
||||||
|
Reader: downlinkReader,
|
||||||
|
Writer: uplinkWriter,
|
||||||
|
}
|
||||||
|
|
||||||
|
return uplink, downlink
|
||||||
|
}
|
||||||
|
|
||||||
|
type TestDispatcher struct {
|
||||||
|
OnDispatch func(ctx context.Context, dest net.Destination) (*transport.Link, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *TestDispatcher) Dispatch(ctx context.Context, dest net.Destination) (*transport.Link, error) {
|
||||||
|
return d.OnDispatch(ctx, dest)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *TestDispatcher) DispatchLink(ctx context.Context, destination net.Destination, outbound *transport.Link) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *TestDispatcher) Start() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *TestDispatcher) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*TestDispatcher) Type() interface{} {
|
||||||
|
return routing.DispatcherType()
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestRegressionOutboundLeak(t *testing.T) {
|
||||||
|
originalOutbounds := []*session.Outbound{{}}
|
||||||
|
serverCtx := session.ContextWithOutbounds(context.Background(), originalOutbounds)
|
||||||
|
|
||||||
|
websiteUplink, websiteDownlink := newLinkPair()
|
||||||
|
|
||||||
|
dispatcher := TestDispatcher{
|
||||||
|
OnDispatch: func(ctx context.Context, dest net.Destination) (*transport.Link, error) {
|
||||||
|
// emulate what DefaultRouter.Dispatch does, and mutate something on the context
|
||||||
|
ob := session.OutboundsFromContext(ctx)[0]
|
||||||
|
ob.Target = dest
|
||||||
|
return websiteDownlink, nil
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
muxServerUplink, muxServerDownlink := newLinkPair()
|
||||||
|
_, err := mux.NewServerWorker(serverCtx, &dispatcher, muxServerUplink)
|
||||||
|
common.Must(err)
|
||||||
|
|
||||||
|
client, err := mux.NewClientWorker(*muxServerDownlink, mux.ClientStrategy{})
|
||||||
|
common.Must(err)
|
||||||
|
|
||||||
|
clientCtx := session.ContextWithOutbounds(context.Background(), []*session.Outbound{{
|
||||||
|
Target: net.TCPDestination(net.DomainAddress("www.example.com"), 80),
|
||||||
|
}})
|
||||||
|
|
||||||
|
muxClientUplink, muxClientDownlink := newLinkPair()
|
||||||
|
|
||||||
|
ok := client.Dispatch(clientCtx, muxClientUplink)
|
||||||
|
if !ok {
|
||||||
|
t.Error("failed to dispatch")
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
b := buf.FromBytes([]byte("hello"))
|
||||||
|
common.Must(muxClientDownlink.Writer.WriteMultiBuffer(buf.MultiBuffer{b}))
|
||||||
|
}
|
||||||
|
|
||||||
|
resMb, err := websiteUplink.Reader.ReadMultiBuffer()
|
||||||
|
common.Must(err)
|
||||||
|
res := resMb.String()
|
||||||
|
if res != "hello" {
|
||||||
|
t.Error("upload: ", res)
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
b := buf.FromBytes([]byte("world"))
|
||||||
|
common.Must(websiteUplink.Writer.WriteMultiBuffer(buf.MultiBuffer{b}))
|
||||||
|
}
|
||||||
|
|
||||||
|
resMb, err = muxClientDownlink.Reader.ReadMultiBuffer()
|
||||||
|
common.Must(err)
|
||||||
|
res = resMb.String()
|
||||||
|
if res != "world" {
|
||||||
|
t.Error("download: ", res)
|
||||||
|
}
|
||||||
|
|
||||||
|
outbounds := session.OutboundsFromContext(serverCtx)
|
||||||
|
if outbounds[0] != originalOutbounds[0] {
|
||||||
|
t.Error("outbound got reassigned: ", outbounds[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
if outbounds[0].Target.Address != nil {
|
||||||
|
t.Error("outbound target got leaked: ", outbounds[0].Target.String())
|
||||||
|
}
|
||||||
|
}
|
@@ -121,6 +121,11 @@ func IPAddress(ip []byte) Address {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DomainAddress creates an Address with given domain.
|
// DomainAddress creates an Address with given domain.
|
||||||
|
// This is an internal function that forcibly converts a string to domain.
|
||||||
|
// It's mainly used in test files and mux.
|
||||||
|
// Unless you have a specific reason, use net.ParseAddress instead,
|
||||||
|
// as this function does not check whether the input is an IP address.
|
||||||
|
// Otherwise, you will get strange results like domain: 1.1.1.1
|
||||||
func DomainAddress(domain string) Address {
|
func DomainAddress(domain string) Address {
|
||||||
return domainAddress(domain)
|
return domainAddress(domain)
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/net/address.proto
|
// source: common/net/address.proto
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ func file_common_net_address_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_net_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_net_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_net_address_proto_goTypes = []interface{}{
|
var file_common_net_address_proto_goTypes = []any{
|
||||||
(*IPOrDomain)(nil), // 0: xray.common.net.IPOrDomain
|
(*IPOrDomain)(nil), // 0: xray.common.net.IPOrDomain
|
||||||
}
|
}
|
||||||
var file_common_net_address_proto_depIdxs = []int32{
|
var file_common_net_address_proto_depIdxs = []int32{
|
||||||
@@ -153,7 +153,7 @@ func file_common_net_address_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_net_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_net_address_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*IPOrDomain); i {
|
switch v := v.(*IPOrDomain); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -166,7 +166,7 @@ func file_common_net_address_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_common_net_address_proto_msgTypes[0].OneofWrappers = []interface{}{
|
file_common_net_address_proto_msgTypes[0].OneofWrappers = []any{
|
||||||
(*IPOrDomain_Ip)(nil),
|
(*IPOrDomain_Ip)(nil),
|
||||||
(*IPOrDomain_Domain)(nil),
|
(*IPOrDomain_Domain)(nil),
|
||||||
}
|
}
|
||||||
|
@@ -51,8 +51,8 @@ func ConnectionOutputMulti(reader buf.Reader) ConnectionOption {
|
|||||||
func ConnectionOutputMultiUDP(reader buf.Reader) ConnectionOption {
|
func ConnectionOutputMultiUDP(reader buf.Reader) ConnectionOption {
|
||||||
return func(c *connection) {
|
return func(c *connection) {
|
||||||
c.reader = &buf.BufferedReader{
|
c.reader = &buf.BufferedReader{
|
||||||
Reader: reader,
|
Reader: reader,
|
||||||
Spliter: buf.SplitFirstBytes,
|
Splitter: buf.SplitFirstBytes,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/net/destination.proto
|
// source: common/net/destination.proto
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ func file_common_net_destination_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_net_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_net_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_net_destination_proto_goTypes = []interface{}{
|
var file_common_net_destination_proto_goTypes = []any{
|
||||||
(*Endpoint)(nil), // 0: xray.common.net.Endpoint
|
(*Endpoint)(nil), // 0: xray.common.net.Endpoint
|
||||||
(Network)(0), // 1: xray.common.net.Network
|
(Network)(0), // 1: xray.common.net.Network
|
||||||
(*IPOrDomain)(nil), // 2: xray.common.net.IPOrDomain
|
(*IPOrDomain)(nil), // 2: xray.common.net.IPOrDomain
|
||||||
@@ -146,7 +146,7 @@ func file_common_net_destination_proto_init() {
|
|||||||
file_common_net_network_proto_init()
|
file_common_net_network_proto_init()
|
||||||
file_common_net_address_proto_init()
|
file_common_net_address_proto_init()
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_net_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_net_destination_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Endpoint); i {
|
switch v := v.(*Endpoint); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/net/network.proto
|
// source: common/net/network.proto
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ func file_common_net_network_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_common_net_network_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_common_net_network_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_common_net_network_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_net_network_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_net_network_proto_goTypes = []interface{}{
|
var file_common_net_network_proto_goTypes = []any{
|
||||||
(Network)(0), // 0: xray.common.net.Network
|
(Network)(0), // 0: xray.common.net.Network
|
||||||
(*NetworkList)(nil), // 1: xray.common.net.NetworkList
|
(*NetworkList)(nil), // 1: xray.common.net.NetworkList
|
||||||
}
|
}
|
||||||
@@ -179,7 +179,7 @@ func file_common_net_network_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_net_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_net_network_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*NetworkList); i {
|
switch v := v.(*NetworkList); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/net/port.proto
|
// source: common/net/port.proto
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ func file_common_net_port_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_net_port_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
var file_common_net_port_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
var file_common_net_port_proto_goTypes = []interface{}{
|
var file_common_net_port_proto_goTypes = []any{
|
||||||
(*PortRange)(nil), // 0: xray.common.net.PortRange
|
(*PortRange)(nil), // 0: xray.common.net.PortRange
|
||||||
(*PortList)(nil), // 1: xray.common.net.PortList
|
(*PortList)(nil), // 1: xray.common.net.PortList
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ func file_common_net_port_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_net_port_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_net_port_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*PortRange); i {
|
switch v := v.(*PortRange); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -190,7 +190,7 @@ func file_common_net_port_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_common_net_port_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_common_net_port_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*PortList); i {
|
switch v := v.(*PortList); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -19,7 +19,7 @@ func GetToolLocation(file string) string {
|
|||||||
return filepath.Join(toolPath, file+".exe")
|
return filepath.Join(toolPath, file+".exe")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAssetLocation searches for `file` in the excutable dir
|
// GetAssetLocation searches for `file` in the executable dir
|
||||||
func GetAssetLocation(file string) string {
|
func GetAssetLocation(file string) string {
|
||||||
assetPath := NewEnvFlag(AssetLocation).GetValue(getExecutableDir)
|
assetPath := NewEnvFlag(AssetLocation).GetValue(getExecutableDir)
|
||||||
return filepath.Join(assetPath, file)
|
return filepath.Join(assetPath, file)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/protocol/headers.proto
|
// source: common/protocol/headers.proto
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ func file_common_protocol_headers_proto_rawDescGZIP() []byte {
|
|||||||
|
|
||||||
var file_common_protocol_headers_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_common_protocol_headers_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_common_protocol_headers_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_protocol_headers_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_protocol_headers_proto_goTypes = []interface{}{
|
var file_common_protocol_headers_proto_goTypes = []any{
|
||||||
(SecurityType)(0), // 0: xray.common.protocol.SecurityType
|
(SecurityType)(0), // 0: xray.common.protocol.SecurityType
|
||||||
(*SecurityConfig)(nil), // 1: xray.common.protocol.SecurityConfig
|
(*SecurityConfig)(nil), // 1: xray.common.protocol.SecurityConfig
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@ func file_common_protocol_headers_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_protocol_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_protocol_headers_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*SecurityConfig); i {
|
switch v := v.(*SecurityConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/protocol/server_spec.proto
|
// source: common/protocol/server_spec.proto
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ func file_common_protocol_server_spec_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_protocol_server_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_protocol_server_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_protocol_server_spec_proto_goTypes = []interface{}{
|
var file_common_protocol_server_spec_proto_goTypes = []any{
|
||||||
(*ServerEndpoint)(nil), // 0: xray.common.protocol.ServerEndpoint
|
(*ServerEndpoint)(nil), // 0: xray.common.protocol.ServerEndpoint
|
||||||
(*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain
|
(*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain
|
||||||
(*User)(nil), // 2: xray.common.protocol.User
|
(*User)(nil), // 2: xray.common.protocol.User
|
||||||
@@ -147,7 +147,7 @@ func file_common_protocol_server_spec_proto_init() {
|
|||||||
}
|
}
|
||||||
file_common_protocol_user_proto_init()
|
file_common_protocol_user_proto_init()
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_protocol_server_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_protocol_server_spec_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ServerEndpoint); i {
|
switch v := v.(*ServerEndpoint); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -19,7 +19,7 @@ import (
|
|||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
||||||
|
|
||||||
type Certificate struct {
|
type Certificate struct {
|
||||||
// Cerificate in ASN.1 DER format
|
// certificate in ASN.1 DER format
|
||||||
Certificate []byte
|
Certificate []byte
|
||||||
// Private key in ASN.1 DER format
|
// Private key in ASN.1 DER format
|
||||||
PrivateKey []byte
|
PrivateKey []byte
|
||||||
@@ -149,10 +149,6 @@ func Generate(parent *Certificate, opts ...Option) (*Certificate, error) {
|
|||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, opt := range opts {
|
|
||||||
opt(template)
|
|
||||||
}
|
|
||||||
|
|
||||||
parentCert := template
|
parentCert := template
|
||||||
if parent != nil {
|
if parent != nil {
|
||||||
pCert, err := x509.ParseCertificate(parent.Certificate)
|
pCert, err := x509.ParseCertificate(parent.Certificate)
|
||||||
@@ -162,6 +158,17 @@ func Generate(parent *Certificate, opts ...Option) (*Certificate, error) {
|
|||||||
parentCert = pCert
|
parentCert = pCert
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if parentCert.NotAfter.Before(template.NotAfter) {
|
||||||
|
template.NotAfter = parentCert.NotAfter
|
||||||
|
}
|
||||||
|
if parentCert.NotBefore.After(template.NotBefore) {
|
||||||
|
template.NotBefore = parentCert.NotBefore
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, opt := range opts {
|
||||||
|
opt(template)
|
||||||
|
}
|
||||||
|
|
||||||
derBytes, err := x509.CreateCertificate(rand.Reader, template, parentCert, publicKey(selfKey), parentKey)
|
derBytes, err := x509.CreateCertificate(rand.Reader, template, parentCert, publicKey(selfKey), parentKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("failed to create certificate").Base(err)
|
return nil, errors.New("failed to create certificate").Base(err)
|
||||||
|
@@ -147,7 +147,7 @@ func TestTLSHeaders(t *testing.T) {
|
|||||||
header, err := SniffTLS(test.input)
|
header, err := SniffTLS(test.input)
|
||||||
if test.err {
|
if test.err {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("Exepct error but nil in test %v", test)
|
t.Errorf("Expect error but nil in test %v", test)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/protocol/user.proto
|
// source: common/protocol/user.proto
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
// User is a generic user for all procotols.
|
// User is a generic user for all protocols.
|
||||||
type User struct {
|
type User struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -124,7 +124,7 @@ func file_common_protocol_user_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_protocol_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_protocol_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_protocol_user_proto_goTypes = []interface{}{
|
var file_common_protocol_user_proto_goTypes = []any{
|
||||||
(*User)(nil), // 0: xray.common.protocol.User
|
(*User)(nil), // 0: xray.common.protocol.User
|
||||||
(*serial.TypedMessage)(nil), // 1: xray.common.serial.TypedMessage
|
(*serial.TypedMessage)(nil), // 1: xray.common.serial.TypedMessage
|
||||||
}
|
}
|
||||||
@@ -143,7 +143,7 @@ func file_common_protocol_user_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_protocol_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_protocol_user_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*User); i {
|
switch v := v.(*User); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -8,7 +8,7 @@ option java_multiple_files = true;
|
|||||||
|
|
||||||
import "common/serial/typed_message.proto";
|
import "common/serial/typed_message.proto";
|
||||||
|
|
||||||
// User is a generic user for all procotols.
|
// User is a generic user for all protocols.
|
||||||
message User {
|
message User {
|
||||||
uint32 level = 1;
|
uint32 level = 1;
|
||||||
string email = 2;
|
string email = 2;
|
||||||
|
@@ -1,22 +1,36 @@
|
|||||||
package reflect
|
package reflect
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
cnet "github.com/xtls/xray-core/common/net"
|
||||||
cserial "github.com/xtls/xray-core/common/serial"
|
cserial "github.com/xtls/xray-core/common/serial"
|
||||||
|
"github.com/xtls/xray-core/infra/conf"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MarshalToJson(v interface{}) (string, bool) {
|
func MarshalToJson(v interface{}, insertTypeInfo bool) (string, bool) {
|
||||||
if itf := marshalInterface(v, true); itf != nil {
|
if itf := marshalInterface(v, true, insertTypeInfo); itf != nil {
|
||||||
if b, err := json.MarshalIndent(itf, "", " "); err == nil {
|
if b, err := JSONMarshalWithoutEscape(itf); err == nil {
|
||||||
return string(b[:]), true
|
return string(b[:]), true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalTypedMessage(v *cserial.TypedMessage, ignoreNullValue bool) interface{} {
|
func JSONMarshalWithoutEscape(t interface{}) ([]byte, error) {
|
||||||
|
buffer := &bytes.Buffer{}
|
||||||
|
encoder := json.NewEncoder(buffer)
|
||||||
|
encoder.SetIndent("", " ")
|
||||||
|
encoder.SetEscapeHTML(false)
|
||||||
|
err := encoder.Encode(t)
|
||||||
|
return buffer.Bytes(), err
|
||||||
|
}
|
||||||
|
|
||||||
|
func marshalTypedMessage(v *cserial.TypedMessage, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -24,36 +38,67 @@ func marshalTypedMessage(v *cserial.TypedMessage, ignoreNullValue bool) interfac
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
r := marshalInterface(tmsg, ignoreNullValue)
|
r := marshalInterface(tmsg, ignoreNullValue, insertTypeInfo)
|
||||||
if msg, ok := r.(map[string]interface{}); ok {
|
if msg, ok := r.(map[string]interface{}); ok && insertTypeInfo {
|
||||||
msg["_TypedMessage_"] = v.Type
|
msg["_TypedMessage_"] = v.Type
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalSlice(v reflect.Value, ignoreNullValue bool) interface{} {
|
func marshalSlice(v reflect.Value, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||||
r := make([]interface{}, 0)
|
r := make([]interface{}, 0)
|
||||||
for i := 0; i < v.Len(); i++ {
|
for i := 0; i < v.Len(); i++ {
|
||||||
rv := v.Index(i)
|
rv := v.Index(i)
|
||||||
if rv.CanInterface() {
|
if rv.CanInterface() {
|
||||||
value := rv.Interface()
|
value := rv.Interface()
|
||||||
r = append(r, marshalInterface(value, ignoreNullValue))
|
r = append(r, marshalInterface(value, ignoreNullValue, insertTypeInfo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalStruct(v reflect.Value, ignoreNullValue bool) interface{} {
|
func isNullValue(f reflect.StructField, rv reflect.Value) bool {
|
||||||
|
if rv.Kind() == reflect.String && rv.Len() == 0 {
|
||||||
|
return true
|
||||||
|
} else if !isValueKind(rv.Kind()) && rv.IsNil() {
|
||||||
|
return true
|
||||||
|
} else if tag := f.Tag.Get("json"); strings.Contains(tag, "omitempty") {
|
||||||
|
if !rv.IsValid() || rv.IsZero() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func toJsonName(f reflect.StructField) string {
|
||||||
|
if tags := f.Tag.Get("protobuf"); len(tags) > 0 {
|
||||||
|
for _, tag := range strings.Split(tags, ",") {
|
||||||
|
if before, after, ok := strings.Cut(tag, "="); ok && before == "json" {
|
||||||
|
return after
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if tag := f.Tag.Get("json"); len(tag) > 0 {
|
||||||
|
if before, _, ok := strings.Cut(tag, ","); ok {
|
||||||
|
return before
|
||||||
|
} else {
|
||||||
|
return tag
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return f.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
func marshalStruct(v reflect.Value, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||||
r := make(map[string]interface{})
|
r := make(map[string]interface{})
|
||||||
t := v.Type()
|
t := v.Type()
|
||||||
for i := 0; i < v.NumField(); i++ {
|
for i := 0; i < v.NumField(); i++ {
|
||||||
rv := v.Field(i)
|
rv := v.Field(i)
|
||||||
if rv.CanInterface() {
|
if rv.CanInterface() {
|
||||||
ft := t.Field(i)
|
ft := t.Field(i)
|
||||||
name := ft.Name
|
if !ignoreNullValue || !isNullValue(ft, rv) {
|
||||||
value := rv.Interface()
|
name := toJsonName(ft)
|
||||||
tv := marshalInterface(value, ignoreNullValue)
|
value := rv.Interface()
|
||||||
if tv != nil || !ignoreNullValue {
|
tv := marshalInterface(value, ignoreNullValue, insertTypeInfo)
|
||||||
r[name] = tv
|
r[name] = tv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,7 +106,7 @@ func marshalStruct(v reflect.Value, ignoreNullValue bool) interface{} {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalMap(v reflect.Value, ignoreNullValue bool) interface{} {
|
func marshalMap(v reflect.Value, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||||
// policy.level is map[uint32] *struct
|
// policy.level is map[uint32] *struct
|
||||||
kt := v.Type().Key()
|
kt := v.Type().Key()
|
||||||
vt := reflect.TypeOf((*interface{})(nil))
|
vt := reflect.TypeOf((*interface{})(nil))
|
||||||
@@ -71,7 +116,7 @@ func marshalMap(v reflect.Value, ignoreNullValue bool) interface{} {
|
|||||||
rv := v.MapIndex(key)
|
rv := v.MapIndex(key)
|
||||||
if rv.CanInterface() {
|
if rv.CanInterface() {
|
||||||
iv := rv.Interface()
|
iv := rv.Interface()
|
||||||
tv := marshalInterface(iv, ignoreNullValue)
|
tv := marshalInterface(iv, ignoreNullValue, insertTypeInfo)
|
||||||
if tv != nil || !ignoreNullValue {
|
if tv != nil || !ignoreNullValue {
|
||||||
r.SetMapIndex(key, reflect.ValueOf(&tv))
|
r.SetMapIndex(key, reflect.ValueOf(&tv))
|
||||||
}
|
}
|
||||||
@@ -87,27 +132,63 @@ func marshalIString(v interface{}) (r string, ok bool) {
|
|||||||
ok = false
|
ok = false
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if iStringFn, ok := v.(interface{ String() string }); ok {
|
if iStringFn, ok := v.(interface{ String() string }); ok {
|
||||||
return iStringFn.String(), true
|
return iStringFn.String(), true
|
||||||
}
|
}
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalKnownType(v interface{}, ignoreNullValue bool) (interface{}, bool) {
|
func serializePortList(portList *cnet.PortList) (interface{}, bool) {
|
||||||
|
if portList == nil {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
|
n := len(portList.Range)
|
||||||
|
if n == 1 {
|
||||||
|
if first := portList.Range[0]; first.From == first.To {
|
||||||
|
return first.From, true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
r := make([]string, 0, n)
|
||||||
|
for _, pr := range portList.Range {
|
||||||
|
if pr.From == pr.To {
|
||||||
|
r = append(r, pr.FromPort().String())
|
||||||
|
} else {
|
||||||
|
r = append(r, fmt.Sprintf("%d-%d", pr.From, pr.To))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return strings.Join(r, ","), true
|
||||||
|
}
|
||||||
|
|
||||||
|
func marshalKnownType(v interface{}, ignoreNullValue bool, insertTypeInfo bool) (interface{}, bool) {
|
||||||
switch ty := v.(type) {
|
switch ty := v.(type) {
|
||||||
case cserial.TypedMessage:
|
case cserial.TypedMessage:
|
||||||
return marshalTypedMessage(&ty, ignoreNullValue), true
|
return marshalTypedMessage(&ty, ignoreNullValue, insertTypeInfo), true
|
||||||
case *cserial.TypedMessage:
|
case *cserial.TypedMessage:
|
||||||
return marshalTypedMessage(ty, ignoreNullValue), true
|
return marshalTypedMessage(ty, ignoreNullValue, insertTypeInfo), true
|
||||||
case map[string]json.RawMessage:
|
case map[string]json.RawMessage:
|
||||||
return ty, true
|
return ty, true
|
||||||
case []json.RawMessage:
|
case []json.RawMessage:
|
||||||
return ty, true
|
return ty, true
|
||||||
case *json.RawMessage:
|
case *json.RawMessage, json.RawMessage:
|
||||||
return ty, true
|
|
||||||
case json.RawMessage:
|
|
||||||
return ty, true
|
return ty, true
|
||||||
|
case *cnet.IPOrDomain:
|
||||||
|
if domain := v.(*cnet.IPOrDomain); domain != nil {
|
||||||
|
return domain.AsAddress().String(), true
|
||||||
|
}
|
||||||
|
return nil, false
|
||||||
|
case *cnet.PortList:
|
||||||
|
npl := v.(*cnet.PortList)
|
||||||
|
return serializePortList(npl)
|
||||||
|
case *conf.PortList:
|
||||||
|
cpl := v.(*conf.PortList)
|
||||||
|
return serializePortList(cpl.Build())
|
||||||
|
case cnet.Address:
|
||||||
|
if addr := v.(cnet.Address); addr != nil {
|
||||||
|
return addr.String(), true
|
||||||
|
}
|
||||||
|
return nil, false
|
||||||
default:
|
default:
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
@@ -138,9 +219,9 @@ func isValueKind(kind reflect.Kind) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func marshalInterface(v interface{}, ignoreNullValue bool) interface{} {
|
func marshalInterface(v interface{}, ignoreNullValue bool, insertTypeInfo bool) interface{} {
|
||||||
|
|
||||||
if r, ok := marshalKnownType(v, ignoreNullValue); ok {
|
if r, ok := marshalKnownType(v, ignoreNullValue, insertTypeInfo); ok {
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,19 +233,27 @@ func marshalInterface(v interface{}, ignoreNullValue bool) interface{} {
|
|||||||
if k == reflect.Invalid {
|
if k == reflect.Invalid {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if isValueKind(k) {
|
|
||||||
|
if ty := rv.Type().Name(); isValueKind(k) {
|
||||||
|
if k.String() != ty {
|
||||||
|
if s, ok := marshalIString(v); ok {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
}
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fmt.Println("kind:", k, "type:", rv.Type().Name())
|
||||||
|
|
||||||
switch k {
|
switch k {
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
return marshalStruct(rv, ignoreNullValue)
|
return marshalStruct(rv, ignoreNullValue, insertTypeInfo)
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
return marshalSlice(rv, ignoreNullValue)
|
return marshalSlice(rv, ignoreNullValue, insertTypeInfo)
|
||||||
case reflect.Array:
|
case reflect.Array:
|
||||||
return marshalSlice(rv, ignoreNullValue)
|
return marshalSlice(rv, ignoreNullValue, insertTypeInfo)
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
return marshalMap(rv, ignoreNullValue)
|
return marshalMap(rv, ignoreNullValue, insertTypeInfo)
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@@ -6,11 +6,40 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/xtls/xray-core/common/protocol"
|
||||||
. "github.com/xtls/xray-core/common/reflect"
|
. "github.com/xtls/xray-core/common/reflect"
|
||||||
cserial "github.com/xtls/xray-core/common/serial"
|
cserial "github.com/xtls/xray-core/common/serial"
|
||||||
iserial "github.com/xtls/xray-core/infra/conf/serial"
|
iserial "github.com/xtls/xray-core/infra/conf/serial"
|
||||||
|
"github.com/xtls/xray-core/proxy/shadowsocks"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMashalAccount(t *testing.T) {
|
||||||
|
account := &shadowsocks.Account{
|
||||||
|
Password: "shadowsocks-password",
|
||||||
|
CipherType: shadowsocks.CipherType_CHACHA20_POLY1305,
|
||||||
|
}
|
||||||
|
|
||||||
|
user := &protocol.User{
|
||||||
|
Level: 0,
|
||||||
|
Email: "love@v2ray.com",
|
||||||
|
Account: cserial.ToTypedMessage(account),
|
||||||
|
}
|
||||||
|
|
||||||
|
j, ok := MarshalToJson(user, false)
|
||||||
|
if !ok || strings.Contains(j, "_TypedMessage_") {
|
||||||
|
|
||||||
|
t.Error("marshal account failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
kws := []string{"CHACHA20_POLY1305", "cipherType", "shadowsocks-password"}
|
||||||
|
for _, kw := range kws {
|
||||||
|
if !strings.Contains(j, kw) {
|
||||||
|
t.Error("marshal account failed")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// t.Log(j)
|
||||||
|
}
|
||||||
|
|
||||||
func TestMashalStruct(t *testing.T) {
|
func TestMashalStruct(t *testing.T) {
|
||||||
type Foo = struct {
|
type Foo = struct {
|
||||||
N int `json:"n"`
|
N int `json:"n"`
|
||||||
@@ -36,8 +65,8 @@ func TestMashalStruct(t *testing.T) {
|
|||||||
Arr: &arr,
|
Arr: &arr,
|
||||||
}
|
}
|
||||||
|
|
||||||
s, ok1 := MarshalToJson(f1)
|
s, ok1 := MarshalToJson(f1, true)
|
||||||
sp, ok2 := MarshalToJson(&f1)
|
sp, ok2 := MarshalToJson(&f1, true)
|
||||||
|
|
||||||
if !ok1 || !ok2 || s != sp {
|
if !ok1 || !ok2 || s != sp {
|
||||||
t.Error("marshal failed")
|
t.Error("marshal failed")
|
||||||
@@ -69,7 +98,7 @@ func TestMarshalConfigJson(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmsg := cserial.ToTypedMessage(bc)
|
tmsg := cserial.ToTypedMessage(bc)
|
||||||
tc, ok := MarshalToJson(tmsg)
|
tc, ok := MarshalToJson(tmsg, true)
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Error("marshal config failed")
|
t.Error("marshal config failed")
|
||||||
}
|
}
|
||||||
@@ -79,15 +108,14 @@ func TestMarshalConfigJson(t *testing.T) {
|
|||||||
keywords := []string{
|
keywords := []string{
|
||||||
"4784f9b8-a879-4fec-9718-ebddefa47750",
|
"4784f9b8-a879-4fec-9718-ebddefa47750",
|
||||||
"bing.com",
|
"bing.com",
|
||||||
"DomainStrategy",
|
"inboundTag",
|
||||||
"InboundTag",
|
"level",
|
||||||
"Level",
|
"stats",
|
||||||
"Stats",
|
"userDownlink",
|
||||||
"UserDownlink",
|
"userUplink",
|
||||||
"UserUplink",
|
"system",
|
||||||
"System",
|
"inboundDownlink",
|
||||||
"InboundDownlink",
|
"outboundUplink",
|
||||||
"OutboundUplink",
|
|
||||||
}
|
}
|
||||||
for _, kw := range keywords {
|
for _, kw := range keywords {
|
||||||
if !strings.Contains(tc, kw) {
|
if !strings.Contains(tc, kw) {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: common/serial/typed_message.proto
|
// source: common/serial/typed_message.proto
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ func file_common_serial_typed_message_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_common_serial_typed_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_common_serial_typed_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_common_serial_typed_message_proto_goTypes = []interface{}{
|
var file_common_serial_typed_message_proto_goTypes = []any{
|
||||||
(*TypedMessage)(nil), // 0: xray.common.serial.TypedMessage
|
(*TypedMessage)(nil), // 0: xray.common.serial.TypedMessage
|
||||||
}
|
}
|
||||||
var file_common_serial_typed_message_proto_depIdxs = []int32{
|
var file_common_serial_typed_message_proto_depIdxs = []int32{
|
||||||
@@ -127,7 +127,7 @@ func file_common_serial_typed_message_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_common_serial_typed_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_common_serial_typed_message_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*TypedMessage); i {
|
switch v := v.(*TypedMessage); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -13,16 +13,16 @@ import (
|
|||||||
func IndependentCancelCtx(parent context.Context) context.Context
|
func IndependentCancelCtx(parent context.Context) context.Context
|
||||||
|
|
||||||
const (
|
const (
|
||||||
inboundSessionKey ctx.SessionKey = 1
|
inboundSessionKey ctx.SessionKey = 1
|
||||||
outboundSessionKey ctx.SessionKey = 2
|
outboundSessionKey ctx.SessionKey = 2
|
||||||
contentSessionKey ctx.SessionKey = 3
|
contentSessionKey ctx.SessionKey = 3
|
||||||
muxPreferedSessionKey ctx.SessionKey = 4
|
muxPreferredSessionKey ctx.SessionKey = 4
|
||||||
sockoptSessionKey ctx.SessionKey = 5
|
sockoptSessionKey ctx.SessionKey = 5
|
||||||
trackedConnectionErrorKey ctx.SessionKey = 6
|
trackedConnectionErrorKey ctx.SessionKey = 6
|
||||||
dispatcherKey ctx.SessionKey = 7
|
dispatcherKey ctx.SessionKey = 7
|
||||||
timeoutOnlyKey ctx.SessionKey = 8
|
timeoutOnlyKey ctx.SessionKey = 8
|
||||||
allowedNetworkKey ctx.SessionKey = 9
|
allowedNetworkKey ctx.SessionKey = 9
|
||||||
handlerSessionKey ctx.SessionKey = 10
|
handlerSessionKey ctx.SessionKey = 10
|
||||||
)
|
)
|
||||||
|
|
||||||
func ContextWithInbound(ctx context.Context, inbound *Inbound) context.Context {
|
func ContextWithInbound(ctx context.Context, inbound *Inbound) context.Context {
|
||||||
@@ -40,6 +40,22 @@ func ContextWithOutbounds(ctx context.Context, outbounds []*Outbound) context.Co
|
|||||||
return context.WithValue(ctx, outboundSessionKey, outbounds)
|
return context.WithValue(ctx, outboundSessionKey, outbounds)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ContextCloneOutbounds(ctx context.Context) context.Context {
|
||||||
|
outbounds := OutboundsFromContext(ctx)
|
||||||
|
newOutbounds := make([]*Outbound, len(outbounds))
|
||||||
|
for i, ob := range outbounds {
|
||||||
|
if ob == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy outbound by value
|
||||||
|
v := *ob
|
||||||
|
newOutbounds[i] = &v
|
||||||
|
}
|
||||||
|
|
||||||
|
return ContextWithOutbounds(ctx, newOutbounds)
|
||||||
|
}
|
||||||
|
|
||||||
func OutboundsFromContext(ctx context.Context) []*Outbound {
|
func OutboundsFromContext(ctx context.Context) []*Outbound {
|
||||||
if outbounds, ok := ctx.Value(outboundSessionKey).([]*Outbound); ok {
|
if outbounds, ok := ctx.Value(outboundSessionKey).([]*Outbound); ok {
|
||||||
return outbounds
|
return outbounds
|
||||||
@@ -58,14 +74,14 @@ func ContentFromContext(ctx context.Context) *Content {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContextWithMuxPrefered returns a new context with the given bool
|
// ContextWithMuxPreferred returns a new context with the given bool
|
||||||
func ContextWithMuxPrefered(ctx context.Context, forced bool) context.Context {
|
func ContextWithMuxPreferred(ctx context.Context, forced bool) context.Context {
|
||||||
return context.WithValue(ctx, muxPreferedSessionKey, forced)
|
return context.WithValue(ctx, muxPreferredSessionKey, forced)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MuxPreferedFromContext returns value in this context, or false if not contained.
|
// MuxPreferredFromContext returns value in this context, or false if not contained.
|
||||||
func MuxPreferedFromContext(ctx context.Context) bool {
|
func MuxPreferredFromContext(ctx context.Context) bool {
|
||||||
if val, ok := ctx.Value(muxPreferedSessionKey).(bool); ok {
|
if val, ok := ctx.Value(muxPreferredSessionKey).(bool); ok {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@@ -29,7 +29,7 @@ func TestActivityTimerUpdate(t *testing.T) {
|
|||||||
timer.SetTimeout(time.Second * 1)
|
timer.SetTimeout(time.Second * 1)
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 2)
|
||||||
if ctx.Err() == nil {
|
if ctx.Err() == nil {
|
||||||
t.Error("expcted some error, but got nil")
|
t.Error("expected some error, but got nil")
|
||||||
}
|
}
|
||||||
runtime.KeepAlive(timer)
|
runtime.KeepAlive(timer)
|
||||||
}
|
}
|
||||||
|
@@ -19,14 +19,19 @@ type ConfigFormat struct {
|
|||||||
Loader ConfigLoader
|
Loader ConfigLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ConfigSource struct {
|
||||||
|
Name string
|
||||||
|
Format string
|
||||||
|
}
|
||||||
|
|
||||||
// ConfigLoader is a utility to load Xray config from external source.
|
// ConfigLoader is a utility to load Xray config from external source.
|
||||||
type ConfigLoader func(input interface{}) (*Config, error)
|
type ConfigLoader func(input interface{}) (*Config, error)
|
||||||
|
|
||||||
// ConfigBuilder is a builder to build core.Config from filenames and formats
|
// ConfigBuilder is a builder to build core.Config from filenames and formats
|
||||||
type ConfigBuilder func(files []string, formats []string) (*Config, error)
|
type ConfigBuilder func(files []*ConfigSource) (*Config, error)
|
||||||
|
|
||||||
// ConfigsMerger merge multiple json configs into on config
|
// ConfigsMerger merge multiple json configs into on config
|
||||||
type ConfigsMerger func(files []string, formats []string) (string, error)
|
type ConfigsMerger func(files []*ConfigSource) (string, error)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
configLoaderByName = make(map[string]*ConfigFormat)
|
configLoaderByName = make(map[string]*ConfigFormat)
|
||||||
@@ -55,20 +60,21 @@ func RegisterConfigLoader(format *ConfigFormat) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetMergedConfig(args cmdarg.Arg) (string, error) {
|
func GetMergedConfig(args cmdarg.Arg) (string, error) {
|
||||||
files := make([]string, 0)
|
var files []*ConfigSource
|
||||||
formats := make([]string, 0)
|
|
||||||
supported := []string{"json", "yaml", "toml"}
|
supported := []string{"json", "yaml", "toml"}
|
||||||
for _, file := range args {
|
for _, file := range args {
|
||||||
format := getFormat(file)
|
format := getFormat(file)
|
||||||
for _, s := range supported {
|
for _, s := range supported {
|
||||||
if s == format {
|
if s == format {
|
||||||
files = append(files, file)
|
files = append(files, &ConfigSource{
|
||||||
formats = append(formats, format)
|
Name: file,
|
||||||
|
Format: format,
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ConfigMergedFormFiles(files, formats)
|
return ConfigMergedFormFiles(files)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetFormatByExtension(ext string) string {
|
func GetFormatByExtension(ext string) string {
|
||||||
@@ -101,7 +107,7 @@ func getFormat(filename string) string {
|
|||||||
func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
||||||
switch v := input.(type) {
|
switch v := input.(type) {
|
||||||
case cmdarg.Arg:
|
case cmdarg.Arg:
|
||||||
formats := make([]string, len(v))
|
files := make([]*ConfigSource, len(v))
|
||||||
hasProtobuf := false
|
hasProtobuf := false
|
||||||
for i, file := range v {
|
for i, file := range v {
|
||||||
var f string
|
var f string
|
||||||
@@ -123,7 +129,10 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
|||||||
if f == "protobuf" {
|
if f == "protobuf" {
|
||||||
hasProtobuf = true
|
hasProtobuf = true
|
||||||
}
|
}
|
||||||
formats[i] = f
|
files[i] = &ConfigSource{
|
||||||
|
Name: file,
|
||||||
|
Format: f,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// only one protobuf config file is allowed
|
// only one protobuf config file is allowed
|
||||||
@@ -136,8 +145,7 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// to avoid import cycle
|
// to avoid import cycle
|
||||||
return ConfigBuilderForFiles(v, formats)
|
return ConfigBuilderForFiles(files)
|
||||||
|
|
||||||
case io.Reader:
|
case io.Reader:
|
||||||
if f, found := configLoaderByName[formatName]; found {
|
if f, found := configLoaderByName[formatName]; found {
|
||||||
return f.Loader(v)
|
return f.Loader(v)
|
||||||
@@ -174,7 +182,7 @@ func init() {
|
|||||||
common.Must(err)
|
common.Must(err)
|
||||||
return loadProtobufConfig(data)
|
return loadProtobufConfig(data)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknow type")
|
return nil, errors.New("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: core/config.proto
|
// source: core/config.proto
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ func file_core_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_core_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_core_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_core_config_proto_goTypes = []interface{}{
|
var file_core_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.core.Config
|
(*Config)(nil), // 0: xray.core.Config
|
||||||
(*InboundHandlerConfig)(nil), // 1: xray.core.InboundHandlerConfig
|
(*InboundHandlerConfig)(nil), // 1: xray.core.InboundHandlerConfig
|
||||||
(*OutboundHandlerConfig)(nil), // 2: xray.core.OutboundHandlerConfig
|
(*OutboundHandlerConfig)(nil), // 2: xray.core.OutboundHandlerConfig
|
||||||
@@ -377,7 +377,7 @@ func file_core_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_core_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_core_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -389,7 +389,7 @@ func file_core_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_core_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_core_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*InboundHandlerConfig); i {
|
switch v := v.(*InboundHandlerConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -401,7 +401,7 @@ func file_core_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_core_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_core_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*OutboundHandlerConfig); i {
|
switch v := v.(*OutboundHandlerConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -19,9 +19,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Version_x byte = 1
|
Version_x byte = 24
|
||||||
Version_y byte = 8
|
Version_y byte = 9
|
||||||
Version_z byte = 16
|
Version_z byte = 7
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
package core
|
package core
|
||||||
|
|
||||||
//go:generate go install -v google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
//go:generate go install -v google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
||||||
//go:generate go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
//go:generate go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
|
||||||
//go:generate go run ../infra/vprotogen/main.go -pwd ./..
|
//go:generate go run ../infra/vprotogen/main.go -pwd ./..
|
||||||
|
34
go.mod
34
go.mod
@@ -1,33 +1,33 @@
|
|||||||
module github.com/xtls/xray-core
|
module github.com/xtls/xray-core
|
||||||
|
|
||||||
go 1.22
|
go 1.21.4
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0
|
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0
|
||||||
github.com/cloudflare/circl v1.3.9
|
github.com/cloudflare/circl v1.4.0
|
||||||
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344
|
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344
|
||||||
github.com/golang/mock v1.7.0-rc.1
|
github.com/golang/mock v1.7.0-rc.1
|
||||||
github.com/google/go-cmp v0.6.0
|
github.com/google/go-cmp v0.6.0
|
||||||
github.com/gorilla/websocket v1.5.3
|
github.com/gorilla/websocket v1.5.3
|
||||||
github.com/miekg/dns v1.1.61
|
github.com/miekg/dns v1.1.62
|
||||||
github.com/pelletier/go-toml v1.9.5
|
github.com/pelletier/go-toml v1.9.5
|
||||||
github.com/pires/go-proxyproto v0.7.0
|
github.com/pires/go-proxyproto v0.7.0
|
||||||
github.com/quic-go/quic-go v0.45.1
|
github.com/quic-go/quic-go v0.46.0
|
||||||
github.com/refraction-networking/utls v1.6.6
|
github.com/refraction-networking/utls v1.6.7
|
||||||
github.com/sagernet/sing v0.4.1
|
github.com/sagernet/sing v0.4.1
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.6
|
github.com/sagernet/sing-shadowsocks v0.2.7
|
||||||
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb
|
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e
|
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e
|
||||||
github.com/vishvananda/netlink v1.2.1-beta.2.0.20230316163032-ced5aaba43e3
|
github.com/vishvananda/netlink v1.3.0
|
||||||
github.com/xtls/reality v0.0.0-20240429224917-ecc4401070cc
|
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
||||||
golang.org/x/crypto v0.24.0
|
golang.org/x/crypto v0.27.0
|
||||||
golang.org/x/net v0.26.0
|
golang.org/x/net v0.29.0
|
||||||
golang.org/x/sync v0.7.0
|
golang.org/x/sync v0.8.0
|
||||||
golang.org/x/sys v0.21.0
|
golang.org/x/sys v0.25.0
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
||||||
google.golang.org/grpc v1.65.0
|
google.golang.org/grpc v1.66.0
|
||||||
google.golang.org/protobuf v1.34.2
|
google.golang.org/protobuf v1.34.2
|
||||||
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489
|
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489
|
||||||
h12.io/socks v1.0.3
|
h12.io/socks v1.0.3
|
||||||
@@ -38,7 +38,6 @@ require (
|
|||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
github.com/andybalholm/brotli v1.1.0 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
|
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect
|
||||||
github.com/francoispqt/gojay v1.2.13 // indirect
|
|
||||||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
||||||
github.com/google/btree v1.1.2 // indirect
|
github.com/google/btree v1.1.2 // indirect
|
||||||
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect
|
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect
|
||||||
@@ -46,16 +45,17 @@ require (
|
|||||||
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
|
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
|
github.com/quic-go/qpack v0.4.0 // indirect
|
||||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
|
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
|
||||||
github.com/vishvananda/netns v0.0.4 // indirect
|
github.com/vishvananda/netns v0.0.4 // indirect
|
||||||
go.uber.org/mock v0.4.0 // indirect
|
go.uber.org/mock v0.4.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect
|
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect
|
||||||
golang.org/x/mod v0.18.0 // indirect
|
golang.org/x/mod v0.18.0 // indirect
|
||||||
golang.org/x/text v0.16.0 // indirect
|
golang.org/x/text v0.18.0 // indirect
|
||||||
golang.org/x/time v0.5.0 // indirect
|
golang.org/x/time v0.5.0 // indirect
|
||||||
golang.org/x/tools v0.22.0 // indirect
|
golang.org/x/tools v0.22.0 // indirect
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
222
go.sum
222
go.sum
@@ -1,249 +1,119 @@
|
|||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
|
||||||
cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo=
|
|
||||||
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
|
|
||||||
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
|
|
||||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
|
||||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
|
||||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
|
||||||
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0 h1:Wo41lDOevRJSGpevP+8Pk5bANX7fJacO2w04aqLiC5I=
|
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0 h1:Wo41lDOevRJSGpevP+8Pk5bANX7fJacO2w04aqLiC5I=
|
||||||
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0/go.mod h1:FVGavL/QEBQDcBpr3fAojoK17xX5k9bicBphrOpP7uM=
|
github.com/OmarTariq612/goech v0.0.0-20240405204721-8e2e1dafd3a0/go.mod h1:FVGavL/QEBQDcBpr3fAojoK17xX5k9bicBphrOpP7uM=
|
||||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY=
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
||||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
|
||||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
|
||||||
github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE=
|
|
||||||
github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
|
|
||||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
|
github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
|
||||||
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 h1:y7y0Oa6UawqTFPCDw9JG6pdKt4F9pAhHv0B7FMGaGD0=
|
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 h1:y7y0Oa6UawqTFPCDw9JG6pdKt4F9pAhHv0B7FMGaGD0=
|
||||||
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
|
github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw=
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
|
||||||
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
|
|
||||||
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
|
||||||
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 h1:Arcl6UOIS/kgO2nW3A65HN+7CMjSDP/gofXL4CZt1V4=
|
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344 h1:Arcl6UOIS/kgO2nW3A65HN+7CMjSDP/gofXL4CZt1V4=
|
||||||
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
|
github.com/ghodss/yaml v1.0.1-0.20220118164431-d8423dcdf344/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I=
|
||||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
|
||||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
|
||||||
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
|
||||||
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||||
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
|
||||||
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
|
||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
|
||||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
|
||||||
github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
|
github.com/golang/mock v1.7.0-rc.1 h1:YojYx61/OLFsiv6Rw1Z96LpldJIy31o+UHmwAUMJ6/U=
|
||||||
github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
|
github.com/golang/mock v1.7.0-rc.1/go.mod h1:s42URUywIqd+OcERslBJvOjepvNymP31m3q8d/GkuRs=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
|
||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
|
||||||
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
|
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
|
||||||
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
|
||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
|
||||||
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba h1:ql1qNgCyOB7iAEk8JTNM+zJrgIbnyCKX/wdlyPufP5g=
|
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba h1:ql1qNgCyOB7iAEk8JTNM+zJrgIbnyCKX/wdlyPufP5g=
|
||||||
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
github.com/google/pprof v0.0.0-20240528025155-186aa0362fba/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo=
|
||||||
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
|
||||||
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
|
||||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
|
||||||
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI=
|
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI=
|
||||||
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364/go.mod h1:eDJQioIyy4Yn3MVivT7rv/39gAJTrA7lgmYr8EW950c=
|
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364/go.mod h1:eDJQioIyy4Yn3MVivT7rv/39gAJTrA7lgmYr8EW950c=
|
||||||
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
|
|
||||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
|
||||||
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
|
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
|
||||||
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
|
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ=
|
||||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
|
||||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
|
||||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
|
||||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
|
||||||
github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs=
|
|
||||||
github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ=
|
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
|
||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
|
||||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
|
||||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
|
github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA=
|
||||||
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
|
github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To=
|
||||||
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
|
github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk=
|
||||||
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
|
github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0=
|
||||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
|
||||||
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
|
||||||
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||||
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
|
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
|
||||||
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
||||||
github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs=
|
github.com/pires/go-proxyproto v0.7.0 h1:IukmRewDQFWC7kfnb66CSomk2q/seBuilHBYFwyq0Hs=
|
||||||
github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4=
|
github.com/pires/go-proxyproto v0.7.0/go.mod h1:Vz/1JPY/OACxWGQNIRY2BeyDmpoaWmEP40O9LbuiFR4=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
|
||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
||||||
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y=
|
||||||
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI=
|
||||||
github.com/quic-go/quic-go v0.45.1 h1:tPfeYCk+uZHjmDRwHHQmvHRYL2t44ROTujLeFVBmjCA=
|
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
|
||||||
github.com/quic-go/quic-go v0.45.1/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI=
|
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
||||||
github.com/refraction-networking/utls v1.6.6 h1:igFsYBUJPYM8Rno9xUuDoM5GQrVEqY4llzEXOkL43Ig=
|
|
||||||
github.com/refraction-networking/utls v1.6.6/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
|
||||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
|
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 h1:f/FNXud6gA3MNr8meMVVGxhp+QBTqY91tM8HjEuMjGg=
|
||||||
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
|
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3/go.mod h1:HgjTstvQsPGkxUsCd2KWxErBblirPizecHcpD3ffK+s=
|
||||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
|
||||||
github.com/sagernet/sing v0.4.1 h1:zVlpE+7k7AFoC2pv6ReqLf0PIHjihL/jsBl5k05PQFk=
|
github.com/sagernet/sing v0.4.1 h1:zVlpE+7k7AFoC2pv6ReqLf0PIHjihL/jsBl5k05PQFk=
|
||||||
github.com/sagernet/sing v0.4.1/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
|
github.com/sagernet/sing v0.4.1/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.6 h1:xr7ylAS/q1cQYS8oxKKajhuQcchd5VJJ4K4UZrrpp0s=
|
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.6/go.mod h1:j2YZBIpWIuElPFL/5sJAj470bcn/3QQ5lxZUNKLDNAM=
|
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
|
||||||
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb h1:XfLJSPIOUX+osiMraVgIrMR27uMXnRJWGm1+GL8/63U=
|
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1L9iaKCTxdy3Em8Wv4ChIAGnfiz18Cda70g4=
|
||||||
github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg=
|
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg=
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
|
||||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
|
||||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
|
||||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
|
||||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
|
||||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
|
||||||
github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
|
||||||
github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI=
|
|
||||||
github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU=
|
|
||||||
github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag=
|
|
||||||
github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg=
|
|
||||||
github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw=
|
|
||||||
github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y=
|
|
||||||
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
|
||||||
github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q=
|
|
||||||
github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ=
|
|
||||||
github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I=
|
|
||||||
github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0=
|
|
||||||
github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ=
|
|
||||||
github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk=
|
|
||||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
|
||||||
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
|
||||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
|
||||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
|
||||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
|
||||||
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI=
|
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI=
|
||||||
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU=
|
github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU=
|
||||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
github.com/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk=
|
||||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs=
|
||||||
github.com/vishvananda/netlink v1.2.1-beta.2.0.20230316163032-ced5aaba43e3 h1:tkMT5pTye+1NlKIXETU78NXw0fyjnaNHmJyyLyzw8+U=
|
|
||||||
github.com/vishvananda/netlink v1.2.1-beta.2.0.20230316163032-ced5aaba43e3/go.mod h1:cAAsePK2e15YDAMJNyOpGYEWNe4sIghTY7gpz4cX/Ik=
|
|
||||||
github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0=
|
|
||||||
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
|
github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8=
|
||||||
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
|
github.com/vishvananda/netns v0.0.4/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM=
|
||||||
github.com/xtls/reality v0.0.0-20240429224917-ecc4401070cc h1:0Nj8T1n7F7+v4vRVroaJIvY6R0vNABLfPH+lzPHRJvI=
|
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg=
|
||||||
github.com/xtls/reality v0.0.0-20240429224917-ecc4401070cc/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE=
|
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE=
|
||||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
|
||||||
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
|
||||||
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
|
||||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba h1:0b9z3AuHCjxk0x/opv64kcgZLBseWJUpBw5I82+2U4M=
|
||||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba/go.mod h1:PLyyIXexvUFg3Owu6p/WfdlivPbZJsZdgWZlrGope/Y=
|
||||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
|
||||||
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
|
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
|
||||||
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg=
|
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg=
|
||||||
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
|
golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
|
||||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
|
||||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||||
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
|
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
|
||||||
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
|
||||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
|
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
|
||||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||||
|
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
|
||||||
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||||
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||||
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
|
golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA=
|
||||||
@@ -255,32 +125,14 @@ golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeu
|
|||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
||||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
||||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
||||||
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
|
google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
||||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
|
||||||
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
|
|
||||||
google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8=
|
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
|
||||||
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
|
||||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
|
||||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
|
||||||
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
|
|
||||||
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
|
|
||||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
|
||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
@@ -288,15 +140,9 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
|
|||||||
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
|
||||||
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 h1:ze1vwAdliUAr68RQ5NtufWaXaOg8WUO2OACzEV+TNdE=
|
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 h1:ze1vwAdliUAr68RQ5NtufWaXaOg8WUO2OACzEV+TNdE=
|
||||||
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489/go.mod h1:10sU+Uh5KKNv1+2x2A0Gvzt8FjD3ASIhorV3YsauXhk=
|
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489/go.mod h1:10sU+Uh5KKNv1+2x2A0Gvzt8FjD3ASIhorV3YsauXhk=
|
||||||
h12.io/socks v1.0.3 h1:Ka3qaQewws4j4/eDQnOdpr4wXsC//dXtWvftlIcCQUo=
|
h12.io/socks v1.0.3 h1:Ka3qaQewws4j4/eDQnOdpr4wXsC//dXtWvftlIcCQUo=
|
||||||
h12.io/socks v1.0.3/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck=
|
h12.io/socks v1.0.3/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck=
|
||||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
|
||||||
lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=
|
lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=
|
||||||
lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
|
lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
|
||||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
|
||||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
|
||||||
|
@@ -2,6 +2,7 @@ package conf
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common/errors"
|
"github.com/xtls/xray-core/common/errors"
|
||||||
@@ -242,3 +243,33 @@ func (v *User) Build() *protocol.User {
|
|||||||
Level: uint32(v.LevelByte),
|
Level: uint32(v.LevelByte),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Int32Range deserializes from "1-2" or 1, so can deserialize from both int and number.
|
||||||
|
// Negative integers can be passed as sentinel values, but do not parse as ranges.
|
||||||
|
type Int32Range struct {
|
||||||
|
From int32
|
||||||
|
To int32
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v *Int32Range) UnmarshalJSON(data []byte) error {
|
||||||
|
var stringrange string
|
||||||
|
var rawint int32
|
||||||
|
if err := json.Unmarshal(data, &stringrange); err == nil {
|
||||||
|
pair := strings.SplitN(stringrange, "-", 2)
|
||||||
|
if len(pair) == 2 {
|
||||||
|
from, err := strconv.Atoi(pair[0])
|
||||||
|
to, err2 := strconv.Atoi(pair[1])
|
||||||
|
if err == nil && err2 == nil {
|
||||||
|
v.From = int32(from)
|
||||||
|
v.To = int32(to)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if err := json.Unmarshal(data, &rawint); err == nil {
|
||||||
|
v.From = rawint
|
||||||
|
v.To = rawint
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return errors.New("Invalid integer range, expected either string of form \"1-2\" or plain integer.")
|
||||||
|
}
|
||||||
|
@@ -18,6 +18,7 @@ type FreedomConfig struct {
|
|||||||
Redirect string `json:"redirect"`
|
Redirect string `json:"redirect"`
|
||||||
UserLevel uint32 `json:"userLevel"`
|
UserLevel uint32 `json:"userLevel"`
|
||||||
Fragment *Fragment `json:"fragment"`
|
Fragment *Fragment `json:"fragment"`
|
||||||
|
Noise *Noise `json:"noise"`
|
||||||
ProxyProtocol uint32 `json:"proxyProtocol"`
|
ProxyProtocol uint32 `json:"proxyProtocol"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +28,11 @@ type Fragment struct {
|
|||||||
Interval string `json:"interval"`
|
Interval string `json:"interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Noise struct {
|
||||||
|
Packet string `json:"packet"`
|
||||||
|
Delay string `json:"delay"`
|
||||||
|
}
|
||||||
|
|
||||||
// Build implements Buildable
|
// Build implements Buildable
|
||||||
func (c *FreedomConfig) Build() (proto.Message, error) {
|
func (c *FreedomConfig) Build() (proto.Message, error) {
|
||||||
config := new(freedom.Config)
|
config := new(freedom.Config)
|
||||||
@@ -143,6 +149,76 @@ func (c *FreedomConfig) Build() (proto.Message, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if c.Noise != nil {
|
||||||
|
config.Noise = new(freedom.Noise)
|
||||||
|
var err, err2 error
|
||||||
|
p := strings.Split(strings.ToLower(c.Noise.Packet), ":")
|
||||||
|
if len(p) != 2 {
|
||||||
|
return nil, errors.New("invalid type for packet")
|
||||||
|
}
|
||||||
|
switch p[0] {
|
||||||
|
case "rand":
|
||||||
|
randValue := strings.Split(p[1], "-")
|
||||||
|
if len(randValue) > 2 {
|
||||||
|
return nil, errors.New("Only 2 values are allowed for rand")
|
||||||
|
}
|
||||||
|
if len(randValue) == 2 {
|
||||||
|
config.Noise.LengthMin, err = strconv.ParseUint(randValue[0], 10, 64)
|
||||||
|
config.Noise.LengthMax, err2 = strconv.ParseUint(randValue[1], 10, 64)
|
||||||
|
}
|
||||||
|
if len(randValue) == 1 {
|
||||||
|
config.Noise.LengthMin, err = strconv.ParseUint(randValue[0], 10, 64)
|
||||||
|
config.Noise.LengthMax = config.Noise.LengthMin
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("invalid value for rand LengthMin").Base(err)
|
||||||
|
}
|
||||||
|
if err2 != nil {
|
||||||
|
return nil, errors.New("invalid value for rand LengthMax").Base(err2)
|
||||||
|
}
|
||||||
|
if config.Noise.LengthMin > config.Noise.LengthMax {
|
||||||
|
config.Noise.LengthMin, config.Noise.LengthMax = config.Noise.LengthMax, config.Noise.LengthMin
|
||||||
|
}
|
||||||
|
if config.Noise.LengthMin == 0 {
|
||||||
|
return nil, errors.New("rand lengthMin or lengthMax cannot be 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
case "str":
|
||||||
|
//user input string
|
||||||
|
config.Noise.StrNoise = strings.TrimSpace(p[1])
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.New("Invalid packet,only rand and str are supported")
|
||||||
|
}
|
||||||
|
if c.Noise.Delay != "" {
|
||||||
|
d := strings.Split(strings.ToLower(c.Noise.Delay), "-")
|
||||||
|
if len(d) > 2 {
|
||||||
|
return nil, errors.New("Invalid delay value")
|
||||||
|
}
|
||||||
|
if len(d) == 2 {
|
||||||
|
config.Noise.DelayMin, err = strconv.ParseUint(d[0], 10, 64)
|
||||||
|
config.Noise.DelayMax, err2 = strconv.ParseUint(d[1], 10, 64)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
config.Noise.DelayMin, err = strconv.ParseUint(d[0], 10, 64)
|
||||||
|
config.Noise.DelayMax = config.Noise.DelayMin
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("Invalid value for DelayMin").Base(err)
|
||||||
|
}
|
||||||
|
if err2 != nil {
|
||||||
|
return nil, errors.New("Invalid value for DelayMax").Base(err2)
|
||||||
|
}
|
||||||
|
if config.Noise.DelayMin > config.Noise.DelayMax {
|
||||||
|
config.Noise.DelayMin, config.Noise.DelayMax = config.Noise.DelayMax, config.Noise.DelayMin
|
||||||
|
}
|
||||||
|
if config.Noise.DelayMin == 0 {
|
||||||
|
return nil, errors.New("DelayMin or DelayMax cannot be 0")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
config.Noise.DelayMin = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if c.Timeout != nil {
|
if c.Timeout != nil {
|
||||||
config.Timeout = *c.Timeout
|
config.Timeout = *c.Timeout
|
||||||
|
@@ -11,27 +11,27 @@ import (
|
|||||||
"github.com/xtls/xray-core/main/confloader"
|
"github.com/xtls/xray-core/main/confloader"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MergeConfigFromFiles(files []string, formats []string) (string, error) {
|
func MergeConfigFromFiles(files []*core.ConfigSource) (string, error) {
|
||||||
c, err := mergeConfigs(files, formats)
|
c, err := mergeConfigs(files)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
if j, ok := creflect.MarshalToJson(c); ok {
|
if j, ok := creflect.MarshalToJson(c, true); ok {
|
||||||
return j, nil
|
return j, nil
|
||||||
}
|
}
|
||||||
return "", errors.New("marshal to json failed.").AtError()
|
return "", errors.New("marshal to json failed.").AtError()
|
||||||
}
|
}
|
||||||
|
|
||||||
func mergeConfigs(files []string, formats []string) (*conf.Config, error) {
|
func mergeConfigs(files []*core.ConfigSource) (*conf.Config, error) {
|
||||||
cf := &conf.Config{}
|
cf := &conf.Config{}
|
||||||
for i, file := range files {
|
for i, file := range files {
|
||||||
errors.LogInfo(context.Background(), "Reading config: ", file)
|
errors.LogInfo(context.Background(), "Reading config: ", file)
|
||||||
r, err := confloader.LoadConfig(file)
|
r, err := confloader.LoadConfig(file.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("failed to read config: ", file).Base(err)
|
return nil, errors.New("failed to read config: ", file).Base(err)
|
||||||
}
|
}
|
||||||
c, err := ReaderDecoderByFormat[formats[i]](r)
|
c, err := ReaderDecoderByFormat[file.Format](r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("failed to decode config: ", file).Base(err)
|
return nil, errors.New("failed to decode config: ", file).Base(err)
|
||||||
}
|
}
|
||||||
@@ -39,13 +39,13 @@ func mergeConfigs(files []string, formats []string) (*conf.Config, error) {
|
|||||||
*cf = *c
|
*cf = *c
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
cf.Override(c, file)
|
cf.Override(c, file.Name)
|
||||||
}
|
}
|
||||||
return cf, nil
|
return cf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BuildConfig(files []string, formats []string) (*core.Config, error) {
|
func BuildConfig(files []*core.ConfigSource) (*core.Config, error) {
|
||||||
config, err := mergeConfigs(files, formats)
|
config, err := mergeConfigs(files)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@@ -1,130 +0,0 @@
|
|||||||
package conf
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
"github.com/xtls/xray-core/common/serial"
|
|
||||||
"github.com/xtls/xray-core/transport/global"
|
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
|
||||||
)
|
|
||||||
|
|
||||||
type TransportConfig struct {
|
|
||||||
TCPConfig *TCPConfig `json:"tcpSettings"`
|
|
||||||
KCPConfig *KCPConfig `json:"kcpSettings"`
|
|
||||||
WSConfig *WebSocketConfig `json:"wsSettings"`
|
|
||||||
HTTPConfig *HTTPConfig `json:"httpSettings"`
|
|
||||||
DSConfig *DomainSocketConfig `json:"dsSettings"`
|
|
||||||
QUICConfig *QUICConfig `json:"quicSettings"`
|
|
||||||
GRPCConfig *GRPCConfig `json:"grpcSettings"`
|
|
||||||
GUNConfig *GRPCConfig `json:"gunSettings"`
|
|
||||||
HTTPUPGRADEConfig *HttpUpgradeConfig `json:"httpupgradeSettings"`
|
|
||||||
SplitHTTPConfig *SplitHTTPConfig `json:"splithttpSettings"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build implements Buildable.
|
|
||||||
func (c *TransportConfig) Build() (*global.Config, error) {
|
|
||||||
config := new(global.Config)
|
|
||||||
|
|
||||||
if c.TCPConfig != nil {
|
|
||||||
ts, err := c.TCPConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to build TCP config").Base(err).AtError()
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "tcp",
|
|
||||||
Settings: serial.ToTypedMessage(ts),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.KCPConfig != nil {
|
|
||||||
ts, err := c.KCPConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to build mKCP config").Base(err).AtError()
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "mkcp",
|
|
||||||
Settings: serial.ToTypedMessage(ts),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.WSConfig != nil {
|
|
||||||
ts, err := c.WSConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to build WebSocket config").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "websocket",
|
|
||||||
Settings: serial.ToTypedMessage(ts),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.HTTPConfig != nil {
|
|
||||||
ts, err := c.HTTPConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build HTTP config.").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(ts),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.DSConfig != nil {
|
|
||||||
ds, err := c.DSConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build DomainSocket config.").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "domainsocket",
|
|
||||||
Settings: serial.ToTypedMessage(ds),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.QUICConfig != nil {
|
|
||||||
qs, err := c.QUICConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build QUIC config.").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "quic",
|
|
||||||
Settings: serial.ToTypedMessage(qs),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.GRPCConfig == nil {
|
|
||||||
c.GRPCConfig = c.GUNConfig
|
|
||||||
}
|
|
||||||
if c.GRPCConfig != nil {
|
|
||||||
gs, err := c.GRPCConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build gRPC config.").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "grpc",
|
|
||||||
Settings: serial.ToTypedMessage(gs),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.HTTPUPGRADEConfig != nil {
|
|
||||||
hs, err := c.HTTPUPGRADEConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to build HttpUpgrade config").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "httpupgrade",
|
|
||||||
Settings: serial.ToTypedMessage(hs),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.SplitHTTPConfig != nil {
|
|
||||||
shs, err := c.SplitHTTPConfig.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to build SplitHTTP config").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "splithttp",
|
|
||||||
Settings: serial.ToTypedMessage(shs),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return config, nil
|
|
||||||
}
|
|
@@ -14,15 +14,12 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/errors"
|
"github.com/xtls/xray-core/common/errors"
|
||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
"github.com/xtls/xray-core/common/platform/filesystem"
|
"github.com/xtls/xray-core/common/platform/filesystem"
|
||||||
"github.com/xtls/xray-core/common/protocol"
|
|
||||||
"github.com/xtls/xray-core/common/serial"
|
"github.com/xtls/xray-core/common/serial"
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
"github.com/xtls/xray-core/transport/internet/domainsocket"
|
|
||||||
httpheader "github.com/xtls/xray-core/transport/internet/headers/http"
|
httpheader "github.com/xtls/xray-core/transport/internet/headers/http"
|
||||||
"github.com/xtls/xray-core/transport/internet/http"
|
"github.com/xtls/xray-core/transport/internet/http"
|
||||||
"github.com/xtls/xray-core/transport/internet/httpupgrade"
|
"github.com/xtls/xray-core/transport/internet/httpupgrade"
|
||||||
"github.com/xtls/xray-core/transport/internet/kcp"
|
"github.com/xtls/xray-core/transport/internet/kcp"
|
||||||
"github.com/xtls/xray-core/transport/internet/quic"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/reality"
|
"github.com/xtls/xray-core/transport/internet/reality"
|
||||||
"github.com/xtls/xray-core/transport/internet/splithttp"
|
"github.com/xtls/xray-core/transport/internet/splithttp"
|
||||||
"github.com/xtls/xray-core/transport/internet/tcp"
|
"github.com/xtls/xray-core/transport/internet/tcp"
|
||||||
@@ -229,8 +226,22 @@ type SplitHTTPConfig struct {
|
|||||||
Host string `json:"host"`
|
Host string `json:"host"`
|
||||||
Path string `json:"path"`
|
Path string `json:"path"`
|
||||||
Headers map[string]string `json:"headers"`
|
Headers map[string]string `json:"headers"`
|
||||||
MaxConcurrentUploads int32 `json:"maxConcurrentUploads"`
|
ScMaxConcurrentPosts *Int32Range `json:"scMaxConcurrentPosts"`
|
||||||
MaxUploadSize int32 `json:"maxUploadSize"`
|
ScMaxEachPostBytes *Int32Range `json:"scMaxEachPostBytes"`
|
||||||
|
ScMinPostsIntervalMs *Int32Range `json:"scMinPostsIntervalMs"`
|
||||||
|
NoSSEHeader bool `json:"noSSEHeader"`
|
||||||
|
XPaddingBytes *Int32Range `json:"xPaddingBytes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func splithttpNewRandRangeConfig(input *Int32Range) *splithttp.RandRangeConfig {
|
||||||
|
if input == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return &splithttp.RandRangeConfig{
|
||||||
|
From: input.From,
|
||||||
|
To: input.To,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
@@ -247,8 +258,11 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||||||
Path: c.Path,
|
Path: c.Path,
|
||||||
Host: c.Host,
|
Host: c.Host,
|
||||||
Header: c.Headers,
|
Header: c.Headers,
|
||||||
MaxConcurrentUploads: c.MaxConcurrentUploads,
|
ScMaxConcurrentPosts: splithttpNewRandRangeConfig(c.ScMaxConcurrentPosts),
|
||||||
MaxUploadSize: c.MaxUploadSize,
|
ScMaxEachPostBytes: splithttpNewRandRangeConfig(c.ScMaxEachPostBytes),
|
||||||
|
ScMinPostsIntervalMs: splithttpNewRandRangeConfig(c.ScMinPostsIntervalMs),
|
||||||
|
NoSSEHeader: c.NoSSEHeader,
|
||||||
|
XPaddingBytes: splithttpNewRandRangeConfig(c.XPaddingBytes),
|
||||||
}
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
@@ -298,62 +312,6 @@ func (c *HTTPConfig) Build() (proto.Message, error) {
|
|||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type QUICConfig struct {
|
|
||||||
Header json.RawMessage `json:"header"`
|
|
||||||
Security string `json:"security"`
|
|
||||||
Key string `json:"key"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build implements Buildable.
|
|
||||||
func (c *QUICConfig) Build() (proto.Message, error) {
|
|
||||||
config := &quic.Config{
|
|
||||||
Key: c.Key,
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.Header) > 0 {
|
|
||||||
headerConfig, _, err := kcpHeaderLoader.Load(c.Header)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("invalid QUIC header config.").Base(err).AtError()
|
|
||||||
}
|
|
||||||
ts, err := headerConfig.(Buildable).Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("invalid QUIC header config").Base(err).AtError()
|
|
||||||
}
|
|
||||||
config.Header = serial.ToTypedMessage(ts)
|
|
||||||
}
|
|
||||||
|
|
||||||
var st protocol.SecurityType
|
|
||||||
switch strings.ToLower(c.Security) {
|
|
||||||
case "aes-128-gcm":
|
|
||||||
st = protocol.SecurityType_AES128_GCM
|
|
||||||
case "chacha20-poly1305":
|
|
||||||
st = protocol.SecurityType_CHACHA20_POLY1305
|
|
||||||
default:
|
|
||||||
st = protocol.SecurityType_NONE
|
|
||||||
}
|
|
||||||
|
|
||||||
config.Security = &protocol.SecurityConfig{
|
|
||||||
Type: st,
|
|
||||||
}
|
|
||||||
|
|
||||||
return config, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type DomainSocketConfig struct {
|
|
||||||
Path string `json:"path"`
|
|
||||||
Abstract bool `json:"abstract"`
|
|
||||||
Padding bool `json:"padding"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build implements Buildable.
|
|
||||||
func (c *DomainSocketConfig) Build() (proto.Message, error) {
|
|
||||||
return &domainsocket.Config{
|
|
||||||
Path: c.Path,
|
|
||||||
Abstract: c.Abstract,
|
|
||||||
Padding: c.Padding,
|
|
||||||
}, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func readFileOrString(f string, s []string) ([]byte, error) {
|
func readFileOrString(f string, s []string) ([]byte, error) {
|
||||||
if len(f) > 0 {
|
if len(f) > 0 {
|
||||||
return filesystem.ReadFile(f)
|
return filesystem.ReadFile(f)
|
||||||
@@ -372,6 +330,7 @@ type TLSCertConfig struct {
|
|||||||
Usage string `json:"usage"`
|
Usage string `json:"usage"`
|
||||||
OcspStapling uint64 `json:"ocspStapling"`
|
OcspStapling uint64 `json:"ocspStapling"`
|
||||||
OneTimeLoading bool `json:"oneTimeLoading"`
|
OneTimeLoading bool `json:"oneTimeLoading"`
|
||||||
|
BuildChain bool `json:"buildChain"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
@@ -410,6 +369,7 @@ func (c *TLSCertConfig) Build() (*tls.Certificate, error) {
|
|||||||
certificate.OneTimeLoading = c.OneTimeLoading
|
certificate.OneTimeLoading = c.OneTimeLoading
|
||||||
}
|
}
|
||||||
certificate.OcspStapling = c.OcspStapling
|
certificate.OcspStapling = c.OcspStapling
|
||||||
|
certificate.BuildChain = c.BuildChain
|
||||||
|
|
||||||
return certificate, nil
|
return certificate, nil
|
||||||
}
|
}
|
||||||
@@ -670,10 +630,6 @@ func (p TransportProtocol) Build() (string, error) {
|
|||||||
return "websocket", nil
|
return "websocket", nil
|
||||||
case "h2", "http":
|
case "h2", "http":
|
||||||
return "http", nil
|
return "http", nil
|
||||||
case "ds", "domainsocket":
|
|
||||||
return "domainsocket", nil
|
|
||||||
case "quic":
|
|
||||||
return "quic", nil
|
|
||||||
case "grpc", "gun":
|
case "grpc", "gun":
|
||||||
return "grpc", nil
|
return "grpc", nil
|
||||||
case "httpupgrade":
|
case "httpupgrade":
|
||||||
@@ -685,23 +641,31 @@ func (p TransportProtocol) Build() (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CustomSockoptConfig struct {
|
||||||
|
Level string `json:"level"`
|
||||||
|
Opt string `json:"opt"`
|
||||||
|
Value string `json:"value"`
|
||||||
|
Type string `json:"type"`
|
||||||
|
}
|
||||||
|
|
||||||
type SocketConfig struct {
|
type SocketConfig struct {
|
||||||
Mark int32 `json:"mark"`
|
Mark int32 `json:"mark"`
|
||||||
TFO interface{} `json:"tcpFastOpen"`
|
TFO interface{} `json:"tcpFastOpen"`
|
||||||
TProxy string `json:"tproxy"`
|
TProxy string `json:"tproxy"`
|
||||||
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
AcceptProxyProtocol bool `json:"acceptProxyProtocol"`
|
||||||
DomainStrategy string `json:"domainStrategy"`
|
DomainStrategy string `json:"domainStrategy"`
|
||||||
DialerProxy string `json:"dialerProxy"`
|
DialerProxy string `json:"dialerProxy"`
|
||||||
TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"`
|
TCPKeepAliveInterval int32 `json:"tcpKeepAliveInterval"`
|
||||||
TCPKeepAliveIdle int32 `json:"tcpKeepAliveIdle"`
|
TCPKeepAliveIdle int32 `json:"tcpKeepAliveIdle"`
|
||||||
TCPCongestion string `json:"tcpCongestion"`
|
TCPCongestion string `json:"tcpCongestion"`
|
||||||
TCPWindowClamp int32 `json:"tcpWindowClamp"`
|
TCPWindowClamp int32 `json:"tcpWindowClamp"`
|
||||||
TCPMaxSeg int32 `json:"tcpMaxSeg"`
|
TCPMaxSeg int32 `json:"tcpMaxSeg"`
|
||||||
TcpNoDelay bool `json:"tcpNoDelay"`
|
TcpNoDelay bool `json:"tcpNoDelay"`
|
||||||
TCPUserTimeout int32 `json:"tcpUserTimeout"`
|
TCPUserTimeout int32 `json:"tcpUserTimeout"`
|
||||||
V6only bool `json:"v6only"`
|
V6only bool `json:"v6only"`
|
||||||
Interface string `json:"interface"`
|
Interface string `json:"interface"`
|
||||||
TcpMptcp bool `json:"tcpMptcp"`
|
TcpMptcp bool `json:"tcpMptcp"`
|
||||||
|
CustomSockopt []*CustomSockoptConfig `json:"customSockopt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
@@ -759,6 +723,18 @@ func (c *SocketConfig) Build() (*internet.SocketConfig, error) {
|
|||||||
return nil, errors.New("unsupported domain strategy: ", c.DomainStrategy)
|
return nil, errors.New("unsupported domain strategy: ", c.DomainStrategy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var customSockopts []*internet.CustomSockopt
|
||||||
|
|
||||||
|
for _, copt := range c.CustomSockopt {
|
||||||
|
customSockopt := &internet.CustomSockopt{
|
||||||
|
Level: copt.Level,
|
||||||
|
Opt: copt.Opt,
|
||||||
|
Value: copt.Value,
|
||||||
|
Type: copt.Type,
|
||||||
|
}
|
||||||
|
customSockopts = append(customSockopts, customSockopt)
|
||||||
|
}
|
||||||
|
|
||||||
return &internet.SocketConfig{
|
return &internet.SocketConfig{
|
||||||
Mark: c.Mark,
|
Mark: c.Mark,
|
||||||
Tfo: tfo,
|
Tfo: tfo,
|
||||||
@@ -776,6 +752,7 @@ func (c *SocketConfig) Build() (*internet.SocketConfig, error) {
|
|||||||
V6Only: c.V6only,
|
V6Only: c.V6only,
|
||||||
Interface: c.Interface,
|
Interface: c.Interface,
|
||||||
TcpMptcp: c.TcpMptcp,
|
TcpMptcp: c.TcpMptcp,
|
||||||
|
CustomSockopt: customSockopts,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -788,8 +765,6 @@ type StreamConfig struct {
|
|||||||
KCPSettings *KCPConfig `json:"kcpSettings"`
|
KCPSettings *KCPConfig `json:"kcpSettings"`
|
||||||
WSSettings *WebSocketConfig `json:"wsSettings"`
|
WSSettings *WebSocketConfig `json:"wsSettings"`
|
||||||
HTTPSettings *HTTPConfig `json:"httpSettings"`
|
HTTPSettings *HTTPConfig `json:"httpSettings"`
|
||||||
DSSettings *DomainSocketConfig `json:"dsSettings"`
|
|
||||||
QUICSettings *QUICConfig `json:"quicSettings"`
|
|
||||||
SocketSettings *SocketConfig `json:"sockopt"`
|
SocketSettings *SocketConfig `json:"sockopt"`
|
||||||
GRPCConfig *GRPCConfig `json:"grpcSettings"`
|
GRPCConfig *GRPCConfig `json:"grpcSettings"`
|
||||||
GUNConfig *GRPCConfig `json:"gunSettings"`
|
GUNConfig *GRPCConfig `json:"gunSettings"`
|
||||||
@@ -824,8 +799,8 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
|||||||
config.SecuritySettings = append(config.SecuritySettings, tm)
|
config.SecuritySettings = append(config.SecuritySettings, tm)
|
||||||
config.SecurityType = tm.Type
|
config.SecurityType = tm.Type
|
||||||
case "reality":
|
case "reality":
|
||||||
if config.ProtocolName != "tcp" && config.ProtocolName != "http" && config.ProtocolName != "grpc" && config.ProtocolName != "domainsocket" {
|
if config.ProtocolName != "tcp" && config.ProtocolName != "http" && config.ProtocolName != "grpc" {
|
||||||
return nil, errors.New("REALITY only supports TCP, H2, gRPC and DomainSocket for now.")
|
return nil, errors.New("REALITY only supports TCP, H2 and gRPC for now.")
|
||||||
}
|
}
|
||||||
if c.REALITYSettings == nil {
|
if c.REALITYSettings == nil {
|
||||||
return nil, errors.New(`REALITY: Empty "realitySettings".`)
|
return nil, errors.New(`REALITY: Empty "realitySettings".`)
|
||||||
@@ -882,26 +857,6 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
|||||||
Settings: serial.ToTypedMessage(ts),
|
Settings: serial.ToTypedMessage(ts),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if c.DSSettings != nil {
|
|
||||||
ds, err := c.DSSettings.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build DomainSocket config.").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "domainsocket",
|
|
||||||
Settings: serial.ToTypedMessage(ds),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if c.QUICSettings != nil {
|
|
||||||
qs, err := c.QUICSettings.Build()
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("Failed to build QUIC config").Base(err)
|
|
||||||
}
|
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
|
||||||
ProtocolName: "quic",
|
|
||||||
Settings: serial.ToTypedMessage(qs),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if c.GRPCConfig == nil {
|
if c.GRPCConfig == nil {
|
||||||
c.GRPCConfig = c.GUNConfig
|
c.GRPCConfig = c.GUNConfig
|
||||||
}
|
}
|
||||||
|
@@ -4,19 +4,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common/protocol"
|
|
||||||
"github.com/xtls/xray-core/common/serial"
|
|
||||||
. "github.com/xtls/xray-core/infra/conf"
|
. "github.com/xtls/xray-core/infra/conf"
|
||||||
"github.com/xtls/xray-core/transport/global"
|
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
"github.com/xtls/xray-core/transport/internet/grpc"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/headers/http"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/headers/noop"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/headers/tls"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/kcp"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/quic"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/tcp"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/websocket"
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -160,155 +149,3 @@ func TestSocketConfig(t *testing.T) {
|
|||||||
t.Fatalf("unexpected parsed TFO value, which should be -1")
|
t.Fatalf("unexpected parsed TFO value, which should be -1")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTransportConfig(t *testing.T) {
|
|
||||||
createParser := func() func(string) (proto.Message, error) {
|
|
||||||
return func(s string) (proto.Message, error) {
|
|
||||||
config := new(TransportConfig)
|
|
||||||
if err := json.Unmarshal([]byte(s), config); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return config.Build()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
runMultiTestCase(t, []TestCase{
|
|
||||||
{
|
|
||||||
Input: `{
|
|
||||||
"tcpSettings": {
|
|
||||||
"header": {
|
|
||||||
"type": "http",
|
|
||||||
"request": {
|
|
||||||
"version": "1.1",
|
|
||||||
"method": "GET",
|
|
||||||
"path": "/b",
|
|
||||||
"headers": {
|
|
||||||
"a": "b",
|
|
||||||
"c": "d"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": {
|
|
||||||
"version": "1.0",
|
|
||||||
"status": "404",
|
|
||||||
"reason": "Not Found"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"kcpSettings": {
|
|
||||||
"mtu": 1200,
|
|
||||||
"header": {
|
|
||||||
"type": "none"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wsSettings": {
|
|
||||||
"path": "/t"
|
|
||||||
},
|
|
||||||
"quicSettings": {
|
|
||||||
"key": "abcd",
|
|
||||||
"header": {
|
|
||||||
"type": "dtls"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"grpcSettings": {
|
|
||||||
"serviceName": "name",
|
|
||||||
"multiMode": true
|
|
||||||
}
|
|
||||||
}`,
|
|
||||||
Parser: createParser(),
|
|
||||||
Output: &global.Config{
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "tcp",
|
|
||||||
Settings: serial.ToTypedMessage(&tcp.Config{
|
|
||||||
HeaderSettings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Request: &http.RequestConfig{
|
|
||||||
Version: &http.Version{Value: "1.1"},
|
|
||||||
Method: &http.Method{Value: "GET"},
|
|
||||||
Uri: []string{"/b"},
|
|
||||||
Header: []*http.Header{
|
|
||||||
{Name: "a", Value: []string{"b"}},
|
|
||||||
{Name: "c", Value: []string{"d"}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Response: &http.ResponseConfig{
|
|
||||||
Version: &http.Version{Value: "1.0"},
|
|
||||||
Status: &http.Status{Code: "404", Reason: "Not Found"},
|
|
||||||
Header: []*http.Header{
|
|
||||||
{
|
|
||||||
Name: "Content-Type",
|
|
||||||
Value: []string{"application/octet-stream", "video/mpeg"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Transfer-Encoding",
|
|
||||||
Value: []string{"chunked"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Connection",
|
|
||||||
Value: []string{"keep-alive"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Pragma",
|
|
||||||
Value: []string{"no-cache"},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Name: "Cache-Control",
|
|
||||||
Value: []string{"private", "no-cache"},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ProtocolName: "mkcp",
|
|
||||||
Settings: serial.ToTypedMessage(&kcp.Config{
|
|
||||||
Mtu: &kcp.MTU{Value: 1200},
|
|
||||||
HeaderConfig: serial.ToTypedMessage(&noop.Config{}),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ProtocolName: "websocket",
|
|
||||||
Settings: serial.ToTypedMessage(&websocket.Config{
|
|
||||||
Path: "/t",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ProtocolName: "quic",
|
|
||||||
Settings: serial.ToTypedMessage(&quic.Config{
|
|
||||||
Key: "abcd",
|
|
||||||
Security: &protocol.SecurityConfig{
|
|
||||||
Type: protocol.SecurityType_NONE,
|
|
||||||
},
|
|
||||||
Header: serial.ToTypedMessage(&tls.PacketConfig{}),
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ProtocolName: "grpc",
|
|
||||||
Settings: serial.ToTypedMessage(&grpc.Config{
|
|
||||||
ServiceName: "name",
|
|
||||||
MultiMode: true,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Input: `{
|
|
||||||
"gunSettings": {
|
|
||||||
"serviceName": "name"
|
|
||||||
}
|
|
||||||
}`,
|
|
||||||
Parser: createParser(),
|
|
||||||
Output: &global.Config{
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "grpc",
|
|
||||||
Settings: serial.ToTypedMessage(&grpc.Config{
|
|
||||||
ServiceName: "name",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@@ -389,28 +389,15 @@ type Config struct {
|
|||||||
// and should not be used.
|
// and should not be used.
|
||||||
Port uint16 `json:"port"`
|
Port uint16 `json:"port"`
|
||||||
|
|
||||||
// Deprecated: InboundConfig exists for historical compatibility
|
// Deprecated: Global transport config is no longer used
|
||||||
// and should not be used.
|
// left for returning error
|
||||||
InboundConfig *InboundDetourConfig `json:"inbound"`
|
Transport map[string]json.RawMessage `json:"transport"`
|
||||||
|
|
||||||
// Deprecated: OutboundConfig exists for historical compatibility
|
|
||||||
// and should not be used.
|
|
||||||
OutboundConfig *OutboundDetourConfig `json:"outbound"`
|
|
||||||
|
|
||||||
// Deprecated: InboundDetours exists for historical compatibility
|
|
||||||
// and should not be used.
|
|
||||||
InboundDetours []InboundDetourConfig `json:"inboundDetour"`
|
|
||||||
|
|
||||||
// Deprecated: OutboundDetours exists for historical compatibility
|
|
||||||
// and should not be used.
|
|
||||||
OutboundDetours []OutboundDetourConfig `json:"outboundDetour"`
|
|
||||||
|
|
||||||
LogConfig *LogConfig `json:"log"`
|
LogConfig *LogConfig `json:"log"`
|
||||||
RouterConfig *RouterConfig `json:"routing"`
|
RouterConfig *RouterConfig `json:"routing"`
|
||||||
DNSConfig *DNSConfig `json:"dns"`
|
DNSConfig *DNSConfig `json:"dns"`
|
||||||
InboundConfigs []InboundDetourConfig `json:"inbounds"`
|
InboundConfigs []InboundDetourConfig `json:"inbounds"`
|
||||||
OutboundConfigs []OutboundDetourConfig `json:"outbounds"`
|
OutboundConfigs []OutboundDetourConfig `json:"outbounds"`
|
||||||
Transport *TransportConfig `json:"transport"`
|
|
||||||
Policy *PolicyConfig `json:"policy"`
|
Policy *PolicyConfig `json:"policy"`
|
||||||
API *APIConfig `json:"api"`
|
API *APIConfig `json:"api"`
|
||||||
Metrics *MetricsConfig `json:"metrics"`
|
Metrics *MetricsConfig `json:"metrics"`
|
||||||
@@ -487,21 +474,6 @@ func (c *Config) Override(o *Config, fn string) {
|
|||||||
c.BurstObservatory = o.BurstObservatory
|
c.BurstObservatory = o.BurstObservatory
|
||||||
}
|
}
|
||||||
|
|
||||||
// deprecated attrs... keep them for now
|
|
||||||
if o.InboundConfig != nil {
|
|
||||||
c.InboundConfig = o.InboundConfig
|
|
||||||
}
|
|
||||||
if o.OutboundConfig != nil {
|
|
||||||
c.OutboundConfig = o.OutboundConfig
|
|
||||||
}
|
|
||||||
if o.InboundDetours != nil {
|
|
||||||
c.InboundDetours = o.InboundDetours
|
|
||||||
}
|
|
||||||
if o.OutboundDetours != nil {
|
|
||||||
c.OutboundDetours = o.OutboundDetours
|
|
||||||
}
|
|
||||||
// deprecated attrs
|
|
||||||
|
|
||||||
// update the Inbound in slice if the only one in override config has same tag
|
// update the Inbound in slice if the only one in override config has same tag
|
||||||
if len(o.InboundConfigs) > 0 {
|
if len(o.InboundConfigs) > 0 {
|
||||||
for i := range o.InboundConfigs {
|
for i := range o.InboundConfigs {
|
||||||
@@ -540,30 +512,6 @@ func (c *Config) Override(o *Config, fn string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyTransportConfig(s *StreamConfig, t *TransportConfig) {
|
|
||||||
if s.TCPSettings == nil {
|
|
||||||
s.TCPSettings = t.TCPConfig
|
|
||||||
}
|
|
||||||
if s.KCPSettings == nil {
|
|
||||||
s.KCPSettings = t.KCPConfig
|
|
||||||
}
|
|
||||||
if s.WSSettings == nil {
|
|
||||||
s.WSSettings = t.WSConfig
|
|
||||||
}
|
|
||||||
if s.HTTPSettings == nil {
|
|
||||||
s.HTTPSettings = t.HTTPConfig
|
|
||||||
}
|
|
||||||
if s.DSSettings == nil {
|
|
||||||
s.DSSettings = t.DSConfig
|
|
||||||
}
|
|
||||||
if s.HTTPUPGRADESettings == nil {
|
|
||||||
s.HTTPUPGRADESettings = t.HTTPUPGRADEConfig
|
|
||||||
}
|
|
||||||
if s.SplitHTTPSettings == nil {
|
|
||||||
s.SplitHTTPSettings = t.SplitHTTPConfig
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
func (c *Config) Build() (*core.Config, error) {
|
func (c *Config) Build() (*core.Config, error) {
|
||||||
if err := PostProcessConfigureFile(c); err != nil {
|
if err := PostProcessConfigureFile(c); err != nil {
|
||||||
@@ -668,14 +616,6 @@ func (c *Config) Build() (*core.Config, error) {
|
|||||||
|
|
||||||
var inbounds []InboundDetourConfig
|
var inbounds []InboundDetourConfig
|
||||||
|
|
||||||
if c.InboundConfig != nil {
|
|
||||||
inbounds = append(inbounds, *c.InboundConfig)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.InboundDetours) > 0 {
|
|
||||||
inbounds = append(inbounds, c.InboundDetours...)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.InboundConfigs) > 0 {
|
if len(c.InboundConfigs) > 0 {
|
||||||
inbounds = append(inbounds, c.InboundConfigs...)
|
inbounds = append(inbounds, c.InboundConfigs...)
|
||||||
}
|
}
|
||||||
@@ -688,13 +628,11 @@ func (c *Config) Build() (*core.Config, error) {
|
|||||||
}}}
|
}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(c.Transport) > 0 {
|
||||||
|
return nil, errors.New("Global transport config is deprecated")
|
||||||
|
}
|
||||||
|
|
||||||
for _, rawInboundConfig := range inbounds {
|
for _, rawInboundConfig := range inbounds {
|
||||||
if c.Transport != nil {
|
|
||||||
if rawInboundConfig.StreamSetting == nil {
|
|
||||||
rawInboundConfig.StreamSetting = &StreamConfig{}
|
|
||||||
}
|
|
||||||
applyTransportConfig(rawInboundConfig.StreamSetting, c.Transport)
|
|
||||||
}
|
|
||||||
ic, err := rawInboundConfig.Build()
|
ic, err := rawInboundConfig.Build()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -704,25 +642,11 @@ func (c *Config) Build() (*core.Config, error) {
|
|||||||
|
|
||||||
var outbounds []OutboundDetourConfig
|
var outbounds []OutboundDetourConfig
|
||||||
|
|
||||||
if c.OutboundConfig != nil {
|
|
||||||
outbounds = append(outbounds, *c.OutboundConfig)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.OutboundDetours) > 0 {
|
|
||||||
outbounds = append(outbounds, c.OutboundDetours...)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.OutboundConfigs) > 0 {
|
if len(c.OutboundConfigs) > 0 {
|
||||||
outbounds = append(outbounds, c.OutboundConfigs...)
|
outbounds = append(outbounds, c.OutboundConfigs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rawOutboundConfig := range outbounds {
|
for _, rawOutboundConfig := range outbounds {
|
||||||
if c.Transport != nil {
|
|
||||||
if rawOutboundConfig.StreamSetting == nil {
|
|
||||||
rawOutboundConfig.StreamSetting = &StreamConfig{}
|
|
||||||
}
|
|
||||||
applyTransportConfig(rawOutboundConfig.StreamSetting, c.Transport)
|
|
||||||
}
|
|
||||||
oc, err := rawOutboundConfig.Build()
|
oc, err := rawOutboundConfig.Build()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@@ -17,13 +17,9 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/serial"
|
"github.com/xtls/xray-core/common/serial"
|
||||||
core "github.com/xtls/xray-core/core"
|
core "github.com/xtls/xray-core/core"
|
||||||
. "github.com/xtls/xray-core/infra/conf"
|
. "github.com/xtls/xray-core/infra/conf"
|
||||||
"github.com/xtls/xray-core/proxy/blackhole"
|
|
||||||
dns_proxy "github.com/xtls/xray-core/proxy/dns"
|
|
||||||
"github.com/xtls/xray-core/proxy/freedom"
|
|
||||||
"github.com/xtls/xray-core/proxy/vmess"
|
"github.com/xtls/xray-core/proxy/vmess"
|
||||||
"github.com/xtls/xray-core/proxy/vmess/inbound"
|
"github.com/xtls/xray-core/proxy/vmess/inbound"
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
"github.com/xtls/xray-core/transport/internet/http"
|
|
||||||
"github.com/xtls/xray-core/transport/internet/tls"
|
"github.com/xtls/xray-core/transport/internet/tls"
|
||||||
"github.com/xtls/xray-core/transport/internet/websocket"
|
"github.com/xtls/xray-core/transport/internet/websocket"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
@@ -43,40 +39,11 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
Input: `{
|
Input: `{
|
||||||
"outbound": {
|
|
||||||
"protocol": "freedom",
|
|
||||||
"settings": {}
|
|
||||||
},
|
|
||||||
"log": {
|
"log": {
|
||||||
"access": "/var/log/xray/access.log",
|
"access": "/var/log/xray/access.log",
|
||||||
"loglevel": "error",
|
"loglevel": "error",
|
||||||
"error": "/var/log/xray/error.log"
|
"error": "/var/log/xray/error.log"
|
||||||
},
|
},
|
||||||
"inbound": {
|
|
||||||
"streamSettings": {
|
|
||||||
"network": "ws",
|
|
||||||
"wsSettings": {
|
|
||||||
"headers": {
|
|
||||||
"host": "example.domain"
|
|
||||||
},
|
|
||||||
"path": ""
|
|
||||||
},
|
|
||||||
"tlsSettings": {
|
|
||||||
"alpn": "h2"
|
|
||||||
},
|
|
||||||
"security": "tls"
|
|
||||||
},
|
|
||||||
"protocol": "vmess",
|
|
||||||
"port": 443,
|
|
||||||
"settings": {
|
|
||||||
"clients": [
|
|
||||||
{
|
|
||||||
"security": "aes-128-gcm",
|
|
||||||
"id": "0cdf8a45-303d-4fed-9780-29aa7f54175e"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inbounds": [{
|
"inbounds": [{
|
||||||
"streamSettings": {
|
"streamSettings": {
|
||||||
"network": "ws",
|
"network": "ws",
|
||||||
@@ -106,15 +73,6 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
"outboundDetour": [
|
|
||||||
{
|
|
||||||
"tag": "blocked",
|
|
||||||
"protocol": "blackhole"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"protocol": "dns"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"routing": {
|
"routing": {
|
||||||
"strategy": "rules",
|
"strategy": "rules",
|
||||||
"settings": {
|
"settings": {
|
||||||
@@ -128,11 +86,6 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"transport": {
|
|
||||||
"httpSettings": {
|
|
||||||
"path": "/test"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
Parser: createParser(),
|
Parser: createParser(),
|
||||||
@@ -169,108 +122,7 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
Outbound: []*core.OutboundHandlerConfig{
|
|
||||||
{
|
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
|
||||||
StreamSettings: &internet.StreamConfig{
|
|
||||||
ProtocolName: "tcp",
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Path: "/test",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
ProxySettings: serial.ToTypedMessage(&freedom.Config{
|
|
||||||
DomainStrategy: freedom.Config_AS_IS,
|
|
||||||
UserLevel: 0,
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Tag: "blocked",
|
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
|
||||||
StreamSettings: &internet.StreamConfig{
|
|
||||||
ProtocolName: "tcp",
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Path: "/test",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
ProxySettings: serial.ToTypedMessage(&blackhole.Config{}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
|
||||||
StreamSettings: &internet.StreamConfig{
|
|
||||||
ProtocolName: "tcp",
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Path: "/test",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
ProxySettings: serial.ToTypedMessage(&dns_proxy.Config{
|
|
||||||
Server: &net.Endpoint{},
|
|
||||||
Non_IPQuery: "drop",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Inbound: []*core.InboundHandlerConfig{
|
Inbound: []*core.InboundHandlerConfig{
|
||||||
{
|
|
||||||
ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{
|
|
||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(443)}},
|
|
||||||
StreamSettings: &internet.StreamConfig{
|
|
||||||
ProtocolName: "websocket",
|
|
||||||
TransportSettings: []*internet.TransportConfig{
|
|
||||||
{
|
|
||||||
ProtocolName: "websocket",
|
|
||||||
Settings: serial.ToTypedMessage(&websocket.Config{
|
|
||||||
Host: "example.domain",
|
|
||||||
Header: map[string]string{
|
|
||||||
"host": "example.domain",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Path: "/test",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
SecurityType: "xray.transport.internet.tls.Config",
|
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
|
||||||
serial.ToTypedMessage(&tls.Config{
|
|
||||||
NextProtocol: []string{"h2"},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
ProxySettings: serial.ToTypedMessage(&inbound.Config{
|
|
||||||
User: []*protocol.User{
|
|
||||||
{
|
|
||||||
Level: 0,
|
|
||||||
Account: serial.ToTypedMessage(&vmess.Account{
|
|
||||||
Id: "0cdf8a45-303d-4fed-9780-29aa7f54175e",
|
|
||||||
SecuritySettings: &protocol.SecurityConfig{
|
|
||||||
Type: protocol.SecurityType_AES128_GCM,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{
|
ReceiverSettings: serial.ToTypedMessage(&proxyman.ReceiverConfig{
|
||||||
PortList: &net.PortList{Range: []*net.PortRange{{
|
PortList: &net.PortList{Range: []*net.PortRange{{
|
||||||
@@ -295,12 +147,6 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
ProtocolName: "http",
|
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
|
||||||
Path: "/test",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
SecurityType: "xray.transport.internet.tls.Config",
|
SecurityType: "xray.transport.internet.tls.Config",
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
@@ -387,7 +233,6 @@ func TestConfig_Override(t *testing.T) {
|
|||||||
LogConfig: &LogConfig{},
|
LogConfig: &LogConfig{},
|
||||||
RouterConfig: &RouterConfig{},
|
RouterConfig: &RouterConfig{},
|
||||||
DNSConfig: &DNSConfig{},
|
DNSConfig: &DNSConfig{},
|
||||||
Transport: &TransportConfig{},
|
|
||||||
Policy: &PolicyConfig{},
|
Policy: &PolicyConfig{},
|
||||||
API: &APIConfig{},
|
API: &APIConfig{},
|
||||||
Stats: &StatsConfig{},
|
Stats: &StatsConfig{},
|
||||||
@@ -398,7 +243,6 @@ func TestConfig_Override(t *testing.T) {
|
|||||||
LogConfig: &LogConfig{},
|
LogConfig: &LogConfig{},
|
||||||
RouterConfig: &RouterConfig{},
|
RouterConfig: &RouterConfig{},
|
||||||
DNSConfig: &DNSConfig{},
|
DNSConfig: &DNSConfig{},
|
||||||
Transport: &TransportConfig{},
|
|
||||||
Policy: &PolicyConfig{},
|
Policy: &PolicyConfig{},
|
||||||
API: &APIConfig{},
|
API: &APIConfig{},
|
||||||
Stats: &StatsConfig{},
|
Stats: &StatsConfig{},
|
||||||
|
@@ -13,10 +13,10 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
"google.golang.org/grpc/credentials/insecure"
|
||||||
"google.golang.org/protobuf/encoding/protojson"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"github.com/xtls/xray-core/common/buf"
|
||||||
"github.com/xtls/xray-core/main/commands/base"
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
|
creflect "github.com/xtls/xray-core/common/reflect"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -107,20 +107,16 @@ func fetchHTTPContent(target string) ([]byte, error) {
|
|||||||
return content, nil
|
return content, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func protoToJSONString(m proto.Message, prefix, indent string) (string, error) {
|
|
||||||
return strings.TrimSpace(protojson.MarshalOptions{Indent: indent}.Format(m)), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func showJSONResponse(m proto.Message) {
|
func showJSONResponse(m proto.Message) {
|
||||||
if isNil(m) {
|
if isNil(m) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
output, err := protoToJSONString(m, "", " ")
|
if j, ok := creflect.MarshalToJson(m, true); ok {
|
||||||
if err != nil {
|
fmt.Println(j)
|
||||||
|
} else {
|
||||||
fmt.Fprintf(os.Stdout, "%v\n", m)
|
fmt.Fprintf(os.Stdout, "%v\n", m)
|
||||||
base.Fatalf("error encode json: %s", err)
|
base.Fatalf("error encode json")
|
||||||
}
|
}
|
||||||
fmt.Println(output)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isNil(i interface{}) bool {
|
func isNil(i interface{}) bool {
|
||||||
|
@@ -2,6 +2,7 @@ package all
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/xtls/xray-core/main/commands/all/api"
|
"github.com/xtls/xray-core/main/commands/all/api"
|
||||||
|
"github.com/xtls/xray-core/main/commands/all/convert"
|
||||||
"github.com/xtls/xray-core/main/commands/all/tls"
|
"github.com/xtls/xray-core/main/commands/all/tls"
|
||||||
"github.com/xtls/xray-core/main/commands/base"
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
)
|
)
|
||||||
@@ -12,7 +13,7 @@ func init() {
|
|||||||
base.RootCommand.Commands = append(
|
base.RootCommand.Commands = append(
|
||||||
base.RootCommand.Commands,
|
base.RootCommand.Commands,
|
||||||
api.CmdAPI,
|
api.CmdAPI,
|
||||||
// cmdConvert,
|
convert.CmdConvert,
|
||||||
tls.CmdTLS,
|
tls.CmdTLS,
|
||||||
cmdUUID,
|
cmdUUID,
|
||||||
cmdX25519,
|
cmdX25519,
|
||||||
|
@@ -1,126 +0,0 @@
|
|||||||
package all
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
|
||||||
"github.com/xtls/xray-core/common/buf"
|
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
"github.com/xtls/xray-core/infra/conf"
|
|
||||||
"github.com/xtls/xray-core/infra/conf/serial"
|
|
||||||
"github.com/xtls/xray-core/main/commands/base"
|
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
)
|
|
||||||
|
|
||||||
var cmdConvert = &base.Command{
|
|
||||||
UsageLine: "{{.Exec}} convert [json file] [json file] ...",
|
|
||||||
Short: "Convert multiple json config to protobuf",
|
|
||||||
Long: `
|
|
||||||
Convert multiple json config to protobuf.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
|
|
||||||
{{.Exec}} convert config.json c1.json c2.json <url>.json
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
cmdConvert.Run = executeConvert // break init loop
|
|
||||||
}
|
|
||||||
|
|
||||||
func executeConvert(cmd *base.Command, args []string) {
|
|
||||||
unnamedArgs := cmdConvert.Flag.Args()
|
|
||||||
if len(unnamedArgs) < 1 {
|
|
||||||
base.Fatalf("empty config list")
|
|
||||||
}
|
|
||||||
|
|
||||||
conf := &conf.Config{}
|
|
||||||
for _, arg := range unnamedArgs {
|
|
||||||
fmt.Fprintf(os.Stderr, "Read config: %s", arg)
|
|
||||||
r, err := loadArg(arg)
|
|
||||||
common.Must(err)
|
|
||||||
c, err := serial.DecodeJSONConfig(r)
|
|
||||||
if err != nil {
|
|
||||||
base.Fatalf(err.Error())
|
|
||||||
}
|
|
||||||
conf.Override(c, arg)
|
|
||||||
}
|
|
||||||
|
|
||||||
pbConfig, err := conf.Build()
|
|
||||||
if err != nil {
|
|
||||||
base.Fatalf(err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
bytesConfig, err := proto.Marshal(pbConfig)
|
|
||||||
if err != nil {
|
|
||||||
base.Fatalf("failed to marshal proto config: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if _, err := os.Stdout.Write(bytesConfig); err != nil {
|
|
||||||
base.Fatalf("failed to write proto config: %s", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// loadArg loads one arg, maybe an remote url, or local file path
|
|
||||||
func loadArg(arg string) (out io.Reader, err error) {
|
|
||||||
var data []byte
|
|
||||||
switch {
|
|
||||||
case strings.HasPrefix(arg, "http://"), strings.HasPrefix(arg, "https://"):
|
|
||||||
data, err = FetchHTTPContent(arg)
|
|
||||||
|
|
||||||
case arg == "stdin:":
|
|
||||||
data, err = io.ReadAll(os.Stdin)
|
|
||||||
|
|
||||||
default:
|
|
||||||
data, err = os.ReadFile(arg)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
out = bytes.NewBuffer(data)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// FetchHTTPContent dials https for remote content
|
|
||||||
func FetchHTTPContent(target string) ([]byte, error) {
|
|
||||||
parsedTarget, err := url.Parse(target)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("invalid URL: ", target).Base(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if s := strings.ToLower(parsedTarget.Scheme); s != "http" && s != "https" {
|
|
||||||
return nil, errors.New("invalid scheme: ", parsedTarget.Scheme)
|
|
||||||
}
|
|
||||||
|
|
||||||
client := &http.Client{
|
|
||||||
Timeout: 30 * time.Second,
|
|
||||||
}
|
|
||||||
resp, err := client.Do(&http.Request{
|
|
||||||
Method: "GET",
|
|
||||||
URL: parsedTarget,
|
|
||||||
Close: true,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to dial to ", target).Base(err)
|
|
||||||
}
|
|
||||||
defer resp.Body.Close()
|
|
||||||
|
|
||||||
if resp.StatusCode != 200 {
|
|
||||||
return nil, errors.New("unexpected HTTP status code: ", resp.StatusCode)
|
|
||||||
}
|
|
||||||
|
|
||||||
content, err := buf.ReadAllToBytes(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to read HTTP response").Base(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return content, nil
|
|
||||||
}
|
|
17
main/commands/all/convert/convert.go
Normal file
17
main/commands/all/convert/convert.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
|
)
|
||||||
|
|
||||||
|
// CmdConvert do config convertion
|
||||||
|
var CmdConvert = &base.Command{
|
||||||
|
UsageLine: "{{.Exec}} convert",
|
||||||
|
Short: "Convert configs",
|
||||||
|
Long: `{{.Exec}} {{.LongName}} provides tools to convert config.
|
||||||
|
`,
|
||||||
|
Commands: []*base.Command{
|
||||||
|
cmdProtobuf,
|
||||||
|
cmdJson,
|
||||||
|
},
|
||||||
|
}
|
71
main/commands/all/convert/json.go
Normal file
71
main/commands/all/convert/json.go
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
creflect "github.com/xtls/xray-core/common/reflect"
|
||||||
|
cserial "github.com/xtls/xray-core/common/serial"
|
||||||
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
|
"github.com/xtls/xray-core/main/confloader"
|
||||||
|
)
|
||||||
|
|
||||||
|
var cmdJson = &base.Command{
|
||||||
|
CustomFlags: true,
|
||||||
|
UsageLine: "{{.Exec}} convert json [-type] [stdin:] [typedMessage file] ",
|
||||||
|
Short: "Convert typedMessage to json",
|
||||||
|
Long: `
|
||||||
|
Convert ONE typedMessage to json.
|
||||||
|
|
||||||
|
Where typedMessage file need to be in the following format:
|
||||||
|
|
||||||
|
{
|
||||||
|
"type": "xray.proxy.shadowsocks.Account",
|
||||||
|
"value": "CgMxMTEQBg=="
|
||||||
|
}
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
-t, -type
|
||||||
|
Inject type infomation.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
{{.Exec}} convert json user.tmsg
|
||||||
|
`,
|
||||||
|
Run: executeTypedMessageToJson,
|
||||||
|
}
|
||||||
|
|
||||||
|
func executeTypedMessageToJson(cmd *base.Command, args []string) {
|
||||||
|
|
||||||
|
var injectTypeInfo bool
|
||||||
|
cmd.Flag.BoolVar(&injectTypeInfo, "t", false, "")
|
||||||
|
cmd.Flag.BoolVar(&injectTypeInfo, "type", false, "")
|
||||||
|
cmd.Flag.Parse(args)
|
||||||
|
|
||||||
|
if cmd.Flag.NArg() < 1 {
|
||||||
|
base.Fatalf("empty input list")
|
||||||
|
}
|
||||||
|
|
||||||
|
reader, err := confloader.LoadConfig(cmd.Flag.Arg(0))
|
||||||
|
if err != nil {
|
||||||
|
base.Fatalf(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
b, err := io.ReadAll(reader)
|
||||||
|
if err != nil {
|
||||||
|
base.Fatalf(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
tm := cserial.TypedMessage{}
|
||||||
|
if err = json.Unmarshal(b, &tm); err != nil {
|
||||||
|
base.Fatalf(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if j, ok := creflect.MarshalToJson(&tm, injectTypeInfo); ok {
|
||||||
|
fmt.Println(j)
|
||||||
|
} else {
|
||||||
|
base.Fatalf("marshal TypedMessage to json failed")
|
||||||
|
}
|
||||||
|
}
|
81
main/commands/all/convert/protobuf.go
Normal file
81
main/commands/all/convert/protobuf.go
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
package convert
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/xtls/xray-core/common/cmdarg"
|
||||||
|
creflect "github.com/xtls/xray-core/common/reflect"
|
||||||
|
"github.com/xtls/xray-core/core"
|
||||||
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
|
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
var cmdProtobuf = &base.Command{
|
||||||
|
CustomFlags: true,
|
||||||
|
UsageLine: "{{.Exec}} convert pb [-debug] [-type] [json file] [json file] ...",
|
||||||
|
Short: "Convert multiple json configs to protobuf",
|
||||||
|
Long: `
|
||||||
|
Convert multiple json configs to protobuf.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
|
||||||
|
-d, -debug
|
||||||
|
Show mix.pb as json.
|
||||||
|
FOR DEBUGGING ONLY!
|
||||||
|
DO NOT PASS THIS OUTPUT TO XRAY-CORE!
|
||||||
|
|
||||||
|
-t, -type
|
||||||
|
Inject type information into debug output.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
{{.Exec}} convert pb config.json c1.json c2.json c3.json > mix.pb
|
||||||
|
`,
|
||||||
|
Run: executeConvertConfigsToProtobuf,
|
||||||
|
}
|
||||||
|
|
||||||
|
func executeConvertConfigsToProtobuf(cmd *base.Command, args []string) {
|
||||||
|
|
||||||
|
var optDump bool
|
||||||
|
var optType bool
|
||||||
|
|
||||||
|
cmd.Flag.BoolVar(&optDump, "d", false, "")
|
||||||
|
cmd.Flag.BoolVar(&optDump, "debug", false, "")
|
||||||
|
cmd.Flag.BoolVar(&optType, "t", false, "")
|
||||||
|
cmd.Flag.BoolVar(&optType, "type", false, "")
|
||||||
|
cmd.Flag.Parse(args)
|
||||||
|
|
||||||
|
unnamedArgs := cmdarg.Arg{}
|
||||||
|
for _, v := range cmd.Flag.Args() {
|
||||||
|
unnamedArgs.Set(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(unnamedArgs) < 1 {
|
||||||
|
base.Fatalf("empty config list")
|
||||||
|
}
|
||||||
|
|
||||||
|
pbConfig, err := core.LoadConfig("auto", unnamedArgs)
|
||||||
|
if err != nil {
|
||||||
|
base.Fatalf(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
if optDump {
|
||||||
|
if j, ok := creflect.MarshalToJson(pbConfig, optType); ok {
|
||||||
|
fmt.Println(j)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
base.Fatalf("failed to marshal proto config to json.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bytesConfig, err := proto.Marshal(pbConfig)
|
||||||
|
if err != nil {
|
||||||
|
base.Fatalf("failed to marshal proto config: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stdout.Write(bytesConfig); err != nil {
|
||||||
|
base.Fatalf("failed to write proto config: %s", err)
|
||||||
|
}
|
||||||
|
}
|
@@ -1,13 +1,8 @@
|
|||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"path"
|
|
||||||
)
|
|
||||||
|
|
||||||
// CommandEnvHolder is a struct holds the environment info of commands
|
// CommandEnvHolder is a struct holds the environment info of commands
|
||||||
type CommandEnvHolder struct {
|
type CommandEnvHolder struct {
|
||||||
// Excutable name of current binary
|
// Executable name of current binary
|
||||||
Exec string
|
Exec string
|
||||||
// commands column width of current command
|
// commands column width of current command
|
||||||
CommandsWidth int
|
CommandsWidth int
|
||||||
@@ -17,10 +12,12 @@ type CommandEnvHolder struct {
|
|||||||
var CommandEnv CommandEnvHolder
|
var CommandEnv CommandEnvHolder
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
exec, err := os.Executable()
|
/*
|
||||||
if err != nil {
|
exec, err := os.Executable()
|
||||||
return
|
if err != nil {
|
||||||
}
|
return
|
||||||
CommandEnv.Exec = path.Base(exec)
|
}
|
||||||
|
CommandEnv.Exec = path.Base(exec)
|
||||||
|
*/
|
||||||
CommandEnv.Exec = "xray"
|
CommandEnv.Exec = "xray"
|
||||||
}
|
}
|
||||||
|
@@ -12,7 +12,7 @@ import (
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// copied from "github.com/golang/go/main.go"
|
// copied from "github.com/golang/go/main.go"
|
||||||
|
|
||||||
// Execute excute the commands
|
// Execute execute the commands
|
||||||
func Execute() {
|
func Execute() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
|
@@ -50,12 +50,10 @@ import (
|
|||||||
_ "github.com/xtls/xray-core/proxy/wireguard"
|
_ "github.com/xtls/xray-core/proxy/wireguard"
|
||||||
|
|
||||||
// Transports
|
// Transports
|
||||||
_ "github.com/xtls/xray-core/transport/internet/domainsocket"
|
|
||||||
_ "github.com/xtls/xray-core/transport/internet/grpc"
|
_ "github.com/xtls/xray-core/transport/internet/grpc"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/http"
|
_ "github.com/xtls/xray-core/transport/internet/http"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/httpupgrade"
|
_ "github.com/xtls/xray-core/transport/internet/httpupgrade"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/kcp"
|
_ "github.com/xtls/xray-core/transport/internet/kcp"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/quic"
|
|
||||||
_ "github.com/xtls/xray-core/transport/internet/reality"
|
_ "github.com/xtls/xray-core/transport/internet/reality"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/splithttp"
|
_ "github.com/xtls/xray-core/transport/internet/splithttp"
|
||||||
_ "github.com/xtls/xray-core/transport/internet/tcp"
|
_ "github.com/xtls/xray-core/transport/internet/tcp"
|
||||||
|
@@ -43,7 +43,7 @@ func init() {
|
|||||||
case io.Reader:
|
case io.Reader:
|
||||||
return serial.LoadJSONConfig(v)
|
return serial.LoadJSONConfig(v)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknow type")
|
return nil, errors.New("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@@ -43,7 +43,7 @@ func init() {
|
|||||||
case io.Reader:
|
case io.Reader:
|
||||||
return serial.LoadTOMLConfig(v)
|
return serial.LoadTOMLConfig(v)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknow type")
|
return nil, errors.New("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@@ -43,7 +43,7 @@ func init() {
|
|||||||
case io.Reader:
|
case io.Reader:
|
||||||
return serial.LoadYAMLConfig(v)
|
return serial.LoadYAMLConfig(v)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New("unknow type")
|
return nil, errors.New("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: proxy/blackhole/config.proto
|
// source: proxy/blackhole/config.proto
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ func file_proxy_blackhole_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_proxy_blackhole_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_proxy_blackhole_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
var file_proxy_blackhole_config_proto_goTypes = []interface{}{
|
var file_proxy_blackhole_config_proto_goTypes = []any{
|
||||||
(*NoneResponse)(nil), // 0: xray.proxy.blackhole.NoneResponse
|
(*NoneResponse)(nil), // 0: xray.proxy.blackhole.NoneResponse
|
||||||
(*HTTPResponse)(nil), // 1: xray.proxy.blackhole.HTTPResponse
|
(*HTTPResponse)(nil), // 1: xray.proxy.blackhole.HTTPResponse
|
||||||
(*Config)(nil), // 2: xray.proxy.blackhole.Config
|
(*Config)(nil), // 2: xray.proxy.blackhole.Config
|
||||||
@@ -202,7 +202,7 @@ func file_proxy_blackhole_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proxy_blackhole_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_blackhole_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*NoneResponse); i {
|
switch v := v.(*NoneResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -214,7 +214,7 @@ func file_proxy_blackhole_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_blackhole_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_blackhole_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*HTTPResponse); i {
|
switch v := v.(*HTTPResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -226,7 +226,7 @@ func file_proxy_blackhole_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_blackhole_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_blackhole_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: proxy/dns/config.proto
|
// source: proxy/dns/config.proto
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ func file_proxy_dns_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_proxy_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_proxy_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_proxy_dns_config_proto_goTypes = []interface{}{
|
var file_proxy_dns_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.proxy.dns.Config
|
(*Config)(nil), // 0: xray.proxy.dns.Config
|
||||||
(*net.Endpoint)(nil), // 1: xray.common.net.Endpoint
|
(*net.Endpoint)(nil), // 1: xray.common.net.Endpoint
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ func file_proxy_dns_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proxy_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_dns_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: proxy/dokodemo/config.proto
|
// source: proxy/dokodemo/config.proto
|
||||||
|
|
||||||
@@ -175,7 +175,7 @@ func file_proxy_dokodemo_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_proxy_dokodemo_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
var file_proxy_dokodemo_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||||
var file_proxy_dokodemo_config_proto_goTypes = []interface{}{
|
var file_proxy_dokodemo_config_proto_goTypes = []any{
|
||||||
(*Config)(nil), // 0: xray.proxy.dokodemo.Config
|
(*Config)(nil), // 0: xray.proxy.dokodemo.Config
|
||||||
(*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain
|
(*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain
|
||||||
(*net.NetworkList)(nil), // 2: xray.common.net.NetworkList
|
(*net.NetworkList)(nil), // 2: xray.common.net.NetworkList
|
||||||
@@ -198,7 +198,7 @@ func file_proxy_dokodemo_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proxy_dokodemo_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_dokodemo_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: proxy/freedom/config.proto
|
// source: proxy/freedom/config.proto
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ func (x Config_DomainStrategy) Number() protoreflect.EnumNumber {
|
|||||||
|
|
||||||
// Deprecated: Use Config_DomainStrategy.Descriptor instead.
|
// Deprecated: Use Config_DomainStrategy.Descriptor instead.
|
||||||
func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) {
|
func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) {
|
||||||
return file_proxy_freedom_config_proto_rawDescGZIP(), []int{2, 0}
|
return file_proxy_freedom_config_proto_rawDescGZIP(), []int{3, 0}
|
||||||
}
|
}
|
||||||
|
|
||||||
type DestinationOverride struct {
|
type DestinationOverride struct {
|
||||||
@@ -228,6 +228,85 @@ func (x *Fragment) GetIntervalMax() uint64 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Noise struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
LengthMin uint64 `protobuf:"varint,1,opt,name=length_min,json=lengthMin,proto3" json:"length_min,omitempty"`
|
||||||
|
LengthMax uint64 `protobuf:"varint,2,opt,name=length_max,json=lengthMax,proto3" json:"length_max,omitempty"`
|
||||||
|
DelayMin uint64 `protobuf:"varint,3,opt,name=delay_min,json=delayMin,proto3" json:"delay_min,omitempty"`
|
||||||
|
DelayMax uint64 `protobuf:"varint,4,opt,name=delay_max,json=delayMax,proto3" json:"delay_max,omitempty"`
|
||||||
|
StrNoise string `protobuf:"bytes,5,opt,name=str_noise,json=strNoise,proto3" json:"str_noise,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) Reset() {
|
||||||
|
*x = Noise{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_proxy_freedom_config_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Noise) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Noise) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_proxy_freedom_config_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Noise.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Noise) Descriptor() ([]byte, []int) {
|
||||||
|
return file_proxy_freedom_config_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) GetLengthMin() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LengthMin
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) GetLengthMax() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LengthMax
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) GetDelayMin() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.DelayMin
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) GetDelayMax() uint64 {
|
||||||
|
if x != nil {
|
||||||
|
return x.DelayMax
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Noise) GetStrNoise() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.StrNoise
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -240,12 +319,13 @@ type Config struct {
|
|||||||
UserLevel uint32 `protobuf:"varint,4,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
|
UserLevel uint32 `protobuf:"varint,4,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"`
|
||||||
Fragment *Fragment `protobuf:"bytes,5,opt,name=fragment,proto3" json:"fragment,omitempty"`
|
Fragment *Fragment `protobuf:"bytes,5,opt,name=fragment,proto3" json:"fragment,omitempty"`
|
||||||
ProxyProtocol uint32 `protobuf:"varint,6,opt,name=proxy_protocol,json=proxyProtocol,proto3" json:"proxy_protocol,omitempty"`
|
ProxyProtocol uint32 `protobuf:"varint,6,opt,name=proxy_protocol,json=proxyProtocol,proto3" json:"proxy_protocol,omitempty"`
|
||||||
|
Noise *Noise `protobuf:"bytes,7,opt,name=noise,proto3" json:"noise,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Config) Reset() {
|
func (x *Config) Reset() {
|
||||||
*x = Config{}
|
*x = Config{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_proxy_freedom_config_proto_msgTypes[2]
|
mi := &file_proxy_freedom_config_proto_msgTypes[3]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -258,7 +338,7 @@ func (x *Config) String() string {
|
|||||||
func (*Config) ProtoMessage() {}
|
func (*Config) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *Config) ProtoReflect() protoreflect.Message {
|
func (x *Config) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_proxy_freedom_config_proto_msgTypes[2]
|
mi := &file_proxy_freedom_config_proto_msgTypes[3]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -271,7 +351,7 @@ func (x *Config) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
|
// Deprecated: Use Config.ProtoReflect.Descriptor instead.
|
||||||
func (*Config) Descriptor() ([]byte, []int) {
|
func (*Config) Descriptor() ([]byte, []int) {
|
||||||
return file_proxy_freedom_config_proto_rawDescGZIP(), []int{2}
|
return file_proxy_freedom_config_proto_rawDescGZIP(), []int{3}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Config) GetDomainStrategy() Config_DomainStrategy {
|
func (x *Config) GetDomainStrategy() Config_DomainStrategy {
|
||||||
@@ -317,6 +397,13 @@ func (x *Config) GetProxyProtocol() uint32 {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Config) GetNoise() *Noise {
|
||||||
|
if x != nil {
|
||||||
|
return x.Noise
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_proxy_freedom_config_proto protoreflect.FileDescriptor
|
var File_proxy_freedom_config_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_proxy_freedom_config_proto_rawDesc = []byte{
|
var file_proxy_freedom_config_proto_rawDesc = []byte{
|
||||||
@@ -343,29 +430,42 @@ var file_proxy_freedom_config_proto_rawDesc = []byte{
|
|||||||
0x6c, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x74,
|
0x6c, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x74,
|
||||||
0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x65,
|
0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x65,
|
||||||
0x72, 0x76, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
|
0x72, 0x76, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b,
|
||||||
0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x61, 0x78, 0x22, 0x82, 0x04, 0x0a, 0x06,
|
0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x61, 0x78, 0x22, 0x9c, 0x01, 0x0a, 0x05,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x52, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
|
0x4e, 0x6f, 0x69, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f,
|
||||||
0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6c, 0x65, 0x6e, 0x67, 0x74,
|
||||||
0x29, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65,
|
0x68, 0x4d, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5f, 0x6d,
|
||||||
0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x6f, 0x6d, 0x61,
|
0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
|
||||||
0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61,
|
0x4d, 0x61, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x69, 0x6e,
|
||||||
0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x69, 0x6e,
|
||||||
0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52,
|
0x12, 0x1b, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x04, 0x20,
|
||||||
0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x5a, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74,
|
0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x12, 0x1b, 0x0a,
|
||||||
0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65,
|
0x09, 0x73, 0x74, 0x72, 0x5f, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72,
|
0x52, 0x08, 0x73, 0x74, 0x72, 0x4e, 0x6f, 0x69, 0x73, 0x65, 0x22, 0xb3, 0x04, 0x0a, 0x06, 0x43,
|
||||||
0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x44, 0x65, 0x73, 0x74,
|
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x52, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f,
|
||||||
0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52,
|
0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29,
|
||||||
0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72,
|
0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65,
|
||||||
0x72, 0x69, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76,
|
0x64, 0x6f, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69,
|
||||||
0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65,
|
0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69,
|
||||||
0x76, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18,
|
0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69, 0x6d,
|
||||||
0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f,
|
0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07,
|
||||||
0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d,
|
0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x5a, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69,
|
||||||
0x65, 0x6e, 0x74, 0x52, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a,
|
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18,
|
||||||
0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18,
|
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74,
|
0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x69,
|
||||||
0x6f, 0x63, 0x6f, 0x6c, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53,
|
0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, 0x13,
|
||||||
|
0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72,
|
||||||
|
0x69, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65,
|
||||||
|
0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76,
|
||||||
|
0x65, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78,
|
||||||
|
0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65,
|
||||||
|
0x6e, 0x74, 0x52, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e,
|
||||||
|
0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x06,
|
||||||
|
0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x63, 0x6f, 0x6c, 0x12, 0x2f, 0x0a, 0x05, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01,
|
||||||
|
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e,
|
||||||
|
0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x4e, 0x6f, 0x69, 0x73, 0x65, 0x52, 0x05, 0x6e,
|
||||||
|
0x6f, 0x69, 0x73, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53,
|
||||||
0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53,
|
0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53,
|
||||||
0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b,
|
0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b,
|
||||||
0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55,
|
0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55,
|
||||||
@@ -398,24 +498,26 @@ func file_proxy_freedom_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_proxy_freedom_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_proxy_freedom_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_proxy_freedom_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
var file_proxy_freedom_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||||
var file_proxy_freedom_config_proto_goTypes = []interface{}{
|
var file_proxy_freedom_config_proto_goTypes = []any{
|
||||||
(Config_DomainStrategy)(0), // 0: xray.proxy.freedom.Config.DomainStrategy
|
(Config_DomainStrategy)(0), // 0: xray.proxy.freedom.Config.DomainStrategy
|
||||||
(*DestinationOverride)(nil), // 1: xray.proxy.freedom.DestinationOverride
|
(*DestinationOverride)(nil), // 1: xray.proxy.freedom.DestinationOverride
|
||||||
(*Fragment)(nil), // 2: xray.proxy.freedom.Fragment
|
(*Fragment)(nil), // 2: xray.proxy.freedom.Fragment
|
||||||
(*Config)(nil), // 3: xray.proxy.freedom.Config
|
(*Noise)(nil), // 3: xray.proxy.freedom.Noise
|
||||||
(*protocol.ServerEndpoint)(nil), // 4: xray.common.protocol.ServerEndpoint
|
(*Config)(nil), // 4: xray.proxy.freedom.Config
|
||||||
|
(*protocol.ServerEndpoint)(nil), // 5: xray.common.protocol.ServerEndpoint
|
||||||
}
|
}
|
||||||
var file_proxy_freedom_config_proto_depIdxs = []int32{
|
var file_proxy_freedom_config_proto_depIdxs = []int32{
|
||||||
4, // 0: xray.proxy.freedom.DestinationOverride.server:type_name -> xray.common.protocol.ServerEndpoint
|
5, // 0: xray.proxy.freedom.DestinationOverride.server:type_name -> xray.common.protocol.ServerEndpoint
|
||||||
0, // 1: xray.proxy.freedom.Config.domain_strategy:type_name -> xray.proxy.freedom.Config.DomainStrategy
|
0, // 1: xray.proxy.freedom.Config.domain_strategy:type_name -> xray.proxy.freedom.Config.DomainStrategy
|
||||||
1, // 2: xray.proxy.freedom.Config.destination_override:type_name -> xray.proxy.freedom.DestinationOverride
|
1, // 2: xray.proxy.freedom.Config.destination_override:type_name -> xray.proxy.freedom.DestinationOverride
|
||||||
2, // 3: xray.proxy.freedom.Config.fragment:type_name -> xray.proxy.freedom.Fragment
|
2, // 3: xray.proxy.freedom.Config.fragment:type_name -> xray.proxy.freedom.Fragment
|
||||||
4, // [4:4] is the sub-list for method output_type
|
3, // 4: xray.proxy.freedom.Config.noise:type_name -> xray.proxy.freedom.Noise
|
||||||
4, // [4:4] is the sub-list for method input_type
|
5, // [5:5] is the sub-list for method output_type
|
||||||
4, // [4:4] is the sub-list for extension type_name
|
5, // [5:5] is the sub-list for method input_type
|
||||||
4, // [4:4] is the sub-list for extension extendee
|
5, // [5:5] is the sub-list for extension type_name
|
||||||
0, // [0:4] is the sub-list for field type_name
|
5, // [5:5] is the sub-list for extension extendee
|
||||||
|
0, // [0:5] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_proxy_freedom_config_proto_init() }
|
func init() { file_proxy_freedom_config_proto_init() }
|
||||||
@@ -424,7 +526,7 @@ func file_proxy_freedom_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proxy_freedom_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_freedom_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*DestinationOverride); i {
|
switch v := v.(*DestinationOverride); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -436,7 +538,7 @@ func file_proxy_freedom_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_freedom_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_freedom_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Fragment); i {
|
switch v := v.(*Fragment); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -448,7 +550,19 @@ func file_proxy_freedom_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_freedom_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_freedom_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
|
switch v := v.(*Noise); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_proxy_freedom_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Config); i {
|
switch v := v.(*Config); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -467,7 +581,7 @@ func file_proxy_freedom_config_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_proxy_freedom_config_proto_rawDesc,
|
RawDescriptor: file_proxy_freedom_config_proto_rawDesc,
|
||||||
NumEnums: 1,
|
NumEnums: 1,
|
||||||
NumMessages: 3,
|
NumMessages: 4,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@@ -20,6 +20,13 @@ message Fragment {
|
|||||||
uint64 interval_min = 5;
|
uint64 interval_min = 5;
|
||||||
uint64 interval_max = 6;
|
uint64 interval_max = 6;
|
||||||
}
|
}
|
||||||
|
message Noise {
|
||||||
|
uint64 length_min = 1;
|
||||||
|
uint64 length_max = 2;
|
||||||
|
uint64 delay_min = 3;
|
||||||
|
uint64 delay_max = 4;
|
||||||
|
string str_noise = 5;
|
||||||
|
}
|
||||||
|
|
||||||
message Config {
|
message Config {
|
||||||
enum DomainStrategy {
|
enum DomainStrategy {
|
||||||
@@ -41,4 +48,5 @@ message Config {
|
|||||||
uint32 user_level = 4;
|
uint32 user_level = 4;
|
||||||
Fragment fragment = 5;
|
Fragment fragment = 5;
|
||||||
uint32 proxy_protocol = 6;
|
uint32 proxy_protocol = 6;
|
||||||
|
Noise noise = 7;
|
||||||
}
|
}
|
||||||
|
@@ -28,6 +28,7 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport"
|
"github.com/xtls/xray-core/transport"
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
"github.com/xtls/xray-core/transport/internet/stat"
|
"github.com/xtls/xray-core/transport/internet/stat"
|
||||||
|
"github.com/xtls/xray-core/transport/internet/tls"
|
||||||
)
|
)
|
||||||
|
|
||||||
var useSplice bool
|
var useSplice bool
|
||||||
@@ -207,6 +208,16 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
writer = NewPacketWriter(conn, h, ctx, UDPOverride)
|
writer = NewPacketWriter(conn, h, ctx, UDPOverride)
|
||||||
|
if h.config.Noise != nil {
|
||||||
|
errors.LogDebug(ctx, "NOISE", h.config.Noise.StrNoise, h.config.Noise.LengthMin, h.config.Noise.LengthMax,
|
||||||
|
h.config.Noise.DelayMin, h.config.Noise.DelayMax)
|
||||||
|
writer = &NoisePacketWriter{
|
||||||
|
Writer: writer,
|
||||||
|
noise: h.config.Noise,
|
||||||
|
firstWrite: true,
|
||||||
|
UDPOverride: UDPOverride,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := buf.Copy(input, writer, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(input, writer, buf.UpdateActivity(timer)); err != nil {
|
||||||
@@ -225,9 +236,16 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
writeConn = inbound.Conn
|
writeConn = inbound.Conn
|
||||||
inTimer = inbound.Timer
|
inTimer = inbound.Timer
|
||||||
}
|
}
|
||||||
return proxy.CopyRawConnIfExist(ctx, conn, writeConn, link.Writer, timer, inTimer)
|
if !isTLSConn(conn) { // it would be tls conn in special use case of MITM, we need to let link handle traffic
|
||||||
|
return proxy.CopyRawConnIfExist(ctx, conn, writeConn, link.Writer, timer, inTimer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var reader buf.Reader
|
||||||
|
if destination.Network == net.Network_TCP {
|
||||||
|
reader = buf.NewReader(conn)
|
||||||
|
} else {
|
||||||
|
reader = NewPacketReader(conn, UDPOverride)
|
||||||
}
|
}
|
||||||
reader := NewPacketReader(conn, UDPOverride)
|
|
||||||
if err := buf.Copy(reader, output, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(reader, output, buf.UpdateActivity(timer)); err != nil {
|
||||||
return errors.New("failed to process response").Base(err)
|
return errors.New("failed to process response").Base(err)
|
||||||
}
|
}
|
||||||
@@ -245,6 +263,19 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isTLSConn(conn stat.Connection) bool {
|
||||||
|
if conn != nil {
|
||||||
|
statConn, ok := conn.(*stat.CounterConnection)
|
||||||
|
if ok {
|
||||||
|
conn = statConn.Connection
|
||||||
|
}
|
||||||
|
if _, ok := conn.(*tls.Conn); ok {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func NewPacketReader(conn net.Conn, UDPOverride net.Destination) buf.Reader {
|
func NewPacketReader(conn net.Conn, UDPOverride net.Destination) buf.Reader {
|
||||||
iConn := conn
|
iConn := conn
|
||||||
statConn, ok := iConn.(*stat.CounterConnection)
|
statConn, ok := iConn.(*stat.CounterConnection)
|
||||||
@@ -307,6 +338,7 @@ func NewPacketWriter(conn net.Conn, h *Handler, ctx context.Context, UDPOverride
|
|||||||
Context: ctx,
|
Context: ctx,
|
||||||
UDPOverride: UDPOverride,
|
UDPOverride: UDPOverride,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return &buf.SequentialWriter{Writer: conn}
|
return &buf.SequentialWriter{Writer: conn}
|
||||||
}
|
}
|
||||||
@@ -362,6 +394,45 @@ func (w *PacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type NoisePacketWriter struct {
|
||||||
|
buf.Writer
|
||||||
|
noise *Noise
|
||||||
|
firstWrite bool
|
||||||
|
UDPOverride net.Destination
|
||||||
|
}
|
||||||
|
|
||||||
|
// MultiBuffer writer with Noise in first packet
|
||||||
|
func (w *NoisePacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error {
|
||||||
|
if w.firstWrite {
|
||||||
|
w.firstWrite = false
|
||||||
|
//Do not send Noise for dns requests(just to be safe)
|
||||||
|
if w.UDPOverride.Port == 53 {
|
||||||
|
return w.Writer.WriteMultiBuffer(mb)
|
||||||
|
}
|
||||||
|
var noise []byte
|
||||||
|
var err error
|
||||||
|
//User input string
|
||||||
|
if w.noise.StrNoise != "" {
|
||||||
|
noise = []byte(w.noise.StrNoise)
|
||||||
|
} else {
|
||||||
|
//Random noise
|
||||||
|
noise, err = GenerateRandomBytes(randBetween(int64(w.noise.LengthMin),
|
||||||
|
int64(w.noise.LengthMax)))
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
w.Writer.WriteMultiBuffer(buf.MultiBuffer{buf.FromBytes(noise)})
|
||||||
|
|
||||||
|
if w.noise.DelayMin != 0 {
|
||||||
|
time.Sleep(time.Duration(randBetween(int64(w.noise.DelayMin), int64(w.noise.DelayMax))) * time.Millisecond)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return w.Writer.WriteMultiBuffer(mb)
|
||||||
|
}
|
||||||
|
|
||||||
type FragmentWriter struct {
|
type FragmentWriter struct {
|
||||||
fragment *Fragment
|
fragment *Fragment
|
||||||
writer io.Writer
|
writer io.Writer
|
||||||
@@ -381,6 +452,7 @@ func (f *FragmentWriter) Write(b []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
data := b[5:recordLen]
|
data := b[5:recordLen]
|
||||||
buf := make([]byte, 1024)
|
buf := make([]byte, 1024)
|
||||||
|
var hello []byte
|
||||||
for from := 0; ; {
|
for from := 0; ; {
|
||||||
to := from + int(randBetween(int64(f.fragment.LengthMin), int64(f.fragment.LengthMax)))
|
to := from + int(randBetween(int64(f.fragment.LengthMin), int64(f.fragment.LengthMax)))
|
||||||
if to > len(data) {
|
if to > len(data) {
|
||||||
@@ -392,12 +464,22 @@ func (f *FragmentWriter) Write(b []byte) (int, error) {
|
|||||||
from = to
|
from = to
|
||||||
buf[3] = byte(l >> 8)
|
buf[3] = byte(l >> 8)
|
||||||
buf[4] = byte(l)
|
buf[4] = byte(l)
|
||||||
_, err := f.writer.Write(buf[:5+l])
|
if f.fragment.IntervalMax == 0 { // combine fragmented tlshello if interval is 0
|
||||||
time.Sleep(time.Duration(randBetween(int64(f.fragment.IntervalMin), int64(f.fragment.IntervalMax))) * time.Millisecond)
|
hello = append(hello, buf[:5+l]...)
|
||||||
if err != nil {
|
} else {
|
||||||
return 0, err
|
_, err := f.writer.Write(buf[:5+l])
|
||||||
|
time.Sleep(time.Duration(randBetween(int64(f.fragment.IntervalMin), int64(f.fragment.IntervalMax))) * time.Millisecond)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if from == len(data) {
|
if from == len(data) {
|
||||||
|
if len(hello) > 0 {
|
||||||
|
_, err := f.writer.Write(hello)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(b) > recordLen {
|
if len(b) > recordLen {
|
||||||
n, err := f.writer.Write(b[recordLen:])
|
n, err := f.writer.Write(b[recordLen:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -437,3 +519,13 @@ func randBetween(left int64, right int64) int64 {
|
|||||||
bigInt, _ := rand.Int(rand.Reader, big.NewInt(right-left))
|
bigInt, _ := rand.Int(rand.Reader, big.NewInt(right-left))
|
||||||
return left + bigInt.Int64()
|
return left + bigInt.Int64()
|
||||||
}
|
}
|
||||||
|
func GenerateRandomBytes(n int64) ([]byte, error) {
|
||||||
|
b := make([]byte, n)
|
||||||
|
_, err := rand.Read(b)
|
||||||
|
// Note that err == nil only if we read len(b) bytes.
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return b, nil
|
||||||
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.1
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.27.0
|
||||||
// source: proxy/http/config.proto
|
// source: proxy/http/config.proto
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ func file_proxy_http_config_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_proxy_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_proxy_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||||
var file_proxy_http_config_proto_goTypes = []interface{}{
|
var file_proxy_http_config_proto_goTypes = []any{
|
||||||
(*Account)(nil), // 0: xray.proxy.http.Account
|
(*Account)(nil), // 0: xray.proxy.http.Account
|
||||||
(*ServerConfig)(nil), // 1: xray.proxy.http.ServerConfig
|
(*ServerConfig)(nil), // 1: xray.proxy.http.ServerConfig
|
||||||
(*Header)(nil), // 2: xray.proxy.http.Header
|
(*Header)(nil), // 2: xray.proxy.http.Header
|
||||||
@@ -347,7 +347,7 @@ func file_proxy_http_config_proto_init() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !protoimpl.UnsafeEnabled {
|
if !protoimpl.UnsafeEnabled {
|
||||||
file_proxy_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_http_config_proto_msgTypes[0].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Account); i {
|
switch v := v.(*Account); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -359,7 +359,7 @@ func file_proxy_http_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_http_config_proto_msgTypes[1].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ServerConfig); i {
|
switch v := v.(*ServerConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -371,7 +371,7 @@ func file_proxy_http_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_http_config_proto_msgTypes[2].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*Header); i {
|
switch v := v.(*Header); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -383,7 +383,7 @@ func file_proxy_http_config_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_proxy_http_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
file_proxy_http_config_proto_msgTypes[3].Exporter = func(v any, i int) any {
|
||||||
switch v := v.(*ClientConfig); i {
|
switch v := v.(*ClientConfig); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
|
@@ -2,6 +2,7 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"io"
|
"io"
|
||||||
@@ -83,14 +84,28 @@ type readerOnly struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher) error {
|
func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher) error {
|
||||||
|
return s.ProcessWithFirstbyte(ctx, network, conn, dispatcher)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Firstbyte is for forwarded conn from SOCKS inbound
|
||||||
|
// Because it needs first byte to choose protocol
|
||||||
|
// We need to add it back
|
||||||
|
// Other parts are the same as the process function
|
||||||
|
func (s *Server) ProcessWithFirstbyte(ctx context.Context, network net.Network, conn stat.Connection, dispatcher routing.Dispatcher, firstbyte ...byte) error {
|
||||||
inbound := session.InboundFromContext(ctx)
|
inbound := session.InboundFromContext(ctx)
|
||||||
inbound.Name = "http"
|
inbound.Name = "http"
|
||||||
inbound.CanSpliceCopy = 2
|
inbound.CanSpliceCopy = 2
|
||||||
inbound.User = &protocol.MemoryUser{
|
inbound.User = &protocol.MemoryUser{
|
||||||
Level: s.config.UserLevel,
|
Level: s.config.UserLevel,
|
||||||
}
|
}
|
||||||
|
var reader *bufio.Reader
|
||||||
reader := bufio.NewReaderSize(readerOnly{conn}, buf.Size)
|
if len(firstbyte) > 0 {
|
||||||
|
readerWithoutFirstbyte := bufio.NewReaderSize(readerOnly{conn}, buf.Size)
|
||||||
|
multiReader := io.MultiReader(bytes.NewReader(firstbyte), readerWithoutFirstbyte)
|
||||||
|
reader = bufio.NewReaderSize(multiReader, buf.Size)
|
||||||
|
} else {
|
||||||
|
reader = bufio.NewReaderSize(readerOnly{conn}, buf.Size)
|
||||||
|
}
|
||||||
|
|
||||||
Start:
|
Start:
|
||||||
if err := conn.SetReadDeadline(time.Now().Add(s.policy().Timeouts.Handshake)); err != nil {
|
if err := conn.SetReadDeadline(time.Now().Add(s.policy().Timeouts.Handshake)); err != nil {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user