mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-24 02:26:48 +08:00
Compare commits
103 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a35d5719f4 | ||
![]() |
363e86c585 | ||
![]() |
b1c6471eeb | ||
![]() |
a931507dd6 | ||
![]() |
67c2a29065 | ||
![]() |
5f0642a671 | ||
![]() |
3fed0c773f | ||
![]() |
d7c5a0fc5f | ||
![]() |
781aaee21f | ||
![]() |
7970f240de | ||
![]() |
88ae774cce | ||
![]() |
c259e4e4a6 | ||
![]() |
3a8c5f38e8 | ||
![]() |
12c3908e8c | ||
![]() |
1919a1e86f | ||
![]() |
1b607ff874 | ||
![]() |
7496413e5c | ||
![]() |
297a9ae7bd | ||
![]() |
a247997e38 | ||
![]() |
6b1bf312d7 | ||
![]() |
c90affe7db | ||
![]() |
3d0feae462 | ||
![]() |
f04cb0b288 | ||
![]() |
9438517130 | ||
![]() |
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 |
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
|
||||||
|
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 }}
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -187,7 +187,7 @@ jobs:
|
|||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.gotoolchain || '1.22' }}
|
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: '1.22'
|
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
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -28,3 +28,6 @@ errorgen
|
|||||||
*.dat
|
*.dat
|
||||||
.vscode
|
.vscode
|
||||||
/build_assets
|
/build_assets
|
||||||
|
|
||||||
|
# Output from dlv test
|
||||||
|
**/debug.*
|
||||||
|
@@ -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
|
||||||
@@ -71,6 +77,7 @@
|
|||||||
- Android
|
- Android
|
||||||
- [v2rayNG](https://github.com/2dust/v2rayNG)
|
- [v2rayNG](https://github.com/2dust/v2rayNG)
|
||||||
- [X-flutter](https://github.com/XTLS/X-flutter)
|
- [X-flutter](https://github.com/XTLS/X-flutter)
|
||||||
|
- [SaeedDev94/Xray](https://github.com/SaeedDev94/Xray)
|
||||||
- iOS & macOS arm64
|
- iOS & macOS arm64
|
||||||
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
- [FoXray](https://apps.apple.com/app/foxray/id6448898396)
|
||||||
- [Streisand](https://apps.apple.com/app/streisand/id6450534064)
|
- [Streisand](https://apps.apple.com/app/streisand/id6450534064)
|
||||||
|
@@ -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
|
||||||
|
@@ -10,8 +10,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"github.com/xtls/xray-core/common/buf"
|
||||||
|
"github.com/xtls/xray-core/common/errors"
|
||||||
"github.com/xtls/xray-core/common/log"
|
"github.com/xtls/xray-core/common/log"
|
||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
"github.com/xtls/xray-core/common/protocol"
|
"github.com/xtls/xray-core/common/protocol"
|
||||||
@@ -41,8 +41,14 @@ func (r *cachedReader) Cache(b *buf.Buffer) {
|
|||||||
if !mb.IsEmpty() {
|
if !mb.IsEmpty() {
|
||||||
r.cache, _ = buf.MergeMulti(r.cache, mb)
|
r.cache, _ = buf.MergeMulti(r.cache, mb)
|
||||||
}
|
}
|
||||||
b.Clear()
|
cacheLen := r.cache.Len()
|
||||||
rawBytes := b.Extend(buf.Size)
|
if cacheLen <= b.Cap() {
|
||||||
|
b.Clear()
|
||||||
|
} else {
|
||||||
|
b.Release()
|
||||||
|
*b = *buf.NewWithSize(cacheLen)
|
||||||
|
}
|
||||||
|
rawBytes := b.Extend(cacheLen)
|
||||||
n := r.cache.Copy(rawBytes)
|
n := r.cache.Copy(rawBytes)
|
||||||
b.Resize(0, int32(n))
|
b.Resize(0, int32(n))
|
||||||
r.Unlock()
|
r.Unlock()
|
||||||
@@ -421,7 +427,11 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
|
|||||||
outTag := route.GetOutboundTag()
|
outTag := route.GetOutboundTag()
|
||||||
if h := d.ohm.GetHandler(outTag); h != nil {
|
if h := d.ohm.GetHandler(outTag); h != nil {
|
||||||
isPickRoute = 2
|
isPickRoute = 2
|
||||||
errors.LogInfo(ctx, "taking detour [", outTag, "] for [", destination, "]")
|
if route.GetRuleTag() == "" {
|
||||||
|
errors.LogInfo(ctx, "taking detour [", outTag, "] for [", destination, "]")
|
||||||
|
} else {
|
||||||
|
errors.LogInfo(ctx, "Hit route rule: [", route.GetRuleTag(), "] so taking detour [", outTag, "] for [", destination, "]")
|
||||||
|
}
|
||||||
handler = h
|
handler = h
|
||||||
} else {
|
} else {
|
||||||
errors.LogWarning(ctx, "non existing outTag: ", outTag)
|
errors.LogWarning(ctx, "non existing outTag: ", outTag)
|
||||||
|
@@ -35,7 +35,7 @@ type Sniffer struct {
|
|||||||
func NewSniffer(ctx context.Context) *Sniffer {
|
func NewSniffer(ctx context.Context) *Sniffer {
|
||||||
ret := &Sniffer{
|
ret := &Sniffer{
|
||||||
sniffer: []protocolSnifferWithMetadata{
|
sniffer: []protocolSnifferWithMetadata{
|
||||||
{func(c context.Context, b []byte) (SniffResult, error) { return http.SniffHTTP(b) }, false, net.Network_TCP},
|
{func(c context.Context, b []byte) (SniffResult, error) { return http.SniffHTTP(b, c) }, false, net.Network_TCP},
|
||||||
{func(c context.Context, b []byte) (SniffResult, error) { return tls.SniffTLS(b) }, false, net.Network_TCP},
|
{func(c context.Context, b []byte) (SniffResult, error) { return tls.SniffTLS(b) }, false, net.Network_TCP},
|
||||||
{func(c context.Context, b []byte) (SniffResult, error) { return bittorrent.SniffBittorrent(b) }, false, net.Network_TCP},
|
{func(c context.Context, b []byte) (SniffResult, error) { return bittorrent.SniffBittorrent(b) }, false, net.Network_TCP},
|
||||||
{func(c context.Context, b []byte) (SniffResult, error) { return quic.SniffQUIC(b) }, false, net.Network_UDP},
|
{func(c context.Context, b []byte) (SniffResult, error) { return quic.SniffQUIC(b) }, false, net.Network_UDP},
|
||||||
|
@@ -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
|
||||||
|
@@ -15,7 +15,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
"github.com/xtls/xray-core/common/session"
|
"github.com/xtls/xray-core/common/session"
|
||||||
"github.com/xtls/xray-core/common/strmatcher"
|
"github.com/xtls/xray-core/common/strmatcher"
|
||||||
"github.com/xtls/xray-core/features"
|
|
||||||
"github.com/xtls/xray-core/features/dns"
|
"github.com/xtls/xray-core/features/dns"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -96,7 +95,7 @@ func New(ctx context.Context, config *Config) (*DNS, error) {
|
|||||||
geoipContainer := router.GeoIPMatcherContainer{}
|
geoipContainer := router.GeoIPMatcherContainer{}
|
||||||
|
|
||||||
for _, endpoint := range config.NameServers {
|
for _, endpoint := range config.NameServers {
|
||||||
features.PrintDeprecatedFeatureWarning("simple DNS server")
|
errors.PrintDeprecatedFeatureWarning("simple DNS server", "")
|
||||||
client, err := NewSimpleClient(ctx, endpoint, clientIP)
|
client, err := NewSimpleClient(ctx, endpoint, clientIP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("failed to create client").Base(err)
|
return nil, errors.New("failed to create client").Base(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/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
|
||||||
|
@@ -7,7 +7,6 @@ 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/strmatcher"
|
"github.com/xtls/xray-core/common/strmatcher"
|
||||||
"github.com/xtls/xray-core/features"
|
|
||||||
"github.com/xtls/xray-core/features/dns"
|
"github.com/xtls/xray-core/features/dns"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -26,7 +25,7 @@ func NewStaticHosts(hosts []*Config_HostMapping, legacy map[string]*net.IPOrDoma
|
|||||||
}
|
}
|
||||||
|
|
||||||
if legacy != nil {
|
if legacy != nil {
|
||||||
features.PrintDeprecatedFeatureWarning("simple host mapping")
|
errors.PrintDeprecatedFeatureWarning("simple host mapping", "")
|
||||||
|
|
||||||
for domain, ip := range legacy {
|
for domain, ip := range legacy {
|
||||||
matcher, err := strmatcher.Full.New(domain)
|
matcher, err := strmatcher.Full.New(domain)
|
||||||
|
@@ -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()
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ func NewClient(
|
|||||||
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:
|
||||||
|
@@ -365,7 +365,7 @@ func (s *DoHNameServer) QueryIP(ctx context.Context, domain string, clientIP net
|
|||||||
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)
|
||||||
} else {
|
} else {
|
||||||
ips, err := s.findIPsForDomain(fqdn, option)
|
ips, err := s.findIPsForDomain(fqdn, option)
|
||||||
if err != errRecordNotFound {
|
if err == nil || err == dns_feature.ErrEmptyResponse {
|
||||||
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
||||||
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
||||||
return ips, err
|
return ips, err
|
||||||
|
@@ -300,7 +300,7 @@ func (s *QUICNameServer) QueryIP(ctx context.Context, domain string, clientIP ne
|
|||||||
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)
|
||||||
} else {
|
} else {
|
||||||
ips, err := s.findIPsForDomain(fqdn, option)
|
ips, err := s.findIPsForDomain(fqdn, option)
|
||||||
if err != errRecordNotFound {
|
if err == nil || err == dns_feature.ErrEmptyResponse {
|
||||||
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
||||||
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
||||||
return ips, err
|
return ips, err
|
||||||
|
@@ -323,7 +323,7 @@ func (s *TCPNameServer) QueryIP(ctx context.Context, domain string, clientIP net
|
|||||||
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)
|
||||||
} else {
|
} else {
|
||||||
ips, err := s.findIPsForDomain(fqdn, option)
|
ips, err := s.findIPsForDomain(fqdn, option)
|
||||||
if err != errRecordNotFound {
|
if err == nil || err == dns_feature.ErrEmptyResponse {
|
||||||
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
||||||
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
||||||
return ips, err
|
return ips, err
|
||||||
|
@@ -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,12 +241,16 @@ 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)
|
||||||
} else {
|
} else {
|
||||||
ips, err := s.findIPsForDomain(fqdn, option)
|
ips, err := s.findIPsForDomain(fqdn, option)
|
||||||
if err != errRecordNotFound {
|
if err == nil || err == dns_feature.ErrEmptyResponse {
|
||||||
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
errors.LogDebugInner(ctx, err, s.name, " cache HIT ", domain, " -> ", ips)
|
||||||
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
log.Record(&log.DNSLog{Server: s.name, Domain: domain, Result: ips, Status: log.DNSCacheHit, Elapsed: 0, Error: err})
|
||||||
return ips, err
|
return ips, 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/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
|
||||||
|
|
||||||
@@ -84,6 +84,7 @@ type Config struct {
|
|||||||
AccessLogType LogType `protobuf:"varint,4,opt,name=access_log_type,json=accessLogType,proto3,enum=xray.app.log.LogType" json:"access_log_type,omitempty"`
|
AccessLogType LogType `protobuf:"varint,4,opt,name=access_log_type,json=accessLogType,proto3,enum=xray.app.log.LogType" json:"access_log_type,omitempty"`
|
||||||
AccessLogPath string `protobuf:"bytes,5,opt,name=access_log_path,json=accessLogPath,proto3" json:"access_log_path,omitempty"`
|
AccessLogPath string `protobuf:"bytes,5,opt,name=access_log_path,json=accessLogPath,proto3" json:"access_log_path,omitempty"`
|
||||||
EnableDnsLog bool `protobuf:"varint,6,opt,name=enable_dns_log,json=enableDnsLog,proto3" json:"enable_dns_log,omitempty"`
|
EnableDnsLog bool `protobuf:"varint,6,opt,name=enable_dns_log,json=enableDnsLog,proto3" json:"enable_dns_log,omitempty"`
|
||||||
|
MaskAddress string `protobuf:"bytes,7,opt,name=mask_address,json=maskAddress,proto3" json:"mask_address,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Config) Reset() {
|
func (x *Config) Reset() {
|
||||||
@@ -160,13 +161,20 @@ func (x *Config) GetEnableDnsLog() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *Config) GetMaskAddress() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.MaskAddress
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
var File_app_log_config_proto protoreflect.FileDescriptor
|
var File_app_log_config_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_app_log_config_proto_rawDesc = []byte{
|
var file_app_log_config_proto_rawDesc = []byte{
|
||||||
0x0a, 0x14, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
0x0a, 0x14, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70,
|
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70,
|
||||||
0x2e, 0x6c, 0x6f, 0x67, 0x1a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67,
|
0x2e, 0x6c, 0x6f, 0x67, 0x1a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67,
|
||||||
0x2f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x02, 0x0a, 0x06, 0x43,
|
0x2f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x06, 0x43,
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c,
|
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c,
|
||||||
0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e,
|
0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e,
|
||||||
0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67,
|
0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67,
|
||||||
@@ -186,15 +194,18 @@ var file_app_log_config_proto_rawDesc = []byte{
|
|||||||
0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x50, 0x61,
|
0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x50, 0x61,
|
||||||
0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x6e, 0x73,
|
0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, 0x6e, 0x73,
|
||||||
0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62,
|
0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62,
|
||||||
0x6c, 0x65, 0x44, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x2a, 0x35, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54,
|
0x6c, 0x65, 0x44, 0x6e, 0x73, 0x4c, 0x6f, 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x73, 0x6b,
|
||||||
0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a,
|
0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
|
||||||
0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69,
|
0x6d, 0x61, 0x73, 0x6b, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2a, 0x35, 0x0a, 0x07, 0x4c,
|
||||||
0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42,
|
0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00,
|
||||||
0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e,
|
0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a,
|
||||||
0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
|
0x04, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74,
|
||||||
0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65,
|
0x10, 0x03, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61,
|
||||||
0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e,
|
0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
|
||||||
0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63,
|
||||||
|
0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72,
|
||||||
|
0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -211,7 +222,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 +244,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
|
||||||
|
@@ -23,4 +23,5 @@ message Config {
|
|||||||
LogType access_log_type = 4;
|
LogType access_log_type = 4;
|
||||||
string access_log_path = 5;
|
string access_log_path = 5;
|
||||||
bool enable_dns_log = 6;
|
bool enable_dns_log = 6;
|
||||||
|
string mask_address= 7;
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,9 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
@@ -101,18 +104,25 @@ func (g *Instance) Handle(msg log.Message) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var Msg log.Message
|
||||||
|
if g.config.MaskAddress != "" {
|
||||||
|
Msg = &MaskedMsgWrapper{Message: msg, config: g.config}
|
||||||
|
} else {
|
||||||
|
Msg = msg
|
||||||
|
}
|
||||||
|
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case *log.AccessMessage:
|
case *log.AccessMessage:
|
||||||
if g.accessLogger != nil {
|
if g.accessLogger != nil {
|
||||||
g.accessLogger.Handle(msg)
|
g.accessLogger.Handle(Msg)
|
||||||
}
|
}
|
||||||
case *log.DNSLog:
|
case *log.DNSLog:
|
||||||
if g.dns && g.accessLogger != nil {
|
if g.dns && g.accessLogger != nil {
|
||||||
g.accessLogger.Handle(msg)
|
g.accessLogger.Handle(Msg)
|
||||||
}
|
}
|
||||||
case *log.GeneralMessage:
|
case *log.GeneralMessage:
|
||||||
if g.errorLogger != nil && msg.Severity <= g.config.ErrorLogLevel {
|
if g.errorLogger != nil && msg.Severity <= g.config.ErrorLogLevel {
|
||||||
g.errorLogger.Handle(msg)
|
g.errorLogger.Handle(Msg)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
// Swallow
|
// Swallow
|
||||||
@@ -141,6 +151,56 @@ func (g *Instance) Close() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MaskedMsgWrapper is to wrap the string() method to mask IP addresses in the log.
|
||||||
|
type MaskedMsgWrapper struct {
|
||||||
|
log.Message
|
||||||
|
config *Config
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MaskedMsgWrapper) String() string {
|
||||||
|
str := m.Message.String()
|
||||||
|
|
||||||
|
ipv4Regex := regexp.MustCompile(`(\d{1,3}\.){3}\d{1,3}`)
|
||||||
|
ipv6Regex := regexp.MustCompile(`((?:[\da-fA-F]{0,4}:[\da-fA-F]{0,4}){2,7})(?:[\/\\%](\d{1,3}))?`)
|
||||||
|
|
||||||
|
// Process ipv4
|
||||||
|
maskedMsg := ipv4Regex.ReplaceAllStringFunc(str, func(ip string) string {
|
||||||
|
parts := strings.Split(ip, ".")
|
||||||
|
switch m.config.MaskAddress {
|
||||||
|
case "half":
|
||||||
|
return fmt.Sprintf("%s.%s.*.*", parts[0], parts[1])
|
||||||
|
case "quarter":
|
||||||
|
return fmt.Sprintf("%s.*.*.*", parts[0])
|
||||||
|
case "full":
|
||||||
|
return "[Masked IPv4]"
|
||||||
|
default:
|
||||||
|
return ip
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// process ipv6
|
||||||
|
maskedMsg = ipv6Regex.ReplaceAllStringFunc(maskedMsg, func(ip string) string {
|
||||||
|
parts := strings.Split(ip, ":")
|
||||||
|
switch m.config.MaskAddress {
|
||||||
|
case "half":
|
||||||
|
if len(parts) >= 2 {
|
||||||
|
return fmt.Sprintf("%s:%s::/32", parts[0], parts[1])
|
||||||
|
}
|
||||||
|
case "quarter":
|
||||||
|
if len(parts) >= 1 {
|
||||||
|
return fmt.Sprintf("%s::/16", parts[0])
|
||||||
|
}
|
||||||
|
case "full":
|
||||||
|
return "Masked IPv6" // Do not use [Masked IPv6] like ipv4, or you will get "[[Masked IPv6]]" (v6 address already has [])
|
||||||
|
default:
|
||||||
|
return ip
|
||||||
|
}
|
||||||
|
return ip
|
||||||
|
})
|
||||||
|
|
||||||
|
return maskedMsg
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||||
return New(ctx, config.(*Config))
|
return New(ctx, config.(*Config))
|
||||||
|
@@ -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
|
||||||
|
@@ -156,7 +156,7 @@ func (h *HealthPing) doCheck(tags []string, duration time.Duration, rounds int)
|
|||||||
for i := 0; i < rounds; i++ {
|
for i := 0; i < rounds; i++ {
|
||||||
delay := time.Duration(0)
|
delay := time.Duration(0)
|
||||||
if duration > 0 {
|
if duration > 0 {
|
||||||
delay = time.Duration(dice.Roll(int(duration)))
|
delay = time.Duration(dice.RollInt63n(int64(duration)))
|
||||||
}
|
}
|
||||||
time.AfterFunc(delay, func() {
|
time.AfterFunc(delay, func() {
|
||||||
errors.LogDebug(h.ctx, "checking ", handler)
|
errors.LogDebug(h.ctx, "checking ", handler)
|
||||||
|
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,21 +19,5 @@ func (c *ReceiverConfig) GetEffectiveSniffingSettings() *SniffingConfig {
|
|||||||
return c.SniffingSettings
|
return c.SniffingSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.DomainOverride) > 0 {
|
|
||||||
var p []string
|
|
||||||
for _, kd := range c.DomainOverride {
|
|
||||||
switch kd {
|
|
||||||
case KnownProtocols_HTTP:
|
|
||||||
p = append(p, "http")
|
|
||||||
case KnownProtocols_TLS:
|
|
||||||
p = append(p, "tls")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return &SniffingConfig{
|
|
||||||
Enabled: true,
|
|
||||||
DestinationOverride: p,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// 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.28.0
|
||||||
// source: app/proxyman/config.proto
|
// source: app/proxyman/config.proto
|
||||||
|
|
||||||
package proxyman
|
package proxyman
|
||||||
@@ -23,52 +23,6 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
type KnownProtocols int32
|
|
||||||
|
|
||||||
const (
|
|
||||||
KnownProtocols_HTTP KnownProtocols = 0
|
|
||||||
KnownProtocols_TLS KnownProtocols = 1
|
|
||||||
)
|
|
||||||
|
|
||||||
// Enum value maps for KnownProtocols.
|
|
||||||
var (
|
|
||||||
KnownProtocols_name = map[int32]string{
|
|
||||||
0: "HTTP",
|
|
||||||
1: "TLS",
|
|
||||||
}
|
|
||||||
KnownProtocols_value = map[string]int32{
|
|
||||||
"HTTP": 0,
|
|
||||||
"TLS": 1,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func (x KnownProtocols) Enum() *KnownProtocols {
|
|
||||||
p := new(KnownProtocols)
|
|
||||||
*p = x
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x KnownProtocols) String() string {
|
|
||||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (KnownProtocols) Descriptor() protoreflect.EnumDescriptor {
|
|
||||||
return file_app_proxyman_config_proto_enumTypes[0].Descriptor()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (KnownProtocols) Type() protoreflect.EnumType {
|
|
||||||
return &file_app_proxyman_config_proto_enumTypes[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x KnownProtocols) Number() protoreflect.EnumNumber {
|
|
||||||
return protoreflect.EnumNumber(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use KnownProtocols.Descriptor instead.
|
|
||||||
func (KnownProtocols) EnumDescriptor() ([]byte, []int) {
|
|
||||||
return file_app_proxyman_config_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
type AllocationStrategy_Type int32
|
type AllocationStrategy_Type int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -105,11 +59,11 @@ func (x AllocationStrategy_Type) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (AllocationStrategy_Type) Descriptor() protoreflect.EnumDescriptor {
|
func (AllocationStrategy_Type) Descriptor() protoreflect.EnumDescriptor {
|
||||||
return file_app_proxyman_config_proto_enumTypes[1].Descriptor()
|
return file_app_proxyman_config_proto_enumTypes[0].Descriptor()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (AllocationStrategy_Type) Type() protoreflect.EnumType {
|
func (AllocationStrategy_Type) Type() protoreflect.EnumType {
|
||||||
return &file_app_proxyman_config_proto_enumTypes[1]
|
return &file_app_proxyman_config_proto_enumTypes[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber {
|
func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber {
|
||||||
@@ -323,12 +277,7 @@ type ReceiverConfig struct {
|
|||||||
AllocationStrategy *AllocationStrategy `protobuf:"bytes,3,opt,name=allocation_strategy,json=allocationStrategy,proto3" json:"allocation_strategy,omitempty"`
|
AllocationStrategy *AllocationStrategy `protobuf:"bytes,3,opt,name=allocation_strategy,json=allocationStrategy,proto3" json:"allocation_strategy,omitempty"`
|
||||||
StreamSettings *internet.StreamConfig `protobuf:"bytes,4,opt,name=stream_settings,json=streamSettings,proto3" json:"stream_settings,omitempty"`
|
StreamSettings *internet.StreamConfig `protobuf:"bytes,4,opt,name=stream_settings,json=streamSettings,proto3" json:"stream_settings,omitempty"`
|
||||||
ReceiveOriginalDestination bool `protobuf:"varint,5,opt,name=receive_original_destination,json=receiveOriginalDestination,proto3" json:"receive_original_destination,omitempty"`
|
ReceiveOriginalDestination bool `protobuf:"varint,5,opt,name=receive_original_destination,json=receiveOriginalDestination,proto3" json:"receive_original_destination,omitempty"`
|
||||||
// Override domains for the given protocol.
|
SniffingSettings *SniffingConfig `protobuf:"bytes,7,opt,name=sniffing_settings,json=sniffingSettings,proto3" json:"sniffing_settings,omitempty"`
|
||||||
// Deprecated. Use sniffing_settings.
|
|
||||||
//
|
|
||||||
// Deprecated: Marked as deprecated in app/proxyman/config.proto.
|
|
||||||
DomainOverride []KnownProtocols `protobuf:"varint,7,rep,packed,name=domain_override,json=domainOverride,proto3,enum=xray.app.proxyman.KnownProtocols" json:"domain_override,omitempty"`
|
|
||||||
SniffingSettings *SniffingConfig `protobuf:"bytes,8,opt,name=sniffing_settings,json=sniffingSettings,proto3" json:"sniffing_settings,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ReceiverConfig) Reset() {
|
func (x *ReceiverConfig) Reset() {
|
||||||
@@ -398,14 +347,6 @@ func (x *ReceiverConfig) GetReceiveOriginalDestination() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Marked as deprecated in app/proxyman/config.proto.
|
|
||||||
func (x *ReceiverConfig) GetDomainOverride() []KnownProtocols {
|
|
||||||
if x != nil {
|
|
||||||
return x.DomainOverride
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ReceiverConfig) GetSniffingSettings() *SniffingConfig {
|
func (x *ReceiverConfig) GetSniffingSettings() *SniffingConfig {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.SniffingSettings
|
return x.SniffingSettings
|
||||||
@@ -817,7 +758,7 @@ var file_app_proxyman_config_proto_rawDesc = []byte{
|
|||||||
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||||
0x61, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x6f,
|
0x61, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x6f,
|
||||||
0x6e, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x6f, 0x75, 0x74, 0x65,
|
0x6e, 0x6c, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x72, 0x6f, 0x75, 0x74, 0x65,
|
||||||
0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x8d, 0x04, 0x0a, 0x0e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
0x4f, 0x6e, 0x6c, 0x79, 0x22, 0xbd, 0x03, 0x0a, 0x0e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
||||||
0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x5f,
|
0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x5f,
|
||||||
0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61,
|
0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61,
|
||||||
0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72,
|
0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72,
|
||||||
@@ -840,13 +781,8 @@ var file_app_proxyman_config_proto_rawDesc = []byte{
|
|||||||
0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01,
|
0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01,
|
||||||
0x28, 0x08, 0x52, 0x1a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69,
|
0x28, 0x08, 0x52, 0x1a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69,
|
||||||
0x6e, 0x61, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e,
|
0x6e, 0x61, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e,
|
||||||
0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64,
|
|
||||||
0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61,
|
|
||||||
0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x4b, 0x6e, 0x6f, 0x77,
|
|
||||||
0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e,
|
|
||||||
0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x4e,
|
|
||||||
0x0a, 0x11, 0x73, 0x6e, 0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69,
|
0x0a, 0x11, 0x73, 0x6e, 0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x6e, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, 0x79,
|
0x6e, 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, 0x79,
|
||||||
0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x53, 0x6e,
|
0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x53, 0x6e,
|
||||||
0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x73, 0x6e,
|
0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x73, 0x6e,
|
||||||
0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x04,
|
0x69, 0x66, 0x66, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x4a, 0x04,
|
||||||
@@ -894,16 +830,13 @@ var file_app_proxyman_config_proto_rawDesc = []byte{
|
|||||||
0x01, 0x28, 0x05, 0x52, 0x0f, 0x78, 0x75, 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72,
|
0x01, 0x28, 0x05, 0x52, 0x0f, 0x78, 0x75, 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72,
|
||||||
0x65, 0x6e, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x78, 0x75, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x78,
|
0x65, 0x6e, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x78, 0x75, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x78,
|
||||||
0x79, 0x55, 0x44, 0x50, 0x34, 0x34, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x78,
|
0x79, 0x55, 0x44, 0x50, 0x34, 0x34, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x78,
|
||||||
0x75, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x44, 0x50, 0x34, 0x34, 0x33, 0x2a, 0x23,
|
0x75, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x44, 0x50, 0x34, 0x34, 0x33, 0x42, 0x55,
|
||||||
0x0a, 0x0e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73,
|
0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70,
|
||||||
0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4c,
|
0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||||
0x53, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e,
|
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d,
|
||||||
0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x26,
|
0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61,
|
||||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f,
|
0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f,
|
||||||
0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72,
|
0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70,
|
|
||||||
0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
|
||||||
0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -918,48 +851,46 @@ func file_app_proxyman_config_proto_rawDescGZIP() []byte {
|
|||||||
return file_app_proxyman_config_proto_rawDescData
|
return file_app_proxyman_config_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_app_proxyman_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
var file_app_proxyman_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
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
|
(AllocationStrategy_Type)(0), // 0: xray.app.proxyman.AllocationStrategy.Type
|
||||||
(AllocationStrategy_Type)(0), // 1: xray.app.proxyman.AllocationStrategy.Type
|
(*InboundConfig)(nil), // 1: xray.app.proxyman.InboundConfig
|
||||||
(*InboundConfig)(nil), // 2: xray.app.proxyman.InboundConfig
|
(*AllocationStrategy)(nil), // 2: xray.app.proxyman.AllocationStrategy
|
||||||
(*AllocationStrategy)(nil), // 3: xray.app.proxyman.AllocationStrategy
|
(*SniffingConfig)(nil), // 3: xray.app.proxyman.SniffingConfig
|
||||||
(*SniffingConfig)(nil), // 4: xray.app.proxyman.SniffingConfig
|
(*ReceiverConfig)(nil), // 4: xray.app.proxyman.ReceiverConfig
|
||||||
(*ReceiverConfig)(nil), // 5: xray.app.proxyman.ReceiverConfig
|
(*InboundHandlerConfig)(nil), // 5: xray.app.proxyman.InboundHandlerConfig
|
||||||
(*InboundHandlerConfig)(nil), // 6: xray.app.proxyman.InboundHandlerConfig
|
(*OutboundConfig)(nil), // 6: xray.app.proxyman.OutboundConfig
|
||||||
(*OutboundConfig)(nil), // 7: xray.app.proxyman.OutboundConfig
|
(*SenderConfig)(nil), // 7: xray.app.proxyman.SenderConfig
|
||||||
(*SenderConfig)(nil), // 8: xray.app.proxyman.SenderConfig
|
(*MultiplexingConfig)(nil), // 8: xray.app.proxyman.MultiplexingConfig
|
||||||
(*MultiplexingConfig)(nil), // 9: xray.app.proxyman.MultiplexingConfig
|
(*AllocationStrategy_AllocationStrategyConcurrency)(nil), // 9: xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency
|
||||||
(*AllocationStrategy_AllocationStrategyConcurrency)(nil), // 10: xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency
|
(*AllocationStrategy_AllocationStrategyRefresh)(nil), // 10: xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh
|
||||||
(*AllocationStrategy_AllocationStrategyRefresh)(nil), // 11: xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh
|
(*net.PortList)(nil), // 11: xray.common.net.PortList
|
||||||
(*net.PortList)(nil), // 12: xray.common.net.PortList
|
(*net.IPOrDomain)(nil), // 12: xray.common.net.IPOrDomain
|
||||||
(*net.IPOrDomain)(nil), // 13: xray.common.net.IPOrDomain
|
(*internet.StreamConfig)(nil), // 13: xray.transport.internet.StreamConfig
|
||||||
(*internet.StreamConfig)(nil), // 14: xray.transport.internet.StreamConfig
|
(*serial.TypedMessage)(nil), // 14: xray.common.serial.TypedMessage
|
||||||
(*serial.TypedMessage)(nil), // 15: xray.common.serial.TypedMessage
|
(*internet.ProxyConfig)(nil), // 15: xray.transport.internet.ProxyConfig
|
||||||
(*internet.ProxyConfig)(nil), // 16: xray.transport.internet.ProxyConfig
|
|
||||||
}
|
}
|
||||||
var file_app_proxyman_config_proto_depIdxs = []int32{
|
var file_app_proxyman_config_proto_depIdxs = []int32{
|
||||||
1, // 0: xray.app.proxyman.AllocationStrategy.type:type_name -> xray.app.proxyman.AllocationStrategy.Type
|
0, // 0: xray.app.proxyman.AllocationStrategy.type:type_name -> xray.app.proxyman.AllocationStrategy.Type
|
||||||
10, // 1: xray.app.proxyman.AllocationStrategy.concurrency:type_name -> xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency
|
9, // 1: xray.app.proxyman.AllocationStrategy.concurrency:type_name -> xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency
|
||||||
11, // 2: xray.app.proxyman.AllocationStrategy.refresh:type_name -> xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh
|
10, // 2: xray.app.proxyman.AllocationStrategy.refresh:type_name -> xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh
|
||||||
12, // 3: xray.app.proxyman.ReceiverConfig.port_list:type_name -> xray.common.net.PortList
|
11, // 3: xray.app.proxyman.ReceiverConfig.port_list:type_name -> xray.common.net.PortList
|
||||||
13, // 4: xray.app.proxyman.ReceiverConfig.listen:type_name -> xray.common.net.IPOrDomain
|
12, // 4: xray.app.proxyman.ReceiverConfig.listen:type_name -> xray.common.net.IPOrDomain
|
||||||
3, // 5: xray.app.proxyman.ReceiverConfig.allocation_strategy:type_name -> xray.app.proxyman.AllocationStrategy
|
2, // 5: xray.app.proxyman.ReceiverConfig.allocation_strategy:type_name -> xray.app.proxyman.AllocationStrategy
|
||||||
14, // 6: xray.app.proxyman.ReceiverConfig.stream_settings:type_name -> xray.transport.internet.StreamConfig
|
13, // 6: xray.app.proxyman.ReceiverConfig.stream_settings:type_name -> xray.transport.internet.StreamConfig
|
||||||
0, // 7: xray.app.proxyman.ReceiverConfig.domain_override:type_name -> xray.app.proxyman.KnownProtocols
|
3, // 7: xray.app.proxyman.ReceiverConfig.sniffing_settings:type_name -> xray.app.proxyman.SniffingConfig
|
||||||
4, // 8: xray.app.proxyman.ReceiverConfig.sniffing_settings:type_name -> xray.app.proxyman.SniffingConfig
|
14, // 8: xray.app.proxyman.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
15, // 9: xray.app.proxyman.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage
|
14, // 9: xray.app.proxyman.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
15, // 10: xray.app.proxyman.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
12, // 10: xray.app.proxyman.SenderConfig.via:type_name -> xray.common.net.IPOrDomain
|
||||||
13, // 11: xray.app.proxyman.SenderConfig.via:type_name -> xray.common.net.IPOrDomain
|
13, // 11: xray.app.proxyman.SenderConfig.stream_settings:type_name -> xray.transport.internet.StreamConfig
|
||||||
14, // 12: xray.app.proxyman.SenderConfig.stream_settings:type_name -> xray.transport.internet.StreamConfig
|
15, // 12: xray.app.proxyman.SenderConfig.proxy_settings:type_name -> xray.transport.internet.ProxyConfig
|
||||||
16, // 13: xray.app.proxyman.SenderConfig.proxy_settings:type_name -> xray.transport.internet.ProxyConfig
|
8, // 13: xray.app.proxyman.SenderConfig.multiplex_settings:type_name -> xray.app.proxyman.MultiplexingConfig
|
||||||
9, // 14: xray.app.proxyman.SenderConfig.multiplex_settings:type_name -> xray.app.proxyman.MultiplexingConfig
|
14, // [14:14] is the sub-list for method output_type
|
||||||
15, // [15:15] is the sub-list for method output_type
|
14, // [14:14] is the sub-list for method input_type
|
||||||
15, // [15:15] is the sub-list for method input_type
|
14, // [14:14] is the sub-list for extension type_name
|
||||||
15, // [15:15] is the sub-list for extension type_name
|
14, // [14:14] is the sub-list for extension extendee
|
||||||
15, // [15:15] is the sub-list for extension extendee
|
0, // [0:14] is the sub-list for field type_name
|
||||||
0, // [0:15] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_app_proxyman_config_proto_init() }
|
func init() { file_app_proxyman_config_proto_init() }
|
||||||
@@ -968,7 +899,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 +911,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 +923,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 +935,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 +947,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 +959,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 +971,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 +983,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 +995,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 +1007,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
|
||||||
@@ -1094,7 +1025,7 @@ func file_app_proxyman_config_proto_init() {
|
|||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_app_proxyman_config_proto_rawDesc,
|
RawDescriptor: file_app_proxyman_config_proto_rawDesc,
|
||||||
NumEnums: 2,
|
NumEnums: 1,
|
||||||
NumMessages: 10,
|
NumMessages: 10,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
|
@@ -40,11 +40,6 @@ message AllocationStrategy {
|
|||||||
AllocationStrategyRefresh refresh = 3;
|
AllocationStrategyRefresh refresh = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum KnownProtocols {
|
|
||||||
HTTP = 0;
|
|
||||||
TLS = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SniffingConfig {
|
message SniffingConfig {
|
||||||
// Whether or not to enable content sniffing on an inbound connection.
|
// Whether or not to enable content sniffing on an inbound connection.
|
||||||
bool enabled = 1;
|
bool enabled = 1;
|
||||||
@@ -71,10 +66,7 @@ message ReceiverConfig {
|
|||||||
xray.transport.internet.StreamConfig stream_settings = 4;
|
xray.transport.internet.StreamConfig stream_settings = 4;
|
||||||
bool receive_original_destination = 5;
|
bool receive_original_destination = 5;
|
||||||
reserved 6;
|
reserved 6;
|
||||||
// Override domains for the given protocol.
|
SniffingConfig sniffing_settings = 7;
|
||||||
// Deprecated. Use sniffing_settings.
|
|
||||||
repeated KnownProtocols domain_override = 7 [ deprecated = true ];
|
|
||||||
SniffingConfig sniffing_settings = 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message InboundHandlerConfig {
|
message InboundHandlerConfig {
|
||||||
|
@@ -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)
|
||||||
|
@@ -28,6 +28,10 @@ func (c routingContext) GetTargetPort() net.Port {
|
|||||||
return net.Port(c.RoutingContext.GetTargetPort())
|
return net.Port(c.RoutingContext.GetTargetPort())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c routingContext) GetRuleTag() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// GetSkipDNSResolve is a mock implementation here to match the interface,
|
// GetSkipDNSResolve is a mock implementation here to match the interface,
|
||||||
// SkipDNSResolve is set from dns module, no use if coming from a protobuf object?
|
// SkipDNSResolve is set from dns module, no use if coming from a protobuf object?
|
||||||
// TODO: please confirm @Vigilans
|
// TODO: please confirm @Vigilans
|
||||||
|
@@ -192,18 +192,28 @@ func (v NetworkMatcher) Apply(ctx routing.Context) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type UserMatcher struct {
|
type UserMatcher struct {
|
||||||
user []string
|
user []string
|
||||||
|
pattern []*regexp.Regexp
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserMatcher(users []string) *UserMatcher {
|
func NewUserMatcher(users []string) *UserMatcher {
|
||||||
usersCopy := make([]string, 0, len(users))
|
usersCopy := make([]string, 0, len(users))
|
||||||
|
patternsCopy := make([]*regexp.Regexp, 0, len(users))
|
||||||
for _, user := range users {
|
for _, user := range users {
|
||||||
if len(user) > 0 {
|
if len(user) > 0 {
|
||||||
|
if len(user) > 7 && strings.HasPrefix(user, "regexp:") {
|
||||||
|
if re, err := regexp.Compile(user[7:]); err != nil {
|
||||||
|
patternsCopy = append(patternsCopy, re)
|
||||||
|
}
|
||||||
|
// Items of users slice with an invalid regexp syntax are ignored.
|
||||||
|
continue
|
||||||
|
}
|
||||||
usersCopy = append(usersCopy, user)
|
usersCopy = append(usersCopy, user)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &UserMatcher{
|
return &UserMatcher{
|
||||||
user: usersCopy,
|
user: usersCopy,
|
||||||
|
pattern: patternsCopy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,6 +228,11 @@ func (v *UserMatcher) Apply(ctx routing.Context) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for _, re := range v.pattern {
|
||||||
|
if re.MatchString(user) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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),
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@ type Route struct {
|
|||||||
routing.Context
|
routing.Context
|
||||||
outboundGroupTags []string
|
outboundGroupTags []string
|
||||||
outboundTag string
|
outboundTag string
|
||||||
|
ruleTag string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Init initializes the Router.
|
// Init initializes the Router.
|
||||||
@@ -89,7 +90,7 @@ func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &Route{Context: ctx, outboundTag: tag}, nil
|
return &Route{Context: ctx, outboundTag: tag, ruleTag: rule.RuleTag}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddRule implements routing.Router.
|
// AddRule implements routing.Router.
|
||||||
@@ -239,6 +240,10 @@ func (r *Route) GetOutboundTag() string {
|
|||||||
return r.outboundTag
|
return r.outboundTag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Route) GetRuleTag() string {
|
||||||
|
return r.ruleTag
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||||
r := new(Router)
|
r := new(Router)
|
||||||
|
@@ -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
|
||||||
|
@@ -207,6 +207,21 @@ func (b *Buffer) Len() int32 {
|
|||||||
return b.end - b.start
|
return b.end - b.start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cap returns the capacity of the buffer content.
|
||||||
|
func (b *Buffer) Cap() int32 {
|
||||||
|
if b == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return int32(len(b.v))
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewWithSize creates a Buffer with 0 length and capacity with at least the given size.
|
||||||
|
func NewWithSize(size int32) *Buffer {
|
||||||
|
return &Buffer{
|
||||||
|
v: bytespool.Alloc(size),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// IsEmpty returns true if the buffer is empty.
|
// IsEmpty returns true if the buffer is empty.
|
||||||
func (b *Buffer) IsEmpty() bool {
|
func (b *Buffer) IsEmpty() bool {
|
||||||
return b.Len() == 0
|
return b.Len() == 0
|
||||||
|
@@ -14,6 +14,14 @@ func Roll(n int) int {
|
|||||||
return rand.Intn(n)
|
return rand.Intn(n)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RollInt63n returns a non-negative number between 0 (inclusive) and n (exclusive).
|
||||||
|
func RollInt63n(n int64) int64 {
|
||||||
|
if n == 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return rand.Int63n(n)
|
||||||
|
}
|
||||||
|
|
||||||
// Roll returns a non-negative number between 0 (inclusive) and n (exclusive).
|
// Roll returns a non-negative number between 0 (inclusive) and n (exclusive).
|
||||||
func RollDeterministic(n int, seed int64) int {
|
func RollDeterministic(n int, seed int64) int {
|
||||||
if n == 1 {
|
if n == 1 {
|
||||||
|
25
common/errors/feature_errors.go
Normal file
25
common/errors/feature_errors.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package errors
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
|
||||||
|
// Do not remove this function even there is no reference to it.
|
||||||
|
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
|
||||||
|
if len(migrateFeature) > 0 {
|
||||||
|
LogWarning(context.Background(), "This feature " + feature + " is deprecated and being migrated to " + migrateFeature + ". Please update your config(s) according to release note and documentation before removal.")
|
||||||
|
} else {
|
||||||
|
LogWarning(context.Background(), "This feature " + feature + " is deprecated. Please update your config(s) according to release note and documentation before removal.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// PrintRemovedFeatureError prints an error message for removed feature then return an error. And after long enough time the message can also be removed, uses as an indicator.
|
||||||
|
// Do not remove this function even there is no reference to it.
|
||||||
|
func PrintRemovedFeatureError(feature string, migrateFeature string) (error) {
|
||||||
|
if len(migrateFeature) > 0 {
|
||||||
|
return New("The feature " + feature + " has been removed and migrated to " + migrateFeature + ". Please update your config(s) according to release note and documentation.")
|
||||||
|
} else {
|
||||||
|
return New("The feature " + feature + " has been removed. Please update your config(s) according to release note and documentation.")
|
||||||
|
}
|
||||||
|
}
|
@@ -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),
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -2,11 +2,13 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
|
"github.com/xtls/xray-core/common/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
type version byte
|
type version byte
|
||||||
@@ -56,7 +58,14 @@ func beginWithHTTPMethod(b []byte) error {
|
|||||||
return errNotHTTPMethod
|
return errNotHTTPMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
func SniffHTTP(b []byte) (*SniffHeader, error) {
|
func SniffHTTP(b []byte, c context.Context) (*SniffHeader, error) {
|
||||||
|
content := session.ContentFromContext(c)
|
||||||
|
ShouldSniffAttr := true
|
||||||
|
// If content.Attributes have information, that means it comes from HTTP inbound PlainHTTP mode.
|
||||||
|
// It will set attributes, so skip it.
|
||||||
|
if content == nil || len(content.Attributes) != 0 {
|
||||||
|
ShouldSniffAttr = false
|
||||||
|
}
|
||||||
if err := beginWithHTTPMethod(b); err != nil {
|
if err := beginWithHTTPMethod(b); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -76,8 +85,12 @@ func SniffHTTP(b []byte) (*SniffHeader, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
key := strings.ToLower(string(parts[0]))
|
key := strings.ToLower(string(parts[0]))
|
||||||
|
value := string(bytes.TrimSpace(parts[1]))
|
||||||
|
if ShouldSniffAttr {
|
||||||
|
content.SetAttribute(key, value) // Put header in attribute
|
||||||
|
}
|
||||||
if key == "host" {
|
if key == "host" {
|
||||||
rawHost := strings.ToLower(string(bytes.TrimSpace(parts[1])))
|
rawHost := strings.ToLower(value)
|
||||||
dest, err := ParseHost(rawHost, net.Port(80))
|
dest, err := ParseHost(rawHost, net.Port(80))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -85,6 +98,16 @@ func SniffHTTP(b []byte) (*SniffHeader, error) {
|
|||||||
sh.host = dest.Address.String()
|
sh.host = dest.Address.String()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Parse request line
|
||||||
|
// Request line is like this
|
||||||
|
// "GET /homo/114514 HTTP/1.1"
|
||||||
|
if len(headers) > 0 && ShouldSniffAttr {
|
||||||
|
RequestLineParts := bytes.Split(headers[0], []byte{' '})
|
||||||
|
if len(RequestLineParts) == 3 {
|
||||||
|
content.SetAttribute(":method", string(RequestLineParts[0]))
|
||||||
|
content.SetAttribute(":path", string(RequestLineParts[1]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(sh.host) > 0 {
|
if len(sh.host) > 0 {
|
||||||
return sh, nil
|
return sh, nil
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package http_test
|
package http_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
. "github.com/xtls/xray-core/common/protocol/http"
|
. "github.com/xtls/xray-core/common/protocol/http"
|
||||||
@@ -88,7 +89,7 @@ first_name=John&last_name=Doe&action=Submit`,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range cases {
|
for _, test := range cases {
|
||||||
header, err := SniffHTTP([]byte(test.input))
|
header, err := SniffHTTP([]byte(test.input), context.TODO())
|
||||||
if test.err {
|
if test.err {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("Expect error but nil, in test: %v", test)
|
t.Errorf("Expect error but nil, in test: %v", test)
|
||||||
|
@@ -47,206 +47,224 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func SniffQUIC(b []byte) (*SniffHeader, error) {
|
func SniffQUIC(b []byte) (*SniffHeader, error) {
|
||||||
buffer := buf.FromBytes(b)
|
// Crypto data separated across packets
|
||||||
typeByte, err := buffer.ReadByte()
|
cryptoLen := 0
|
||||||
if err != nil {
|
cryptoData := bytespool.Alloc(int32(len(b)))
|
||||||
return nil, errNotQuic
|
defer bytespool.Free(cryptoData)
|
||||||
}
|
|
||||||
isLongHeader := typeByte&0x80 > 0
|
|
||||||
if !isLongHeader || typeByte&0x40 == 0 {
|
|
||||||
return nil, errNotQuicInitial
|
|
||||||
}
|
|
||||||
|
|
||||||
vb, err := buffer.ReadBytes(4)
|
// Parse QUIC packets
|
||||||
if err != nil {
|
for len(b) > 0 {
|
||||||
return nil, errNotQuic
|
buffer := buf.FromBytes(b)
|
||||||
}
|
typeByte, err := buffer.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
versionNumber := binary.BigEndian.Uint32(vb)
|
isLongHeader := typeByte&0x80 > 0
|
||||||
|
if !isLongHeader || typeByte&0x40 == 0 {
|
||||||
|
return nil, errNotQuicInitial
|
||||||
|
}
|
||||||
|
|
||||||
if versionNumber != 0 && typeByte&0x40 == 0 {
|
vb, err := buffer.ReadBytes(4)
|
||||||
return nil, errNotQuic
|
if err != nil {
|
||||||
} else if versionNumber != versionDraft29 && versionNumber != version1 {
|
return nil, errNotQuic
|
||||||
return nil, errNotQuic
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (typeByte&0x30)>>4 != 0x0 {
|
versionNumber := binary.BigEndian.Uint32(vb)
|
||||||
return nil, errNotQuicInitial
|
if versionNumber != 0 && typeByte&0x40 == 0 {
|
||||||
}
|
return nil, errNotQuic
|
||||||
|
} else if versionNumber != versionDraft29 && versionNumber != version1 {
|
||||||
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
var destConnID []byte
|
packetType := (typeByte & 0x30) >> 4
|
||||||
if l, err := buffer.ReadByte(); err != nil {
|
isQuicInitial := packetType == 0x0
|
||||||
return nil, errNotQuic
|
|
||||||
} else if destConnID, err = buffer.ReadBytes(int32(l)); err != nil {
|
|
||||||
return nil, errNotQuic
|
|
||||||
}
|
|
||||||
|
|
||||||
if l, err := buffer.ReadByte(); err != nil {
|
var destConnID []byte
|
||||||
return nil, errNotQuic
|
if l, err := buffer.ReadByte(); err != nil {
|
||||||
} else if common.Error2(buffer.ReadBytes(int32(l))) != nil {
|
return nil, errNotQuic
|
||||||
return nil, errNotQuic
|
} else if destConnID, err = buffer.ReadBytes(int32(l)); err != nil {
|
||||||
}
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
tokenLen, err := quicvarint.Read(buffer)
|
if l, err := buffer.ReadByte(); err != nil {
|
||||||
if err != nil || tokenLen > uint64(len(b)) {
|
return nil, errNotQuic
|
||||||
return nil, errNotQuic
|
} else if common.Error2(buffer.ReadBytes(int32(l))) != nil {
|
||||||
}
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
if _, err = buffer.ReadBytes(int32(tokenLen)); err != nil {
|
tokenLen, err := quicvarint.Read(buffer)
|
||||||
return nil, errNotQuic
|
if err != nil || tokenLen > uint64(len(b)) {
|
||||||
}
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
packetLen, err := quicvarint.Read(buffer)
|
if _, err = buffer.ReadBytes(int32(tokenLen)); err != nil {
|
||||||
if err != nil {
|
return nil, errNotQuic
|
||||||
return nil, errNotQuic
|
}
|
||||||
}
|
|
||||||
|
|
||||||
hdrLen := len(b) - int(buffer.Len())
|
packetLen, err := quicvarint.Read(buffer)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errNotQuic
|
||||||
|
}
|
||||||
|
|
||||||
origPNBytes := make([]byte, 4)
|
hdrLen := len(b) - int(buffer.Len())
|
||||||
copy(origPNBytes, b[hdrLen:hdrLen+4])
|
if len(b) < hdrLen+int(packetLen) {
|
||||||
|
return nil, common.ErrNoClue // Not enough data to read as a QUIC packet. QUIC is UDP-based, so this is unlikely to happen.
|
||||||
|
}
|
||||||
|
|
||||||
var salt []byte
|
restPayload := b[hdrLen+int(packetLen):]
|
||||||
if versionNumber == version1 {
|
if !isQuicInitial { // Skip this packet if it's not initial packet
|
||||||
salt = quicSalt
|
b = restPayload
|
||||||
} else {
|
continue
|
||||||
salt = quicSaltOld
|
}
|
||||||
}
|
|
||||||
initialSecret := hkdf.Extract(crypto.SHA256.New, destConnID, salt)
|
|
||||||
secret := hkdfExpandLabel(crypto.SHA256, initialSecret, []byte{}, "client in", crypto.SHA256.Size())
|
|
||||||
hpKey := hkdfExpandLabel(initialSuite.Hash, secret, []byte{}, "quic hp", initialSuite.KeyLen)
|
|
||||||
block, err := aes.NewCipher(hpKey)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
cache := buf.New()
|
origPNBytes := make([]byte, 4)
|
||||||
defer cache.Release()
|
copy(origPNBytes, b[hdrLen:hdrLen+4])
|
||||||
|
|
||||||
mask := cache.Extend(int32(block.BlockSize()))
|
var salt []byte
|
||||||
block.Encrypt(mask, b[hdrLen+4:hdrLen+4+16])
|
if versionNumber == version1 {
|
||||||
b[0] ^= mask[0] & 0xf
|
salt = quicSalt
|
||||||
for i := range b[hdrLen : hdrLen+4] {
|
} else {
|
||||||
b[hdrLen+i] ^= mask[i+1]
|
salt = quicSaltOld
|
||||||
}
|
}
|
||||||
packetNumberLength := b[0]&0x3 + 1
|
initialSecret := hkdf.Extract(crypto.SHA256.New, destConnID, salt)
|
||||||
if packetNumberLength != 1 {
|
secret := hkdfExpandLabel(crypto.SHA256, initialSecret, []byte{}, "client in", crypto.SHA256.Size())
|
||||||
return nil, errNotQuicInitial
|
hpKey := hkdfExpandLabel(initialSuite.Hash, secret, []byte{}, "quic hp", initialSuite.KeyLen)
|
||||||
}
|
block, err := aes.NewCipher(hpKey)
|
||||||
var packetNumber uint32
|
|
||||||
{
|
|
||||||
n, err := buffer.ReadByte()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
packetNumber = uint32(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
if packetNumber != 0 && packetNumber != 1 {
|
cache := buf.New()
|
||||||
return nil, errNotQuicInitial
|
defer cache.Release()
|
||||||
}
|
|
||||||
|
|
||||||
extHdrLen := hdrLen + int(packetNumberLength)
|
mask := cache.Extend(int32(block.BlockSize()))
|
||||||
copy(b[extHdrLen:hdrLen+4], origPNBytes[packetNumberLength:])
|
block.Encrypt(mask, b[hdrLen+4:hdrLen+4+16])
|
||||||
data := b[extHdrLen : int(packetLen)+hdrLen]
|
b[0] ^= mask[0] & 0xf
|
||||||
|
for i := range b[hdrLen : hdrLen+4] {
|
||||||
key := hkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic key", 16)
|
b[hdrLen+i] ^= mask[i+1]
|
||||||
iv := hkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic iv", 12)
|
|
||||||
cipher := AEADAESGCMTLS13(key, iv)
|
|
||||||
nonce := cache.Extend(int32(cipher.NonceSize()))
|
|
||||||
binary.BigEndian.PutUint64(nonce[len(nonce)-8:], uint64(packetNumber))
|
|
||||||
decrypted, err := cipher.Open(b[extHdrLen:extHdrLen], nonce, data, b[:extHdrLen])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
buffer = buf.FromBytes(decrypted)
|
|
||||||
|
|
||||||
cryptoLen := uint(0)
|
|
||||||
cryptoData := bytespool.Alloc(buffer.Len())
|
|
||||||
defer bytespool.Free(cryptoData)
|
|
||||||
for i := 0; !buffer.IsEmpty(); i++ {
|
|
||||||
frameType := byte(0x0) // Default to PADDING frame
|
|
||||||
for frameType == 0x0 && !buffer.IsEmpty() {
|
|
||||||
frameType, _ = buffer.ReadByte()
|
|
||||||
}
|
}
|
||||||
switch frameType {
|
packetNumberLength := b[0]&0x3 + 1
|
||||||
case 0x00: // PADDING frame
|
if packetNumberLength != 1 {
|
||||||
case 0x01: // PING frame
|
|
||||||
case 0x02, 0x03: // ACK frame
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: Largest Acknowledged
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Delay
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
ackRangeCount, err := quicvarint.Read(buffer) // Field: ACK Range Count
|
|
||||||
if err != nil {
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: First ACK Range
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
for i := 0; i < int(ackRangeCount); i++ { // Field: ACK Range
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Range -> Gap
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Range -> ACK Range Length
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if frameType == 0x03 {
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: ECN Counts -> ECT0 Count
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: ECN Counts -> ECT1 Count
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { //nolint:misspell // Field: ECN Counts -> ECT-CE Count
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 0x06: // CRYPTO frame, we will use this frame
|
|
||||||
offset, err := quicvarint.Read(buffer) // Field: Offset
|
|
||||||
if err != nil {
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
length, err := quicvarint.Read(buffer) // Field: Length
|
|
||||||
if err != nil || length > uint64(buffer.Len()) {
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if cryptoLen < uint(offset+length) {
|
|
||||||
cryptoLen = uint(offset + length)
|
|
||||||
}
|
|
||||||
if _, err := buffer.Read(cryptoData[offset : offset+length]); err != nil { // Field: Crypto Data
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
case 0x1c: // CONNECTION_CLOSE frame, only 0x1c is permitted in initial packet
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: Error Code
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err = quicvarint.Read(buffer); err != nil { // Field: Frame Type
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
length, err := quicvarint.Read(buffer) // Field: Reason Phrase Length
|
|
||||||
if err != nil {
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
if _, err := buffer.ReadBytes(int32(length)); err != nil { // Field: Reason Phrase
|
|
||||||
return nil, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
// Only above frame types are permitted in initial packet.
|
|
||||||
// See https://www.rfc-editor.org/rfc/rfc9000.html#section-17.2.2-8
|
|
||||||
return nil, errNotQuicInitial
|
return nil, errNotQuicInitial
|
||||||
}
|
}
|
||||||
}
|
var packetNumber uint32
|
||||||
|
{
|
||||||
|
n, err := buffer.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
packetNumber = uint32(n)
|
||||||
|
}
|
||||||
|
|
||||||
tlsHdr := &ptls.SniffHeader{}
|
extHdrLen := hdrLen + int(packetNumberLength)
|
||||||
err = ptls.ReadClientHello(cryptoData[:cryptoLen], tlsHdr)
|
copy(b[extHdrLen:hdrLen+4], origPNBytes[packetNumberLength:])
|
||||||
if err != nil {
|
data := b[extHdrLen : int(packetLen)+hdrLen]
|
||||||
return nil, err
|
|
||||||
|
key := hkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic key", 16)
|
||||||
|
iv := hkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic iv", 12)
|
||||||
|
cipher := AEADAESGCMTLS13(key, iv)
|
||||||
|
nonce := cache.Extend(int32(cipher.NonceSize()))
|
||||||
|
binary.BigEndian.PutUint64(nonce[len(nonce)-8:], uint64(packetNumber))
|
||||||
|
decrypted, err := cipher.Open(b[extHdrLen:extHdrLen], nonce, data, b[:extHdrLen])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
buffer = buf.FromBytes(decrypted)
|
||||||
|
for i := 0; !buffer.IsEmpty(); i++ {
|
||||||
|
frameType := byte(0x0) // Default to PADDING frame
|
||||||
|
for frameType == 0x0 && !buffer.IsEmpty() {
|
||||||
|
frameType, _ = buffer.ReadByte()
|
||||||
|
}
|
||||||
|
switch frameType {
|
||||||
|
case 0x00: // PADDING frame
|
||||||
|
case 0x01: // PING frame
|
||||||
|
case 0x02, 0x03: // ACK frame
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: Largest Acknowledged
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Delay
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
ackRangeCount, err := quicvarint.Read(buffer) // Field: ACK Range Count
|
||||||
|
if err != nil {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: First ACK Range
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
for i := 0; i < int(ackRangeCount); i++ { // Field: ACK Range
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Range -> Gap
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: ACK Range -> ACK Range Length
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if frameType == 0x03 {
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: ECN Counts -> ECT0 Count
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: ECN Counts -> ECT1 Count
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { //nolint:misspell // Field: ECN Counts -> ECT-CE Count
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 0x06: // CRYPTO frame, we will use this frame
|
||||||
|
offset, err := quicvarint.Read(buffer) // Field: Offset
|
||||||
|
if err != nil {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
length, err := quicvarint.Read(buffer) // Field: Length
|
||||||
|
if err != nil || length > uint64(buffer.Len()) {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if cryptoLen < int(offset+length) {
|
||||||
|
cryptoLen = int(offset + length)
|
||||||
|
if len(cryptoData) < cryptoLen {
|
||||||
|
newCryptoData := bytespool.Alloc(int32(cryptoLen))
|
||||||
|
copy(newCryptoData, cryptoData)
|
||||||
|
bytespool.Free(cryptoData)
|
||||||
|
cryptoData = newCryptoData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if _, err := buffer.Read(cryptoData[offset : offset+length]); err != nil { // Field: Crypto Data
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
case 0x1c: // CONNECTION_CLOSE frame, only 0x1c is permitted in initial packet
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: Error Code
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err = quicvarint.Read(buffer); err != nil { // Field: Frame Type
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
length, err := quicvarint.Read(buffer) // Field: Reason Phrase Length
|
||||||
|
if err != nil {
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if _, err := buffer.ReadBytes(int32(length)); err != nil { // Field: Reason Phrase
|
||||||
|
return nil, io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// Only above frame types are permitted in initial packet.
|
||||||
|
// See https://www.rfc-editor.org/rfc/rfc9000.html#section-17.2.2-8
|
||||||
|
return nil, errNotQuicInitial
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tlsHdr := &ptls.SniffHeader{}
|
||||||
|
err = ptls.ReadClientHello(cryptoData[:cryptoLen], tlsHdr)
|
||||||
|
if err != nil {
|
||||||
|
// The crypto data may have not been fully recovered in current packets,
|
||||||
|
// So we continue to sniff rest packets.
|
||||||
|
b = restPayload
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
return &SniffHeader{domain: tlsHdr.Domain()}, nil
|
||||||
}
|
}
|
||||||
return &SniffHeader{domain: tlsHdr.Domain()}, nil
|
return nil, common.ErrNoClue
|
||||||
}
|
}
|
||||||
|
|
||||||
func hkdfExpandLabel(hash crypto.Hash, secret, context []byte, label string, length int) []byte {
|
func hkdfExpandLabel(hash crypto.Hash, secret, context []byte, label string, length int) []byte {
|
||||||
|
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
@@ -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
|
||||||
|
|
||||||
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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
|
||||||
|
@@ -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)
|
||||||
|
@@ -1,14 +1,13 @@
|
|||||||
// 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.28.0
|
||||||
// source: core/config.proto
|
// source: core/config.proto
|
||||||
|
|
||||||
package core
|
package core
|
||||||
|
|
||||||
import (
|
import (
|
||||||
serial "github.com/xtls/xray-core/common/serial"
|
serial "github.com/xtls/xray-core/common/serial"
|
||||||
global "github.com/xtls/xray-core/transport/global"
|
|
||||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
reflect "reflect"
|
reflect "reflect"
|
||||||
@@ -38,12 +37,6 @@ type Config struct {
|
|||||||
// implement the Feature interface, and its config type must be registered
|
// implement the Feature interface, and its config type must be registered
|
||||||
// through common.RegisterConfig.
|
// through common.RegisterConfig.
|
||||||
App []*serial.TypedMessage `protobuf:"bytes,4,rep,name=app,proto3" json:"app,omitempty"`
|
App []*serial.TypedMessage `protobuf:"bytes,4,rep,name=app,proto3" json:"app,omitempty"`
|
||||||
// Transport settings.
|
|
||||||
// Deprecated. Each inbound and outbound should choose their own transport
|
|
||||||
// config. Date to remove: 2020-01-13
|
|
||||||
//
|
|
||||||
// Deprecated: Marked as deprecated in core/config.proto.
|
|
||||||
Transport *global.Config `protobuf:"bytes,5,opt,name=transport,proto3" json:"transport,omitempty"`
|
|
||||||
// Configuration for extensions. The config may not work if corresponding
|
// Configuration for extensions. The config may not work if corresponding
|
||||||
// extension is not loaded into Xray. Xray will ignore such config during
|
// extension is not loaded into Xray. Xray will ignore such config during
|
||||||
// initialization.
|
// initialization.
|
||||||
@@ -103,14 +96,6 @@ func (x *Config) GetApp() []*serial.TypedMessage {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Marked as deprecated in core/config.proto.
|
|
||||||
func (x *Config) GetTransport() *global.Config {
|
|
||||||
if x != nil {
|
|
||||||
return x.Transport
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *Config) GetExtension() []*serial.TypedMessage {
|
func (x *Config) GetExtension() []*serial.TypedMessage {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Extension
|
return x.Extension
|
||||||
@@ -278,60 +263,54 @@ var file_core_config_proto_rawDesc = []byte{
|
|||||||
0x6f, 0x74, 0x6f, 0x12, 0x09, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x21,
|
0x6f, 0x74, 0x6f, 0x12, 0x09, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x21,
|
||||||
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2f, 0x74, 0x79,
|
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2f, 0x74, 0x79,
|
||||||
0x70, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x70, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x1a, 0x1d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x67, 0x6c, 0x6f,
|
0x6f, 0x22, 0xfb, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x07,
|
||||||
0x62, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e,
|
||||||
0x22, 0xb5, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x07, 0x69,
|
0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e,
|
||||||
0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78,
|
0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07,
|
||||||
0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64,
|
0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3c, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f,
|
||||||
0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x69,
|
0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79,
|
||||||
0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3c, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75,
|
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61,
|
||||||
0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e,
|
0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x6f, 0x75, 0x74,
|
||||||
0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e,
|
0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x04, 0x20, 0x03,
|
||||||
0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62,
|
0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
|
||||||
0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28,
|
0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73,
|
||||||
|
0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x61, 0x70, 0x70, 0x12, 0x3e, 0x0a, 0x09, 0x65, 0x78, 0x74,
|
||||||
|
0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78,
|
||||||
|
0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61,
|
||||||
|
0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x09,
|
||||||
|
0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22,
|
||||||
|
0xc0, 0x01, 0x0a, 0x14, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c,
|
||||||
|
0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18,
|
||||||
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x11, 0x72, 0x65,
|
||||||
|
0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d,
|
||||||
|
0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64,
|
||||||
|
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x10, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
|
||||||
|
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x70, 0x72, 0x6f,
|
||||||
|
0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||||
0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||||
0x61, 0x67, 0x65, 0x52, 0x03, 0x61, 0x70, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e,
|
0x61, 0x67, 0x65, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x78, 0x72,
|
0x67, 0x73, 0x22, 0xef, 0x01, 0x0a, 0x15, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48,
|
||||||
0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x43, 0x6f, 0x6e,
|
0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03,
|
||||||
0x66, 0x69, 0x67, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f,
|
0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x49,
|
||||||
0x72, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18,
|
0x0a, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||||
0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d,
|
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63,
|
||||||
0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64,
|
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70,
|
||||||
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,
|
0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65,
|
||||||
0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xc0, 0x01, 0x0a, 0x14, 0x49, 0x6e, 0x62,
|
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x70, 0x72, 0x6f,
|
||||||
0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
|
||||||
0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f,
|
0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73,
|
||||||
0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20,
|
0x61, 0x67, 0x65, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72,
|
0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f,
|
||||||
0x52, 0x10, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d,
|
||||||
0x67, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74,
|
0x6d, 0x65, 0x6e, 0x74, 0x42, 0x3d, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79,
|
||||||
0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61,
|
0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||||
0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e,
|
0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f,
|
||||||
0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x70, 0x72,
|
0x72, 0x65, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x09, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43,
|
||||||
0x6f, 0x78, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xef, 0x01, 0x0a, 0x15,
|
0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43,
|
|
||||||
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01,
|
|
||||||
0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x49, 0x0a, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65,
|
|
||||||
0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b,
|
|
||||||
0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73,
|
|
||||||
0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61,
|
|
||||||
0x67, 0x65, 0x52, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
|
||||||
0x67, 0x73, 0x12, 0x47, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74,
|
|
||||||
0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61,
|
|
||||||
0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e,
|
|
||||||
0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x70, 0x72,
|
|
||||||
0x6f, 0x78, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65,
|
|
||||||
0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70,
|
|
||||||
0x69, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05,
|
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x3d, 0x0a,
|
|
||||||
0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01,
|
|
||||||
0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c,
|
|
||||||
0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x72, 0x65,
|
|
||||||
0xaa, 0x02, 0x09, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -347,28 +326,26 @@ 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
|
||||||
(*serial.TypedMessage)(nil), // 3: xray.common.serial.TypedMessage
|
(*serial.TypedMessage)(nil), // 3: xray.common.serial.TypedMessage
|
||||||
(*global.Config)(nil), // 4: xray.transport.Config
|
|
||||||
}
|
}
|
||||||
var file_core_config_proto_depIdxs = []int32{
|
var file_core_config_proto_depIdxs = []int32{
|
||||||
1, // 0: xray.core.Config.inbound:type_name -> xray.core.InboundHandlerConfig
|
1, // 0: xray.core.Config.inbound:type_name -> xray.core.InboundHandlerConfig
|
||||||
2, // 1: xray.core.Config.outbound:type_name -> xray.core.OutboundHandlerConfig
|
2, // 1: xray.core.Config.outbound:type_name -> xray.core.OutboundHandlerConfig
|
||||||
3, // 2: xray.core.Config.app:type_name -> xray.common.serial.TypedMessage
|
3, // 2: xray.core.Config.app:type_name -> xray.common.serial.TypedMessage
|
||||||
4, // 3: xray.core.Config.transport:type_name -> xray.transport.Config
|
3, // 3: xray.core.Config.extension:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 4: xray.core.Config.extension:type_name -> xray.common.serial.TypedMessage
|
3, // 4: xray.core.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 5: xray.core.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage
|
3, // 5: xray.core.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 6: xray.core.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
3, // 6: xray.core.OutboundHandlerConfig.sender_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 7: xray.core.OutboundHandlerConfig.sender_settings:type_name -> xray.common.serial.TypedMessage
|
3, // 7: xray.core.OutboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 8: xray.core.OutboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage
|
8, // [8:8] is the sub-list for method output_type
|
||||||
9, // [9:9] is the sub-list for method output_type
|
8, // [8:8] is the sub-list for method input_type
|
||||||
9, // [9:9] is the sub-list for method input_type
|
8, // [8:8] is the sub-list for extension type_name
|
||||||
9, // [9:9] is the sub-list for extension type_name
|
8, // [8:8] is the sub-list for extension extendee
|
||||||
9, // [9:9] is the sub-list for extension extendee
|
0, // [0:8] is the sub-list for field type_name
|
||||||
0, // [0:9] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_core_config_proto_init() }
|
func init() { file_core_config_proto_init() }
|
||||||
@@ -377,7 +354,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 +366,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 +378,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
|
||||||
|
@@ -7,7 +7,6 @@ option java_package = "com.xray.core";
|
|||||||
option java_multiple_files = true;
|
option java_multiple_files = true;
|
||||||
|
|
||||||
import "common/serial/typed_message.proto";
|
import "common/serial/typed_message.proto";
|
||||||
import "transport/global/config.proto";
|
|
||||||
|
|
||||||
// Config is the master config of Xray. Xray takes this config as input and
|
// Config is the master config of Xray. Xray takes this config as input and
|
||||||
// functions accordingly.
|
// functions accordingly.
|
||||||
@@ -26,15 +25,15 @@ message Config {
|
|||||||
// through common.RegisterConfig.
|
// through common.RegisterConfig.
|
||||||
repeated xray.common.serial.TypedMessage app = 4;
|
repeated xray.common.serial.TypedMessage app = 4;
|
||||||
|
|
||||||
// Transport settings.
|
|
||||||
// Deprecated. Each inbound and outbound should choose their own transport
|
|
||||||
// config. Date to remove: 2020-01-13
|
|
||||||
xray.transport.Config transport = 5 [deprecated = true];
|
|
||||||
|
|
||||||
// Configuration for extensions. The config may not work if corresponding
|
// Configuration for extensions. The config may not work if corresponding
|
||||||
// extension is not loaded into Xray. Xray will ignore such config during
|
// extension is not loaded into Xray. Xray will ignore such config during
|
||||||
// initialization.
|
// initialization.
|
||||||
repeated xray.common.serial.TypedMessage extension = 6;
|
repeated xray.common.serial.TypedMessage extension = 6;
|
||||||
|
|
||||||
|
// Transport settings.
|
||||||
|
// Deprecated. Each inbound and outbound should choose their own transport
|
||||||
|
// config. Date to remove: 2020-01-13
|
||||||
|
// xray.transport.Config transport = 5 [deprecated = true];
|
||||||
}
|
}
|
||||||
|
|
||||||
// InboundHandlerConfig is the configuration for inbound handler.
|
// InboundHandlerConfig is the configuration for inbound handler.
|
||||||
|
@@ -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 = 18
|
Version_z byte = 16
|
||||||
)
|
)
|
||||||
|
|
||||||
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 ./..
|
||||||
|
@@ -185,13 +185,6 @@ func initInstanceWithConfig(config *Config, server *Instance) (bool, error) {
|
|||||||
server.ctx = context.WithValue(server.ctx, "cone",
|
server.ctx = context.WithValue(server.ctx, "cone",
|
||||||
platform.NewEnvFlag(platform.UseCone).GetValue(func() string { return "" }) != "true")
|
platform.NewEnvFlag(platform.UseCone).GetValue(func() string { return "" }) != "true")
|
||||||
|
|
||||||
if config.Transport != nil {
|
|
||||||
features.PrintDeprecatedFeatureWarning("global transport settings")
|
|
||||||
}
|
|
||||||
if err := config.Transport.Apply(); err != nil {
|
|
||||||
return true, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, appSettings := range config.App {
|
for _, appSettings := range config.App {
|
||||||
settings, err := appSettings.GetInstance()
|
settings, err := appSettings.GetInstance()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@@ -1,22 +1,12 @@
|
|||||||
package features
|
package features
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
// Feature is the interface for Xray features. All features must implement this interface.
|
// Feature is the interface for Xray features. All features must implement this interface.
|
||||||
// All existing features have an implementation in app directory. These features can be replaced by third-party ones.
|
// All existing features have an implementation in app directory. These features can be replaced by third-party ones.
|
||||||
type Feature interface {
|
type Feature interface {
|
||||||
common.HasType
|
common.HasType
|
||||||
common.Runnable
|
common.Runnable
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrintDeprecatedFeatureWarning prints a warning for deprecated feature.
|
|
||||||
func PrintDeprecatedFeatureWarning(feature string) {
|
|
||||||
errors.LogInfo(context.Background(), "You are using a deprecated feature: " + feature + ". Please update your config file with latest configuration format, or update your client software.")
|
|
||||||
}
|
|
||||||
|
@@ -30,6 +30,9 @@ type Route interface {
|
|||||||
|
|
||||||
// GetOutboundTag returns the tag of the outbound the connection was dispatched to.
|
// GetOutboundTag returns the tag of the outbound the connection was dispatched to.
|
||||||
GetOutboundTag() string
|
GetOutboundTag() string
|
||||||
|
|
||||||
|
// GetRuleTag returns the matching rule tag for debugging if exists
|
||||||
|
GetRuleTag() string
|
||||||
}
|
}
|
||||||
|
|
||||||
// RouterType return the type of Router interface. Can be used to implement common.HasType.
|
// RouterType return the type of Router interface. Can be used to implement common.HasType.
|
||||||
|
28
go.mod
28
go.mod
@@ -4,30 +4,30 @@ 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.7
|
github.com/refraction-networking/utls v1.6.7
|
||||||
github.com/sagernet/sing v0.4.1
|
github.com/sagernet/sing v0.4.3
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.7
|
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-20240712055506-48f0b2d5ed6d
|
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.25.0
|
golang.org/x/crypto v0.27.0
|
||||||
golang.org/x/net v0.27.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.22.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.2
|
||||||
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
|
||||||
)
|
)
|
||||||
|
214
go.sum
214
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/quic-go/quic-go v0.45.1/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI=
|
|
||||||
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
|
github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM=
|
||||||
github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0=
|
github.com/refraction-networking/utls v1.6.7/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.3 h1:Ty/NAiNnVd6844k7ujlL5lkzydhcTH5Psc432jXA4Y8=
|
||||||
github.com/sagernet/sing v0.4.1 h1:zVlpE+7k7AFoC2pv6ReqLf0PIHjihL/jsBl5k05PQFk=
|
github.com/sagernet/sing v0.4.3/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
|
||||||
github.com/sagernet/sing v0.4.1/go.mod h1:ieZHA/+Y9YZfXs2I3WtuwgyCZ6GPsIR7HdKb1SdEnls=
|
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
|
github.com/sagernet/sing-shadowsocks v0.2.7 h1:zaopR1tbHEw5Nk6FAkM05wCslV6ahVegEZaKMv9ipx8=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.7/go.mod h1:0rIKJZBR65Qi0zwdKezt4s57y/Tl1ofkaq6NlkzVuyE=
|
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-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg=
|
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d h1:+B97uD9uHLgAAulhigmys4BVwZZypzK7gPN3WtpgRJg=
|
||||||
github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d/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.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
|
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||||
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
|
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.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
|
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||||
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
|
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.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
|
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.22.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.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/grpc v1.66.2/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.")
|
||||||
|
}
|
||||||
|
@@ -13,6 +13,7 @@ type DNSOutboundConfig struct {
|
|||||||
Port uint16 `json:"port"`
|
Port uint16 `json:"port"`
|
||||||
UserLevel uint32 `json:"userLevel"`
|
UserLevel uint32 `json:"userLevel"`
|
||||||
NonIPQuery string `json:"nonIPQuery"`
|
NonIPQuery string `json:"nonIPQuery"`
|
||||||
|
BlockTypes []int32 `json:"blockTypes"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DNSOutboundConfig) Build() (proto.Message, error) {
|
func (c *DNSOutboundConfig) Build() (proto.Message, error) {
|
||||||
@@ -34,5 +35,6 @@ func (c *DNSOutboundConfig) Build() (proto.Message, error) {
|
|||||||
return nil, errors.New(`unknown "nonIPQuery": `, c.NonIPQuery)
|
return nil, errors.New(`unknown "nonIPQuery": `, c.NonIPQuery)
|
||||||
}
|
}
|
||||||
config.Non_IPQuery = c.NonIPQuery
|
config.Non_IPQuery = c.NonIPQuery
|
||||||
|
config.BlockTypes = c.BlockTypes
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package conf
|
package conf
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/base64"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -18,6 +19,8 @@ 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"`
|
||||||
|
Noises []*Noise `json:"noises"`
|
||||||
ProxyProtocol uint32 `json:"proxyProtocol"`
|
ProxyProtocol uint32 `json:"proxyProtocol"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,6 +30,12 @@ type Fragment struct {
|
|||||||
Interval string `json:"interval"`
|
Interval string `json:"interval"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Noise struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Packet string `json:"packet"`
|
||||||
|
Delay *Int32Range `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)
|
||||||
@@ -144,6 +153,20 @@ func (c *FreedomConfig) Build() (proto.Message, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Noise != nil {
|
||||||
|
return nil, errors.PrintRemovedFeatureError("noise = { ... }", "noises = [ { ... } ]")
|
||||||
|
}
|
||||||
|
|
||||||
|
if c.Noises != nil {
|
||||||
|
for _, n := range c.Noises {
|
||||||
|
NConfig, err := ParseNoise(n)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
config.Noises = append(config.Noises, NConfig)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if c.Timeout != nil {
|
if c.Timeout != nil {
|
||||||
config.Timeout = *c.Timeout
|
config.Timeout = *c.Timeout
|
||||||
}
|
}
|
||||||
@@ -172,3 +195,67 @@ func (c *FreedomConfig) Build() (proto.Message, error) {
|
|||||||
}
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ParseNoise(noise *Noise) (*freedom.Noise, error) {
|
||||||
|
var err, err2 error
|
||||||
|
NConfig := new(freedom.Noise)
|
||||||
|
|
||||||
|
switch strings.ToLower(noise.Type) {
|
||||||
|
case "rand":
|
||||||
|
randValue := strings.Split(noise.Packet, "-")
|
||||||
|
if len(randValue) > 2 {
|
||||||
|
return nil, errors.New("Only 2 values are allowed for rand")
|
||||||
|
}
|
||||||
|
if len(randValue) == 2 {
|
||||||
|
NConfig.LengthMin, err = strconv.ParseUint(randValue[0], 10, 64)
|
||||||
|
NConfig.LengthMax, err2 = strconv.ParseUint(randValue[1], 10, 64)
|
||||||
|
}
|
||||||
|
if len(randValue) == 1 {
|
||||||
|
NConfig.LengthMin, err = strconv.ParseUint(randValue[0], 10, 64)
|
||||||
|
NConfig.LengthMax = NConfig.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 NConfig.LengthMin > NConfig.LengthMax {
|
||||||
|
NConfig.LengthMin, NConfig.LengthMax = NConfig.LengthMax, NConfig.LengthMin
|
||||||
|
}
|
||||||
|
if NConfig.LengthMin == 0 {
|
||||||
|
return nil, errors.New("rand lengthMin or lengthMax cannot be 0")
|
||||||
|
}
|
||||||
|
|
||||||
|
case "str":
|
||||||
|
//user input string
|
||||||
|
NConfig.StrNoise = []byte(strings.TrimSpace(noise.Packet))
|
||||||
|
|
||||||
|
case "base64":
|
||||||
|
//user input base64
|
||||||
|
NConfig.StrNoise, err = base64.StdEncoding.DecodeString(strings.TrimSpace(noise.Packet))
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("Invalid base64 string")
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return nil, errors.New("Invalid packet,only rand,str,base64 are supported")
|
||||||
|
}
|
||||||
|
|
||||||
|
if noise.Delay != nil {
|
||||||
|
if noise.Delay.From != 0 && noise.Delay.To != 0 {
|
||||||
|
NConfig.DelayMin = uint64(noise.Delay.From)
|
||||||
|
NConfig.DelayMax = uint64(noise.Delay.To)
|
||||||
|
if NConfig.DelayMin > NConfig.LengthMax {
|
||||||
|
NConfig.DelayMin, NConfig.DelayMax = NConfig.LengthMax, NConfig.DelayMin
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return nil, errors.New("DelayMin or DelayMax cannot be zero")
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
NConfig.DelayMin = 0
|
||||||
|
NConfig.DelayMax = 0
|
||||||
|
}
|
||||||
|
return NConfig, nil
|
||||||
|
}
|
||||||
|
@@ -16,10 +16,11 @@ func DefaultLogConfig() *log.Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type LogConfig struct {
|
type LogConfig struct {
|
||||||
AccessLog string `json:"access"`
|
AccessLog string `json:"access"`
|
||||||
ErrorLog string `json:"error"`
|
ErrorLog string `json:"error"`
|
||||||
LogLevel string `json:"loglevel"`
|
LogLevel string `json:"loglevel"`
|
||||||
DNSLog bool `json:"dnsLog"`
|
DNSLog bool `json:"dnsLog"`
|
||||||
|
MaskAddress string `json:"maskAddress"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *LogConfig) Build() *log.Config {
|
func (v *LogConfig) Build() *log.Config {
|
||||||
@@ -59,5 +60,6 @@ func (v *LogConfig) Build() *log.Config {
|
|||||||
default:
|
default:
|
||||||
config.ErrorLogLevel = clog.Severity_Warning
|
config.ErrorLogLevel = clog.Severity_Warning
|
||||||
}
|
}
|
||||||
|
config.MaskAddress = v.MaskAddress
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
@@ -14,11 +14,6 @@ import (
|
|||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RouterRulesConfig struct {
|
|
||||||
RuleList []json.RawMessage `json:"rules"`
|
|
||||||
DomainStrategy string `json:"domainStrategy"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StrategyConfig represents a strategy config
|
// StrategyConfig represents a strategy config
|
||||||
type StrategyConfig struct {
|
type StrategyConfig struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
@@ -76,7 +71,6 @@ func (r *BalancingRule) Build() (*router.BalancingRule, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RouterConfig struct {
|
type RouterConfig struct {
|
||||||
Settings *RouterRulesConfig `json:"settings"` // Deprecated
|
|
||||||
RuleList []json.RawMessage `json:"rules"`
|
RuleList []json.RawMessage `json:"rules"`
|
||||||
DomainStrategy *string `json:"domainStrategy"`
|
DomainStrategy *string `json:"domainStrategy"`
|
||||||
Balancers []*BalancingRule `json:"balancers"`
|
Balancers []*BalancingRule `json:"balancers"`
|
||||||
@@ -88,8 +82,6 @@ func (c *RouterConfig) getDomainStrategy() router.Config_DomainStrategy {
|
|||||||
ds := ""
|
ds := ""
|
||||||
if c.DomainStrategy != nil {
|
if c.DomainStrategy != nil {
|
||||||
ds = *c.DomainStrategy
|
ds = *c.DomainStrategy
|
||||||
} else if c.Settings != nil {
|
|
||||||
ds = c.Settings.DomainStrategy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch strings.ToLower(ds) {
|
switch strings.ToLower(ds) {
|
||||||
@@ -111,10 +103,6 @@ func (c *RouterConfig) Build() (*router.Config, error) {
|
|||||||
var rawRuleList []json.RawMessage
|
var rawRuleList []json.RawMessage
|
||||||
if c != nil {
|
if c != nil {
|
||||||
rawRuleList = c.RuleList
|
rawRuleList = c.RuleList
|
||||||
if c.Settings != nil {
|
|
||||||
c.RuleList = append(c.RuleList, c.Settings.RuleList...)
|
|
||||||
rawRuleList = c.RuleList
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rawRule := range rawRuleList {
|
for _, rawRule := range rawRuleList {
|
||||||
|
@@ -64,36 +64,33 @@ func TestRouterConfig(t *testing.T) {
|
|||||||
runMultiTestCase(t, []TestCase{
|
runMultiTestCase(t, []TestCase{
|
||||||
{
|
{
|
||||||
Input: `{
|
Input: `{
|
||||||
"strategy": "rules",
|
"domainStrategy": "AsIs",
|
||||||
"settings": {
|
"rules": [
|
||||||
"domainStrategy": "AsIs",
|
{
|
||||||
"rules": [
|
"type": "field",
|
||||||
{
|
"domain": [
|
||||||
"type": "field",
|
"baidu.com",
|
||||||
"domain": [
|
"qq.com"
|
||||||
"baidu.com",
|
],
|
||||||
"qq.com"
|
"outboundTag": "direct"
|
||||||
],
|
},
|
||||||
"outboundTag": "direct"
|
{
|
||||||
},
|
"type": "field",
|
||||||
{
|
"ip": [
|
||||||
"type": "field",
|
"10.0.0.0/8",
|
||||||
"ip": [
|
"::1/128"
|
||||||
"10.0.0.0/8",
|
],
|
||||||
"::1/128"
|
"outboundTag": "test"
|
||||||
],
|
},{
|
||||||
"outboundTag": "test"
|
"type": "field",
|
||||||
},{
|
"port": "53, 443, 1000-2000",
|
||||||
"type": "field",
|
"outboundTag": "test"
|
||||||
"port": "53, 443, 1000-2000",
|
},{
|
||||||
"outboundTag": "test"
|
"type": "field",
|
||||||
},{
|
"port": 123,
|
||||||
"type": "field",
|
"outboundTag": "test"
|
||||||
"port": 123,
|
}
|
||||||
"outboundTag": "test"
|
],
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"balancers": [
|
"balancers": [
|
||||||
{
|
{
|
||||||
"tag": "b1",
|
"tag": "b1",
|
||||||
@@ -225,28 +222,25 @@ func TestRouterConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Input: `{
|
Input: `{
|
||||||
"strategy": "rules",
|
"domainStrategy": "IPIfNonMatch",
|
||||||
"settings": {
|
"rules": [
|
||||||
"domainStrategy": "IPIfNonMatch",
|
{
|
||||||
"rules": [
|
"type": "field",
|
||||||
{
|
"domain": [
|
||||||
"type": "field",
|
"baidu.com",
|
||||||
"domain": [
|
"qq.com"
|
||||||
"baidu.com",
|
],
|
||||||
"qq.com"
|
"outboundTag": "direct"
|
||||||
],
|
},
|
||||||
"outboundTag": "direct"
|
{
|
||||||
},
|
"type": "field",
|
||||||
{
|
"ip": [
|
||||||
"type": "field",
|
"10.0.0.0/8",
|
||||||
"ip": [
|
"::1/128"
|
||||||
"10.0.0.0/8",
|
],
|
||||||
"::1/128"
|
"outboundTag": "test"
|
||||||
],
|
}
|
||||||
"outboundTag": "test"
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}`,
|
}`,
|
||||||
Parser: createParser(),
|
Parser: createParser(),
|
||||||
Output: &router.Config{
|
Output: &router.Config{
|
||||||
@@ -289,68 +283,5 @@ func TestRouterConfig(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
Input: `{
|
|
||||||
"domainStrategy": "AsIs",
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"type": "field",
|
|
||||||
"domain": [
|
|
||||||
"baidu.com",
|
|
||||||
"qq.com"
|
|
||||||
],
|
|
||||||
"outboundTag": "direct"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "field",
|
|
||||||
"ip": [
|
|
||||||
"10.0.0.0/8",
|
|
||||||
"::1/128"
|
|
||||||
],
|
|
||||||
"outboundTag": "test"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}`,
|
|
||||||
Parser: createParser(),
|
|
||||||
Output: &router.Config{
|
|
||||||
DomainStrategy: router.Config_AsIs,
|
|
||||||
Rule: []*router.RoutingRule{
|
|
||||||
{
|
|
||||||
Domain: []*router.Domain{
|
|
||||||
{
|
|
||||||
Type: router.Domain_Plain,
|
|
||||||
Value: "baidu.com",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Type: router.Domain_Plain,
|
|
||||||
Value: "qq.com",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
TargetTag: &router.RoutingRule_Tag{
|
|
||||||
Tag: "direct",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Geoip: []*router.GeoIP{
|
|
||||||
{
|
|
||||||
Cidr: []*router.CIDR{
|
|
||||||
{
|
|
||||||
Ip: []byte{10, 0, 0, 0},
|
|
||||||
Prefix: 8,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Ip: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
|
|
||||||
Prefix: 128,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
TargetTag: &router.RoutingRule_Tag{
|
|
||||||
Tag: "test",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -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,30 @@ 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"`
|
||||||
|
Xmux Xmux `json:"xmux"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Xmux struct {
|
||||||
|
maxConnections *Int32Range `json:"maxConnections"`
|
||||||
|
maxConcurrency *Int32Range `json:"maxConcurrency"`
|
||||||
|
cMaxReuseTimes *Int32Range `json:"cMaxReuseTimes"`
|
||||||
|
cMaxLifetimeMs *Int32Range `json:"cMaxLifetimeMs"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -243,12 +262,29 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||||||
} else if c.Host == "" && c.Headers["Host"] != "" {
|
} else if c.Host == "" && c.Headers["Host"] != "" {
|
||||||
c.Host = c.Headers["Host"]
|
c.Host = c.Headers["Host"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Xmux.maxConnections != nil && c.Xmux.maxConcurrency != nil {
|
||||||
|
return nil, errors.New("maxConnections cannot be specified together with maxConcurrency")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multiplexing config
|
||||||
|
muxProtobuf := splithttp.Multiplexing{
|
||||||
|
MaxConnections: splithttpNewRandRangeConfig(c.Xmux.maxConnections),
|
||||||
|
MaxConcurrency: splithttpNewRandRangeConfig(c.Xmux.maxConcurrency),
|
||||||
|
CMaxReuseTimes: splithttpNewRandRangeConfig(c.Xmux.cMaxReuseTimes),
|
||||||
|
CMaxLifetimeMs: splithttpNewRandRangeConfig(c.Xmux.cMaxLifetimeMs),
|
||||||
|
}
|
||||||
|
|
||||||
config := &splithttp.Config{
|
config := &splithttp.Config{
|
||||||
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),
|
||||||
|
Xmux: &muxProtobuf,
|
||||||
}
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
@@ -298,62 +334,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 +352,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 +391,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 +652,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":
|
||||||
@@ -809,8 +787,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"`
|
||||||
@@ -845,8 +821,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".`)
|
||||||
@@ -859,7 +835,7 @@ 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 "xtls":
|
case "xtls":
|
||||||
return nil, errors.New(`Please use VLESS flow "xtls-rprx-vision" with TLS or REALITY.`)
|
return nil, errors.PrintRemovedFeatureError(`Legacy XTLS`, `xtls-rprx-vision with TLS or REALITY`)
|
||||||
default:
|
default:
|
||||||
return nil, errors.New(`Unknown security "` + c.Security + `".`)
|
return nil, errors.New(`Unknown security "` + c.Security + `".`)
|
||||||
}
|
}
|
||||||
@@ -903,26 +879,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",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
@@ -52,7 +52,7 @@ func (c *TrojanClientConfig) Build() (proto.Message, error) {
|
|||||||
return nil, errors.New("Trojan password is not specified.")
|
return nil, errors.New("Trojan password is not specified.")
|
||||||
}
|
}
|
||||||
if rec.Flow != "" {
|
if rec.Flow != "" {
|
||||||
return nil, errors.New(`Trojan doesn't support "flow" anymore.`)
|
return nil, errors.PrintRemovedFeatureError(`Flow for Trojan`, ``)
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Server[idx] = &protocol.ServerEndpoint{
|
config.Server[idx] = &protocol.ServerEndpoint{
|
||||||
@@ -106,7 +106,7 @@ func (c *TrojanServerConfig) Build() (proto.Message, error) {
|
|||||||
|
|
||||||
for idx, rawUser := range c.Clients {
|
for idx, rawUser := range c.Clients {
|
||||||
if rawUser.Flow != "" {
|
if rawUser.Flow != "" {
|
||||||
return nil, errors.New(`Trojan doesn't support "flow" anymore.`)
|
return nil, errors.PrintRemovedFeatureError(`Flow for Trojan`, ``)
|
||||||
}
|
}
|
||||||
|
|
||||||
config.Users[idx] = &protocol.User{
|
config.Users[idx] = &protocol.User{
|
||||||
|
@@ -57,10 +57,6 @@ func (c *VMessDetourConfig) Build() *inbound.DetourConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type FeaturesConfig struct {
|
|
||||||
Detour *VMessDetourConfig `json:"detour"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type VMessDefaultConfig struct {
|
type VMessDefaultConfig struct {
|
||||||
Level byte `json:"level"`
|
Level byte `json:"level"`
|
||||||
}
|
}
|
||||||
@@ -74,7 +70,6 @@ func (c *VMessDefaultConfig) Build() *inbound.DefaultConfig {
|
|||||||
|
|
||||||
type VMessInboundConfig struct {
|
type VMessInboundConfig struct {
|
||||||
Users []json.RawMessage `json:"clients"`
|
Users []json.RawMessage `json:"clients"`
|
||||||
Features *FeaturesConfig `json:"features"`
|
|
||||||
Defaults *VMessDefaultConfig `json:"default"`
|
Defaults *VMessDefaultConfig `json:"default"`
|
||||||
DetourConfig *VMessDetourConfig `json:"detour"`
|
DetourConfig *VMessDetourConfig `json:"detour"`
|
||||||
}
|
}
|
||||||
@@ -89,8 +84,6 @@ func (c *VMessInboundConfig) Build() (proto.Message, error) {
|
|||||||
|
|
||||||
if c.DetourConfig != nil {
|
if c.DetourConfig != nil {
|
||||||
config.Detour = c.DetourConfig.Build()
|
config.Detour = c.DetourConfig.Build()
|
||||||
} else if c.Features != nil && c.Features.Detour != nil {
|
|
||||||
config.Detour = c.Features.Detour.Build()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config.User = make([]*protocol.User, len(c.Users))
|
config.User = make([]*protocol.User, len(c.Users))
|
||||||
|
@@ -48,21 +48,6 @@ var (
|
|||||||
ctllog = log.New(os.Stderr, "xctl> ", 0)
|
ctllog = log.New(os.Stderr, "xctl> ", 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
func toProtocolList(s []string) ([]proxyman.KnownProtocols, error) {
|
|
||||||
kp := make([]proxyman.KnownProtocols, 0, 8)
|
|
||||||
for _, p := range s {
|
|
||||||
switch strings.ToLower(p) {
|
|
||||||
case "http":
|
|
||||||
kp = append(kp, proxyman.KnownProtocols_HTTP)
|
|
||||||
case "https", "tls", "ssl":
|
|
||||||
kp = append(kp, proxyman.KnownProtocols_TLS)
|
|
||||||
default:
|
|
||||||
return nil, errors.New("Unknown protocol: ", p)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return kp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type SniffingConfig struct {
|
type SniffingConfig struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
DestOverride *StringList `json:"destOverride"`
|
DestOverride *StringList `json:"destOverride"`
|
||||||
@@ -175,7 +160,6 @@ type InboundDetourConfig struct {
|
|||||||
Tag string `json:"tag"`
|
Tag string `json:"tag"`
|
||||||
Allocation *InboundDetourAllocationConfig `json:"allocate"`
|
Allocation *InboundDetourAllocationConfig `json:"allocate"`
|
||||||
StreamSetting *StreamConfig `json:"streamSettings"`
|
StreamSetting *StreamConfig `json:"streamSettings"`
|
||||||
DomainOverride *StringList `json:"domainOverride"`
|
|
||||||
SniffingConfig *SniffingConfig `json:"sniffing"`
|
SniffingConfig *SniffingConfig `json:"sniffing"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,13 +233,6 @@ func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error) {
|
|||||||
}
|
}
|
||||||
receiverSettings.SniffingSettings = s
|
receiverSettings.SniffingSettings = s
|
||||||
}
|
}
|
||||||
if c.DomainOverride != nil {
|
|
||||||
kp, err := toProtocolList(*c.DomainOverride)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New("failed to parse inbound detour config").Base(err)
|
|
||||||
}
|
|
||||||
receiverSettings.DomainOverride = kp
|
|
||||||
}
|
|
||||||
|
|
||||||
settings := []byte("{}")
|
settings := []byte("{}")
|
||||||
if c.Settings != nil {
|
if c.Settings != nil {
|
||||||
@@ -384,33 +361,15 @@ func (c *StatsConfig) Build() (*stats.Config, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Port of this Point server.
|
// Deprecated: Global transport config is no longer used
|
||||||
// Deprecated: Port exists for historical compatibility
|
// left for returning error
|
||||||
// and should not be used.
|
Transport map[string]json.RawMessage `json:"transport"`
|
||||||
Port uint16 `json:"port"`
|
|
||||||
|
|
||||||
// Deprecated: InboundConfig exists for historical compatibility
|
|
||||||
// and should not be used.
|
|
||||||
InboundConfig *InboundDetourConfig `json:"inbound"`
|
|
||||||
|
|
||||||
// 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 +446,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 +484,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,33 +588,15 @@ 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...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backward compatibility.
|
if len(c.Transport) > 0 {
|
||||||
if len(inbounds) > 0 && inbounds[0].PortList == nil && c.Port > 0 {
|
return nil, errors.PrintRemovedFeatureError("Global transport config", "streamSettings in inbounds and outbounds")
|
||||||
inbounds[0].PortList = &PortList{[]PortRange{{
|
|
||||||
From: uint32(c.Port),
|
|
||||||
To: uint32(c.Port),
|
|
||||||
}}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 +606,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,33 +73,16 @@ func TestXrayConfig(t *testing.T) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
"outboundDetour": [
|
|
||||||
{
|
|
||||||
"tag": "blocked",
|
|
||||||
"protocol": "blackhole"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"protocol": "dns"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"routing": {
|
"routing": {
|
||||||
"strategy": "rules",
|
"rules": [
|
||||||
"settings": {
|
{
|
||||||
"rules": [
|
"ip": [
|
||||||
{
|
"10.0.0.0/8"
|
||||||
"ip": [
|
],
|
||||||
"10.0.0.0/8"
|
"type": "field",
|
||||||
],
|
"outboundTag": "blocked"
|
||||||
"type": "field",
|
}
|
||||||
"outboundTag": "blocked"
|
]
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"transport": {
|
|
||||||
"httpSettings": {
|
|
||||||
"path": "/test"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}`,
|
}`,
|
||||||
Parser: createParser(),
|
Parser: createParser(),
|
||||||
@@ -169,108 +119,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 +144,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 +230,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 +240,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
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user