diff --git a/.env.example b/.env.example index 3089f79..c27966e 100644 --- a/.env.example +++ b/.env.example @@ -1,21 +1,19 @@ SERVICE_PORT = 62050 -XRAY_API_PORT = 62051 NODE_HOST = "0.0.0.0" +# use absolute path + # XRAY_EXECUTABLE_PATH = /usr/local/bin/xray # XRAY_ASSETS_PATH = /usr/local/share/xray +SSL_CERT_FILE = /var/lib/gozargah-node/certs/ssl_cert.pem +SSL_KEY_FILE = /var/lib/gozargah-node/certs/ssl_key.pem +SSL_CLIENT_CERT_FILE = /var/lib/gozargah-node/certs/ssl_client_cert.pem -SSL_CERT_FILE = /var/lib/marzban-node/ssl_cert.pem -SSL_KEY_FILE = /var/lib/marzban-node/ssl_key.pem -SSL_CLIENT_CERT_FILE = /var/lib/marzban-node/ssl_client_cert.pem - -### can be rest or rpyc -# go version only support rest protocol -# SERVICE_PROTOCOL = rpyc +### can be rest or grpc +# SERVICE_PROTOCOL = grpc # MAX_LOG_PER_REQUEST = 1000 ### for developers # DEBUG = false -# works only when debug is true -# GENERATED_CONFIG_PATH = /var/lib/marzban-node/generated_config-debug.json \ No newline at end of file +# GENERATED_CONFIG_PATH = /var/lib/gozargah-node/generated diff --git a/.github/workflows/docker-build-dev.yml b/.github/workflows/docker-build-dev.yml new file mode 100644 index 0000000..147108e --- /dev/null +++ b/.github/workflows/docker-build-dev.yml @@ -0,0 +1,57 @@ +name: Build and Push Docker Image (All Branches) + +on: + push: + branches: + - '*' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/m03ed/gozargah-node + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + m03ed/gozargah-node:${{ github.ref_name }} + ghcr.io/m03ed/gozargah-node:${{ github.ref_name }} + + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..0c48957 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,64 @@ +name: Build and Push Docker Image (On Release) + +on: + release: + types: [created] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/m03ed/gozargah-node + + - name: Set Docker tags + id: tags + run: | + if [ "${{ github.event.release.prerelease }}" = "true" ]; then + # Pre-release: only version tags + echo "DOCKER_TAGS=m03ed/gozargah-node:${{ github.ref_name }},ghcr.io/m03ed/gozargah-node:${{ github.ref_name }}" >> $GITHUB_ENV + else + # Regular release: version tags + latest tags + echo "DOCKER_TAGS=m03ed/gozargah-node:${{ github.ref_name }},m03ed/gozargah-node:latest,ghcr.io/m03ed/gozargah-node:${{ github.ref_name }},ghcr.io/m03ed/gozargah-node:latest" >> $GITHUB_ENV + fi + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ env.DOCKER_TAGS }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e32a4ba --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,143 @@ +name: Create Release + +on: + release: + types: [created] + +jobs: + build: + permissions: + contents: write + strategy: + matrix: + # Include amd64 on all platforms. + goos: + # - windows + - freebsd + - openbsd + - linux + # - darwin + + goarch: [ amd64, 386 ] + gotoolchain: [ "" ] + patch-assetname: [ "" ] + + # exclude: + + include: + # BEGIN MacOS ARM64 + # - goos: darwin + # goarch: arm64 + # END MacOS ARM64 + # BEGIN Linux ARM 5 6 7 + - goos: linux + goarch: arm + goarm: 7 + - goos: linux + goarch: arm + goarm: 6 + - goos: linux + goarch: arm + goarm: 5 + # END Linux ARM 5 6 7 + # Windows ARM + # - goos: windows + # goarch: arm64 + # - goos: windows + # goarch: arm + # goarm: 7 + # BEGIN Other architectures + # BEGIN ARM64 + - goos: linux + goarch: arm64 + # END ARM64 + #BEGIN riscv64 & LOONG64 + # - goos: linux + # goarch: riscv64 + # - goos: linux + # goarch: loong64 + # END riscv64 & LOONG64 + # BEGIN MIPS + # - goos: linux + # goarch: mips64 + # - goos: linux + # goarch: mips64le + # - goos: linux + # goarch: mipsle + # - goos: linux + # goarch: mips + # END MIPS + # BEGIN PPC + # - goos: linux + # goarch: ppc64 + # - goos: linux + # goarch: ppc64le + # END PPC + # BEGIN FreeBSD ARM + - goos: freebsd + goarch: arm64 + - goos: freebsd + goarch: arm + goarm: 7 + # END FreeBSD ARM + # BEGIN S390X + - goos: linux + goarch: s390x + # END S390X + # END Other architectures + # BEGIN OPENBSD ARM + - goos: openbsd + goarch: arm64 + - goos: openbsd + goarch: arm + goarm: 7 + # END OPENBSD ARM + fail-fast: false + + runs-on: ubuntu-latest + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + GOARM: ${{ matrix.goarm }} + CGO_ENABLED: 0 + steps: + - name: Checkout codebase + uses: actions/checkout@v4 + + - name: Show workflow information + run: | + _GOARM="${GOARM:-""}" + if [ -n "$_GOARM" ]; then + _NAME="${GOOS}-${GOARCH}-${_GOARM}" + else + _NAME="${GOOS}-${GOARCH}" + fi + echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV + echo "BINARY_NAME=gozargah-node-${_NAME}" >> $GITHUB_ENV + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.gotoolchain || '1.24.0' }} + check-latest: true + + - name: Get project dependencies + run: make deps + + - name: Build binary and zip + run: | + make + find . -type f -name "gozargah-node*" -exec mv {} "./gozargah-node-${{ env.ASSET_NAME }}" \; + # Create zip file with max compression and include README & LICENSE + zip -9 "./gozargah-node-${{ env.ASSET_NAME }}.zip" "./gozargah-node-${{ env.ASSET_NAME }}" README.md LICENSE + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./gozargah-node-${{ env.ASSET_NAME }}.zip + asset_name: gozargah-node-${{ env.ASSET_NAME }}.zip + asset_content_type: application/zip diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..7145bac --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,38 @@ +name: Test Modules + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout codebase + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.gotoolchain || '1.24.0' }} + check-latest: true + + - name: Get project dependencies + run: make deps + + - name: Install xray-core + run: make install_xray + + - name: Create certificate + run: | + mkdir certs + make generate_server_cert + make generate_client_cert + + - name: Run tests + run: make test diff --git a/.gitignore b/.gitignore index 00b4e93..bec8b78 100644 --- a/.gitignore +++ b/.gitignore @@ -7,13 +7,14 @@ *.dll *.so *.dylib -*xray.json # Test binary, built with `go test -c` *.test # Output of the go coverage tool, specifically when used with LiteIDE *.out *.idea +./certs +./generated # Dependency directories (remove the comment below to include it) # vendor/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6762a43 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contribute to Gozargah-Node-Go +Thanks for considering contributing to Gozargah! + +## Questions + +Please don't ask your questions in issues. Instead, use one of the following ways to ask: +- Ask on our telegram group: [@Gozargah_Marzban](https://t.me/gozargah_marzban) +- Ask on our [Node GitHub Discussions](https://github.com/m03ed/gozargah_node_go/discussions) for long term discussion or larger questions. +- Ask on our [Marzban GitHub Discussions](https://github.com/gozargah/marzban/discussions) for long term discussion or larger questions. + +## Reporting issues + +Include the following information in your post: +- Describe what you expected to happen. +- Describe what actually happened. Include server logs or any error that browser shows. +- If possible, post your core config file and what you have set in env (by censoring critical information). +- Also tell the version of Marzban, Core and docker (if you use docker) you are using. + +# Submitting a Pull Request +If there is not an open issue for what you want to submit, prefer opening one for discussion before working on a PR. You can work on any issue that doesn't have an open PR linked to it or a maintainer assigned to it. These show up in the sidebar. No need to ask if you can work on an issue that interests you. +
+Before you create a PR, make sure to run tests using the `make test` command to prevent any bugs. + +## Branches +When starting development on this project, please make sure to create a new branch off the `dev` branch. This helps to keep the `main` branch stable and free of any development work that may not be complete or fully tested. + +## Project Structure +``` +├───backend # Backend handler and interfaces +│ └───xray # Xray methods and jobs +│ └───api # Xray API handler +├───common # Proto files and common object structures +├───config # Reads .env configuration +├───controller # Service controllers for managing API interactions +│ ├───rest # REST API protocol methods +│ └───rpc # gRPC protocol methods +├───logger # primary logger for backend logs +└───tools # Standalone utilities with no project dependencies +``` diff --git a/Dockerfile b/Dockerfile index 0bdaddd..6ef7075 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.23 as builder +FROM golang:1.24.0 as builder WORKDIR /app COPY go.mod . @@ -6,17 +6,20 @@ COPY go.sum . RUN go mod download COPY . . -RUN go build -o main . +COPY . . +ARG TARGETOS +ARG TARGETARCH +RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o main -ldflags="-w -s" . + +FROM alpine:latest -FROM ubuntu:latest +RUN apk update && apk add --no-cache make RUN mkdir /app WORKDIR /app COPY --from=builder /app/main . +COPY Makefile . -RUN apt-get update \ - && apt-get install -y curl unzip \ - && rm -rf /var/lib/apt/lists/* \ - && bash -c "$(curl -L https://github.com/Gozargah/Marzban-scripts/raw/master/install_latest_xray.sh)" +RUN make install_xray ENTRYPOINT ["./main", "serve"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c1ef4ba --- /dev/null +++ b/Makefile @@ -0,0 +1,108 @@ +NAME = gozargah-node-$(GOOS)-$(GOARCH) + +LDFLAGS = -s -w -buildid= +PARAMS = -trimpath -ldflags "$(LDFLAGS)" -v +MAIN = ./main.go +PREFIX ?= $(shell go env GOPATH) + +ifeq ($(GOOS),windows) +OUTPUT = $(NAME).exe +ADDITION = go build -o w$(NAME).exe -trimpath -ldflags "-H windowsgui $(LDFLAGS)" -v $(MAIN) +else +OUTPUT = $(NAME) +endif + +ifeq ($(shell echo "$(GOARCH)" | grep -Eq "(mips|mipsle)" && echo true),true) +ADDITION = GOMIPS=softfloat go build -o $(NAME)_softfloat -trimpath -ldflags "$(LDFLAGS)" -v $(MAIN) +endif + +.PHONY: clean build + +build: + go build -o $(OUTPUT) $(PARAMS) $(MAIN) + $(ADDITION) + +clean: + go clean -v -i $(PWD) + rm -f $(NAME)-* w$(NAME)-*.exe + +deps: + go mod download + go mod tidy + +generate_grpc_code: + protoc \ + --go_out=. \ + --go_opt=paths=source_relative \ + --go-grpc_out=. \ + --go-grpc_opt=paths=source_relative \ + common/service.proto + +generate_server_cert: + openssl req -x509 -newkey rsa:4096 -keyout ./certs/ssl_key.pem \ + -out ./certs/ssl_cert.pem -days 36500 -nodes -subj "/CN=Gozargah" + +generate_client_cert: + openssl req -x509 -newkey rsa:4096 -keyout ./certs/ssl_client_key.pem \ + -out ./certs/ssl_client_cert.pem -days 36500 -nodes -subj "/CN=Gozargah" + +UNAME_S := $(shell uname -s) +UNAME_M := $(shell uname -m) +DISTRO := $(shell . /etc/os-release 2>/dev/null && echo $$ID || echo "unknown") + +update_os: +ifeq ($(UNAME_S),Linux) + @echo "Detected OS: Linux" + @echo "Distribution: $(DISTRO)" + + # Debian/Ubuntu + if [ "$(DISTRO)" = "debian" ] || [ "$(DISTRO)" = "ubuntu" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y curl bash; \ + fi + + # Alpine Linux + if [ "$(DISTRO)" = "alpine" ]; then \ + apk update && \ + apk add --no-cache curl bash; \ + fi + + # CentOS/RHEL/Fedora + if [ "$(DISTRO)" = "centos" ] || [ "$(DISTRO)" = "rhel" ] || [ "$(DISTRO)" = "fedora" ]; then \ + sudo yum update -y && \ + sudo yum install -y curl bash; \ + fi + + # Arch Linux + if [ "$(DISTRO)" = "arch" ]; then \ + sudo pacman -Sy --noconfirm curl bash; \ + fi +else + @echo "Unsupported operating system: $(UNAME_S)" + @exit 1 +endif + +install_xray: update_os +ifeq ($(UNAME_S),Linux) + # Debian/Ubuntu, CentOS, Fedora, Arch → Use sudo + if [ "$(DISTRO)" = "debian" ] || [ "$(DISTRO)" = "ubuntu" ] || \ + [ "$(DISTRO)" = "centos" ] || [ "$(DISTRO)" = "rhel" ] || [ "$(DISTRO)" = "fedora" ] || \ + [ "$(DISTRO)" = "arch" ]; then \ + sudo bash -c "$$(curl -L https://github.com/Gozargah/Marzban-scripts/raw/master/install_latest_xray.sh)"; \ + else \ + bash -c "$$(curl -L https://github.com/Gozargah/Marzban-scripts/raw/master/install_latest_xray.sh)"; \ + fi + +else + @echo "Unsupported operating system: $(UNAME_S)" + @exit 1 +endif + +test-integration: + TEST_INTEGRATION=true go test ./... -v -p 1 + +test: + TEST_INTEGRATION=false go test ./... -v -p 1 + +serve: + go run main.go serve \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2f49285 --- /dev/null +++ b/README.md @@ -0,0 +1,158 @@ +# Gozargah-Node-Go +

+ + + + + + +

+ +# Attention ⚠️ +This project is in the testing and development stage. The code may undergo major changes during this phase, so use it at your own risk. + +## Table of Contents + +- [Overview](#overview) + - [Why Use Gozargah Node?](#why-use-gozargah-node) + - [Supported Cores](#supported-cores) +- [Documentation](#documentation) + - [Configuration](#configuration) + - [API](#api) + - [Data Structure](#data-structure) + - [Methods](#methods) +- [Official library](#official-library) + - [Go](#go) + - [Python](#python) +- [Donation](#donation) +- [Contributors](#contributors) + +# Overview + +Gozargah Node is developed by the Gozargah team to replace [Marzban-node](https://github.com/Gozargah/Marzban-node). It aims to be more stable, scalable, and efficient. + +## Why Use Gozargah Node? + +We designed this project to be usable in any project, even without Marzban. You can run nodes with a simple script and the help of official libraries. +We plan to expand supported cores after the testing stage, allowing you to use any core you want. + +## Supported Cores + +| Core | Support | +|:-------------------------------------------------:|---------| +| [xray-core](https://github.com/XTLS/Xray-core) | ✅ | +| [sing-box](https://github.com/SagerNet/sing-box) | ❌ | +| [v2ray-core](https://github.com/v2fly/v2ray-core) | ❌ | + +# Documentation + +## Configuration + +> You can set the settings below using environment variables or by placing them in a `.env` file. + +| Variable | Description | +|:------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `SERVICE_PORT` | Bind application to this port (default: `62050`). | +| `NODE_HOST` | Bind application to this host (default: `127.0.0.1`). | +| `XRAY_EXECUTABLE_PATH` | Path of Xray binary (default: `/usr/local/bin/xray`). | +| `XRAY_ASSETS_PATH` | Path of Xray assets (default: `/usr/local/share/xray`). | +| `SSL_CERT_FILE` | SSL certificate file to secure the application between master and node (it will generate a self-signed SSL if it doesn't exist; better to use a real SSL with a domain). | +| `SSL_KEY_FILE` | SSL key file to secure the application between master and node (it will generate a self-signed SSL if it doesn't exist; better to use a real SSL with a domain). | +| `SSL_CLIENT_CERT_FILE` | SSL certificate file to ensure only allowed clients can connect. | +| `SERVICE_PROTOCOL` | Protocol to use: `grpc` or `rest` (recommended: `grpc`). | +| `MAX_LOG_PER_REQUEST` | Maximum number of logs per request (only for long polling in REST connections). | +| `DEBUG` | Debug mode for development; prints core logs in the node server (default: `False`). | +| `GENERATED_CONFIG_PATH` | Path to the generated config by the node (default: `/var/lib/gozargah-node/generated`). | + +## API + +Gozargah Node supports two types of connection protocols: **gRPC** and **REST API**. +We recommend using **gRPC**, with REST always available as a fallback option (in case there is a problem with gRPC). + +### Data Structure + +The node uses the `common/service.proto` file messages for both protocols. + +| Message | Description | +|:-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `Empty` | Used when no input is required. Can replace `null` with `Empty`. | +| `BaseInfoResponse` | Contains:
- `started` (bool): Indicates if the service is started.
- `core_version` (string): Version of the core.
- `node_version` (string): Version of the node.
- `session_id` (string): Session ID.
- `extra` (string): Additional information. | +| `Vmess` | Contains:
- `id` (string): UUID for Vmess configuration. | +| `Vless` | Contains:
- `id` (string): UUID for Vless configuration.
- `flow` (string): Currently only supports `xtls-rprx-vision`. | +| `Trojan` | Contains:
- `password` (string): Password for Trojan configuration. | +| `Shadowsocks` | Contains:
- `password` (string): Password for Shadowsocks.
- `method` (string): Encryption method. Supported methods: `aes-128-gcm`, `aes-256-gcm`, `chacha20-poly1305`, `xchacha20-poly1305`. | +| `Proxy` | Contains:
- `vmess` (Vmess): Vmess configuration.
- `vless` (Vless): Vless configuration.
- `trojan` (Trojan): Trojan configuration.
- `shadowsocks` (Shadowsocks): Shadowsocks configuration. | +| `User` | Contains:
- `email` (string): User's email.
- `proxies` (Proxy): Proxy configurations.
- `inbounds` ([]string): List of inbounds. | +| `BackendType` | Enum:
- `XRAY = 0`: Represents the Xray backend type. | +| `Backend` | Contains:
- `type` (BackendType): Type of backend.
- `config` (string): Configuration for the backend.
- `users` ([]User): List of users. | +| `Log` | Contains:
- `detail` (string): Log details. | +| `Stat` | Contains:
- `name` (string): Stat name.
- `type` (string): Stat type.
- `link` (string): Link associated with the stat.
- `value` (int64): Stat value. | +| `StatResponse` | Contains:
- `stats` ([]Stat): List of stats. | +| `StatRequest` | Contains:
- `name` (string): Name of the stat to request, user email or inbound \ outbound tag.
- `reset` (bool) Whether to reset traffic stats. | +| `OnlineStatResponse` | Contains:
- `email` (string): User's email.
- `value` (int64): Online stat value. | +| `BackendStatsResponse` | Contains:
- `num_goroutine` (uint32): Number of goroutines.
- `num_gc` (uint32): Number of garbage collections.
- `alloc` (uint64): Allocated memory.
- `total_alloc` (uint64): Total allocated memory.
- `sys` (uint64): System memory.
- `mallocs` (uint64): Number of mallocs.
- `frees` (uint64): Number of frees.
- `live_objects` (uint64): Number of live objects.
- `pause_total_ns` (uint64): Total pause time in nanoseconds.
- `uptime` (uint32): Uptime in seconds. | +| `SystemStatsResponse` | Contains:
- `mem_total` (uint64): Total memory.
- `mem_used` (uint64): Used memory.
- `cpu_cores` (uint64): Number of CPU cores.
- `cpu_usage` (double): CPU usage percentage.
- `incoming_bandwidth_speed` (uint64): Incoming bandwidth speed.
- `outgoing_bandwidth_speed` (uint64): Outgoing bandwidth speed. | +| `Users` | Contains:
- `users` ([]User): List of users. | + +**Note:** The node receives data with `x-protobuf` as the content type in the **REST API**. + +### Methods + +- Add `address:port` at the beginning of the **REST API** URL. +- Use `Authorization Bearer ` in the header for authentication with the **REST API**. +- Use `authorization Bearer ` in metadata for authentication with **gRPC**. + +| gRPC | REST | Input | Output | Description | +|:-----------------------|:---------------------------|---------------|--------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `Start()` | `POST`,`/start` | `Backend` | `BaseInfoResponse` | This is the only method called before creating a connection. | +| `Stop()` | `PUT`,`/stop` | `Empty` | `Empty` | Stops the backend and deactivates the connection with the client. | +| `GetBaseInfo()` | `GET`,`/info` | `Empty` | `BaseInfoResponse` | Returns base info; can be used to check the connection between the node and client. | +| `GetLogs()` | `GET`,`/logs` | `Empty` | gRPC: (stream `Log`)
REST API: (`SSE`) | This method is a `SSE` connection in the REST protocol, but in gRPC, it provides a stream connection. | +| `GetSystemStats()` | `GET`,`/stats/system` | `Empty` | `SystemStatsResponse` | Retrieves system statistics. | +| `GetBackendStats()` | `GET`,`/stats/backend` | `Empty` | `BackendStatsResponse` | Retrieves backend statistics. | +| `GetOutboundsStats()` | `GET`, `/stats/outbounds` | `StatRequest` | `StatResponse` | Retrieves outbound statistics. The `name` field in the request will be ignored. | +| `GetOutboundStats()` | `GET`,`/stats/outbound` | `StatRequest` | `StatResponse` | Retrieves statistics for a specific outbound. | +| `GetInboundsStats()` | `GET`,`/stats/inbounds` | `StatRequest` | `StatResponse` | Retrieves inbound statistics. The `name` field in the request will be ignored. | +| `GetInboundStats()` | `GET`,`/stats/inbound` | `StatRequest` | `StatResponse` | Retrieves statistics for a specific inbound. | +| `GetUsersStats()` | `GET`,`/stats/users` | `StatRequest` | `StatResponse` | Retrieves user statistics and resets traffic stats. The `name` field in the request will be ignored. | +| `GetUserStats()` | `GET`,`/stats/user` | `StatRequest` | `StatResponse` | Retrieves statistics for a specific user. | +| `GetUserOnlineStats()` | `GET`,`/stats/user/online` | `StatRequest` | `StatResponse` | Retrieves online statistics for a specific user. The `reset` field in the request will be ignored | +| `SyncUser()` | `PUT`,`/user/sync` | `User` | `Empty` | Adds/updates/removes a user in the core. To remove a user, ensure you send empty inbounds. Provides a stream in `gRPC` but must be called for each user in the `REST API`. | +| `SyncUsers()` | `PUT`,`/users/sync` | `Users` | `Empty` | Removes all old users and replaces them with the provided users. | + +# Official library +We create some library's for you so make your job easier + +## Go +[gozargah-node-bridge](https://github.com/m03ed/gozargah_node_bridge) + +To add bridge to your project use: +```shell +go get github.com/m03ed/gozargah_node_bridge +``` +## Python +[gozargah-node-bridge-py](https://github.com/m03ed/gozargah_node_bridge_py) +```shell +pip install gozargah-node-bridge +``` + +# Donation +You can help gozargah team with your donations, [Click Here](https://donate.gozargah.pro) + +# Contributors + +We ❤️‍🔥 contributors! If you'd like to contribute, please check out our [Contributing Guidelines](CONTRIBUTING.md) and feel free to submit a pull request or open an issue. We also welcome you to join our [Telegram](https://t.me/gozargah_marzban) group for either support or contributing guidance. + +Check [open issues](https://github.com/m03ed/gozargah-node/issues) to help the progress of this project. + +

+Thanks to the all contributors who have helped improve Gozargah Node: +

+

+ + + +

+

+ Made with contrib.rocks +

\ No newline at end of file diff --git a/backend/backend.go b/backend/backend.go new file mode 100644 index 0000000..723470d --- /dev/null +++ b/backend/backend.go @@ -0,0 +1,26 @@ +package backend + +import ( + "context" + + "github.com/m03ed/gozargah-node/common" +) + +type Backend interface { + Started() bool + GetVersion() string + GetLogs() chan string + Restart() error + Shutdown() + GenerateConfigFile() error + SyncUser(context.Context, *common.User) error + SyncUsers(context.Context, []*common.User) error + GetSysStats(context.Context) (*common.BackendStatsResponse, error) + GetUsersStats(context.Context, bool) (*common.StatResponse, error) + GetUserStats(context.Context, string, bool) (*common.StatResponse, error) + GetStatOnline(context.Context, string) (*common.OnlineStatResponse, error) + GetOutboundsStats(context.Context, bool) (*common.StatResponse, error) + GetOutboundStats(context.Context, string, bool) (*common.StatResponse, error) + GetInboundsStats(context.Context, bool) (*common.StatResponse, error) + GetInboundStats(context.Context, string, bool) (*common.StatResponse, error) +} diff --git a/backend/config.go b/backend/config.go new file mode 100644 index 0000000..55819ef --- /dev/null +++ b/backend/config.go @@ -0,0 +1,11 @@ +package backend + +type Config interface { + ToJSON() (string, error) + ApplyAPI(int) error + RemoveLogFiles() (string, string) +} + +type ConfigKey struct{} + +type UsersKey struct{} diff --git a/backend/core.go b/backend/core.go new file mode 100644 index 0000000..e4355f1 --- /dev/null +++ b/backend/core.go @@ -0,0 +1,7 @@ +package backend + +type Core interface { + GetVersion() string + Started() bool + GetLogs() chan string +} diff --git a/backend/handler.go b/backend/handler.go new file mode 100644 index 0000000..674d4a1 --- /dev/null +++ b/backend/handler.go @@ -0,0 +1,13 @@ +package backend + +import ( + "context" + "github.com/m03ed/gozargah-node/common" +) + +type Handler interface { + GetSysStats(context.Context) (*common.BackendStatsResponse, error) + GetUsersStats(context.Context, bool) (*common.StatResponse, error) + GetOutboundsStats(context.Context, bool) (*common.StatResponse, error) + GetInboundsStats(context.Context, bool) (*common.StatResponse, error) +} diff --git a/backend/xray/api/account.go b/backend/xray/api/account.go new file mode 100644 index 0000000..196d8f0 --- /dev/null +++ b/backend/xray/api/account.go @@ -0,0 +1,185 @@ +package api + +import ( + "github.com/google/uuid" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/shadowsocks" + "github.com/xtls/xray-core/proxy/shadowsocks_2022" + "github.com/xtls/xray-core/proxy/trojan" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vmess" + + "github.com/m03ed/gozargah-node/common" +) + +type Account interface { + GetEmail() string + GetLevel() uint32 + Message() (*serial.TypedMessage, error) +} + +type BaseAccount struct { + Email string `json:"email"` + Level uint32 `json:"level"` +} + +func (ba *BaseAccount) GetEmail() string { + return ba.Email +} + +func (ba *BaseAccount) GetLevel() uint32 { + return ba.Level +} + +type VmessAccount struct { + BaseAccount + ID uuid.UUID `json:"id"` +} + +func (va *VmessAccount) Message() (*serial.TypedMessage, error) { + return ToTypedMessage(&vmess.Account{Id: va.ID.String()}) +} + +func NewVmessAccount(user *common.User) (*VmessAccount, error) { + id, err := uuid.Parse(user.GetProxies().GetVmess().GetId()) + if err != nil { + return nil, err + } + return &VmessAccount{ + BaseAccount: BaseAccount{ + Email: user.GetEmail(), + Level: 0, + }, + ID: id, + }, nil +} + +type VlessAccount struct { + BaseAccount + ID uuid.UUID `json:"id"` + Flow string `json:"flow"` +} + +func (va *VlessAccount) Message() (*serial.TypedMessage, error) { + return ToTypedMessage(&vless.Account{Id: va.ID.String(), Flow: va.Flow}) +} + +func NewVlessAccount(user *common.User) (*VlessAccount, error) { + id, err := uuid.Parse(user.GetProxies().GetVless().GetId()) + if err != nil { + return nil, err + } + return &VlessAccount{ + BaseAccount: BaseAccount{ + Email: user.GetEmail(), + Level: 0, + }, + ID: id, + Flow: user.GetProxies().GetVless().GetFlow(), + }, nil +} + +type TrojanAccount struct { + BaseAccount + Password string `json:"password"` +} + +func (ta *TrojanAccount) Message() (*serial.TypedMessage, error) { + return ToTypedMessage(&trojan.Account{Password: ta.Password}) +} + +func NewTrojanAccount(user *common.User) *TrojanAccount { + return &TrojanAccount{ + BaseAccount: BaseAccount{ + Email: user.GetEmail(), + Level: 0, + }, + Password: user.GetProxies().GetTrojan().GetPassword(), + } +} + +type CipherType int32 + +const ( + CipherType_AES_128_GCM CipherType = 5 + CipherType_AES_256_GCM CipherType = 6 + CipherType_CHACHA20_POLY1305 CipherType = 7 + CipherType_XCHACHA20_POLY1305 CipherType = 8 + CipherType_NONE CipherType = 9 +) + +// Enum value maps for CipherType. +var ( + CipherType_name = map[int32]string{ + 5: "aes-128-gcm", + 6: "aes-256-gcm", + 7: "chacha20-poly1305", + 8: "xchacha20-poly1305", + 9: "none", + } + CipherType_value = map[string]int32{ + "aes-128-gcm": 5, + "aes-256-gcm": 6, + "chacha20-poly1305": 7, + "xchacha20-poly1305": 8, + "none": 9, + } +) + +type ShadowsocksAccount struct { + BaseAccount + Password string `json:"password"` +} + +func (sa *ShadowsocksAccount) Message() (*serial.TypedMessage, error) { + return ToTypedMessage(&shadowsocks_2022.Account{Key: sa.Password}) +} + +func NewShadowsocksAccount(user *common.User) *ShadowsocksAccount { + return &ShadowsocksAccount{ + BaseAccount: BaseAccount{ + Email: user.GetEmail(), + Level: 0, + }, + Password: user.GetProxies().GetShadowsocks().GetPassword(), + } +} + +type ShadowsocksTcpAccount struct { + ShadowsocksAccount + Method string `json:"method"` +} + +func (sa *ShadowsocksTcpAccount) CipherType() string { + return sa.Method +} + +func (sa *ShadowsocksTcpAccount) Message() (*serial.TypedMessage, error) { + return ToTypedMessage(&shadowsocks.Account{Password: sa.Password, CipherType: shadowsocks.CipherType(CipherType_value[sa.Method])}) +} + +func NewShadowsocksTcpAccount(user *common.User) *ShadowsocksTcpAccount { + method := user.GetProxies().GetShadowsocks().GetMethod() + if _, ok := CipherType_value[method]; !ok { + method = CipherType_name[9] + } + + return &ShadowsocksTcpAccount{ + ShadowsocksAccount: ShadowsocksAccount{ + BaseAccount: BaseAccount{ + Email: user.GetEmail(), + Level: 0, + }, + Password: user.GetProxies().GetShadowsocks().GetPassword(), + }, + Method: method, + } +} + +type ProxySettings struct { + Vmess *VmessAccount + Vless *VlessAccount + Trojan *TrojanAccount + Shadowsocks *ShadowsocksTcpAccount + Shadowsocks2022 *ShadowsocksAccount +} diff --git a/xray_api/base.go b/backend/xray/api/base.go similarity index 74% rename from xray_api/base.go rename to backend/xray/api/base.go index 792b502..7615fc1 100644 --- a/xray_api/base.go +++ b/backend/xray/api/base.go @@ -1,21 +1,21 @@ -package xray_api +package api import ( "fmt" + "github.com/xtls/xray-core/app/proxyman/command" + statsService "github.com/xtls/xray-core/app/stats/command" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" - "marzban-node/xray_api/proto/app/proxyman/command" - statsService "marzban-node/xray_api/proto/app/stats/command" ) -type XrayAPI struct { +type XrayHandler struct { HandlerServiceClient *command.HandlerServiceClient StatsServiceClient *statsService.StatsServiceClient GrpcClient *grpc.ClientConn } -func NewXrayAPI(apiPort int) (*XrayAPI, error) { - x := &XrayAPI{} +func NewXrayAPI(apiPort int) (*XrayHandler, error) { + x := &XrayHandler{} var err error x.GrpcClient, err = grpc.NewClient(fmt.Sprintf("127.0.0.1:%v", apiPort), grpc.WithTransportCredentials(insecure.NewCredentials())) @@ -32,7 +32,7 @@ func NewXrayAPI(apiPort int) (*XrayAPI, error) { return x, nil } -func (x *XrayAPI) Close() { +func (x *XrayHandler) Close() { if x.GrpcClient != nil { x.GrpcClient.Close() } diff --git a/xray_api/types/message.go b/backend/xray/api/message.go similarity index 83% rename from xray_api/types/message.go rename to backend/xray/api/message.go index aafd5ab..685e930 100644 --- a/xray_api/types/message.go +++ b/backend/xray/api/message.go @@ -1,9 +1,8 @@ -package types +package api import ( + "github.com/xtls/xray-core/common/serial" "google.golang.org/protobuf/proto" - - "marzban-node/xray_api/proto/common/serial" ) func ToTypedMessage(account proto.Message) (*serial.TypedMessage, error) { diff --git a/xray_api/proxyman.go b/backend/xray/api/proxyman.go similarity index 58% rename from xray_api/proxyman.go rename to backend/xray/api/proxyman.go index 3203023..4e75cc6 100644 --- a/xray_api/proxyman.go +++ b/backend/xray/api/proxyman.go @@ -1,14 +1,13 @@ -package xray_api +package api import ( "context" - "marzban-node/xray_api/proto/app/proxyman/command" - "marzban-node/xray_api/proto/common/protocol" - "marzban-node/xray_api/proto/common/serial" - "marzban-node/xray_api/types" + "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" ) -func (x *XrayAPI) AlertInbound(ctx context.Context, tag string, operation *serial.TypedMessage) error { +func (x *XrayHandler) AlertInbound(ctx context.Context, tag string, operation *serial.TypedMessage) error { client := *x.HandlerServiceClient _, err := client.AlterInbound(ctx, &command.AlterInboundRequest{Tag: tag, Operation: operation}) if err != nil { @@ -17,7 +16,7 @@ func (x *XrayAPI) AlertInbound(ctx context.Context, tag string, operation *seria return nil } -func (x *XrayAPI) AlertOutbound(ctx context.Context, tag string, operation *serial.TypedMessage) error { +func (x *XrayHandler) AlertOutbound(ctx context.Context, tag string, operation *serial.TypedMessage) error { client := *x.HandlerServiceClient _, err := client.AlterOutbound(ctx, &command.AlterOutboundRequest{Tag: tag, Operation: operation}) if err != nil { @@ -26,13 +25,13 @@ func (x *XrayAPI) AlertOutbound(ctx context.Context, tag string, operation *seri return nil } -func (x *XrayAPI) AddInboundUser(ctx context.Context, tag string, user types.Account) error { +func (x *XrayHandler) AddInboundUser(ctx context.Context, tag string, user Account) error { // Create the AddUserOperation message account, err := user.Message() if err != nil { return err } - operation, err := types.ToTypedMessage(&command.AddUserOperation{ + operation, err := ToTypedMessage(&command.AddUserOperation{ User: &protocol.User{ Level: user.GetLevel(), Email: user.GetEmail(), @@ -47,8 +46,8 @@ func (x *XrayAPI) AddInboundUser(ctx context.Context, tag string, user types.Acc return x.AlertInbound(ctx, tag, operation) } -func (x *XrayAPI) RemoveInboundUser(ctx context.Context, tag, email string) error { - operation, err := types.ToTypedMessage(&command.RemoveUserOperation{ +func (x *XrayHandler) RemoveInboundUser(ctx context.Context, tag, email string) error { + operation, err := ToTypedMessage(&command.RemoveUserOperation{ Email: email, }) if err != nil { @@ -59,13 +58,13 @@ func (x *XrayAPI) RemoveInboundUser(ctx context.Context, tag, email string) erro return x.AlertInbound(ctx, tag, operation) } -func (x *XrayAPI) AddOutboundUser(ctx context.Context, tag string, user types.Account) error { +func (x *XrayHandler) AddOutboundUser(ctx context.Context, tag string, user Account) error { // Create the AddUserOperation message account, err := user.Message() if err != nil { return err } - operation, err := types.ToTypedMessage(&command.AddUserOperation{ + operation, err := ToTypedMessage(&command.AddUserOperation{ User: &protocol.User{ Level: user.GetLevel(), Email: user.GetEmail(), @@ -80,8 +79,8 @@ func (x *XrayAPI) AddOutboundUser(ctx context.Context, tag string, user types.Ac return x.AlertOutbound(ctx, tag, operation) } -func (x *XrayAPI) RemoveOutboundUser(ctx context.Context, tag, email string) error { - operation, err := types.ToTypedMessage(&command.RemoveUserOperation{ +func (x *XrayHandler) RemoveOutboundUser(ctx context.Context, tag, email string) error { + operation, err := ToTypedMessage(&command.RemoveUserOperation{ Email: email, }) if err != nil { diff --git a/backend/xray/api/stats.go b/backend/xray/api/stats.go new file mode 100644 index 0000000..8f07a4c --- /dev/null +++ b/backend/xray/api/stats.go @@ -0,0 +1,218 @@ +package api + +import ( + "context" + "fmt" + "strings" + + "github.com/xtls/xray-core/app/stats/command" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/m03ed/gozargah-node/common" +) + +func (x *XrayHandler) GetSysStats(ctx context.Context) (*common.BackendStatsResponse, error) { + client := *x.StatsServiceClient + resp, err := client.GetSysStats(ctx, &command.SysStatsRequest{}) + if err != nil { + return nil, status.Errorf(codes.Unknown, "failed to get sys stats: %v", err) + } + + return &common.BackendStatsResponse{ + NumGoroutine: resp.NumGoroutine, + NumGc: resp.NumGC, + Alloc: resp.Alloc, + TotalAlloc: resp.TotalAlloc, + Sys: resp.Sys, + Mallocs: resp.Mallocs, + Frees: resp.Frees, + LiveObjects: resp.LiveObjects, + PauseTotalNs: resp.PauseTotalNs, + Uptime: resp.Uptime, + }, nil +} + +func (x *XrayHandler) QueryStats(ctx context.Context, pattern string, reset bool) (*command.QueryStatsResponse, error) { + client := *x.StatsServiceClient + resp, err := client.QueryStats(ctx, &command.QueryStatsRequest{Pattern: pattern, Reset_: reset}) + if err != nil { + return nil, err + } + + return resp, nil +} + +func (x *XrayHandler) GetStatOnline(ctx context.Context, email string) (*common.OnlineStatResponse, error) { + client := *x.StatsServiceClient + resp, err := client.GetStatsOnline(ctx, &command.GetStatsRequest{Name: email}) + if err != nil { + return nil, err + } + + return &common.OnlineStatResponse{Email: email, Value: resp.GetStat().Value}, nil +} + +func (x *XrayHandler) GetUsersStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("user>>>"), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + // Extract the type from the name (e.g., "traffic") + parts := strings.Split(data, ">>>") + name := parts[1] + link := parts[2] + statType := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} + +func (x *XrayHandler) GetInboundsStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("inbound>>>"), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + // Extract the type from the name (e.g., "traffic") + parts := strings.Split(data, ">>>") + name := parts[1] + link := parts[2] + statType := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} + +func (x *XrayHandler) GetOutboundsStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("outbound>>>"), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + parts := strings.Split(data, ">>>") + name := parts[1] + statType := parts[2] + link := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} + +func (x *XrayHandler) GetUserStats(ctx context.Context, email string, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("user>>>%s>>>", email), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + parts := strings.Split(data, ">>>") + name := parts[1] + statType := parts[2] + link := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} + +func (x *XrayHandler) GetInboundStats(ctx context.Context, tag string, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("inbound>>>%s>>>", tag), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + parts := strings.Split(data, ">>>") + name := parts[1] + statType := parts[2] + link := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} + +func (x *XrayHandler) GetOutboundStats(ctx context.Context, tag string, reset bool) (*common.StatResponse, error) { + resp, err := x.QueryStats(ctx, fmt.Sprintf("outbound>>>%s>>>", tag), reset) + if err != nil { + return nil, err + } + + stats := &common.StatResponse{} + for _, stat := range resp.GetStat() { + data := stat.GetName() + value := stat.GetValue() + + parts := strings.Split(data, ">>>") + name := parts[1] + statType := parts[2] + link := parts[3] + + stats.Stats = append(stats.Stats, &common.Stat{ + Name: name, + Type: statType, + Link: link, + Value: value, + }) + } + + return stats, nil +} diff --git a/backend/xray/config.go b/backend/xray/config.go new file mode 100644 index 0000000..bcfcec6 --- /dev/null +++ b/backend/xray/config.go @@ -0,0 +1,416 @@ +package xray + +import ( + "encoding/json" + "log" + "slices" + "strings" + "sync" + + "github.com/m03ed/gozargah-node/backend/xray/api" + "github.com/m03ed/gozargah-node/common" + "github.com/xtls/xray-core/infra/conf" +) + +type Protocol string + +const ( + Vmess = "vmess" + Vless = "vless" + Trojan = "trojan" + Shadowsocks = "shadowsocks" +) + +type Config struct { + LogConfig *conf.LogConfig `json:"log"` + RouterConfig map[string]interface{} `json:"routing"` + DNSConfig map[string]interface{} `json:"dns"` + InboundConfigs []*Inbound `json:"inbounds"` + OutboundConfigs interface{} `json:"outbounds"` + Policy *conf.PolicyConfig `json:"policy"` + API *conf.APIConfig `json:"api"` + Metrics map[string]interface{} `json:"metrics,omitempty"` + Stats Stats `json:"stats"` + Reverse map[string]interface{} `json:"reverse,omitempty"` + FakeDNS map[string]interface{} `json:"fakeDns,omitempty"` + Observatory map[string]interface{} `json:"observatory,omitempty"` + BurstObservatory map[string]interface{} `json:"burstObservatory,omitempty"` +} + +type Inbound struct { + Tag string `json:"tag"` + Listen string `json:"listen,omitempty"` + Port interface{} `json:"port,omitempty"` + Protocol string `json:"protocol"` + Settings map[string]interface{} `json:"settings"` + StreamSettings map[string]interface{} `json:"streamSettings,omitempty"` + Sniffing interface{} `json:"sniffing,omitempty"` + Allocation map[string]interface{} `json:"allocate,omitempty"` + mu sync.RWMutex +} + +func (c *Config) syncUsers(users []*common.User) { + for _, i := range c.InboundConfigs { + i.syncUsers(users) + } +} + +func (i *Inbound) syncUsers(users []*common.User) { + i.mu.Lock() + defer i.mu.Unlock() + + switch i.Protocol { + case Vmess: + var clients []*api.VmessAccount + for _, user := range users { + if user.GetProxies().GetVmess() == nil { + continue + } + account, err := api.NewVmessAccount(user) + if err != nil { + log.Println("error for user", user.GetEmail(), ":", err) + } + if slices.Contains(user.Inbounds, i.Tag) { + clients = append(clients, account) + } + } + i.Settings["clients"] = clients + + case Vless: + var clients []*api.VlessAccount + for _, user := range users { + if user.GetProxies().GetVless() == nil { + continue + } + account, err := api.NewVlessAccount(user) + if err != nil { + log.Println("error for user", user.GetEmail(), ":", err) + } + if newAccount, active := isActiveInbound(i, user.GetInbounds(), api.ProxySettings{Vless: account}); active { + clients = append(clients, newAccount.(*api.VlessAccount)) + } + } + i.Settings["clients"] = clients + + case Trojan: + var clients []*api.TrojanAccount + for _, user := range users { + if user.GetProxies().GetTrojan() == nil { + continue + } + if slices.Contains(user.Inbounds, i.Tag) { + clients = append(clients, api.NewTrojanAccount(user)) + } + } + i.Settings["clients"] = clients + + case Shadowsocks: + method, methodOk := i.Settings["method"].(string) + if methodOk && strings.HasPrefix("2022-blake3", method) { + var clients []*api.ShadowsocksAccount + for _, user := range users { + if user.GetProxies().GetShadowsocks() == nil { + continue + } + if slices.Contains(user.Inbounds, i.Tag) { + clients = append(clients, api.NewShadowsocksAccount(user)) + } + } + i.Settings["clients"] = clients + + } else { + clients := []*api.ShadowsocksTcpAccount{} + for _, user := range users { + if user.GetProxies().GetShadowsocks() == nil { + continue + } + if slices.Contains(user.Inbounds, i.Tag) { + clients = append(clients, api.NewShadowsocksTcpAccount(user)) + } + } + i.Settings["clients"] = clients + } + } +} + +func (i *Inbound) updateUser(account api.Account) { + i.mu.Lock() + defer i.mu.Unlock() + + email := account.GetEmail() + switch account.(type) { + case *api.VmessAccount: + clients, ok := i.Settings["clients"].([]*api.VmessAccount) + if !ok { + clients = []*api.VmessAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + + i.Settings["clients"] = append(clients, account.(*api.VmessAccount)) + + case *api.VlessAccount: + clients, ok := i.Settings["clients"].([]*api.VlessAccount) + if !ok { + clients = []*api.VlessAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + + i.Settings["clients"] = append(clients, account.(*api.VlessAccount)) + + case *api.TrojanAccount: + clients, ok := i.Settings["clients"].([]*api.TrojanAccount) + if !ok { + clients = []*api.TrojanAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + + i.Settings["clients"] = append(clients, account.(*api.TrojanAccount)) + + case *api.ShadowsocksTcpAccount: + clients, ok := i.Settings["clients"].([]*api.ShadowsocksTcpAccount) + if !ok { + clients = []*api.ShadowsocksTcpAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + + i.Settings["clients"] = append(clients, account.(*api.ShadowsocksTcpAccount)) + + case *api.ShadowsocksAccount: + clients, ok := i.Settings["clients"].([]*api.ShadowsocksAccount) + if !ok { + clients = []*api.ShadowsocksAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + + i.Settings["clients"] = append(clients, account.(*api.ShadowsocksAccount)) + + default: + return + } +} + +func (i *Inbound) removeUser(email string) { + i.mu.Lock() + defer i.mu.Unlock() + + switch Protocol(i.Protocol) { + case Vmess: + clients, ok := i.Settings["clients"].([]*api.VmessAccount) + if !ok { + clients = []*api.VmessAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + i.Settings["clients"] = clients + + case Vless: + clients, ok := i.Settings["clients"].([]*api.VlessAccount) + if !ok { + clients = []*api.VlessAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + i.Settings["clients"] = clients + + case Trojan: + clients, ok := i.Settings["clients"].([]*api.TrojanAccount) + if !ok { + clients = []*api.TrojanAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + i.Settings["clients"] = clients + + case Shadowsocks: + method, methodOk := i.Settings["method"].(string) + if methodOk && strings.HasPrefix("2022-blake3", method) { + clients, ok := i.Settings["clients"].([]*api.ShadowsocksAccount) + if !ok { + clients = []*api.ShadowsocksAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + i.Settings["clients"] = clients + + } else { + clients, ok := i.Settings["clients"].([]*api.ShadowsocksTcpAccount) + if !ok { + clients = []*api.ShadowsocksTcpAccount{} + } + + for x, client := range clients { + if client.Email == email { + clients = append(clients[:x], clients[x+1:]...) + break + } + } + i.Settings["clients"] = clients + } + default: + return + } +} + +type Stats struct{} + +func (c *Config) ToJSON() (string, error) { + for _, i := range c.InboundConfigs { + i.mu.RLock() + defer i.mu.RUnlock() + } + + b, err := json.Marshal(c) + if err != nil { + return "", err + } + return string(b), nil +} + +func (c *Config) ApplyAPI(apiPort int) error { + // Remove the existing inbound with the API_INBOUND tag + for i, inbound := range c.InboundConfigs { + if inbound.Tag == "API_INBOUND" { + c.InboundConfigs = append(c.InboundConfigs[:i], c.InboundConfigs[i+1:]...) + } + } + + if c.API == nil { + c.API = &conf.APIConfig{ + Services: []string{"HandlerService", "LoggerService", "StatsService"}, + Tag: "API", + } + } + + rules, ok := c.RouterConfig["rules"].([]map[string]interface{}) + if c.API.Tag != "" { + apiTag := c.API.Tag + if ok { + for i, rule := range rules { + if outboundTag, ok := rule["outboundTag"].(string); ok && outboundTag == apiTag { + rules = append(rules[:i], rules[i+1:]...) + } + } + } else { + // Initialize RouterConfig if it's nil + if c.RouterConfig == nil { + c.RouterConfig = make(map[string]interface{}) + } + // Set a default empty slice of rules + c.RouterConfig["rules"] = []map[string]interface{}{} + } + } + + c.checkPolicy() + + inbound := &Inbound{ + Listen: "127.0.0.1", + Port: apiPort, + Protocol: "dokodemo-door", + Settings: map[string]interface{}{"address": "127.0.0.1"}, + Tag: "API_INBOUND", + } + + c.InboundConfigs = append([]*Inbound{inbound}, c.InboundConfigs...) + + rule := map[string]interface{}{ + "inboundTag": []string{"API_INBOUND"}, + "source": []string{"127.0.0.1"}, + "outboundTag": "API", + "type": "field", + } + + c.RouterConfig["rules"] = append([]map[string]interface{}{rule}, rules...) + + return nil +} + +func (c *Config) checkPolicy() { + if c.Policy != nil { + zero, ok := c.Policy.Levels[0] + if !ok { + c.Policy.Levels[0] = &conf.Policy{StatsUserUplink: true, StatsUserDownlink: true} + } else { + zero.StatsUserDownlink = true + zero.StatsUserUplink = true + } + } else { + c.Policy = &conf.PolicyConfig{Levels: make(map[uint32]*conf.Policy)} + c.Policy.Levels[0] = &conf.Policy{StatsUserUplink: true, StatsUserDownlink: true} + } + + c.Policy.System = &conf.SystemPolicy{ + StatsInboundDownlink: false, + StatsInboundUplink: false, + StatsOutboundDownlink: true, + StatsOutboundUplink: true, + } +} + +func (c *Config) RemoveLogFiles() (accessFile, errorFile string) { + accessFile = c.LogConfig.AccessLog + c.LogConfig.AccessLog = "" + errorFile = c.LogConfig.ErrorLog + c.LogConfig.ErrorLog = "" + + return accessFile, errorFile +} + +func NewXRayConfig(config string) (*Config, error) { + var xrayConfig Config + err := json.Unmarshal([]byte(config), &xrayConfig) + if err != nil { + return nil, err + } + + return &xrayConfig, nil +} diff --git a/backend/xray/config.json b/backend/xray/config.json new file mode 100644 index 0000000..4efb9a8 --- /dev/null +++ b/backend/xray/config.json @@ -0,0 +1,178 @@ +{ + "log": { + "loglevel": "warning" + }, + "inbounds": [ + { + "tag": "Shadowsocks TCP", + "listen": "0.0.0.0", + "port": 4080, + "protocol": "shadowsocks", + "settings": { + "password": "password", + "clients": [], + "network": "tcp,udp" + } + }, + { + "tag": "Shadowsocks 2024", + "port": 1234, + "protocol": "shadowsocks", + "settings": { + "method": "2022-blake3-aes-128-gcm", + "password": "sMLi2fSOqrmrYArJZbLhfH8LcaE5s0kHf4CdebqVLdg=", + "clients": [], + "network": "tcp,udp" + } + }, + { + "tag": "VLESS TCP REALITY", + "listen": "0.0.0.0", + "port": 7878, + "protocol": "vless", + "settings": { + "clients": [], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "tcpSettings": {}, + "security": "reality", + "realitySettings": { + "show": false, + "dest": 22654, + "xver": 1, + "serverNames": [ + "speedtest.net" + ], + "privateKey": "eLYejRceHJVL6aGGLXRIEB5GDDdWwztq0Nu0Dxp0zlM", + "shortIds": [ + "074e71788d28fd03" + ] + } + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "VLESS TCP NOTLS", + "listen": "0.0.0.0", + "port": 4435, + "protocol": "vless", + "settings": { + "clients": [], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "tcpSettings": {}, + "security": "none" + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "VLESS TCP Header NoTLS", + "listen": "0.0.0.0", + "port": 4436, + "protocol": "vless", + "settings": { + "clients": [], + "decryption": "none" + }, + "streamSettings": { + "network": "tcp", + "tcpSettings": { + "header": { + "type": "http", + "request": { + "method": "GET", + "path": [ + "/" + ], + "headers": { + "Host": [ + "cloudflare.com" + ] + } + }, + "response": {} + } + }, + "security": "none" + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "VMESS TCP NOTLS", + "listen": "0.0.0.0", + "port": "4433", + "protocol": "vmess", + "settings": { + "clients": [] + }, + "streamSettings": { + "network": "tcp" + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + }, + { + "tag": "TROJAN TCP NOTLS", + "listen": "0.0.0.0", + "port": "4434", + "protocol": "trojan", + "settings": { + "clients": [] + }, + "streamSettings": { + "network": "tcp", + "tcpSettings": {}, + "security": "none" + }, + "sniffing": { + "enabled": true, + "destOverride": [ + "http", + "tls", + "quic" + ] + } + } + ], + "outbounds": [ + { + "protocol": "freedom", + "tag": "direct" + }, + { + "protocol": "blackhole", + "tag": "BLOCK" + } + ] +} \ No newline at end of file diff --git a/backend/xray/core.go b/backend/xray/core.go new file mode 100644 index 0000000..626167a --- /dev/null +++ b/backend/xray/core.go @@ -0,0 +1,187 @@ +package xray + +import ( + "bytes" + "context" + "errors" + "log" + "os" + "os/exec" + "path/filepath" + "regexp" + "sync" + + nodeLogger "github.com/m03ed/gozargah-node/logger" +) + +type Core struct { + executablePath string + assetsPath string + configPath string + version string + process *exec.Cmd + restarting bool + logsChan chan string + cancelFunc context.CancelFunc + mu sync.Mutex +} + +func NewXRayCore(executablePath, assetsPath, configPath string) (*Core, error) { + core := &Core{ + executablePath: executablePath, + assetsPath: assetsPath, + configPath: configPath, + logsChan: make(chan string), + } + + version, err := core.refreshVersion() + if err != nil { + return nil, err + } + core.setVersion(version) + + return core, nil +} + +func (c *Core) refreshVersion() (string, error) { + cmd := exec.Command(c.executablePath, "version") + var out bytes.Buffer + cmd.Stdout = &out + err := cmd.Run() + if err != nil { + return "", err + } + + r := regexp.MustCompile(`^Xray (\d+\.\d+\.\d+)`) + matches := r.FindStringSubmatch(out.String()) + if len(matches) > 1 { + return matches[1], nil + } + + return "", errors.New("could not parse Xray version") +} + +func (c *Core) setVersion(version string) { + c.mu.Lock() + defer c.mu.Unlock() + c.version = version +} + +func (c *Core) GetVersion() string { + c.mu.Lock() + defer c.mu.Unlock() + return c.version +} + +func (c *Core) Started() bool { + c.mu.Lock() + defer c.mu.Unlock() + if c.process == nil || c.process.Process == nil { + return false + } + if c.process.ProcessState == nil { + return true + } + return false +} + +func (c *Core) Start(config *Config) error { + if c.Started() { + return errors.New("xray is started already") + } + + logLevel := config.LogConfig.LogLevel + if logLevel == "none" || logLevel == "error" { + config.LogConfig.LogLevel = "warning" + } + + accessFile, errorFile := config.RemoveLogFiles() + + cmd := exec.Command(c.executablePath, "-c", filepath.Join(c.configPath, "xray.json")) + cmd.Env = append(os.Environ(), "XRAY_LOCATION_ASSET="+c.assetsPath) + + xrayJson, err := config.ToJSON() + if err != nil { + return err + } + + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + + stderr, err := cmd.StderrPipe() + if err != nil { + return err + } + + if err = nodeLogger.SetLogFile(accessFile, errorFile); err != nil { + return err + } + + cmd.Stdin = bytes.NewBufferString(xrayJson) + err = cmd.Start() + if err != nil { + return err + } + c.process = cmd + + ctxCore := c.makeContext() + // Start capturing process logs + go c.captureProcessLogs(ctxCore, stdout) + go c.captureProcessLogs(ctxCore, stderr) + + return nil +} + +func (c *Core) Stop() { + if !c.Started() { + return + } + + c.mu.Lock() + defer c.mu.Unlock() + _ = c.process.Process.Kill() + c.process = nil + + c.cancelFunc() + + log.Println("xray core stopped") +} + +func (c *Core) Restart(config *Config) error { + if c.restarting { + return errors.New("xray is already restarted") + } + + c.mu.Lock() + c.restarting = true + c.mu.Unlock() + + defer func() { + c.mu.Lock() + c.restarting = false + c.mu.Unlock() + }() + + log.Println("restarting Xray core...") + c.Stop() + if err := c.Start(config); err != nil { + return err + } + return nil +} + +func (c *Core) GetLogs() chan string { + c.mu.Lock() + defer c.mu.Unlock() + return c.logsChan +} + +func (c *Core) makeContext() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + c.mu.Lock() + defer c.mu.Unlock() + c.cancelFunc = cancel + return ctx +} diff --git a/backend/xray/log.go b/backend/xray/log.go new file mode 100644 index 0000000..791f91f --- /dev/null +++ b/backend/xray/log.go @@ -0,0 +1,56 @@ +package xray + +import ( + "bufio" + "context" + "io" + "regexp" + "strings" + + nodeLogger "github.com/m03ed/gozargah-node/logger" +) + +var ( + re *regexp.Regexp +) + +func init() { + pattern := `^(\d{4}/\d{2}/\d{2}) (\d{2}:\d{2}:\d{2}) (\[.*?\]) (.*)$` + + // Compile the regex + re = regexp.MustCompile(pattern) +} + +func (c *Core) detectLogType(newLog string) { + message := "" + level := "" + + // Find the matches + matches := re.FindStringSubmatch(newLog) + if len(matches) > 3 { + level = strings.Trim(matches[3], "[]") + message = matches[4] + } else { + message = newLog + } + + if level == "" { + level = "Debug" + } + + nodeLogger.Log(level, message) +} + +func (c *Core) captureProcessLogs(ctx context.Context, pipe io.Reader) { + scanner := bufio.NewScanner(pipe) + for scanner.Scan() { + select { + case <-ctx.Done(): + return // Exit gracefully if stop signal received + default: + output := scanner.Text() + c.detectLogType(output) + c.logsChan <- output + } + } +} diff --git a/backend/xray/user.go b/backend/xray/user.go new file mode 100644 index 0000000..144caf6 --- /dev/null +++ b/backend/xray/user.go @@ -0,0 +1,166 @@ +package xray + +import ( + "context" + "errors" + "log" + "slices" + "strings" + + "github.com/m03ed/gozargah-node/backend/xray/api" + "github.com/m03ed/gozargah-node/common" +) + +func setupUserAccount(user *common.User) (api.ProxySettings, error) { + settings := api.ProxySettings{} + if user.GetProxies().GetVmess() != nil { + vmessAccount, err := api.NewVmessAccount(user) + if err != nil { + return settings, err + } + settings.Vmess = vmessAccount + } + + if user.GetProxies().GetVless() != nil { + vlessAccount, err := api.NewVlessAccount(user) + if err != nil { + return settings, err + } + settings.Vless = vlessAccount + } + + if user.GetProxies().GetTrojan() != nil { + settings.Trojan = api.NewTrojanAccount(user) + } + + if user.GetProxies().GetTrojan() != nil { + settings.Shadowsocks = api.NewShadowsocksTcpAccount(user) + settings.Shadowsocks2022 = api.NewShadowsocksAccount(user) + } + + return settings, nil +} + +func isActiveInbound(inbound *Inbound, inbounds []string, settings api.ProxySettings) (api.Account, bool) { + if slices.Contains(inbounds, inbound.Tag) { + switch inbound.Protocol { + case Vless: + if settings.Vless == nil { + return nil, false + } + + account := *settings.Vless + if settings.Vless.Flow != "" { + + networkType, ok := inbound.StreamSettings["network"] + if !ok || !(networkType == "tcp" || networkType == "raw" || networkType == "kcp") { + account.Flow = "" + return &account, true + } + + securityType, ok := inbound.StreamSettings["security"] + if !ok || !(securityType == "tls" || securityType == "reality") { + account.Flow = "" + return &account, true + } + + rawMap, ok := inbound.StreamSettings["rawSettings"].(map[string]interface{}) + if !ok { + rawMap, ok = inbound.StreamSettings["tcpSettings"].(map[string]interface{}) + if !ok { + return &account, true + } + } + + headerMap, ok := rawMap["header"].(map[string]interface{}) + if !ok { + return &account, true + } + + headerType, ok := headerMap["Type"].(string) + if !ok { + return &account, true + } + + if headerType == "http" { + account.Flow = "" + return &account, true + } + } + return &account, true + + case Vmess: + if settings.Vmess == nil { + return nil, false + } + return settings.Vmess, true + + case Trojan: + if settings.Trojan == nil { + return nil, false + } + return settings.Trojan, true + + case Shadowsocks: + method, ok := inbound.Settings["method"].(string) + if ok && strings.HasPrefix("2022-blake3", method) { + if settings.Shadowsocks2022 == nil { + return nil, false + } + return settings.Shadowsocks2022, true + } + if settings.Shadowsocks == nil { + return nil, false + } + return settings.Shadowsocks, true + } + } + return nil, false +} + +func (x *Xray) SyncUser(ctx context.Context, user *common.User) error { + proxySetting, err := setupUserAccount(user) + if err != nil { + return err + } + + handler := x.getHandler() + inbounds := x.getConfig().InboundConfigs + + var errMessage string + + for _, inbound := range inbounds { + _ = handler.RemoveInboundUser(ctx, inbound.Tag, user.Email) + account, isActive := isActiveInbound(inbound, user.GetInbounds(), proxySetting) + if isActive { + inbound.updateUser(account) + err = handler.AddInboundUser(ctx, inbound.Tag, account) + if err != nil { + log.Println(err) + errMessage += "\n" + err.Error() + } + } else { + inbound.removeUser(user.GetEmail()) + } + } + + if err = x.GenerateConfigFile(); err != nil { + log.Println(err) + } + + if errMessage != "" { + return errors.New("failed to add user:" + errMessage) + } + return nil +} + +func (x *Xray) SyncUsers(_ context.Context, users []*common.User) error { + x.config.syncUsers(users) + if err := x.GenerateConfigFile(); err != nil { + return err + } + if err := x.Restart(); err != nil { + return err + } + return nil +} diff --git a/backend/xray/xray.go b/backend/xray/xray.go new file mode 100644 index 0000000..d3fcca0 --- /dev/null +++ b/backend/xray/xray.go @@ -0,0 +1,292 @@ +package xray + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "log" + "os" + "path/filepath" + "regexp" + "strings" + "sync" + "time" + + "github.com/m03ed/gozargah-node/backend" + "github.com/m03ed/gozargah-node/backend/xray/api" + "github.com/m03ed/gozargah-node/common" + nodeLogger "github.com/m03ed/gozargah-node/logger" +) + +type Xray struct { + config *Config + core *Core + handler *api.XrayHandler + configPath string + ctx context.Context + cancelFunc context.CancelFunc + mu sync.Mutex +} + +func NewXray(ctx context.Context, port int, executablePath, assetsPath, configPath string) (*Xray, error) { + executableAbsolutePath, err := filepath.Abs(executablePath) + if err != nil { + return nil, err + } + + assetsAbsolutePath, err := filepath.Abs(assetsPath) + if err != nil { + return nil, err + } + + configAbsolutePath, err := filepath.Abs(configPath) + if err != nil { + return nil, err + } + + xCtx, xCancel := context.WithCancel(context.Background()) + + xray := &Xray{configPath: configAbsolutePath, ctx: xCtx, cancelFunc: xCancel} + + start := time.Now() + + config, ok := ctx.Value(backend.ConfigKey{}).(*Config) + if !ok { + return nil, errors.New("xray config has not been initialized") + } + + if err = config.ApplyAPI(port); err != nil { + return nil, err + } + + users := ctx.Value(backend.UsersKey{}).([]*common.User) + config.syncUsers(users) + + xray.setConfig(config) + + if err = xray.GenerateConfigFile(); err != nil { + return nil, err + } + + log.Println("config generated in", time.Since(start).Seconds(), "second.") + + core, err := NewXRayCore(executableAbsolutePath, assetsAbsolutePath, configAbsolutePath) + if err != nil { + return nil, err + } + + if err = core.Start(config); err != nil { + return nil, err + } + + xray.setCore(core) + + if err = xray.checkXrayStatus(); err != nil { + xray.Shutdown() + return nil, err + } + + handler, err := api.NewXrayAPI(port) + if err != nil { + xray.Shutdown() + return nil, err + } + xray.setHandler(handler) + go xray.checkXrayHealth() + + return xray, nil +} + +func (x *Xray) setConfig(config *Config) { + x.mu.Lock() + defer x.mu.Unlock() + x.config = config +} + +func (x *Xray) getConfig() *Config { + x.mu.Lock() + defer x.mu.Unlock() + return x.config +} + +func (x *Xray) setCore(core *Core) { + x.mu.Lock() + defer x.mu.Unlock() + x.core = core +} + +func (x *Xray) getCore() *Core { + x.mu.Lock() + defer x.mu.Unlock() + return x.core +} + +func (x *Xray) GetCore() backend.Core { + x.mu.Lock() + defer x.mu.Unlock() + return x.core +} + +func (x *Xray) GetLogs() chan string { + x.mu.Lock() + defer x.mu.Unlock() + return x.core.GetLogs() +} + +func (x *Xray) GetVersion() string { + x.mu.Lock() + defer x.mu.Unlock() + return x.core.GetVersion() +} + +func (x *Xray) setHandler(handler *api.XrayHandler) { + x.mu.Lock() + defer x.mu.Unlock() + x.handler = handler +} + +func (x *Xray) getHandler() *api.XrayHandler { + x.mu.Lock() + defer x.mu.Unlock() + return x.handler +} + +func (x *Xray) Started() bool { + return x.core.Started() +} + +func (x *Xray) Restart() error { + x.mu.Lock() + defer x.mu.Unlock() + if err := x.core.Restart(x.config); err != nil { + return err + } + return nil +} + +func (x *Xray) Shutdown() { + x.mu.Lock() + defer x.mu.Unlock() + + x.cancelFunc() + + if x.core != nil { + x.core.Stop() + } + if x.handler != nil { + x.handler.Close() + } +} + +func (x *Xray) GetSysStats(ctx context.Context) (*common.BackendStatsResponse, error) { + return x.handler.GetSysStats(ctx) +} + +func (x *Xray) GetUsersStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + return x.handler.GetUsersStats(ctx, reset) +} + +func (x *Xray) GetUserStats(ctx context.Context, email string, reset bool) (*common.StatResponse, error) { + return x.handler.GetUserStats(ctx, email, reset) +} + +func (x *Xray) GetStatOnline(ctx context.Context, email string) (*common.OnlineStatResponse, error) { + return x.handler.GetStatOnline(ctx, email) +} + +func (x *Xray) GetOutboundsStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + return x.handler.GetOutboundsStats(ctx, reset) +} + +func (x *Xray) GetOutboundStats(ctx context.Context, tag string, reset bool) (*common.StatResponse, error) { + return x.handler.GetOutboundStats(ctx, tag, reset) +} + +func (x *Xray) GetInboundsStats(ctx context.Context, reset bool) (*common.StatResponse, error) { + return x.handler.GetInboundsStats(ctx, reset) +} + +func (x *Xray) GetInboundStats(ctx context.Context, tag string, reset bool) (*common.StatResponse, error) { + return x.handler.GetInboundStats(ctx, tag, reset) +} + +func (x *Xray) GenerateConfigFile() error { + x.mu.Lock() + defer x.mu.Unlock() + + var prettyJSON bytes.Buffer + + config, err := x.config.ToJSON() + if err != nil { + return err + } + + if err = json.Indent(&prettyJSON, []byte(config), "", " "); err != nil { + return err + } + + // Ensure the directory exists + if err = os.MkdirAll(x.configPath, 0755); err != nil { + return fmt.Errorf("failed to create config directory: %v", err) + } + + jsonFile, err := os.Create(filepath.Join(x.configPath, "xray.json")) + if err != nil { + return err + } + defer jsonFile.Close() + + _, err = jsonFile.WriteString(prettyJSON.String()) + return err +} + +func (x *Xray) checkXrayStatus() error { + core := x.getCore() + + logChan := core.GetLogs() + version := core.GetVersion() + + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + +Loop: + for { + select { + case lastLog := <-logChan: + if strings.Contains(lastLog, "Xray "+version+" started") { + break Loop + } else { + regex := regexp.MustCompile(`^(\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}) \[([^]]+)\] (.+)$`) + matches := regex.FindStringSubmatch(lastLog) + if len(matches) > 3 && matches[2] == "Error" { + return errors.New("Failed to start xray: " + matches[3]) + } + } + case <-ctx.Done(): + return errors.New("failed to start xray: context done") + } + } + return nil +} + +func (x *Xray) checkXrayHealth() { + for { + select { + case <-x.ctx.Done(): + return + default: + ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) + if _, err := x.GetSysStats(ctx); err != nil { + if err = x.Restart(); err != nil { + nodeLogger.Log(nodeLogger.LogError, err.Error()) + } else { + nodeLogger.Log(nodeLogger.LogInfo, "xray restarted") + } + } + cancel() + } + time.Sleep(time.Second * 2) + } +} diff --git a/backend/xray/xray_test.go b/backend/xray/xray_test.go new file mode 100644 index 0000000..778e584 --- /dev/null +++ b/backend/xray/xray_test.go @@ -0,0 +1,142 @@ +package xray + +import ( + "context" + "fmt" + "log" + "testing" + "time" + + "github.com/google/uuid" + + "github.com/m03ed/gozargah-node/backend" + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/tools" +) + +var ( + jsonFile = "./config.json" + executablePath = "/usr/local/bin/xray" + assetsPath = "/usr/local/share/xray" + configPath = "../../generated/" +) + +func TestXrayBackend(t *testing.T) { + xrayFile, err := tools.ReadFileAsString(jsonFile) + if err != nil { + t.Fatal(err) + } + + //test creating config + newConfig, err := NewXRayConfig(xrayFile) + if err != nil { + t.Fatal(err) + } + + log.Println("xray config created") + + // test HandlerServiceClient + user := &common.User{ + Email: "test_user@example.com", + Inbounds: []string{ + "VMESS TCP NOTLS", + "VLESS TCP REALITY", + "TROJAN TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + "VLESS TCP Header NoTLS", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + Flow: "xtls-rprx-vision", + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-128-gcm", + }, + }, + } + + user2 := &common.User{ + Email: "test_user1@example.com", + Inbounds: []string{ + "VLESS TCP REALITY", + "VLESS TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + Flow: "xtls-rprx-vision", + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-256-gcm", + }, + }, + } + + ctx := context.WithValue(context.Background(), backend.ConfigKey{}, newConfig) + ctx = context.WithValue(ctx, backend.UsersKey{}, []*common.User{user, user2}) + + back, err := NewXray(ctx, tools.FindFreePort(), executablePath, assetsPath, configPath) + if err != nil { + t.Fatal(err) + } + + log.Println("xray started") + + ctx1, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + + // test with service StatsServiceClient + stats, err := back.GetOutboundsStats(ctx1, true) + if err != nil { + t.Error(err) + } + + for _, stat := range stats.GetStats() { + log.Printf("Name: %s , Traffic: %d , Type: %s , Link: %s", + stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink()) + } + + if err = back.SyncUser(ctx1, user2); err != nil { + t.Fatal(err) + } + + log.Println("user synced") + + ctx1, cancel = context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + + logs := back.GetLogs() +loop: + for { + select { + case newLog, ok := <-logs: + if !ok { + log.Println("channel closed") + break loop + } + fmt.Println(newLog) + case <-ctx1.Done(): + break loop + } + } + + back.Shutdown() +} diff --git a/common/helper.go b/common/helper.go new file mode 100644 index 0000000..4bce609 --- /dev/null +++ b/common/helper.go @@ -0,0 +1,32 @@ +package common + +import ( + "io" + "net/http" + + "google.golang.org/protobuf/proto" +) + +func ReadProtoBody(body io.ReadCloser, message proto.Message) error { + data, err := io.ReadAll(body) + if err != nil { + return err + } + defer body.Close() + + // Decode into a map + if err = proto.Unmarshal(data, message); err != nil { + return err + } + return nil +} + +func SendProtoResponse(w http.ResponseWriter, data proto.Message) { + response, _ := proto.Marshal(data) + + w.Header().Set("Content-Type", "application/x-protobuf") + if _, err := w.Write(response); err != nil { + http.Error(w, "Failed to write response", http.StatusInternalServerError) + return + } +} diff --git a/common/service.pb.go b/common/service.pb.go new file mode 100644 index 0000000..fdef708 --- /dev/null +++ b/common/service.pb.go @@ -0,0 +1,1359 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.2 +// protoc v3.6.1 +// source: common/service.proto + +package common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type BackendType int32 + +const ( + BackendType_XRAY BackendType = 0 +) + +// Enum value maps for BackendType. +var ( + BackendType_name = map[int32]string{ + 0: "XRAY", + } + BackendType_value = map[string]int32{ + "XRAY": 0, + } +) + +func (x BackendType) Enum() *BackendType { + p := new(BackendType) + *p = x + return p +} + +func (x BackendType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BackendType) Descriptor() protoreflect.EnumDescriptor { + return file_common_service_proto_enumTypes[0].Descriptor() +} + +func (BackendType) Type() protoreflect.EnumType { + return &file_common_service_proto_enumTypes[0] +} + +func (x BackendType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use BackendType.Descriptor instead. +func (BackendType) EnumDescriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{0} +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + mi := &file_common_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{0} +} + +// Base info response message +type BaseInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Started bool `protobuf:"varint,1,opt,name=started,proto3" json:"started,omitempty"` + CoreVersion string `protobuf:"bytes,2,opt,name=core_version,json=coreVersion,proto3" json:"core_version,omitempty"` + NodeVersion string `protobuf:"bytes,3,opt,name=node_version,json=nodeVersion,proto3" json:"node_version,omitempty"` + SessionId string `protobuf:"bytes,4,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + Extra string `protobuf:"bytes,5,opt,name=extra,proto3" json:"extra,omitempty"` +} + +func (x *BaseInfoResponse) Reset() { + *x = BaseInfoResponse{} + mi := &file_common_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BaseInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BaseInfoResponse) ProtoMessage() {} + +func (x *BaseInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BaseInfoResponse.ProtoReflect.Descriptor instead. +func (*BaseInfoResponse) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{1} +} + +func (x *BaseInfoResponse) GetStarted() bool { + if x != nil { + return x.Started + } + return false +} + +func (x *BaseInfoResponse) GetCoreVersion() string { + if x != nil { + return x.CoreVersion + } + return "" +} + +func (x *BaseInfoResponse) GetNodeVersion() string { + if x != nil { + return x.NodeVersion + } + return "" +} + +func (x *BaseInfoResponse) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *BaseInfoResponse) GetExtra() string { + if x != nil { + return x.Extra + } + return "" +} + +type Backend struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type BackendType `protobuf:"varint,1,opt,name=type,proto3,enum=service.BackendType" json:"type,omitempty"` + Config string `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` + Users []*User `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *Backend) Reset() { + *x = Backend{} + mi := &file_common_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Backend) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Backend) ProtoMessage() {} + +func (x *Backend) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Backend.ProtoReflect.Descriptor instead. +func (*Backend) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{2} +} + +func (x *Backend) GetType() BackendType { + if x != nil { + return x.Type + } + return BackendType_XRAY +} + +func (x *Backend) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +func (x *Backend) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +// log +type Log struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"` +} + +func (x *Log) Reset() { + *x = Log{} + mi := &file_common_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Log) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Log) ProtoMessage() {} + +func (x *Log) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Log.ProtoReflect.Descriptor instead. +func (*Log) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{3} +} + +func (x *Log) GetDetail() string { + if x != nil { + return x.Detail + } + return "" +} + +// stats +type Stat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Link string `protobuf:"bytes,3,opt,name=link,proto3" json:"link,omitempty"` + Value int64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Stat) Reset() { + *x = Stat{} + mi := &file_common_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Stat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Stat) ProtoMessage() {} + +func (x *Stat) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Stat.ProtoReflect.Descriptor instead. +func (*Stat) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{4} +} + +func (x *Stat) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Stat) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Stat) GetLink() string { + if x != nil { + return x.Link + } + return "" +} + +func (x *Stat) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +type StatResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Stats []*Stat `protobuf:"bytes,1,rep,name=stats,proto3" json:"stats,omitempty"` +} + +func (x *StatResponse) Reset() { + *x = StatResponse{} + mi := &file_common_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatResponse) ProtoMessage() {} + +func (x *StatResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatResponse.ProtoReflect.Descriptor instead. +func (*StatResponse) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{5} +} + +func (x *StatResponse) GetStats() []*Stat { + if x != nil { + return x.Stats + } + return nil +} + +type StatRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Reset_ bool `protobuf:"varint,2,opt,name=reset,proto3" json:"reset,omitempty"` +} + +func (x *StatRequest) Reset() { + *x = StatRequest{} + mi := &file_common_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatRequest) ProtoMessage() {} + +func (x *StatRequest) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatRequest.ProtoReflect.Descriptor instead. +func (*StatRequest) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{6} +} + +func (x *StatRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StatRequest) GetReset_() bool { + if x != nil { + return x.Reset_ + } + return false +} + +type OnlineStatResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *OnlineStatResponse) Reset() { + *x = OnlineStatResponse{} + mi := &file_common_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OnlineStatResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnlineStatResponse) ProtoMessage() {} + +func (x *OnlineStatResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnlineStatResponse.ProtoReflect.Descriptor instead. +func (*OnlineStatResponse) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{7} +} + +func (x *OnlineStatResponse) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *OnlineStatResponse) GetValue() int64 { + if x != nil { + return x.Value + } + return 0 +} + +type BackendStatsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NumGoroutine uint32 `protobuf:"varint,1,opt,name=num_goroutine,json=numGoroutine,proto3" json:"num_goroutine,omitempty"` + NumGc uint32 `protobuf:"varint,2,opt,name=num_gc,json=numGc,proto3" json:"num_gc,omitempty"` + Alloc uint64 `protobuf:"varint,3,opt,name=alloc,proto3" json:"alloc,omitempty"` + TotalAlloc uint64 `protobuf:"varint,4,opt,name=total_alloc,json=totalAlloc,proto3" json:"total_alloc,omitempty"` + Sys uint64 `protobuf:"varint,5,opt,name=sys,proto3" json:"sys,omitempty"` + Mallocs uint64 `protobuf:"varint,6,opt,name=mallocs,proto3" json:"mallocs,omitempty"` + Frees uint64 `protobuf:"varint,7,opt,name=frees,proto3" json:"frees,omitempty"` + LiveObjects uint64 `protobuf:"varint,8,opt,name=live_objects,json=liveObjects,proto3" json:"live_objects,omitempty"` + PauseTotalNs uint64 `protobuf:"varint,9,opt,name=pause_total_ns,json=pauseTotalNs,proto3" json:"pause_total_ns,omitempty"` + Uptime uint32 `protobuf:"varint,10,opt,name=uptime,proto3" json:"uptime,omitempty"` +} + +func (x *BackendStatsResponse) Reset() { + *x = BackendStatsResponse{} + mi := &file_common_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *BackendStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BackendStatsResponse) ProtoMessage() {} + +func (x *BackendStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BackendStatsResponse.ProtoReflect.Descriptor instead. +func (*BackendStatsResponse) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{8} +} + +func (x *BackendStatsResponse) GetNumGoroutine() uint32 { + if x != nil { + return x.NumGoroutine + } + return 0 +} + +func (x *BackendStatsResponse) GetNumGc() uint32 { + if x != nil { + return x.NumGc + } + return 0 +} + +func (x *BackendStatsResponse) GetAlloc() uint64 { + if x != nil { + return x.Alloc + } + return 0 +} + +func (x *BackendStatsResponse) GetTotalAlloc() uint64 { + if x != nil { + return x.TotalAlloc + } + return 0 +} + +func (x *BackendStatsResponse) GetSys() uint64 { + if x != nil { + return x.Sys + } + return 0 +} + +func (x *BackendStatsResponse) GetMallocs() uint64 { + if x != nil { + return x.Mallocs + } + return 0 +} + +func (x *BackendStatsResponse) GetFrees() uint64 { + if x != nil { + return x.Frees + } + return 0 +} + +func (x *BackendStatsResponse) GetLiveObjects() uint64 { + if x != nil { + return x.LiveObjects + } + return 0 +} + +func (x *BackendStatsResponse) GetPauseTotalNs() uint64 { + if x != nil { + return x.PauseTotalNs + } + return 0 +} + +func (x *BackendStatsResponse) GetUptime() uint32 { + if x != nil { + return x.Uptime + } + return 0 +} + +type SystemStatsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MemTotal uint64 `protobuf:"varint,1,opt,name=mem_total,json=memTotal,proto3" json:"mem_total,omitempty"` + MemUsed uint64 `protobuf:"varint,2,opt,name=mem_used,json=memUsed,proto3" json:"mem_used,omitempty"` + CpuCores uint64 `protobuf:"varint,3,opt,name=cpu_cores,json=cpuCores,proto3" json:"cpu_cores,omitempty"` + CpuUsage float64 `protobuf:"fixed64,4,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"` + IncomingBandwidthSpeed uint64 `protobuf:"varint,5,opt,name=incoming_bandwidth_speed,json=incomingBandwidthSpeed,proto3" json:"incoming_bandwidth_speed,omitempty"` + OutgoingBandwidthSpeed uint64 `protobuf:"varint,6,opt,name=outgoing_bandwidth_speed,json=outgoingBandwidthSpeed,proto3" json:"outgoing_bandwidth_speed,omitempty"` +} + +func (x *SystemStatsResponse) Reset() { + *x = SystemStatsResponse{} + mi := &file_common_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SystemStatsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SystemStatsResponse) ProtoMessage() {} + +func (x *SystemStatsResponse) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SystemStatsResponse.ProtoReflect.Descriptor instead. +func (*SystemStatsResponse) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{9} +} + +func (x *SystemStatsResponse) GetMemTotal() uint64 { + if x != nil { + return x.MemTotal + } + return 0 +} + +func (x *SystemStatsResponse) GetMemUsed() uint64 { + if x != nil { + return x.MemUsed + } + return 0 +} + +func (x *SystemStatsResponse) GetCpuCores() uint64 { + if x != nil { + return x.CpuCores + } + return 0 +} + +func (x *SystemStatsResponse) GetCpuUsage() float64 { + if x != nil { + return x.CpuUsage + } + return 0 +} + +func (x *SystemStatsResponse) GetIncomingBandwidthSpeed() uint64 { + if x != nil { + return x.IncomingBandwidthSpeed + } + return 0 +} + +func (x *SystemStatsResponse) GetOutgoingBandwidthSpeed() uint64 { + if x != nil { + return x.OutgoingBandwidthSpeed + } + return 0 +} + +// User +type Vmess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *Vmess) Reset() { + *x = Vmess{} + mi := &file_common_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Vmess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vmess) ProtoMessage() {} + +func (x *Vmess) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Vmess.ProtoReflect.Descriptor instead. +func (*Vmess) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{10} +} + +func (x *Vmess) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type Vless struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` +} + +func (x *Vless) Reset() { + *x = Vless{} + mi := &file_common_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Vless) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Vless) ProtoMessage() {} + +func (x *Vless) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Vless.ProtoReflect.Descriptor instead. +func (*Vless) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{11} +} + +func (x *Vless) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Vless) GetFlow() string { + if x != nil { + return x.Flow + } + return "" +} + +type Trojan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *Trojan) Reset() { + *x = Trojan{} + mi := &file_common_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Trojan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Trojan) ProtoMessage() {} + +func (x *Trojan) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Trojan.ProtoReflect.Descriptor instead. +func (*Trojan) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{12} +} + +func (x *Trojan) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type Shadowsocks struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` + Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` +} + +func (x *Shadowsocks) Reset() { + *x = Shadowsocks{} + mi := &file_common_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Shadowsocks) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Shadowsocks) ProtoMessage() {} + +func (x *Shadowsocks) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Shadowsocks.ProtoReflect.Descriptor instead. +func (*Shadowsocks) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{13} +} + +func (x *Shadowsocks) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Shadowsocks) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +type Proxy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Vmess *Vmess `protobuf:"bytes,1,opt,name=vmess,proto3" json:"vmess,omitempty"` + Vless *Vless `protobuf:"bytes,2,opt,name=vless,proto3" json:"vless,omitempty"` + Trojan *Trojan `protobuf:"bytes,3,opt,name=trojan,proto3" json:"trojan,omitempty"` + Shadowsocks *Shadowsocks `protobuf:"bytes,4,opt,name=shadowsocks,proto3" json:"shadowsocks,omitempty"` +} + +func (x *Proxy) Reset() { + *x = Proxy{} + mi := &file_common_service_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Proxy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Proxy) ProtoMessage() {} + +func (x *Proxy) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Proxy.ProtoReflect.Descriptor instead. +func (*Proxy) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{14} +} + +func (x *Proxy) GetVmess() *Vmess { + if x != nil { + return x.Vmess + } + return nil +} + +func (x *Proxy) GetVless() *Vless { + if x != nil { + return x.Vless + } + return nil +} + +func (x *Proxy) GetTrojan() *Trojan { + if x != nil { + return x.Trojan + } + return nil +} + +func (x *Proxy) GetShadowsocks() *Shadowsocks { + if x != nil { + return x.Shadowsocks + } + return nil +} + +type User struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` + Proxies *Proxy `protobuf:"bytes,2,opt,name=proxies,proto3" json:"proxies,omitempty"` + Inbounds []string `protobuf:"bytes,3,rep,name=inbounds,proto3" json:"inbounds,omitempty"` +} + +func (x *User) Reset() { + *x = User{} + mi := &file_common_service_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *User) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*User) ProtoMessage() {} + +func (x *User) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{15} +} + +func (x *User) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +func (x *User) GetProxies() *Proxy { + if x != nil { + return x.Proxies + } + return nil +} + +func (x *User) GetInbounds() []string { + if x != nil { + return x.Inbounds + } + return nil +} + +type Users struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *Users) Reset() { + *x = Users{} + mi := &file_common_service_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Users) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Users) ProtoMessage() {} + +func (x *Users) ProtoReflect() protoreflect.Message { + mi := &file_common_service_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Users.ProtoReflect.Descriptor instead. +func (*Users) Descriptor() ([]byte, []int) { + return file_common_service_proto_rawDescGZIP(), []int{16} +} + +func (x *Users) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + +var File_common_service_proto protoreflect.FileDescriptor + +var file_common_service_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, + 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xa7, 0x01, 0x0a, 0x10, 0x42, 0x61, 0x73, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x72, 0x65, 0x5f, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x6f, 0x72, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x6f, + 0x64, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, + 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x78, 0x74, + 0x72, 0x61, 0x22, 0x70, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x12, 0x28, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x23, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x22, 0x1d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x22, 0x58, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x33, 0x0a, + 0x0c, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x73, 0x22, 0x37, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x22, 0x40, 0x0a, 0x12, 0x4f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xac, 0x02, + 0x0a, 0x14, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x75, 0x6d, 0x5f, 0x67, 0x6f, + 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6e, + 0x75, 0x6d, 0x47, 0x6f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x5f, 0x67, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6e, 0x75, 0x6d, + 0x47, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x74, + 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x79, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x79, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x61, + 0x6c, 0x6c, 0x6f, 0x63, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x72, 0x65, 0x65, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x66, 0x72, 0x65, 0x65, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6c, + 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0b, 0x6c, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x24, + 0x0a, 0x0e, 0x70, 0x61, 0x75, 0x73, 0x65, 0x5f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6e, 0x73, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x70, 0x61, 0x75, 0x73, 0x65, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x4e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xfb, 0x01, 0x0a, + 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x54, 0x6f, 0x74, 0x61, + 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x65, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x63, 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x63, 0x70, 0x75, 0x43, 0x6f, 0x72, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, + 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x63, 0x70, + 0x75, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x5f, 0x73, 0x70, 0x65, + 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x69, 0x6e, 0x63, 0x6f, 0x6d, 0x69, + 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x53, 0x70, 0x65, 0x65, 0x64, + 0x12, 0x38, 0x0a, 0x18, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x6e, + 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x5f, 0x73, 0x70, 0x65, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x16, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x6e, 0x64, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x53, 0x70, 0x65, 0x65, 0x64, 0x22, 0x17, 0x0a, 0x05, 0x56, 0x6d, + 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x2b, 0x0a, 0x05, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, + 0x22, 0x24, 0x0a, 0x06, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x41, 0x0a, 0x0b, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, + 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x05, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x6d, 0x65, + 0x73, 0x73, 0x52, 0x05, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x76, 0x6c, 0x65, + 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x52, 0x05, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x12, + 0x27, 0x0a, 0x06, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, + 0x52, 0x06, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x12, 0x36, 0x0a, 0x0b, 0x73, 0x68, 0x61, 0x64, + 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, + 0x63, 0x6b, 0x73, 0x52, 0x0b, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, + 0x22, 0x62, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, + 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, + 0x07, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x73, 0x22, 0x2c, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x23, 0x0a, + 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x2a, 0x17, 0x0a, 0x0b, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x08, 0x0a, 0x04, 0x58, 0x52, 0x41, 0x59, 0x10, 0x00, 0x32, 0x92, 0x07, 0x0a, 0x0b, + 0x4e, 0x6f, 0x64, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0x19, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x28, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x0e, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0e, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3a, 0x0a, + 0x0b, 0x47, 0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x2b, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, + 0x6f, 0x67, 0x22, 0x00, 0x30, 0x01, 0x12, 0x40, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x0e, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x41, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, + 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x62, + 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x15, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3d, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x14, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4f, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x2d, 0x0a, 0x08, 0x53, 0x79, 0x6e, 0x63, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x1a, 0x0e, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x28, + 0x01, 0x12, 0x2d, 0x0a, 0x09, 0x53, 0x79, 0x6e, 0x63, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x0e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x1a, 0x0e, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, + 0x42, 0x18, 0x5a, 0x16, 0x6d, 0x61, 0x72, 0x7a, 0x62, 0x61, 0x6e, 0x5f, 0x6e, 0x6f, 0x64, 0x65, + 0x5f, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_common_service_proto_rawDescOnce sync.Once + file_common_service_proto_rawDescData = file_common_service_proto_rawDesc +) + +func file_common_service_proto_rawDescGZIP() []byte { + file_common_service_proto_rawDescOnce.Do(func() { + file_common_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_service_proto_rawDescData) + }) + return file_common_service_proto_rawDescData +} + +var file_common_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_service_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_common_service_proto_goTypes = []any{ + (BackendType)(0), // 0: service.BackendType + (*Empty)(nil), // 1: service.Empty + (*BaseInfoResponse)(nil), // 2: service.BaseInfoResponse + (*Backend)(nil), // 3: service.Backend + (*Log)(nil), // 4: service.Log + (*Stat)(nil), // 5: service.Stat + (*StatResponse)(nil), // 6: service.StatResponse + (*StatRequest)(nil), // 7: service.StatRequest + (*OnlineStatResponse)(nil), // 8: service.OnlineStatResponse + (*BackendStatsResponse)(nil), // 9: service.BackendStatsResponse + (*SystemStatsResponse)(nil), // 10: service.SystemStatsResponse + (*Vmess)(nil), // 11: service.Vmess + (*Vless)(nil), // 12: service.Vless + (*Trojan)(nil), // 13: service.Trojan + (*Shadowsocks)(nil), // 14: service.Shadowsocks + (*Proxy)(nil), // 15: service.Proxy + (*User)(nil), // 16: service.User + (*Users)(nil), // 17: service.Users +} +var file_common_service_proto_depIdxs = []int32{ + 0, // 0: service.Backend.type:type_name -> service.BackendType + 16, // 1: service.Backend.users:type_name -> service.User + 5, // 2: service.StatResponse.stats:type_name -> service.Stat + 11, // 3: service.Proxy.vmess:type_name -> service.Vmess + 12, // 4: service.Proxy.vless:type_name -> service.Vless + 13, // 5: service.Proxy.trojan:type_name -> service.Trojan + 14, // 6: service.Proxy.shadowsocks:type_name -> service.Shadowsocks + 15, // 7: service.User.proxies:type_name -> service.Proxy + 16, // 8: service.Users.users:type_name -> service.User + 3, // 9: service.NodeService.Start:input_type -> service.Backend + 1, // 10: service.NodeService.Stop:input_type -> service.Empty + 1, // 11: service.NodeService.GetBaseInfo:input_type -> service.Empty + 1, // 12: service.NodeService.GetLogs:input_type -> service.Empty + 1, // 13: service.NodeService.GetSystemStats:input_type -> service.Empty + 1, // 14: service.NodeService.GetBackendStats:input_type -> service.Empty + 7, // 15: service.NodeService.GetOutboundsStats:input_type -> service.StatRequest + 7, // 16: service.NodeService.GetOutboundStats:input_type -> service.StatRequest + 7, // 17: service.NodeService.GetInboundsStats:input_type -> service.StatRequest + 7, // 18: service.NodeService.GetInboundStats:input_type -> service.StatRequest + 7, // 19: service.NodeService.GetUsersStats:input_type -> service.StatRequest + 7, // 20: service.NodeService.GetUserStats:input_type -> service.StatRequest + 7, // 21: service.NodeService.GetUserOnlineStats:input_type -> service.StatRequest + 16, // 22: service.NodeService.SyncUser:input_type -> service.User + 17, // 23: service.NodeService.SyncUsers:input_type -> service.Users + 2, // 24: service.NodeService.Start:output_type -> service.BaseInfoResponse + 1, // 25: service.NodeService.Stop:output_type -> service.Empty + 2, // 26: service.NodeService.GetBaseInfo:output_type -> service.BaseInfoResponse + 4, // 27: service.NodeService.GetLogs:output_type -> service.Log + 10, // 28: service.NodeService.GetSystemStats:output_type -> service.SystemStatsResponse + 9, // 29: service.NodeService.GetBackendStats:output_type -> service.BackendStatsResponse + 6, // 30: service.NodeService.GetOutboundsStats:output_type -> service.StatResponse + 6, // 31: service.NodeService.GetOutboundStats:output_type -> service.StatResponse + 6, // 32: service.NodeService.GetInboundsStats:output_type -> service.StatResponse + 6, // 33: service.NodeService.GetInboundStats:output_type -> service.StatResponse + 6, // 34: service.NodeService.GetUsersStats:output_type -> service.StatResponse + 6, // 35: service.NodeService.GetUserStats:output_type -> service.StatResponse + 8, // 36: service.NodeService.GetUserOnlineStats:output_type -> service.OnlineStatResponse + 1, // 37: service.NodeService.SyncUser:output_type -> service.Empty + 1, // 38: service.NodeService.SyncUsers:output_type -> service.Empty + 24, // [24:39] is the sub-list for method output_type + 9, // [9:24] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name +} + +func init() { file_common_service_proto_init() } +func file_common_service_proto_init() { + if File_common_service_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 17, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_common_service_proto_goTypes, + DependencyIndexes: file_common_service_proto_depIdxs, + EnumInfos: file_common_service_proto_enumTypes, + MessageInfos: file_common_service_proto_msgTypes, + }.Build() + File_common_service_proto = out.File + file_common_service_proto_rawDesc = nil + file_common_service_proto_goTypes = nil + file_common_service_proto_depIdxs = nil +} diff --git a/common/service.proto b/common/service.proto new file mode 100644 index 0000000..665b9ce --- /dev/null +++ b/common/service.proto @@ -0,0 +1,133 @@ +syntax = "proto3"; + +package service; + +option go_package = "marzban_node_go/common"; + +message Empty {} + +// Base info response message +message BaseInfoResponse { + bool started = 1; + string core_version = 2; + string node_version = 3; + string session_id = 4; + string extra = 5; +} + +enum BackendType { + XRAY = 0; +} + +message Backend { + BackendType type = 1; + string config = 2; + repeated User users = 3; +} + +// log +message Log { + string detail = 1; +} + +// stats +message Stat { + string name = 1; + string type = 2; + string link = 3; + int64 value = 4; +} + +message StatResponse { + repeated Stat stats = 1; +} + +message StatRequest { + string name = 1; + bool reset = 2; +} + +message OnlineStatResponse { + string email = 1; + int64 value = 2; +} + +message BackendStatsResponse { + uint32 num_goroutine = 1; + uint32 num_gc = 2; + uint64 alloc = 3; + uint64 total_alloc = 4; + uint64 sys = 5; + uint64 mallocs = 6; + uint64 frees = 7; + uint64 live_objects = 8; + uint64 pause_total_ns = 9; + uint32 uptime = 10; +} + +message SystemStatsResponse { + uint64 mem_total = 1; + uint64 mem_used = 2; + uint64 cpu_cores = 3; + double cpu_usage = 4; + uint64 incoming_bandwidth_speed = 5; + uint64 outgoing_bandwidth_speed = 6; +} + +// User +message Vmess { + string id = 1; +} + +message Vless { + string id = 1; + string flow = 2; +} + +message Trojan { + string password = 1; +} + +message Shadowsocks { + string password = 1; + string method = 2; +} + +message Proxy { + Vmess vmess = 1; + Vless vless = 2; + Trojan trojan = 3; + Shadowsocks shadowsocks = 4; +} + +message User { + string email = 1; + Proxy proxies = 2; + repeated string inbounds = 3; +} + +message Users { + repeated User users = 1; +} + +// Service for node management and connection +service NodeService { + rpc Start (Backend) returns (BaseInfoResponse) {} + rpc Stop (Empty) returns (Empty) {} + rpc GetBaseInfo (Empty) returns (BaseInfoResponse) {} + + rpc GetLogs (Empty) returns (stream Log) {} + + rpc GetSystemStats (Empty) returns (SystemStatsResponse) {} + rpc GetBackendStats (Empty) returns (BackendStatsResponse) {} + rpc GetOutboundsStats (StatRequest) returns (StatResponse) {} + rpc GetOutboundStats (StatRequest) returns (StatResponse) {} + rpc GetInboundsStats (StatRequest) returns (StatResponse) {} + rpc GetInboundStats (StatRequest) returns (StatResponse) {} + rpc GetUsersStats (StatRequest) returns (StatResponse) {} + rpc GetUserStats (StatRequest) returns (StatResponse) {} + rpc GetUserOnlineStats (StatRequest) returns (OnlineStatResponse) {} + + rpc SyncUser (stream User) returns (Empty) {} + rpc SyncUsers (Users) returns (Empty) {} +} diff --git a/common/service_grpc.pb.go b/common/service_grpc.pb.go new file mode 100644 index 0000000..3de7df4 --- /dev/null +++ b/common/service_grpc.pb.go @@ -0,0 +1,654 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc v3.6.1 +// source: common/service.proto + +package common + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + NodeService_Start_FullMethodName = "/service.NodeService/Start" + NodeService_Stop_FullMethodName = "/service.NodeService/Stop" + NodeService_GetBaseInfo_FullMethodName = "/service.NodeService/GetBaseInfo" + NodeService_GetLogs_FullMethodName = "/service.NodeService/GetLogs" + NodeService_GetSystemStats_FullMethodName = "/service.NodeService/GetSystemStats" + NodeService_GetBackendStats_FullMethodName = "/service.NodeService/GetBackendStats" + NodeService_GetOutboundsStats_FullMethodName = "/service.NodeService/GetOutboundsStats" + NodeService_GetOutboundStats_FullMethodName = "/service.NodeService/GetOutboundStats" + NodeService_GetInboundsStats_FullMethodName = "/service.NodeService/GetInboundsStats" + NodeService_GetInboundStats_FullMethodName = "/service.NodeService/GetInboundStats" + NodeService_GetUsersStats_FullMethodName = "/service.NodeService/GetUsersStats" + NodeService_GetUserStats_FullMethodName = "/service.NodeService/GetUserStats" + NodeService_GetUserOnlineStats_FullMethodName = "/service.NodeService/GetUserOnlineStats" + NodeService_SyncUser_FullMethodName = "/service.NodeService/SyncUser" + NodeService_SyncUsers_FullMethodName = "/service.NodeService/SyncUsers" +) + +// NodeServiceClient is the client API for NodeService service. +// +// 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. +// +// Service for node management and connection +type NodeServiceClient interface { + Start(ctx context.Context, in *Backend, opts ...grpc.CallOption) (*BaseInfoResponse, error) + Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + GetBaseInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseInfoResponse, error) + GetLogs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Log], error) + GetSystemStats(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemStatsResponse, error) + GetBackendStats(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BackendStatsResponse, error) + GetOutboundsStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetOutboundStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetInboundsStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetInboundStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetUsersStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetUserStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) + GetUserOnlineStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*OnlineStatResponse, error) + SyncUser(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[User, Empty], error) + SyncUsers(ctx context.Context, in *Users, opts ...grpc.CallOption) (*Empty, error) +} + +type nodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient { + return &nodeServiceClient{cc} +} + +func (c *nodeServiceClient) Start(ctx context.Context, in *Backend, opts ...grpc.CallOption) (*BaseInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseInfoResponse) + err := c.cc.Invoke(ctx, NodeService_Start_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NodeService_Stop_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetBaseInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseInfoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseInfoResponse) + err := c.cc.Invoke(ctx, NodeService_GetBaseInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetLogs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[Log], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &NodeService_ServiceDesc.Streams[0], NodeService_GetLogs_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[Empty, Log]{ClientStream: stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type NodeService_GetLogsClient = grpc.ServerStreamingClient[Log] + +func (c *nodeServiceClient) GetSystemStats(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SystemStatsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SystemStatsResponse) + err := c.cc.Invoke(ctx, NodeService_GetSystemStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetBackendStats(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BackendStatsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BackendStatsResponse) + err := c.cc.Invoke(ctx, NodeService_GetBackendStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetOutboundsStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetOutboundsStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetOutboundStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetOutboundStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetInboundsStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetInboundsStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetInboundStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetInboundStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetUsersStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetUsersStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetUserStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatResponse) + err := c.cc.Invoke(ctx, NodeService_GetUserStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) GetUserOnlineStats(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*OnlineStatResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OnlineStatResponse) + err := c.cc.Invoke(ctx, NodeService_GetUserOnlineStats_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nodeServiceClient) SyncUser(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[User, Empty], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &NodeService_ServiceDesc.Streams[1], NodeService_SyncUser_FullMethodName, cOpts...) + if err != nil { + return nil, err + } + x := &grpc.GenericClientStream[User, Empty]{ClientStream: stream} + return x, nil +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type NodeService_SyncUserClient = grpc.ClientStreamingClient[User, Empty] + +func (c *nodeServiceClient) SyncUsers(ctx context.Context, in *Users, opts ...grpc.CallOption) (*Empty, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(Empty) + err := c.cc.Invoke(ctx, NodeService_SyncUsers_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NodeServiceServer is the server API for NodeService service. +// All implementations must embed UnimplementedNodeServiceServer +// for forward compatibility. +// +// Service for node management and connection +type NodeServiceServer interface { + Start(context.Context, *Backend) (*BaseInfoResponse, error) + Stop(context.Context, *Empty) (*Empty, error) + GetBaseInfo(context.Context, *Empty) (*BaseInfoResponse, error) + GetLogs(*Empty, grpc.ServerStreamingServer[Log]) error + GetSystemStats(context.Context, *Empty) (*SystemStatsResponse, error) + GetBackendStats(context.Context, *Empty) (*BackendStatsResponse, error) + GetOutboundsStats(context.Context, *StatRequest) (*StatResponse, error) + GetOutboundStats(context.Context, *StatRequest) (*StatResponse, error) + GetInboundsStats(context.Context, *StatRequest) (*StatResponse, error) + GetInboundStats(context.Context, *StatRequest) (*StatResponse, error) + GetUsersStats(context.Context, *StatRequest) (*StatResponse, error) + GetUserStats(context.Context, *StatRequest) (*StatResponse, error) + GetUserOnlineStats(context.Context, *StatRequest) (*OnlineStatResponse, error) + SyncUser(grpc.ClientStreamingServer[User, Empty]) error + SyncUsers(context.Context, *Users) (*Empty, error) + mustEmbedUnimplementedNodeServiceServer() +} + +// UnimplementedNodeServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedNodeServiceServer struct{} + +func (UnimplementedNodeServiceServer) Start(context.Context, *Backend) (*BaseInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") +} +func (UnimplementedNodeServiceServer) Stop(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") +} +func (UnimplementedNodeServiceServer) GetBaseInfo(context.Context, *Empty) (*BaseInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBaseInfo not implemented") +} +func (UnimplementedNodeServiceServer) GetLogs(*Empty, grpc.ServerStreamingServer[Log]) error { + return status.Errorf(codes.Unimplemented, "method GetLogs not implemented") +} +func (UnimplementedNodeServiceServer) GetSystemStats(context.Context, *Empty) (*SystemStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSystemStats not implemented") +} +func (UnimplementedNodeServiceServer) GetBackendStats(context.Context, *Empty) (*BackendStatsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBackendStats not implemented") +} +func (UnimplementedNodeServiceServer) GetOutboundsStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOutboundsStats not implemented") +} +func (UnimplementedNodeServiceServer) GetOutboundStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOutboundStats not implemented") +} +func (UnimplementedNodeServiceServer) GetInboundsStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInboundsStats not implemented") +} +func (UnimplementedNodeServiceServer) GetInboundStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInboundStats not implemented") +} +func (UnimplementedNodeServiceServer) GetUsersStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUsersStats not implemented") +} +func (UnimplementedNodeServiceServer) GetUserStats(context.Context, *StatRequest) (*StatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserStats not implemented") +} +func (UnimplementedNodeServiceServer) GetUserOnlineStats(context.Context, *StatRequest) (*OnlineStatResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserOnlineStats not implemented") +} +func (UnimplementedNodeServiceServer) SyncUser(grpc.ClientStreamingServer[User, Empty]) error { + return status.Errorf(codes.Unimplemented, "method SyncUser not implemented") +} +func (UnimplementedNodeServiceServer) SyncUsers(context.Context, *Users) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncUsers not implemented") +} +func (UnimplementedNodeServiceServer) mustEmbedUnimplementedNodeServiceServer() {} +func (UnimplementedNodeServiceServer) testEmbeddedByValue() {} + +// UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NodeServiceServer will +// result in compilation errors. +type UnsafeNodeServiceServer interface { + mustEmbedUnimplementedNodeServiceServer() +} + +func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer) { + // If the following call pancis, it indicates UnimplementedNodeServiceServer 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(&NodeService_ServiceDesc, srv) +} + +func _NodeService_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Backend) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).Start(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_Start_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).Start(ctx, req.(*Backend)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).Stop(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_Stop_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).Stop(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetBaseInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetBaseInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetBaseInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetBaseInfo(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetLogs_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(NodeServiceServer).GetLogs(m, &grpc.GenericServerStream[Empty, Log]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type NodeService_GetLogsServer = grpc.ServerStreamingServer[Log] + +func _NodeService_GetSystemStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetSystemStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetSystemStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetSystemStats(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetBackendStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetBackendStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetBackendStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetBackendStats(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetOutboundsStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetOutboundsStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetOutboundsStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetOutboundsStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetOutboundStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetOutboundStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetOutboundStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetOutboundStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetInboundsStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetInboundsStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetInboundsStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetInboundsStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetInboundStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetInboundStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetInboundStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetInboundStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetUsersStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetUsersStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetUsersStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetUsersStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetUserStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetUserStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetUserStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetUserStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_GetUserOnlineStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).GetUserOnlineStats(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_GetUserOnlineStats_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).GetUserOnlineStats(ctx, req.(*StatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _NodeService_SyncUser_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(NodeServiceServer).SyncUser(&grpc.GenericServerStream[User, Empty]{ServerStream: stream}) +} + +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type NodeService_SyncUserServer = grpc.ClientStreamingServer[User, Empty] + +func _NodeService_SyncUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Users) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodeServiceServer).SyncUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: NodeService_SyncUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodeServiceServer).SyncUsers(ctx, req.(*Users)) + } + return interceptor(ctx, in, info, handler) +} + +// NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NodeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "service.NodeService", + HandlerType: (*NodeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Start", + Handler: _NodeService_Start_Handler, + }, + { + MethodName: "Stop", + Handler: _NodeService_Stop_Handler, + }, + { + MethodName: "GetBaseInfo", + Handler: _NodeService_GetBaseInfo_Handler, + }, + { + MethodName: "GetSystemStats", + Handler: _NodeService_GetSystemStats_Handler, + }, + { + MethodName: "GetBackendStats", + Handler: _NodeService_GetBackendStats_Handler, + }, + { + MethodName: "GetOutboundsStats", + Handler: _NodeService_GetOutboundsStats_Handler, + }, + { + MethodName: "GetOutboundStats", + Handler: _NodeService_GetOutboundStats_Handler, + }, + { + MethodName: "GetInboundsStats", + Handler: _NodeService_GetInboundsStats_Handler, + }, + { + MethodName: "GetInboundStats", + Handler: _NodeService_GetInboundStats_Handler, + }, + { + MethodName: "GetUsersStats", + Handler: _NodeService_GetUsersStats_Handler, + }, + { + MethodName: "GetUserStats", + Handler: _NodeService_GetUserStats_Handler, + }, + { + MethodName: "GetUserOnlineStats", + Handler: _NodeService_GetUserOnlineStats_Handler, + }, + { + MethodName: "SyncUsers", + Handler: _NodeService_SyncUsers_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetLogs", + Handler: _NodeService_GetLogs_Handler, + ServerStreams: true, + }, + { + StreamName: "SyncUser", + Handler: _NodeService_SyncUser_Handler, + ClientStreams: true, + }, + }, + Metadata: "common/service.proto", +} diff --git a/config/config.go b/config/config.go index 6e0a1cf..9c73461 100644 --- a/config/config.go +++ b/config/config.go @@ -12,16 +12,17 @@ import ( func init() { err := godotenv.Load() if err != nil { - log.Fatalf("Failed to load env file , Error: %v", err) + log.Printf("[Warning] Failed to load env file, if you're using 'Docker' and you set 'environment' or 'env_file' variable, don't worry, everything is fine. Error: %v", err) } ServicePort = GetEnvAsInt("SERVICE_PORT", 62050) XrayExecutablePath = GetEnv("XRAY_EXECUTABLE_PATH", "/usr/local/bin/xray") XrayAssetsPath = GetEnv("XRAY_ASSETS_PATH", "/usr/local/share/xray") - SslCertFile = GetEnv("SSL_CERT_FILE", "/var/lib/marzban-node/ssl_cert.pem") - SslKeyFile = GetEnv("SSL_KEY_FILE", "/var/lib/marzban-node/ssl_key.pem") - SslClientCertFile = GetEnv("SSL_CLIENT_CERT_FILE", "/var/lib/marzban-node/ssl_client_cert_file.pem") - GeneratedConfigPath = GetEnv("GENERATED_CONFIG_PATH", "/var/lib/marzban-node/generated_config-debug.json") + SslCertFile = GetEnv("SSL_CERT_FILE", "/var/lib/gozargah-node/certs/ssl_cert.pem") + SslKeyFile = GetEnv("SSL_KEY_FILE", "/var/lib/gozargah-node/certs/ssl_key.pem") + SslClientCertFile = GetEnv("SSL_CLIENT_CERT_FILE", "/var/lib/gozargah-node/certs/ssl_client_cert.pem") + GeneratedConfigPath = GetEnv("GENERATED_CONFIG_PATH", "/var/lib/gozargah-node/generated/") + ServiceProtocol = GetEnv("SERVICE_PROTOCOL", "rest") MaxLogPerRequest = GetEnvAsInt("MAX_LOG_PER_REQUEST", 1000) Debug = GetEnvAsBool("DEBUG", false) nodeHostStr := GetEnv("NODE_HOST", "0.0.0.0") @@ -40,6 +41,22 @@ func init() { } } +// Warning: only use in tests +func SetEnv(port, maxLogPerRequest int, host, xrayExecutablePath, xrayAssetsPath, sslCertFile, sslKeyFile, sslClientCertFile, + serviceProtocol, generatedConfigPath string, debug bool) { + ServicePort = port + NodeHost = host + XrayExecutablePath = xrayExecutablePath + XrayAssetsPath = xrayAssetsPath + SslCertFile = sslCertFile + SslKeyFile = sslKeyFile + SslClientCertFile = sslClientCertFile + ServiceProtocol = serviceProtocol + MaxLogPerRequest = maxLogPerRequest + GeneratedConfigPath = generatedConfigPath + Debug = debug +} + func GetEnv(key, fallback string) string { value, exists := os.LookupEnv(key) if !exists { @@ -72,6 +89,7 @@ var ( SslCertFile string SslKeyFile string SslClientCertFile string + ServiceProtocol string MaxLogPerRequest int Debug bool GeneratedConfigPath string diff --git a/controller/controller.go b/controller/controller.go new file mode 100644 index 0000000..9628fe1 --- /dev/null +++ b/controller/controller.go @@ -0,0 +1,156 @@ +package controller + +import ( + "context" + "errors" + "log" + "sync" + "time" + + "github.com/google/uuid" + + "github.com/m03ed/gozargah-node/backend" + "github.com/m03ed/gozargah-node/backend/xray" + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/config" + "github.com/m03ed/gozargah-node/tools" +) + +const NodeVersion = "1.0.0" + +type Service interface { + StopService() +} + +type Controller struct { + backend backend.Backend + sessionID uuid.UUID + apiPort int + stats *common.SystemStatsResponse + cancelFunc context.CancelFunc + mu sync.Mutex +} + +func NewController() *Controller { + c := &Controller{ + sessionID: uuid.Nil, + apiPort: tools.FindFreePort(), + } + c.startJobs() + return c +} + +func (c *Controller) GetSessionID() uuid.UUID { + c.mu.Lock() + defer c.mu.Unlock() + return c.sessionID +} + +func (c *Controller) Connect() { + c.mu.Lock() + defer c.mu.Unlock() + c.sessionID = uuid.New() +} + +func (c *Controller) Disconnect() { + c.mu.Lock() + defer c.mu.Unlock() + + if c.backend != nil { + c.backend.Shutdown() + } + c.backend = nil + + apiPort := tools.FindFreePort() + c.apiPort = apiPort + + c.sessionID = uuid.Nil +} + +func (c *Controller) StartBackend(ctx context.Context, backendType common.BackendType) error { + c.mu.Lock() + defer c.mu.Unlock() + + switch backendType { + case common.BackendType_XRAY: + newBackend, err := xray.NewXray(ctx, c.apiPort, config.XrayExecutablePath, config.XrayAssetsPath, config.GeneratedConfigPath) + if err != nil { + return err + } + c.backend = newBackend + default: + return errors.New("invalid backend type") + } + + return nil +} + +func (c *Controller) GetBackend() backend.Backend { + c.mu.Lock() + defer c.mu.Unlock() + return c.backend +} + +func (c *Controller) recordSystemStats(ctx context.Context) { + for { + select { + case <-ctx.Done(): + break + default: + stats, err := tools.GetSystemStats() + if err != nil { + log.Printf("Failed to get system stats: %v", err) + } else { + c.mu.Lock() + c.stats = stats + c.mu.Unlock() + } + time.Sleep(100 * time.Millisecond) + } + } +} + +func (c *Controller) GetStats() *common.SystemStatsResponse { + c.mu.Lock() + defer c.mu.Unlock() + return c.stats +} + +func (c *Controller) BaseInfoResponse(includeID bool, extra string) *common.BaseInfoResponse { + c.mu.Lock() + defer c.mu.Unlock() + + response := &common.BaseInfoResponse{ + Started: false, + CoreVersion: "", + NodeVersion: NodeVersion, + Extra: extra, + } + + if c.backend != nil { + response.Started = c.backend.Started() + response.CoreVersion = c.backend.GetVersion() + } + if includeID { + response.SessionId = c.sessionID.String() + } + + return response +} + +func (c *Controller) startJobs() { + ctx, cancel := context.WithCancel(context.Background()) + c.mu.Lock() + defer c.mu.Unlock() + c.cancelFunc = cancel + go c.recordSystemStats(ctx) +} + +func (c *Controller) StopJobs() { + c.mu.Lock() + c.cancelFunc() + c.mu.Unlock() + + c.Disconnect() + +} diff --git a/controller/rest/base.go b/controller/rest/base.go new file mode 100644 index 0000000..83fbc1a --- /dev/null +++ b/controller/rest/base.go @@ -0,0 +1,77 @@ +package rest + +import ( + "context" + "errors" + "log" + "net" + "net/http" + + "github.com/m03ed/gozargah-node/backend" + "github.com/m03ed/gozargah-node/backend/xray" + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) Base(w http.ResponseWriter, _ *http.Request) { + common.SendProtoResponse(w, s.controller.BaseInfoResponse(false, "")) +} + +func (s *Service) Start(w http.ResponseWriter, r *http.Request) { + ctx, backendType, err := s.detectBackend(r) + if err != nil { + http.Error(w, err.Error(), http.StatusServiceUnavailable) + return + } + + ip, _, err := net.SplitHostPort(r.RemoteAddr) + if err != nil { + http.Error(w, "unknown ip", http.StatusServiceUnavailable) + return + } + + if s.controller.GetBackend() != nil { + log.Println("New connection from ", ip, " core control access was taken away from previous client.") + s.disconnect() + } + + s.connect(ip) + + log.Println(ip, " connected, Session ID = ", s.controller.GetSessionID()) + + if err = s.controller.StartBackend(ctx, backendType); err != nil { + http.Error(w, err.Error(), http.StatusServiceUnavailable) + return + } + + common.SendProtoResponse(w, s.controller.BaseInfoResponse(true, "")) +} + +func (s *Service) Stop(w http.ResponseWriter, _ *http.Request) { + log.Println(s.GetIP(), " disconnected, Session ID = ", s.controller.GetSessionID()) + s.disconnect() + + common.SendProtoResponse(w, &common.Empty{}) +} + +func (s *Service) detectBackend(r *http.Request) (context.Context, common.BackendType, error) { + var data common.Backend + var ctx context.Context + + if err := common.ReadProtoBody(r.Body, &data); err != nil { + return nil, 0, err + } + + if data.Type == common.BackendType_XRAY { + config, err := xray.NewXRayConfig(data.Config) + if err != nil { + return nil, 0, err + } + ctx = context.WithValue(r.Context(), backend.ConfigKey{}, config) + } else { + return ctx, data.Type, errors.New("invalid backend type") + } + + ctx = context.WithValue(ctx, backend.UsersKey{}, data.GetUsers()) + + return ctx, data.Type, nil +} diff --git a/controller/rest/log.go b/controller/rest/log.go new file mode 100644 index 0000000..8a97f17 --- /dev/null +++ b/controller/rest/log.go @@ -0,0 +1,39 @@ +package rest + +import ( + "fmt" + "net/http" +) + +func (s *Service) GetLogs(w http.ResponseWriter, r *http.Request) { + flusher, ok := w.(http.Flusher) + if !ok { + http.Error(w, "Streaming unsupported", http.StatusInternalServerError) + return + } + + w.Header().Set("Content-Type", "text/event-stream") + w.Header().Set("Cache-Control", "no-cache") + w.Header().Set("Connection", "keep-alive") + + logChan := s.controller.GetBackend().GetLogs() + + for { + select { + case log, ok := <-logChan: + if !ok { + return + } + + _, err := fmt.Fprintf(w, "%s\n", log) + if err != nil { + return + } + + flusher.Flush() + + case <-r.Context().Done(): + return + } + } +} diff --git a/service/middleware.go b/controller/rest/middleware.go similarity index 56% rename from service/middleware.go rename to controller/rest/middleware.go index 2cf8f3e..cd0caf0 100644 --- a/service/middleware.go +++ b/controller/rest/middleware.go @@ -1,23 +1,21 @@ -package service +package rest import ( "fmt" + "log" "net" "net/http" "strings" "github.com/go-chi/chi/v5/middleware" - "github.com/google/uuid" - - log "marzban-node/logger" ) -func (s *Service) checkSessionID(next http.Handler) http.Handler { +func (s *Service) checkSessionIDMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // check ip clientIP := s.GetIP() - clientID := s.GetSessionID() + clientID := s.controller.GetSessionID() if clientIP == "" || clientID == uuid.Nil { http.Error(w, "please connect first", http.StatusTooEarly) return @@ -40,8 +38,13 @@ func (s *Service) checkSessionID(next http.Handler) http.Handler { return } - tokenString := strings.Split(authHeader, " ")[1] - // check session id + parts := strings.Split(authHeader, " ") + if len(parts) != 2 { + http.Error(w, "invalid Authorization header format", http.StatusUnauthorized) + return + } + + tokenString := parts[1] sessionID, err := uuid.Parse(tokenString) switch { case err != nil: @@ -56,12 +59,30 @@ func (s *Service) checkSessionID(next http.Handler) http.Handler { }) } +func (s *Service) checkBackendMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + back := s.controller.GetBackend() + if back == nil { + http.Error(w, "backend not initialized", http.StatusInternalServerError) + return + } + if !back.Started() { + http.Error(w, "core is not started yet", http.StatusServiceUnavailable) + return + } + + next.ServeHTTP(w, r) + }) +} + func LogRequest(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) + + log.Println(fmt.Sprintf("[API] New requesrt from %s, %s, %s", r.RemoteAddr, r.Method, r.URL.Path)) + next.ServeHTTP(ww, r) - logMessage := fmt.Sprintf("%s, %s, %s, %d", r.RemoteAddr, r.Method, r.URL.Path, ww.Status()) - log.Api(logMessage) + log.Println(fmt.Sprintf("[API] %s, %s, %s, %d", r.RemoteAddr, r.Method, r.URL.Path, ww.Status())) }) } diff --git a/controller/rest/rest_test.go b/controller/rest/rest_test.go new file mode 100644 index 0000000..c1d9d29 --- /dev/null +++ b/controller/rest/rest_test.go @@ -0,0 +1,293 @@ +package rest + +import ( + "bufio" + "bytes" + "context" + "crypto/tls" + "errors" + "fmt" + "io" + "log" + "net/http" + "os" + "testing" + "time" + + "github.com/google/uuid" + "google.golang.org/protobuf/proto" + + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/config" + nodeLogger "github.com/m03ed/gozargah-node/logger" + "github.com/m03ed/gozargah-node/tools" +) + +var ( + servicePort = 8002 + nodeHost = "127.0.0.1" + xrayExecutablePath = "/usr/local/bin/xray" + xrayAssetsPath = "/usr/local/share/xray" + sslCertFile = "../../certs/ssl_cert.pem" + sslKeyFile = "../../certs/ssl_key.pem" + sslClientCertFile = "../../certs/ssl_client_cert.pem" + sslClientKeyFile = "../../certs/ssl_client_key.pem" + generatedConfigPath = "../../generated/" + addr = fmt.Sprintf("%s:%d", nodeHost, servicePort) + configPath = "../../backend/xray/config.json" +) + +// httpClient creates a custom HTTP client with TLS configuration +func createHTTPClient(tlsConfig *tls.Config) *http.Client { + transport := &http.Transport{ + TLSClientConfig: tlsConfig, + Protocols: new(http.Protocols), + } + transport.Protocols.SetHTTP2(true) + + return &http.Client{ + Transport: transport, + Timeout: 10 * time.Second, + } +} + +func TestRESTConnection(t *testing.T) { + config.SetEnv(servicePort, 1000, nodeHost, xrayExecutablePath, xrayAssetsPath, + sslCertFile, sslKeyFile, sslClientCertFile, "rest", generatedConfigPath, true) + + nodeLogger.SetOutputMode(true) + + certFileExists := tools.FileExists(sslCertFile) + keyFileExists := tools.FileExists(sslKeyFile) + if !certFileExists || !keyFileExists { + if err := tools.RewriteSslFile(sslCertFile, sslKeyFile); err != nil { + t.Fatal(err) + } + } + + clientFileExists := tools.FileExists(sslClientCertFile) + if !clientFileExists { + t.Fatal("SSL_CLIENT_CERT_FILE is required.") + } + + tlsConfig, err := tools.LoadTLSCredentials(sslCertFile, sslKeyFile, sslClientCertFile, false) + if err != nil { + t.Fatal(err) + } + + shutdownFunc, s, err := StartHttpListener(tlsConfig, addr) + if err != nil { + t.Fatalf("Failed to start HTTP listener: %v", err) + } + defer s.StopService() + + creds, err := tools.LoadTLSCredentials(sslClientCertFile, sslClientKeyFile, sslCertFile, true) + if err != nil { + t.Fatal(err) + } + + url := fmt.Sprintf("https://%s", addr) + + client := createHTTPClient(creds) + sessionId := "" + + createAuthenticatedRequest := func(method, endpoint string, data proto.Message, response proto.Message) error { + body, err := proto.Marshal(data) + if err != nil { + return err + } + + req, err := http.NewRequest(method, url+endpoint, bytes.NewBuffer(body)) + if err != nil { + return err + } + req.Header.Set("Authorization", "Bearer "+sessionId) + if body != nil { + req.Header.Set("Content-Type", "application/x-protobuf") + } + + do, err := client.Do(req) + if err != nil { + return err + } + defer do.Body.Close() + + responseBody, _ := io.ReadAll(do.Body) + if err = proto.Unmarshal(responseBody, response); err != nil { + return err + } + return nil + } + + createAuthenticatedStreamingRequest := func(method, endpoint string) (io.ReadCloser, error) { + req, err := http.NewRequest(method, url+endpoint, nil) + if err != nil { + return nil, err + } + req.Header.Set("Authorization", "Bearer "+sessionId) + + resp, err := client.Do(req) + if err != nil { + return nil, err + } + + if resp.StatusCode != http.StatusOK { + defer resp.Body.Close() + return nil, fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + + return resp.Body, nil + } + + configFile, err := os.ReadFile(configPath) + if err != nil { + t.Fatal(err) + } + + user := &common.User{ + Email: "test_user1@example.com", + Inbounds: []string{ + "VMESS TCP NOTLS", + "VLESS TCP REALITY", + "TROJAN TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-256-gcm", + }, + }, + } + + user2 := &common.User{ + Email: "test_user2@example.com", + Inbounds: []string{ + "VMESS TCP NOTLS", + "VLESS TCP REALITY", + "TROJAN TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-256-gcm", + }, + }, + } + + backendStartReq := &common.Backend{ + Type: common.BackendType_XRAY, + Config: string(configFile), + Users: []*common.User{user, user2}, + } + + var baseInfoResp common.BaseInfoResponse + if err = createAuthenticatedRequest("POST", "/start", backendStartReq, &baseInfoResp); err != nil { + t.Fatalf("Failed to start backend: %v", err) + } + + sessionId = baseInfoResp.GetSessionId() + if sessionId == "" { + t.Fatal("No session ID received") + } + + var stats common.StatResponse + // Try To Get Outbounds Stats + if err = createAuthenticatedRequest("GET", "/stats/outbounds", &common.StatRequest{Reset_: true}, &stats); err != nil { + t.Fatalf("Failed to get outbound stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Printf("Outbound Stat - Name: %s, Traffic: %d, Type: %s, Link: %s", + stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink()) + } + + if err = createAuthenticatedRequest("GET", "/stats/inbounds", &common.StatRequest{Reset_: true}, &stats); err != nil { + t.Fatalf("Failed to get inbounds stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Printf("Inbound Stat - Name: %s, Traffic: %d, Type: %s, Link: %s", + stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink()) + } + + if err = createAuthenticatedRequest("GET", "/stats/users", &common.StatRequest{Reset_: true}, &stats); err != nil { + t.Fatalf("Failed to get users stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Printf("Users Stat - Name: %s, Traffic: %d, Type: %s, Link: %s", + stat.GetName(), stat.GetValue(), stat.GetType(), stat.GetLink()) + } + + var backendStats common.BackendStatsResponse + if err = createAuthenticatedRequest("GET", "/stats/backend", &common.Empty{}, &backendStats); err != nil { + t.Fatalf("Failed to get backend stats: %v", err) + } + + fmt.Println(backendStats) + + if err = createAuthenticatedRequest("PUT", "/user/sync", user, &common.Empty{}); err != nil { + t.Fatalf("Sync user request failed: %v", err) + } + + reader, err := createAuthenticatedStreamingRequest("GET", "/logs") + if err != nil { + t.Fatalf("Failed to start streaming logs: %v", err) + } + defer reader.Close() + + scanner := bufio.NewScanner(reader) + + for scanner.Scan() { + fmt.Println(scanner.Text()) + } + + if err = scanner.Err(); err != nil { + if errors.Is(err, context.DeadlineExceeded) { + t.Logf("Skipping context deadline exceeded error: %v", err) + return + } + t.Fatalf("Error reading streaming logs: %v", err) + } + + // Try To Get Node Stats + var systemStats common.SystemStatsResponse + if err = createAuthenticatedRequest("GET", "/stats/system", &common.Empty{}, &systemStats); err != nil { + t.Fatalf("Node stats request failed: %v", err) + } + + fmt.Printf("System Stats: \nMem Total: %d \nMem Used: %d \nCpu Number: %d \nCpu Usage: %f \nIncoming: %d \nOutgoing: %d \n", + systemStats.MemTotal, systemStats.MemUsed, systemStats.CpuCores, systemStats.CpuUsage, systemStats.IncomingBandwidthSpeed, systemStats.OutgoingBandwidthSpeed) + + if err = createAuthenticatedRequest("PUT", "/stop", user, &common.Empty{}); err != nil { + t.Fatalf("Sync user request failed: %v", err) + } + + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + if err = shutdownFunc(ctx); err != nil { + t.Fatalf("Failed to shutdown server: %v", err) + } +} diff --git a/controller/rest/service.go b/controller/rest/service.go new file mode 100644 index 0000000..a003f8b --- /dev/null +++ b/controller/rest/service.go @@ -0,0 +1,145 @@ +package rest + +import ( + "context" + "crypto/tls" + "errors" + "log" + "net/http" + "sync" + + "github.com/go-chi/chi/v5" + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/controller" +) + +func NewService() *Service { + s := &Service{ + controller: controller.NewController(), + clientIP: "", + } + s.setRouter() + return s +} + +func (s *Service) setRouter() { + router := chi.NewRouter() + + // Api Handlers + router.Use(LogRequest) + + router.Post("/start", s.Start) + + router.Group(func(protected chi.Router) { + // check session and need to return data as context + protected.Use(s.checkSessionIDMiddleware) + + protected.Get("/info", s.Base) + protected.Put("/stop", s.Stop) + protected.Get("/logs", s.GetLogs) + + protected.Get("/stats/system", s.GetSystemStats) + + protected.Group(func(private chi.Router) { + private.Use(s.checkBackendMiddleware) + + // stats api + private.Route("/stats", func(statsGroup chi.Router) { + statsGroup.Get("/inbounds", s.GetInboundsStats) + statsGroup.Get("/inbound", s.GetInboundStats) + statsGroup.Get("/outbounds", s.GetOutboundsStats) + statsGroup.Get("/outbound", s.GetOutboundStats) + statsGroup.Get("/users", s.GetUsersStats) + statsGroup.Get("/user", s.GetUserStats) + statsGroup.Get("/user/online", s.GetUserOnlineStat) + statsGroup.Get("/backend", s.GetBackendStats) + }) + private.Put("/user/sync", s.SyncUser) + private.Put("/users/sync", s.SyncUsers) + }) + }) + + s.mu.Lock() + defer s.mu.Unlock() + s.Router = router +} + +type Service struct { + Router chi.Router + clientIP string + controller *controller.Controller + mu sync.Mutex +} + +func (s *Service) connect(ip string) { + s.mu.Lock() + defer s.mu.Unlock() + s.clientIP = ip + s.controller.Connect() +} + +func (s *Service) disconnect() { + s.controller.Disconnect() + + s.mu.Lock() + defer s.mu.Unlock() + + s.clientIP = "" +} + +func (s *Service) StopService() { + s.mu.Lock() + defer s.mu.Unlock() + s.controller.StopJobs() +} + +func (s *Service) GetIP() string { + s.mu.Lock() + defer s.mu.Unlock() + return s.clientIP +} + +func (s *Service) response(includeID bool, extra string) *common.BaseInfoResponse { + response := &common.BaseInfoResponse{ + Started: false, + CoreVersion: "", + NodeVersion: controller.NodeVersion, + Extra: extra, + } + + s.mu.Lock() + defer s.mu.Unlock() + + back := s.controller.GetBackend() + if back != nil { + response.Started = back.Started() + response.CoreVersion = back.GetVersion() + } + + if includeID { + response.SessionId = s.controller.GetSessionID().String() + } + + return response +} + +func StartHttpListener(tlsConfig *tls.Config, addr string) (func(ctx context.Context) error, controller.Service, error) { + s := NewService() + + httpServer := &http.Server{ + Addr: addr, + TLSConfig: tlsConfig, + Handler: s.Router, + } + + go func() { + log.Println("HTTP Server listening on", addr) + log.Println("Press Ctrl+C to stop") + if err := httpServer.ListenAndServeTLS("", ""); err != nil && !errors.Is(err, http.ErrServerClosed) { + log.Printf("HTTP server error: %v", err) + } + }() + + // Return a shutdown function for HTTP server + return httpServer.Shutdown, controller.Service(s), nil +} diff --git a/controller/rest/stats.go b/controller/rest/stats.go new file mode 100644 index 0000000..c4c878f --- /dev/null +++ b/controller/rest/stats.go @@ -0,0 +1,153 @@ +package rest + +import ( + "net/http" + + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) GetOutboundsStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetOutboundsStats(r.Context(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetOutboundStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + if request.GetName() == "" { + http.Error(w, "name is required", http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetOutboundStats(r.Context(), request.GetName(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetInboundsStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetInboundsStats(r.Context(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetInboundStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + if request.GetName() == "" { + http.Error(w, "name is required", http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetInboundStats(r.Context(), request.GetName(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetUsersStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetUsersStats(r.Context(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetUserStats(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + if request.GetName() == "" { + http.Error(w, "name is required", http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetUserStats(r.Context(), request.GetName(), request.GetReset_()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetUserOnlineStat(w http.ResponseWriter, r *http.Request) { + var request common.StatRequest + if err := common.ReadProtoBody(r.Body, &request); err != nil { + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + + if request.GetName() == "" { + http.Error(w, "name is required", http.StatusBadRequest) + return + } + + stats, err := s.controller.GetBackend().GetStatOnline(r.Context(), request.GetName()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetBackendStats(w http.ResponseWriter, r *http.Request) { + stats, err := s.controller.GetBackend().GetSysStats(r.Context()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + common.SendProtoResponse(w, stats) +} + +func (s *Service) GetSystemStats(w http.ResponseWriter, _ *http.Request) { + common.SendProtoResponse(w, s.controller.GetStats()) +} diff --git a/controller/rest/user.go b/controller/rest/user.go new file mode 100644 index 0000000..7c91c2f --- /dev/null +++ b/controller/rest/user.go @@ -0,0 +1,71 @@ +package rest + +import ( + "io" + "net/http" + + "google.golang.org/protobuf/proto" + + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) SyncUser(w http.ResponseWriter, r *http.Request) { + body, err := io.ReadAll(r.Body) + if err != nil { + http.Error(w, "Failed to read request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + + user := &common.User{} + if err = proto.Unmarshal(body, user); err != nil { + http.Error(w, "Failed to decode user", http.StatusBadRequest) + return + } + + if user == nil { + http.Error(w, "no user received", http.StatusBadRequest) + return + } + + if err = s.controller.GetBackend().SyncUser(r.Context(), user); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + response, _ := proto.Marshal(&common.Empty{}) + + w.Header().Set("Content-Type", "application/x-protobuf") + if _, err = w.Write(response); err != nil { + http.Error(w, "Failed to write response", http.StatusInternalServerError) + return + } +} + +func (s *Service) SyncUsers(w http.ResponseWriter, r *http.Request) { + body, err := io.ReadAll(r.Body) + if err != nil { + http.Error(w, "Failed to read request body", http.StatusBadRequest) + return + } + defer r.Body.Close() + + users := &common.Users{} + if err = proto.Unmarshal(body, users); err != nil { + http.Error(w, "Failed to decode user", http.StatusBadRequest) + return + } + + if err = s.controller.GetBackend().SyncUsers(r.Context(), users.GetUsers()); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + response, _ := proto.Marshal(&common.Empty{}) + + w.Header().Set("Content-Type", "application/x-protobuf") + if _, err = w.Write(response); err != nil { + http.Error(w, "Failed to write response", http.StatusInternalServerError) + return + } +} diff --git a/controller/rpc/base.go b/controller/rpc/base.go new file mode 100644 index 0000000..ac1adca --- /dev/null +++ b/controller/rpc/base.go @@ -0,0 +1,50 @@ +package rpc + +import ( + "context" + "errors" + + "github.com/m03ed/gozargah-node/backend" + "github.com/m03ed/gozargah-node/backend/xray" + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) Start(ctx context.Context, detail *common.Backend) (*common.BaseInfoResponse, error) { + ctx, err := s.detectBackend(ctx, detail) + if err != nil { + return nil, err + } + + if err = s.controller.StartBackend(ctx, detail.GetType()); err != nil { + return nil, err + } + + s.connect() + + return s.controller.BaseInfoResponse(true, ""), nil +} + +func (s *Service) Stop(_ context.Context, _ *common.Empty) (*common.Empty, error) { + s.disconnect() + return nil, nil +} + +func (s *Service) detectBackend(ctx context.Context, detail *common.Backend) (context.Context, error) { + if detail.GetType() == common.BackendType_XRAY { + config, err := xray.NewXRayConfig(detail.GetConfig()) + if err != nil { + return nil, err + } + ctx = context.WithValue(ctx, backend.ConfigKey{}, config) + } else { + return nil, errors.New("unknown backend type") + } + + ctx = context.WithValue(ctx, backend.UsersKey{}, detail.GetUsers()) + + return ctx, nil +} + +func (s *Service) GetBaseInfo(_ context.Context, _ *common.Empty) (*common.BaseInfoResponse, error) { + return s.controller.BaseInfoResponse(false, ""), nil +} diff --git a/controller/rpc/log.go b/controller/rpc/log.go new file mode 100644 index 0000000..6042455 --- /dev/null +++ b/controller/rpc/log.go @@ -0,0 +1,29 @@ +package rpc + +import ( + "errors" + "fmt" + + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) GetLogs(_ *common.Empty, stream common.NodeService_GetLogsServer) error { + logChan := s.controller.GetBackend().GetLogs() + + for { + select { + case log, ok := <-logChan: + if !ok { + return errors.New("log channel closed") + } + + if err := stream.Send(&common.Log{Detail: log}); err != nil { + return fmt.Errorf("failed to send log: %w", err) + } + + case <-stream.Context().Done(): + // Client has disconnected or cancelled the request + return stream.Context().Err() + } + } +} diff --git a/controller/rpc/middleware.go b/controller/rpc/middleware.go new file mode 100644 index 0000000..ffb9e57 --- /dev/null +++ b/controller/rpc/middleware.go @@ -0,0 +1,263 @@ +package rpc + +import ( + "context" + "fmt" + "log" + "strings" + + "github.com/google/uuid" + grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/status" +) + +func validateSessionID(ctx context.Context, s *Service) error { + // Extract metadata + md, ok := metadata.FromIncomingContext(ctx) + if !ok { + return status.Errorf(codes.Unauthenticated, "missing metadata") + } + + // Check session ID + sessionID := s.controller.GetSessionID() + if sessionID == uuid.Nil { + return status.Errorf(codes.Unauthenticated, "please connect first") + } + + // Extract Authorization header + authHeader, ok := md["authorization"] + if !ok || len(authHeader) == 0 { + return status.Errorf(codes.Unauthenticated, "missing authorization header") + } + + // Validate token format (Bearer ) + tokenParts := strings.Split(authHeader[0], " ") + if len(tokenParts) != 2 || tokenParts[0] != "Bearer" { + return status.Errorf(codes.InvalidArgument, "invalid authorization header format") + } + + // Parse token + tokenString := tokenParts[1] + token, err := uuid.Parse(tokenString) + if err != nil { + return status.Errorf(codes.InvalidArgument, "invalid session ID: %v", err) + } + + // Check if session ID matches + if token != sessionID { + return status.Errorf(codes.PermissionDenied, "session ID mismatch") + } + + return nil +} + +func CheckSessionIDMiddleware(s *Service) grpc.UnaryServerInterceptor { + return func( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, + ) (interface{}, error) { + if err := validateSessionID(ctx, s); err != nil { + return nil, err + } + + return handler(ctx, req) + } +} + +func CheckSessionIDStreamMiddleware(s *Service) grpc.StreamServerInterceptor { + return func( + srv interface{}, + ss grpc.ServerStream, + info *grpc.StreamServerInfo, + handler grpc.StreamHandler, + ) error { + // Use common session validation logic + if err := validateSessionID(ss.Context(), s); err != nil { + log.Println("invalid session ID stream:", err) + return err + } + + return handler(srv, ss) + } +} + +func checkBackendStatus(s *Service) error { + back := s.controller.GetBackend() + if back == nil { + return status.Errorf(codes.Internal, "backend not initialized") + } + if !back.Started() { + return status.Errorf(codes.Unavailable, "core is not started yet") + } + return nil +} + +func CheckBackendMiddleware(s *Service) grpc.UnaryServerInterceptor { + return func( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, + ) (interface{}, error) { + if err := checkBackendStatus(s); err != nil { + return nil, err + } + + return handler(ctx, req) + } +} + +func CheckBackendStreamMiddleware(s *Service) grpc.StreamServerInterceptor { + return func( + srv interface{}, + ss grpc.ServerStream, + info *grpc.StreamServerInfo, + handler grpc.StreamHandler, + ) error { + if err := checkBackendStatus(s); err != nil { + return err + } + + return handler(srv, ss) + } +} + +func logRequest(ctx context.Context, method string, err error) { + // Extract client IP + clientIP := "unknown" + if p, ok := peer.FromContext(ctx); ok { + clientIP = p.Addr.String() + } + + logEntry := fmt.Sprintf("IP: %s, Method: %s,", clientIP, strings.TrimPrefix(method, "/service.NodeService/")) + + // Log based on the response status + if err != nil { + st, _ := status.FromError(err) + log.Println(logEntry, "Code:", st.Code()) + } else { + log.Println(logEntry, "Status: Success") + } +} + +func LoggingInterceptor( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, +) (interface{}, error) { + // Handle the request + resp, err := handler(ctx, req) + + // Log the request + logRequest(ctx, info.FullMethod, err) + + return resp, err +} + +func LoggingStreamInterceptor() grpc.StreamServerInterceptor { + return func( + srv interface{}, + ss grpc.ServerStream, + info *grpc.StreamServerInfo, + handler grpc.StreamHandler, + ) error { + clientIP := "unknown" + if p, ok := peer.FromContext(ss.Context()); ok { + clientIP = p.Addr.String() + } + log.Printf("Trying To Open Stream Connection, IP: %s, Method: %s,", clientIP, strings.TrimPrefix(info.FullMethod, "/service.NodeService/")) + + // Handle the request + err := handler(srv, ss) + + // Log the request + logRequest(ss.Context(), info.FullMethod, err) + + return err + } +} + +var backendMethods = map[string]bool{ + "/service.NodeService/GetOutboundsStats": true, + "/service.NodeService/GetOutboundStats": true, + "/service.NodeService/GetInboundsStats": true, + "/service.NodeService/GetInboundStats": true, + "/service.NodeService/GetUsersStats": true, + "/service.NodeService/GetUserStats": true, + "/service.NodeService/GetUserOnlineStats": true, + "/service.NodeService/GetBackendStats": true, + "/service.NodeService/SyncUser": true, + "/service.NodeService/SyncUsers": true, +} + +var sessionIDMethods = map[string]bool{ + "/service.NodeService/Stop": true, + "/service.NodeService/GetBaseInfo": true, + "/service.NodeService/GetLogs": true, + "/service.NodeService/GetSystemStats": true, + "/service.NodeService/GetOutboundsStats": true, + "/service.NodeService/GetOutboundStats": true, + "/service.NodeService/GetInboundsStats": true, + "/service.NodeService/GetInboundStats": true, + "/service.NodeService/GetUsersStats": true, + "/service.NodeService/GetUserStats": true, + "/service.NodeService/GetUserOnlineStats": true, + "/service.NodeService/GetBackendStats": true, + "/service.NodeService/SyncUser": true, + "/service.NodeService/SyncUsers": true, +} + +func ConditionalMiddleware(s *Service) grpc.UnaryServerInterceptor { + return func( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, + ) (interface{}, error) { + var interceptors []grpc.UnaryServerInterceptor + + interceptors = append(interceptors, LoggingInterceptor) + + if sessionIDMethods[info.FullMethod] { + interceptors = append(interceptors, CheckSessionIDMiddleware(s)) + } + + if backendMethods[info.FullMethod] { + interceptors = append(interceptors, CheckBackendMiddleware(s)) + } + + chained := grpcmiddleware.ChainUnaryServer(interceptors...) + return chained(ctx, req, info, handler) + } +} + +func ConditionalStreamMiddleware(s *Service) grpc.StreamServerInterceptor { + return func( + srv interface{}, + ss grpc.ServerStream, + info *grpc.StreamServerInfo, + handler grpc.StreamHandler, + ) error { + var interceptors []grpc.StreamServerInterceptor + + interceptors = append(interceptors, LoggingStreamInterceptor()) + + if sessionIDMethods[info.FullMethod] { + interceptors = append(interceptors, CheckSessionIDStreamMiddleware(s)) + } + + if backendMethods[info.FullMethod] { + interceptors = append(interceptors, CheckBackendStreamMiddleware(s)) + } + + chained := grpcmiddleware.ChainStreamServer(interceptors...) + return chained(srv, ss, info, handler) + } +} diff --git a/controller/rpc/rpc_test.go b/controller/rpc/rpc_test.go new file mode 100644 index 0000000..8328b07 --- /dev/null +++ b/controller/rpc/rpc_test.go @@ -0,0 +1,323 @@ +package rpc + +import ( + "context" + "fmt" + "io" + "log" + "os" + "testing" + "time" + + "github.com/google/uuid" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/config" + nodeLogger "github.com/m03ed/gozargah-node/logger" + "github.com/m03ed/gozargah-node/tools" +) + +var ( + servicePort = 8001 + nodeHost = "127.0.0.1" + xrayExecutablePath = "/usr/local/bin/xray" + xrayAssetsPath = "/usr/local/share/xray" + sslCertFile = "../../certs/ssl_cert.pem" + sslKeyFile = "../../certs/ssl_key.pem" + sslClientCertFile = "../../certs/ssl_client_cert.pem" + sslClientKeyFile = "../../certs/ssl_client_key.pem" + generatedConfigPath = "../../generated/" + addr = fmt.Sprintf("%s:%d", nodeHost, servicePort) + configPath = "../../backend/xray/config.json" +) + +func TestGRPCConnection(t *testing.T) { + config.SetEnv(servicePort, 0, nodeHost, xrayExecutablePath, xrayAssetsPath, sslCertFile, + sslKeyFile, sslClientCertFile, "grpc", generatedConfigPath, true) + + nodeLogger.SetOutputMode(true) + + certFileExists := tools.FileExists(sslCertFile) + keyFileExists := tools.FileExists(sslKeyFile) + + if !certFileExists || !keyFileExists { + if err := tools.RewriteSslFile(sslCertFile, sslKeyFile); err != nil { + t.Fatal(err) + } + } + clientCertFileExists := tools.FileExists(sslClientCertFile) + if !clientCertFileExists { + t.Fatal("SSL_CLIENT_CERT_FILE is required.") + } + + clientKeyFileExists := tools.FileExists(sslClientCertFile) + if !clientKeyFileExists { + t.Fatal("SSL_CLIENT_KEY_FILE is required.") + } + + tlsConfig, err := tools.LoadTLSCredentials(sslCertFile, sslKeyFile, sslClientCertFile, false) + if err != nil { + t.Fatal(err) + } + + shutdownFunc, s, err := StartGRPCListener(tlsConfig, addr) + defer s.StopService() + if err != nil { + t.Fatal(err) + } + + creds, err := tools.LoadTLSCredentials(sslClientCertFile, sslClientKeyFile, sslCertFile, true) + if err != nil { + t.Fatal(err) + } + + conn, err := grpc.NewClient(addr, grpc.WithTransportCredentials(credentials.NewTLS(creds))) + if err != nil { + t.Fatalf("Failed to connect to gRPC server: %v", err) + } + defer conn.Close() + + client := common.NewNodeServiceClient(conn) + + configFile, err := os.ReadFile(configPath) + if err != nil { + t.Fatal(err) + } + + baseCtx := context.Background() + + ctx, cancel := context.WithTimeout(baseCtx, 5*time.Second) + defer cancel() + + _, err = client.GetBaseInfo(ctx, &common.Empty{}) + if err != nil { + log.Println("info error: ", err) + } else { + t.Fatal("expected session ID error") + } + + ctx, cancel = context.WithTimeout(baseCtx, 5*time.Second) + defer cancel() + + info, err := client.Start(ctx, + &common.Backend{ + Type: common.BackendType_XRAY, + Config: string(configFile), + }) + if err != nil { + t.Fatal(err) + } + + sessionID := info.SessionId + log.Println("Session ID:", sessionID) + + // Add SessionId to the metadata + md := metadata.Pairs("authorization", "Bearer "+info.SessionId) + ctxWithSession := metadata.NewOutgoingContext(context.Background(), md) + + // test all methods + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetBackendStats + backStats, err := client.GetBackendStats(ctx, &common.Empty{}) + if err != nil { + t.Fatalf("Failed to get backend stats: %v", err) + } + log.Println(backStats) + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetOutboundsStats + stats, err := client.GetOutboundsStats(ctx, &common.StatRequest{Reset_: true}) + if err != nil { + t.Fatalf("Failed to get outbounds stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetInboundsStats + stats, err = client.GetInboundsStats(ctx, &common.StatRequest{Reset_: true}) + if err != nil { + t.Fatalf("Failed to get inbounds stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetUsersStats + stats, err = client.GetUsersStats(ctx, &common.StatRequest{Reset_: true}) + if err != nil { + t.Fatalf("Failed to get users stats: %v", err) + } + + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 10*time.Second) + defer cancel() + + syncUser, _ := client.SyncUser(ctx) + + user := &common.User{ + Email: "test_user1@example.com", + Inbounds: []string{ + "VMESS TCP NOTLS", + "VLESS TCP REALITY", + "TROJAN TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-256-gcm", + }, + }, + } + + if err = syncUser.Send(user); err != nil { + t.Fatalf("Failed to sync user: %v", err) + } + + user = &common.User{ + Email: "test_user2@example.com", + Inbounds: []string{ + "VMESS TCP NOTLS", + "VLESS TCP REALITY", + "TROJAN TCP NOTLS", + "Shadowsocks TCP", + "Shadowsocks UDP", + }, + Proxies: &common.Proxy{ + Vmess: &common.Vmess{ + Id: uuid.New().String(), + }, + Vless: &common.Vless{ + Id: uuid.New().String(), + }, + Trojan: &common.Trojan{ + Password: "try a random string", + }, + Shadowsocks: &common.Shadowsocks{ + Password: "try a random string", + Method: "aes-256-gcm", + }, + }, + } + + if err = syncUser.Send(user); err != nil { + t.Fatalf("Failed to sync user: %v", err) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + stats, err = client.GetUserStats(ctx, &common.StatRequest{Name: user.GetEmail(), Reset_: true}) + if err != nil { + t.Fatalf("Failed to get user stats: %v", err) + } + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + stats, err = client.GetOutboundStats(ctx, &common.StatRequest{Name: "direct", Reset_: true}) + if err != nil { + t.Fatalf("Failed to get outbound stats: %v", err) + } + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + stats, err = client.GetInboundStats(ctx, &common.StatRequest{Name: "Shadowsocks TCP", Reset_: true}) + if err != nil { + t.Fatalf("Failed to get inbound stats: %v", err) + } + for _, stat := range stats.GetStats() { + log.Println(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetLogs Stream + logs, _ := client.GetLogs(ctx, &common.Empty{}) +loop: + for { + newLog, err := logs.Recv() + if err == io.EOF { + break loop + } + + if errStatus, ok := status.FromError(err); ok { + switch errStatus.Code() { + case codes.DeadlineExceeded: + log.Printf("Operation timed out: %v", err) + break loop + case codes.Canceled: + log.Printf("Operation was canceled: %v", err) + break loop + default: + if err != nil { + t.Fatalf("Failed to receive log: %v (gRPC code: %v)", err, errStatus.Code()) + } + } + } + + if newLog != nil { + fmt.Println("Log detail:", newLog.Detail) + } + } + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + // test GetNodeStats + nodeStats, err := client.GetSystemStats(ctx, &common.Empty{}) + if err != nil { + t.Fatalf("Failed to get node stats: %v", err) + } + log.Println(nodeStats) + + ctx, cancel = context.WithTimeout(ctxWithSession, 5*time.Second) + defer cancel() + + if _, err = client.Stop(ctx, nil); err != nil { + t.Fatalf("Failed to stop s: %v", err) + } + + if err = shutdownFunc(ctx); err != nil { + t.Fatalf("Failed to shutdown server: %v", err) + } +} diff --git a/controller/rpc/service.go b/controller/rpc/service.go new file mode 100644 index 0000000..6e0f045 --- /dev/null +++ b/controller/rpc/service.go @@ -0,0 +1,89 @@ +package rpc + +import ( + "context" + "crypto/tls" + "fmt" + "log" + "net" + "sync" + + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + + "github.com/m03ed/gozargah-node/common" + "github.com/m03ed/gozargah-node/controller" +) + +type Service struct { + common.UnimplementedNodeServiceServer + controller *controller.Controller + mu sync.Mutex +} + +func NewService() *Service { + s := &Service{controller: controller.NewController()} + return s +} + +func (s *Service) StopService() { + s.mu.Lock() + defer s.mu.Unlock() + s.controller.StopJobs() +} + +func (s *Service) connect() { + s.controller.Connect() +} + +func (s *Service) disconnect() { + s.controller.Disconnect() +} + +func StartGRPCListener(tlsConfig *tls.Config, addr string) (func(ctx context.Context) error, controller.Service, error) { + s := NewService() + + creds := credentials.NewTLS(tlsConfig) + + // Create the gRPC server with conditional middleware + grpcServer := grpc.NewServer( + grpc.Creds(creds), + grpc.UnaryInterceptor(ConditionalMiddleware(s)), + grpc.StreamInterceptor(ConditionalStreamMiddleware(s)), + ) + + // Register the service + common.RegisterNodeServiceServer(grpcServer, s) + + listener, err := net.Listen("tcp", addr) + if err != nil { + return nil, nil, fmt.Errorf("failed to listen on %s: %w", addr, err) + } + + go func() { + log.Println("gRPC Server listening on", addr) + log.Println("Press Ctrl+C to stop") + if err = grpcServer.Serve(listener); err != nil { + log.Printf("gRPC server error: %v", err) + } + }() + + // Create a shutdown function for gRPC server + return func(ctx context.Context) error { + // Graceful stop for gRPC server + stopped := make(chan struct{}) + go func() { + grpcServer.GracefulStop() + close(stopped) + }() + + // Wait for server to stop or context to timeout + select { + case <-stopped: + return nil + case <-ctx.Done(): + grpcServer.Stop() // Force stop if graceful stop times out + return ctx.Err() + } + }, controller.Service(s), nil +} diff --git a/controller/rpc/stats.go b/controller/rpc/stats.go new file mode 100644 index 0000000..40e3738 --- /dev/null +++ b/controller/rpc/stats.go @@ -0,0 +1,56 @@ +package rpc + +import ( + "context" + "errors" + + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) GetOutboundsStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + return s.controller.GetBackend().GetOutboundsStats(ctx, request.GetReset_()) +} + +func (s *Service) GetOutboundStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + if request.GetName() == "" { + return nil, errors.New("name is required") + } + return s.controller.GetBackend().GetOutboundStats(ctx, request.GetName(), request.GetReset_()) +} + +func (s *Service) GetInboundsStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + return s.controller.GetBackend().GetInboundsStats(ctx, request.GetReset_()) +} + +func (s *Service) GetInboundStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + if request.GetName() == "" { + return nil, errors.New("name is required") + } + return s.controller.GetBackend().GetInboundStats(ctx, request.GetName(), request.GetReset_()) +} + +func (s *Service) GetUsersStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + return s.controller.GetBackend().GetUsersStats(ctx, request.GetReset_()) +} + +func (s *Service) GetUserStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { + if request.GetName() == "" { + return nil, errors.New("name is required") + } + return s.controller.GetBackend().GetUserStats(ctx, request.GetName(), request.GetReset_()) +} + +func (s *Service) GetUserOnlineStats(ctx context.Context, request *common.StatRequest) (*common.OnlineStatResponse, error) { + if request.GetName() == "" { + return nil, errors.New("name is required") + } + return s.controller.GetBackend().GetStatOnline(ctx, request.GetName()) +} + +func (s *Service) GetBackendStats(ctx context.Context, _ *common.Empty) (*common.BackendStatsResponse, error) { + return s.controller.GetBackend().GetSysStats(ctx) +} + +func (s *Service) GetSystemStats(_ context.Context, _ *common.Empty) (*common.SystemStatsResponse, error) { + return s.controller.GetStats(), nil +} diff --git a/controller/rpc/user.go b/controller/rpc/user.go new file mode 100644 index 0000000..8d83bd2 --- /dev/null +++ b/controller/rpc/user.go @@ -0,0 +1,41 @@ +package rpc + +import ( + "context" + "errors" + "io" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/m03ed/gozargah-node/common" +) + +func (s *Service) SyncUser(stream grpc.ClientStreamingServer[common.User, common.Empty]) error { + for { + user, err := stream.Recv() + if err == io.EOF { + return stream.SendAndClose(&common.Empty{}) + } + if err != nil { + return status.Errorf(codes.Internal, "failed to receive user: %v", err) + } + + if user.GetEmail() == "" { + return errors.New("email is required") + } + + if err = s.controller.GetBackend().SyncUser(stream.Context(), user); err != nil { + return status.Errorf(codes.Internal, "failed to update user: %v", err) + } + } +} + +func (s *Service) SyncUsers(ctx context.Context, users *common.Users) (*common.Empty, error) { + if err := s.controller.GetBackend().SyncUsers(ctx, users.GetUsers()); err != nil { + return nil, err + } + + return nil, nil +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..150dbd8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +services: + gozargah-node: + image: m03ed/gozargah-node:latest + # for situations, you don't have access to docker hub use 👇 + # image: ghcr.io/m03ed/gozargah-node:dev + restart: always + network_mode: host + + environment: + SERVICE_PORT: 62050 + SERVICE_PROTOCOL: "grpc" + + SSL_CERT_FILE: "/var/lib/gozargah-node/certs/ssl_cert.pem" + SSL_KEY_FILE: "/var/lib/gozargah-node/certs/ssl_key.pem" + SSL_CLIENT_CERT_FILE: "/var/lib/gozargah-node/certs/ssl_client_cert.pem" + + GENERATED_CONFIG_PATH: "/var/lib/gozargah-node/generated" + + volumes: + - /var/lib/gozargah-node:/var/lib/gozargah-node diff --git a/go.mod b/go.mod index 2e40a1b..afe090e 100644 --- a/go.mod +++ b/go.mod @@ -1,24 +1,58 @@ -module marzban-node +module github.com/m03ed/gozargah-node -go 1.23.0 +go 1.24.0 require ( - github.com/go-chi/chi/v5 v5.1.0 + github.com/go-chi/chi/v5 v5.2.1 github.com/google/uuid v1.6.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/joho/godotenv v1.5.1 github.com/shirou/gopsutil v3.21.11+incompatible - google.golang.org/grpc v1.65.0 - google.golang.org/protobuf v1.34.2 + github.com/xtls/xray-core v1.8.25-0.20241130041635-98a72b6fb49b + google.golang.org/grpc v1.70.0 + google.golang.org/protobuf v1.36.5 ) require ( + github.com/andybalholm/brotli v1.1.0 // indirect + github.com/cloudflare/circl v1.4.0 // indirect + github.com/dgryski/go-metro v0.0.0-20211217172704-adc40b04c140 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/google/pprof v0.0.0-20240528025155-186aa0362fba // indirect + github.com/gorilla/websocket v1.5.3 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/onsi/ginkgo/v2 v2.19.0 // indirect + github.com/pires/go-proxyproto v0.8.0 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/quic-go v0.46.0 // indirect + github.com/refraction-networking/utls v1.6.7 // indirect + github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect + github.com/sagernet/sing v0.5.1 // indirect + github.com/sagernet/sing-shadowsocks v0.2.7 // indirect + github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect github.com/tklauser/go-sysconf v0.3.14 // indirect github.com/tklauser/numcpus v0.8.0 // indirect + github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e // indirect + github.com/vishvananda/netlink v1.3.0 // indirect + github.com/vishvananda/netns v0.0.4 // indirect + github.com/xtls/reality v0.0.0-20240712055506-48f0b2d5ed6d // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect + go.uber.org/mock v0.4.0 // indirect + go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect + golang.org/x/crypto v0.33.0 // indirect + golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect + golang.org/x/mod v0.18.0 // indirect + golang.org/x/net v0.35.0 // indirect + golang.org/x/sys v0.30.0 // indirect + golang.org/x/text v0.22.0 // indirect + golang.org/x/time v0.5.0 // indirect + golang.org/x/tools v0.22.0 // indirect + golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect + golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect + gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489 // indirect + lukechampine.com/blake3 v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 0dffaa4..83e8abf 100644 --- a/go.sum +++ b/go.sum @@ -1,64 +1,255 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +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/go.mod h1:FVGavL/QEBQDcBpr3fAojoK17xX5k9bicBphrOpP7uM= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY= +github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= -github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= +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/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +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/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= +github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +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/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/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/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.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +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/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/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +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/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= +github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= +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/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +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/pires/go-proxyproto v0.8.0 h1:5unRmEAPbHXHuLjDg01CxJWf91cw3lKHc/0xzKpXEe0= +github.com/pires/go-proxyproto v0.8.0/go.mod h1:iknsfgnH8EkjrMeMyvfKByp9TiBZCKZM0jx2xmKqnVY= +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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/quic-go v0.46.0 h1:uuwLClEEyk1DNvchH8uCByQVjo3yKL9opKulExNDs7Y= +github.com/quic-go/quic-go v0.46.0/go.mod h1:1dLehS7TIR64+vxGR70GDcatWTOtMX2PUtnKsjbTurI= +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/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/sagernet/sing v0.5.1 h1:mhL/MZVq0TjuvHcpYcFtmSD1BFOxZ/+8ofbNZcg1k1Y= +github.com/sagernet/sing v0.5.1/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= +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/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 h1:emzAzMZ1L9iaKCTxdy3Em8Wv4ChIAGnfiz18Cda70g4= +github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771/go.mod h1:bR6DqgcAl1zTcOX8/pE2Qkj9XO00eCNqmKb7lXP8EAg= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -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/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tklauser/go-sysconf v0.3.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= github.com/tklauser/numcpus v0.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= github.com/tklauser/numcpus v0.8.0/go.mod h1:ZJZlAY+dmR4eut8epnzf0u/VwodKmryxR8txiloSqBE= +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/vishvananda/netlink v1.3.0 h1:X7l42GfcV4S6E4vHTsw48qbrV+9PVojNfIhZcwQdrZk= +github.com/vishvananda/netlink v1.3.0/go.mod h1:i6NetklAujEcC6fK0JPjT8qSwWyO0HLn4UKG+hGqeJs= +github.com/vishvananda/netns v0.0.4 h1:Oeaw1EM2JMxD51g9uhtC0D7erkIjgmj8+JZc26m1YX8= +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/go.mod h1:dm4y/1QwzjGaK17ofi0Vs6NpKAHegZky8qk6J2JJZAE= +github.com/xtls/xray-core v1.8.25-0.20241130041635-98a72b6fb49b h1:h8DhM+nmPMo4yKqNnxQ7TZ3e8YiESKm9h0gE45UiNmA= +github.com/xtls/xray-core v1.8.25-0.20241130041635-98a72b6fb49b/go.mod h1:BCeSy6P4xz8vSk46ziVkg0iby82W2Mmqvz2ub5kfYrc= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +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= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/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-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +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/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= +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/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +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/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-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +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-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= +golang.org/x/sync v0.11.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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= -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/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= -google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= -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/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +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.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +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/tools v0.0.0-20180917221912-90fa682c2a6e/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-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/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.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.22.0 h1:gqSGLZqv+AI9lIQzniJ0nZDRG5GBPsSi+DRNHWNz6yA= +golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeunTOisW56dUokqW/FOteYJJ/yg= +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/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +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-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= +google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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.v3 v3.0.0-20200313102051-9f266ea9e77c/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.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= +lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= diff --git a/logger/logger.go b/logger/logger.go index c843b5b..d032f12 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -3,25 +3,24 @@ package logger import ( "fmt" "log" - "marzban-node/config" "os" "path/filepath" - "regexp" + "sync" ) var ( - re *regexp.Regexp + outputLogs = false accessLogFile *os.File errorLogFile *os.File accessLogger *log.Logger errorLogger *log.Logger + mutex sync.Mutex ) -func init() { - pattern := `^(\d{4}/\d{2}/\d{2}) (\d{2}:\d{2}:\d{2}) (\[.*?\]) (.*)$` - - // Compile the regex - re = regexp.MustCompile(pattern) +func SetOutputMode(mode bool) { + mutex.Lock() + defer mutex.Unlock() + outputLogs = mode } func openLogFile(path string) (*os.File, error) { @@ -43,122 +42,53 @@ func openLogFile(path string) (*os.File, error) { return f, nil } -func SetLogFile(accessPath, errorPath string) { - // Close any previously opened files - if accessLogFile != nil { - _ = accessLogFile.Close() - accessLogFile = nil - } - if errorLogFile != nil { - _ = errorLogFile.Close() - errorLogFile = nil - } +func SetLogFile(accessPath, errorPath string) error { + mutex.Lock() + defer mutex.Unlock() var err error - accessLogFile, err = openLogFile(accessPath) - switch { - case err != nil: - Error("Error opening access log file: ", err) - Warning("Access log will not be recorded on file") - accessLogger = nil - case accessLogger != nil: - // Create the access logger - accessLogger = log.New(accessLogFile, "", 0) - default: - accessLogger = nil + if accessLogFile, err = openLogFile(accessPath); err != nil { + return fmt.Errorf("failed to open access log: %w", err) + } + if accessLogFile != nil { + accessLogger = log.New(accessLogFile, "", log.LstdFlags) } - errorLogFile, err = openLogFile(errorPath) - switch { - case err != nil: - Error("Error opening error log file: ", err) - Warning("Error log will not be recorded on file") - errorLogger = nil - case errorLogFile != nil: - // Create the error logger - errorLogger = log.New(errorLogFile, "", 0) - default: - errorLogger = nil + if errorLogFile, err = openLogFile(errorPath); err != nil { + return fmt.Errorf("failed to open error log: %w", err) + } + if errorLogFile != nil { + errorLogger = log.New(errorLogFile, "", log.LstdFlags) } + + return nil } const ( - colorReset = "\033[0m" - colorRed = "\033[31m" - colorGreen = "\033[32m" - colorYellow = "\033[33m" - colorBlue = "\033[34m" - colorMagenta = "\033[35m" - colorCyan = "\033[36m" + LogDebug = "Debug" + LogInfo = "Info" + LogWarning = "Warning" + LogError = "Error" + LogCritical = "Critical" ) -func Info(message ...any) { - formattedLog := fmt.Sprintf("%s[Info] %s %s", colorGreen, colorReset, message) - log.Println(formattedLog) -} - -func Api(message ...any) { - formattedLog := fmt.Sprintf("%s[Api] %s %s", colorCyan, colorReset, message) - log.Println(formattedLog) -} - -func Error(message ...any) { - formattedLog := fmt.Sprintf("%s[Error]%s %s", colorRed, colorReset, message) - log.Println(formattedLog) -} - -func Debug(message ...any) { - formattedLog := fmt.Sprintf("%s[Debug] %s %s", colorBlue, colorReset, message) - log.Println(formattedLog) -} - -func Warning(message ...any) { - formattedLog := fmt.Sprintf("%s[Warning] %s %s", colorYellow, colorReset, message) - log.Println(formattedLog) -} - -func Critical(message ...any) { - formattedLog := fmt.Sprintf("%s[Critical] %s %s", colorMagenta, colorReset, message) - log.Println(formattedLog) -} - -func DetectLogType(newLog string) { - level := "" - message := "" - - // Find the matches - matches := re.FindStringSubmatch(newLog) - if len(matches) > 3 { - level = matches[3] - message = matches[4] - } else { - message = newLog - } - - if config.Debug { - switch level { - case "Debug": - Debug(message) - case "Info": - Info(message) - case "Warning": - Warning(message) - case "Error": - Error(message) - default: - Debug(message) - } +func logMessage(logger *log.Logger, level, message string) { + if logger == nil { + return } + logger.Printf("[%s] %s\n", level, message) +} +func Log(level, message string) { + formattedMessage := fmt.Sprintf("[%s] %s", level, message) switch level { - case "Error": - if errorLogger != nil { - errorLogger.Println(newLog) - } + case LogError, LogCritical: + logMessage(errorLogger, level, message) default: - if accessLogger != nil { - accessLogger.Println(newLog) - } + logMessage(accessLogger, level, message) + } + if outputLogs { + log.Println(formattedMessage) } } diff --git a/main.go b/main.go index 7e0e90f..f258fb1 100644 --- a/main.go +++ b/main.go @@ -2,99 +2,59 @@ package main import ( "context" - "crypto/tls" - "crypto/x509" - "errors" "fmt" - "marzban-node/tools" - "net/http" + "log" "os" "os/signal" "syscall" "time" - "github.com/go-chi/chi/v5" - "marzban-node/config" - log "marzban-node/logger" - "marzban-node/service" + "github.com/m03ed/gozargah-node/config" + "github.com/m03ed/gozargah-node/controller" + "github.com/m03ed/gozargah-node/controller/rest" + "github.com/m03ed/gozargah-node/controller/rpc" + nodeLogger "github.com/m03ed/gozargah-node/logger" + "github.com/m03ed/gozargah-node/tools" ) -func createServer(addr string, r chi.Router) (server *http.Server) { +func main() { + nodeLogger.SetOutputMode(config.Debug) - serverCert, err := tls.LoadX509KeyPair(config.SslCertFile, config.SslKeyFile) - if err != nil { - log.Error("Failed to load server certificate and key: ", err) - } + addr := fmt.Sprintf("%s:%d", config.NodeHost, config.ServicePort) - clientCertPool := x509.NewCertPool() - clientCert, err := os.ReadFile(config.SslClientCertFile) + tlsConfig, err := tools.LoadTLSCredentials(config.SslCertFile, config.SslKeyFile, + config.SslClientCertFile, false) if err != nil { - log.Error("Failed to read client certificate: ", err) - } - clientCertPool.AppendCertsFromPEM(clientCert) - - tlsConfig := &tls.Config{ - Certificates: []tls.Certificate{serverCert}, - ClientCAs: clientCertPool, - ClientAuth: tls.RequireAndVerifyClientCert, - } - - server = &http.Server{ - Addr: addr, - TLSConfig: tlsConfig, - Handler: r, + log.Fatal(err) } - return server -} -func main() { - certFileExists := tools.FileExists(config.SslCertFile) - keyFileExists := tools.FileExists(config.SslKeyFile) - if !certFileExists || !keyFileExists { - tools.RewriteSslFile() - } - sslClientCertFile := tools.FileExists(config.SslClientCertFile) + log.Printf("Starting Node Version: %s", controller.NodeVersion) - if !sslClientCertFile { - panic("SSL_CLIENT_CERT_FILE is required for rest service.") - } + var shutdownFunc func(ctx context.Context) error + var service controller.Service - addr := fmt.Sprintf("%s:%d", config.NodeHost, config.ServicePort) - s, err := service.NewService() - if err != nil { - panic(err) + if config.ServiceProtocol == "rest" { + shutdownFunc, service, err = rest.StartHttpListener(tlsConfig, addr) + } else { + shutdownFunc, service, err = rpc.StartGRPCListener(tlsConfig, addr) } - server := createServer(addr, s.Router) + defer service.StopService() - // Create a channel to listen for interrupt signals stopChan := make(chan os.Signal, 1) signal.Notify(stopChan, os.Interrupt, syscall.SIGTERM) - // Start server with TLS - go func() { - log.Info("Server is listening on", addr) - log.Info("Press Ctrl+C to stop") - if err = server.ListenAndServeTLS("", ""); err != nil && !errors.Is(http.ErrServerClosed, err) { - log.Error("Failed to start server: %v", err) - } - }() - - // Wait for interrupt signal + // Wait for interrupt <-stopChan - log.Info("Shutting down server...") - - log.Info("Performing cleanup job...") - s.StopJobs() + log.Println("Shutting down server...") - // Create a context with timeout for the shutdown - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + // Graceful shutdown + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - // Shutdown the server gracefully - if err = server.Shutdown(ctx); err != nil { - log.Error("Server forced to shutdown: ", err) + if err = shutdownFunc(ctx); err != nil { + log.Printf("Server shutdown error: %v", err) } - log.Info("Server gracefully stopped") + log.Println("Server gracefully stopped") } diff --git a/node_test.go b/node_test.go deleted file mode 100644 index 1d6b325..0000000 --- a/node_test.go +++ /dev/null @@ -1,134 +0,0 @@ -package main - -import ( - "context" - "fmt" - "github.com/google/uuid" - log "marzban-node/logger" - "marzban-node/service" - "marzban-node/tools" - "marzban-node/xray" - "regexp" - "strings" - "testing" - "time" -) - -func TestService(t *testing.T) { - xrayFile, err := tools.ReadFileAsString("xray.json") - if err != nil { - t.Error(err) - } - - //test creating config - newConfig, err := xray.NewXRayConfig(xrayFile) - if err != nil { - t.Error(err) - } - - s := new(service.Service) - err = s.Init() - if err != nil { - t.Error(err) - } - - err = newConfig.ApplyAPI(s.GetAPIPort()) - if err != nil { - t.Error(err) - } - - core := s.GetCore() - - log.Info("core created.") - log.Info("Version: ", core.GetVersion()) - - err = core.Start(newConfig) - if err != nil { - t.Error(err) - } - - logChan := core.GetLogs() - version := core.GetVersion() - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - -Loop: - for { - select { - case lastLog := <-logChan: - if strings.Contains(lastLog, "Xray "+version+" started") { - break Loop - } else { - regex := regexp.MustCompile(`^(\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}) \[([^\]]+)\] (.+)$`) - matches := regex.FindStringSubmatch(lastLog) - if len(matches) > 3 && matches[2] == "Error" { - t.Error(matches) - } - } - case <-ctx.Done(): - t.Error("context done") - return - } - } - - if !core.Started() { - t.Error("core is not running") - } - - api := s.GetXrayAPI() - log.Info("api created.") - - ctx1, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - - // test with service StatsServiceClient - stats, err := api.GetOutboundsStats(ctx1, true) - if err != nil { - t.Error(err) - } - - for _, stat := range stats { - log.Info(fmt.Sprintf("Name: %s , Traffic: %d , Type: %s , Link: %s", stat.Name, stat.Value, stat.Type, stat.Link)) - } - - time.Sleep(10 * time.Second) - // test HandlerServiceClient - user := &xray.User{ - Email: "Mosed.1", - Inbounds: &xray.Inbounds{ - Vmess: []string{"VMESS_TCP_INBOUND", "VMESS_no_tls"}, - Vless: []string{"VLESS_Reality"}, - Trojan: []string{}, - Shadowsocks: []string{}, - }, - Proxies: &xray.Proxy{ - Vmess: &xray.VmessSetting{ - ID: uuid.New(), - }, - Vless: &xray.VlessSetting{ - ID: uuid.New(), - }, - }, - } - - ctx2, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - proxySetting := xray.SetupUserAccount(user) - - for _, inbound := range newConfig.Inbounds { - account, isActive := xray.IsActiveInbound(inbound, user, proxySetting) - if isActive { - err = api.AddInboundUser(ctx2, inbound.Tag, account) - if err != nil { - t.Error(err) - } else { - log.Info("Added user to inbound ", inbound.Tag) - } - } - } - - time.Sleep(time.Second * 10) - - core.Stop() -} diff --git a/service/base_api.go b/service/base_api.go deleted file mode 100644 index 9c6080a..0000000 --- a/service/base_api.go +++ /dev/null @@ -1,209 +0,0 @@ -package service - -import ( - "context" - "encoding/json" - "errors" - "net" - "net/http" - "regexp" - "strings" - "time" - - "github.com/google/uuid" - - log "marzban-node/logger" -) - -const NodeVersion = "go-0.1.2" - -func (s *Service) Base(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response()) -} - -func (s *Service) Connect(w http.ResponseWriter, r *http.Request) { - sessionID := uuid.New() - s.SetSessionID(sessionID) - - ip, _, err := net.SplitHostPort(r.RemoteAddr) - if err != nil { - return - } - - s.SetIP(ip) - - if s.IsConnected() { - log.Info("New connection from ", ip, " core control access was taken away from previous client.") - s.core.Stop() - } - - s.SetConnected(true) - - log.Info(ip, " connected, Session ID = ", sessionID) - - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response("session_id", sessionID)) -} - -func (s *Service) Disconnect(w http.ResponseWriter, _ *http.Request) { - if s.IsConnected() { - log.Info(s.clientIP, " disconnected, Session ID = ", s.GetSessionID()) - } - - s.SetSessionID(uuid.Nil) - s.SetIP("") - s.SetConnected(false) - - core := s.GetCore() - - if core.Started() { - core.Stop() - } - - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response()) -} - -func (s *Service) Ping(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(map[string]interface{}{}) -} - -func (s *Service) Start(w http.ResponseWriter, r *http.Request) { - var body startBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - newConfig := body.Config - if newConfig == nil { - http.Error(w, "no config received", http.StatusNotAcceptable) - return - } - - if err := newConfig.ApplyAPI(s.GetAPIPort()); err != nil { - log.Error("Failed to apply API: ", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.GetCore().Start(newConfig); err != nil { - log.Error("Failed to start core: ", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.ResetXrayAPI(); err != nil { - log.Error("Failed to reset xray API: ", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.checkXrayStatus(); err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - s.SetConfig(newConfig) - - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response()) -} - -func (s *Service) Stop(w http.ResponseWriter, _ *http.Request) { - s.GetCore().Stop() - - s.SetConfig(nil) - - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response()) -} - -func (s *Service) Restart(w http.ResponseWriter, r *http.Request) { - var body startBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - newConfig := body.Config - if newConfig == nil { - http.Error(w, "no config received", http.StatusNotAcceptable) - return - } - - if err := newConfig.ApplyAPI(s.GetAPIPort()); err != nil { - log.Error("Failed to apply API: ", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.GetCore().Restart(newConfig); err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.ResetXrayAPI(); err != nil { - log.Error("Failed to reset xray API: ", err) - http.Error(w, err.Error(), http.StatusServiceUnavailable) - return - } - - if err := s.checkXrayStatus(); err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - - s.SetConfig(newConfig) - - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(s.response()) -} - -func (s *Service) checkXrayStatus() error { - core := s.GetCore() - - logChan := core.GetLogs() - version := core.GetVersion() - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - -Loop: - for { - select { - case lastLog := <-logChan: - if strings.Contains(lastLog, "Xray "+version+" started") { - break Loop - } else { - regex := regexp.MustCompile(`^(\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}) \[([^]]+)\] (.+)$`) - matches := regex.FindStringSubmatch(lastLog) - if len(matches) > 3 && matches[2] == "Error" { - return errors.New("Failed to start xray: " + matches[3]) - } - } - case <-ctx.Done(): - return errors.New("Failed to start xray: context done.") - } - } - return nil -} - -func (s *Service) response(extra ...interface{}) map[string]interface{} { - core := s.GetCore() - res := map[string]interface{}{ - "connected": s.IsConnected(), - "started": core.Started(), - "core_version": core.GetVersion(), - "node_version": NodeVersion, - } - for i := 0; i < len(extra); i += 2 { - res[extra[i].(string)] = extra[i+1] - } - return res -} diff --git a/service/log_api.go b/service/log_api.go deleted file mode 100644 index abdcc92..0000000 --- a/service/log_api.go +++ /dev/null @@ -1,81 +0,0 @@ -package service - -import ( - "encoding/json" - "marzban-node/config" - "net/http" - "time" -) - -type logResponse struct { - Logs []string `json:"logs,omitempty"` - Error string `json:"error,omitempty"` -} - -func sendLogs(w http.ResponseWriter, logs []string, status int) { - err := "" - if status != http.StatusOK { - err = http.StatusText(status) - } - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(logResponse{ - Logs: logs, - Error: err, - }) -} - -func (s *Service) Logs(w http.ResponseWriter, r *http.Request) { - core := s.GetCore() - if !core.Started() { - sendLogs(w, []string{}, http.StatusTooEarly) - } - logs := make([]string, 0, 100) - logChan := core.GetLogs() - timeout := time.After(60 * time.Second) - counter := 0 - - ticker := time.NewTicker(100 * time.Millisecond) // Periodic check every 100ms - defer ticker.Stop() - - for { - select { - case log, ok := <-logChan: - if !ok { // If the channel is closed, break the loop - sendLogs(w, logs, http.StatusInternalServerError) - } - - // Add the log to the logs slice using the counter - if counter < cap(logs) { - logs = logs[:counter+1] - logs[counter] = log - counter++ - } - - if counter >= config.MaxLogPerRequest { - // Send the collected logs immediately - sendLogs(w, logs, http.StatusOK) - return - } - continue - - case <-ticker.C: - if len(logs) > 0 && len(logChan) == 0 { - // If the cache is not empty and the channel is empty, send the logs - sendLogs(w, logs, http.StatusOK) - return - } - - case <-timeout: - if len(logs) > 0 { - sendLogs(w, logs, http.StatusOK) - } else { - sendLogs(w, logs, http.StatusNoContent) - } - return - - case <-r.Context().Done(): // If the client disconnects or the request is canceled - sendLogs(w, logs, http.StatusRequestTimeout) - return - } - } -} diff --git a/service/main.go b/service/main.go deleted file mode 100644 index ddcc155..0000000 --- a/service/main.go +++ /dev/null @@ -1,12 +0,0 @@ -package service - -func NewService() (*Service, error) { - - s := new(Service) - err := s.Init() - if err != nil { - return nil, err - } - - return s, nil -} diff --git a/service/models.go b/service/models.go deleted file mode 100644 index b3c2ac5..0000000 --- a/service/models.go +++ /dev/null @@ -1,251 +0,0 @@ -package service - -import ( - "context" - "sync" - "time" - - "github.com/go-chi/chi/v5" - "github.com/google/uuid" - log "marzban-node/logger" - "marzban-node/tools" - "marzban-node/xray" - "marzban-node/xray_api" -) - -type Service struct { - Router chi.Router - connected bool - clientIP string - sessionID uuid.UUID - core *xray.Core - config *xray.Config - apiPort int - xrayAPI *xray_api.XrayAPI - stats tools.SystemStats - cancelFunc context.CancelFunc - mu sync.Mutex -} - -type userBody struct { - User *xray.User `json:"user"` -} - -type startBody struct { - Config *xray.Config `json:"config"` -} - -func (s *Service) Init() error { - s.SetSessionID(uuid.Nil) - s.SetIP("") - s.SetConnected(false) - - s.SetRouter() - s.ResetAPIPort() - - if err := s.ResetCore(); err != nil { - return err - } - - if err := s.ResetXrayAPI(); err != nil { - return err - } - - s.startJobs() - - return nil -} - -func (s *Service) SetRouter() { - router := chi.NewRouter() - - // Api Handlers - router.Use(LogRequest) - - router.Get("/", s.Base) - router.Get("/connect", s.Connect) - - router.Group(func(protected chi.Router) { - // check session and need to return data as context - protected.Use(s.checkSessionID) - - protected.Get("/ping", s.Ping) - protected.Post("/start", s.Start) - protected.Post("/restart", s.Restart) - protected.Get("/stop", s.Stop) - protected.Get("/disconnect", s.Disconnect) - - protected.Get("/logs", s.Logs) - - // users api - protected.Group(func(userGroup chi.Router) { - userGroup.Mount("/user", userGroup) - - userGroup.Post("/add", s.AddUser) - userGroup.Post("/update", s.UpdateUser) - userGroup.Post("/remove", s.RemoveUser) - }) - - // stats api - protected.Group(func(statsGroup chi.Router) { - statsGroup.Mount("/stats", statsGroup) - - statsGroup.Get("/users", s.GetUsersStats) - statsGroup.Get("/inbounds", s.GetInboundsStats) - statsGroup.Get("/outbounds", s.GetOutboundsStats) - statsGroup.Get("/system", s.GetSystemStats) - statsGroup.Get("/node", s.GetNodeStats) - }) - }) - - s.mu.Lock() - defer s.mu.Unlock() - s.Router = router -} - -func (s *Service) GetRouter() chi.Router { - s.mu.Lock() - defer s.mu.Unlock() - return s.Router -} - -func (s *Service) SetConnected(connected bool) { - s.mu.Lock() - defer s.mu.Unlock() - s.connected = connected -} - -func (s *Service) IsConnected() bool { - s.mu.Lock() - defer s.mu.Unlock() - return s.connected -} - -func (s *Service) SetIP(ip string) { - s.mu.Lock() - defer s.mu.Unlock() - s.clientIP = ip -} - -func (s *Service) GetIP() string { - s.mu.Lock() - defer s.mu.Unlock() - return s.clientIP -} - -func (s *Service) SetSessionID(id uuid.UUID) { - s.mu.Lock() - defer s.mu.Unlock() - s.sessionID = id -} - -func (s *Service) GetSessionID() uuid.UUID { - s.mu.Lock() - defer s.mu.Unlock() - return s.sessionID -} - -func (s *Service) ResetCore() error { - s.mu.Lock() - defer s.mu.Unlock() - - core, err := xray.NewXRayCore() - if err != nil { - return err - } - s.core = core - return nil -} - -func (s *Service) GetCore() *xray.Core { - s.mu.Lock() - defer s.mu.Unlock() - return s.core -} - -func (s *Service) SetConfig(config *xray.Config) { - s.mu.Lock() - defer s.mu.Unlock() - s.config = config -} - -func (s *Service) GetConfig() *xray.Config { - s.mu.Lock() - defer s.mu.Unlock() - return s.config -} - -func (s *Service) ResetAPIPort() int { - s.mu.Lock() - defer s.mu.Unlock() - - apiPort := tools.FindFreePort() - s.apiPort = apiPort - return apiPort -} - -func (s *Service) GetAPIPort() int { - s.mu.Lock() - defer s.mu.Unlock() - return s.apiPort -} - -func (s *Service) ResetXrayAPI() error { - s.mu.Lock() - defer s.mu.Unlock() - - api, err := xray_api.NewXrayAPI(s.apiPort) - if err != nil { - log.Error("Failed to create new xray client: ", err) - return nil - } - s.xrayAPI = api - return nil -} - -func (s *Service) GetXrayAPI() *xray_api.XrayAPI { - s.mu.Lock() - defer s.mu.Unlock() - return s.xrayAPI -} - -func (s *Service) recordSystemStats(ctx context.Context) { - for { - select { - case <-ctx.Done(): - break - default: - stats, err := tools.GetSystemStats() - if err != nil { - log.Error("Failed to get system stats: ", err) - } else { - s.mu.Lock() - s.stats = stats - s.mu.Unlock() - } - time.Sleep(100 * time.Millisecond) - } - } -} - -func (s *Service) GetStats() tools.SystemStats { - s.mu.Lock() - defer s.mu.Unlock() - return s.stats -} - -func (s *Service) startJobs() { - ctx, cancel := context.WithCancel(context.Background()) - s.mu.Lock() - defer s.mu.Unlock() - s.cancelFunc = cancel - go s.recordSystemStats(ctx) -} - -func (s *Service) StopJobs() { - s.GetCore().Stop() - - s.mu.Lock() - defer s.mu.Unlock() - s.cancelFunc() -} diff --git a/service/stats_api.go b/service/stats_api.go deleted file mode 100644 index ff6343d..0000000 --- a/service/stats_api.go +++ /dev/null @@ -1,114 +0,0 @@ -package service - -import ( - "context" - "encoding/json" - log "marzban-node/logger" - "net/http" - "time" -) - -func (s *Service) GetOutboundsStats(w http.ResponseWriter, _ *http.Request) { - if !s.GetCore().Started() { - http.Error(w, "core is not started yet", http.StatusServiceUnavailable) - return - } - - api := s.GetXrayAPI() - if api.StatsServiceClient == nil { - http.Error(w, "stat service is not available", http.StatusServiceUnavailable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - - response, err := api.GetOutboundsStats(ctx, true) - if err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) -} - -func (s *Service) GetInboundsStats(w http.ResponseWriter, _ *http.Request) { - if !s.core.Started() { - http.Error(w, "core is not started yet", http.StatusServiceUnavailable) - return - } - - api := s.GetXrayAPI() - if api.StatsServiceClient == nil { - http.Error(w, "stat service is not available", http.StatusServiceUnavailable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - - response, err := api.GetInboundsStats(ctx, true) - if err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) -} - -func (s *Service) GetUsersStats(w http.ResponseWriter, _ *http.Request) { - if !s.core.Started() { - http.Error(w, "core is not started yet", http.StatusServiceUnavailable) - return - } - - api := s.GetXrayAPI() - if api.StatsServiceClient == nil { - http.Error(w, "stat service is not available", http.StatusServiceUnavailable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - - response, err := api.GetUsersStats(ctx, true) - if err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) -} - -func (s *Service) GetSystemStats(w http.ResponseWriter, _ *http.Request) { - if !s.core.Started() { - http.Error(w, "core is not started yet", http.StatusServiceUnavailable) - return - } - - api := s.GetXrayAPI() - if api.StatsServiceClient == nil { - http.Error(w, "stat service is not available", http.StatusServiceUnavailable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*2) - defer cancel() - - response, err := api.GetSysStats(ctx) - if err != nil { - log.Error(err) - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(response) -} - -func (s *Service) GetNodeStats(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(s.GetStats()) -} diff --git a/service/user_api.go b/service/user_api.go deleted file mode 100644 index b45838f..0000000 --- a/service/user_api.go +++ /dev/null @@ -1,128 +0,0 @@ -package service - -import ( - "context" - "encoding/json" - log "marzban-node/logger" - "marzban-node/xray" - "net/http" - "slices" - "time" -) - -func (s *Service) AddUser(w http.ResponseWriter, r *http.Request) { - api := s.GetXrayAPI() - if api.HandlerServiceClient == nil { - http.Error(w, "handler service is not available", http.StatusServiceUnavailable) - return - } - - var body userBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - user := body.User - if user == nil { - http.Error(w, "no user received", http.StatusNotAcceptable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) - defer cancel() - - errorMessage := "Failed to add user:" - - proxySetting := xray.SetupUserAccount(user) - for _, inbound := range s.GetConfig().Inbounds { - account, isActive := xray.IsActiveInbound(inbound, user, proxySetting) - if isActive { - if err := api.AddInboundUser(ctx, inbound.Tag, account); err != nil { - http.Error(w, errorMessage+err.Error(), http.StatusInternalServerError) - log.Error(errorMessage, err) - } - } - } - - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]interface{}{}) -} - -func (s *Service) UpdateUser(w http.ResponseWriter, r *http.Request) { - api := s.GetXrayAPI() - if api.HandlerServiceClient == nil { - http.Error(w, "handler service is not available", http.StatusServiceUnavailable) - return - } - - var body userBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - user := body.User - if user == nil { - http.Error(w, "no user received", http.StatusNotAcceptable) - return - } - - var activeInbounds []string - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) - defer cancel() - - errorMessage := "Failed to add user:" - - proxySetting := xray.SetupUserAccount(user) - for _, inbound := range s.GetConfig().Inbounds { - account, isActive := xray.IsActiveInbound(inbound, user, proxySetting) - if isActive { - activeInbounds = append(activeInbounds, inbound.Tag) - if err := api.AddInboundUser(ctx, inbound.Tag, account); err != nil { - http.Error(w, errorMessage+err.Error(), http.StatusInternalServerError) - log.Error(errorMessage, err) - } - } - } - - for _, inbound := range s.GetConfig().Inbounds { - if !slices.Contains(activeInbounds, inbound.Tag) { - _ = api.RemoveInboundUser(ctx, inbound.Tag, user.Email) - } - } - - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]interface{}{}) -} - -func (s *Service) RemoveUser(w http.ResponseWriter, r *http.Request) { - api := s.GetXrayAPI() - if api.HandlerServiceClient == nil { - http.Error(w, "handler service is not available", http.StatusServiceUnavailable) - return - } - - var body userBody - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - - user := body.User - if user == nil { - http.Error(w, "no user received", http.StatusNotAcceptable) - return - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) - defer cancel() - - for _, inbound := range s.GetConfig().Inbounds { - _ = api.RemoveInboundUser(ctx, inbound.Tag, user.Email) - } - - w.Header().Set("Content-Type", "application/json") - json.NewEncoder(w).Encode(map[string]interface{}{}) -} diff --git a/tools/certificate.go b/tools/certificate.go index b2b10ac..3267820 100644 --- a/tools/certificate.go +++ b/tools/certificate.go @@ -6,8 +6,7 @@ import ( "crypto/x509" "crypto/x509/pkix" "encoding/pem" - "marzban-node/config" - log "marzban-node/logger" + "log" "math/big" "os" "time" @@ -47,35 +46,32 @@ func generateCertificate() (string, string, error) { return string(certOut), string(keyOut), nil } -func RewriteSslFile() { +func RewriteSslFile(certPath, keyPath string) error { cert, key, err := generateCertificate() if err != nil { - panic(err) + log.Fatal(err) } // Write certificate to file - certFile, err := os.Create(config.SslCertFile) + certFile, err := os.Create(certPath) if err != nil { - log.Error("Problem in creating SslCert File: ", err) - return + return err } defer certFile.Close() if _, err = certFile.WriteString(cert); err != nil { - log.Error("Problem in writing SslCert File: ", err) - return + return err } // Write key to file - keyFile, err := os.Create(config.SslKeyFile) + keyFile, err := os.Create(keyPath) if err != nil { - log.Error("Problem in creating SslKey File: ", err) - return + return err } defer keyFile.Close() if _, err = keyFile.WriteString(key); err != nil { - log.Error("Problem in writing SslKey File: ", err) - return + return err } + return nil } diff --git a/tools/current_time.go b/tools/current_time.go deleted file mode 100644 index a6313e4..0000000 --- a/tools/current_time.go +++ /dev/null @@ -1,41 +0,0 @@ -package tools - -import ( - "encoding/json" - "net/http" - "time" -) - -func UtcTime() (*time.Time, error) { - url := "https://worldtimeapi.org/api/timezone/utc" - resp, err := http.Get(url) - if err != nil { - return nil, err - } - defer resp.Body.Close() - - var body response - if err = json.NewDecoder(resp.Body).Decode(&resp); err != nil { - return nil, err - } - - return body.UtcDatetime, nil -} - -type response struct { - Abbreviation string `json:"abbreviation"` - ClientIp string `json:"client_ip"` - Datetime time.Time `json:"datetime"` - DayOfWeek int `json:"day_of_week"` - DayOfYear int `json:"day_of_year"` - Dst bool `json:"dst"` - DstFrom interface{} `json:"dst_from"` - DstOffset int `json:"dst_offset"` - DstUntil interface{} `json:"dst_until"` - RawOffset int `json:"raw_offset"` - Timezone string `json:"timezone"` - UnixTime int `json:"unixtime"` - UtcDatetime *time.Time `json:"utc_datetime"` - UtcOffset string `json:"utc_offset"` - WeekNumber int `json:"week_number"` -} diff --git a/tools/sys.go b/tools/sys.go index f489ac1..5a8f95a 100644 --- a/tools/sys.go +++ b/tools/sys.go @@ -2,25 +2,19 @@ package tools import ( "bufio" - "github.com/shirou/gopsutil/cpu" - "github.com/shirou/gopsutil/mem" "os" "strconv" "strings" "time" -) -type SystemStats struct { - MemTotal uint64 `json:"mem_total"` - MemUsed uint64 `json:"mem_used"` - CpuCores int `json:"cpu_cores"` - CpuUsage float64 `json:"cpu_usage"` - IncomingBandwidthSpeed int `json:"incoming_bandwidth_speed"` - OutgoingBandwidthSpeed int `json:"outgoing_bandwidth_speed"` -} + "github.com/shirou/gopsutil/cpu" + "github.com/shirou/gopsutil/mem" + + "github.com/m03ed/gozargah-node/common" +) -func GetSystemStats() (SystemStats, error) { - stats := SystemStats{} +func GetSystemStats() (*common.SystemStatsResponse, error) { + stats := &common.SystemStatsResponse{} vm, err := mem.VirtualMemory() if err != nil { @@ -33,7 +27,7 @@ func GetSystemStats() (SystemStats, error) { if err != nil { return stats, err } - stats.CpuCores = cores + stats.CpuCores = uint64(cores) percentages, err := cpu.Percent(time.Second, false) if err != nil { @@ -47,8 +41,8 @@ func GetSystemStats() (SystemStats, error) { if err != nil { return stats, err } - stats.IncomingBandwidthSpeed = incomingSpeed - stats.OutgoingBandwidthSpeed = outgoingSpeed + stats.IncomingBandwidthSpeed = uint64(incomingSpeed) + stats.OutgoingBandwidthSpeed = uint64(outgoingSpeed) return stats, nil } diff --git a/tools/tls.go b/tools/tls.go new file mode 100644 index 0000000..2cee541 --- /dev/null +++ b/tools/tls.go @@ -0,0 +1,37 @@ +package tools + +import ( + "crypto/tls" + "crypto/x509" + "fmt" + "os" +) + +func LoadTLSCredentials(cert, key, poolCert string, isClient bool) (*tls.Config, error) { + pem, err := os.ReadFile(poolCert) + if err != nil { + return nil, err + } + + certPool := x509.NewCertPool() + if !certPool.AppendCertsFromPEM(pem) { + return nil, fmt.Errorf("failed to add CA's certificate") + } + + serverCert, err := tls.LoadX509KeyPair(cert, key) + if err != nil { + return nil, err + } + + config := &tls.Config{ + Certificates: []tls.Certificate{serverCert}, + } + if isClient { + config.RootCAs = certPool + config.InsecureSkipVerify = true + } else { + config.ClientAuth = tls.RequireAndVerifyClientCert + config.ClientCAs = certPool + } + return config, nil +} diff --git a/xray/config.go b/xray/config.go deleted file mode 100644 index 69ca0a5..0000000 --- a/xray/config.go +++ /dev/null @@ -1,197 +0,0 @@ -package xray - -import ( - "encoding/json" -) - -type Protocol string - -const ( - Vmess = "vmess" - Vless = "vless" - Trojan = "trojan" - Shadowsocks = "shadowsocks" -) - -type Config struct { - Log Log `json:"log,omitempty"` - Inbounds []Inbound `json:"Inbounds"` - Outbounds []interface{} `json:"outbounds,omitempty"` - Routing Routing `json:"routing,omitempty"` - API API `json:"api"` - Stats Stats `json:"stats"` - Policy Policy `json:"policy"` -} - -type Log struct { - Access string `json:"access,omitempty"` - Error string `json:"error,omitempty"` - LogLevel string `json:"loglevel,omitempty"` - DnsLog string `json:"dnsLog,omitempty"` -} - -type Inbound struct { - Listen string `json:"listen,omitempty"` - Port int `json:"port,omitempty"` - Protocol string `json:"protocol"` - Settings map[string]interface{} `json:"settings"` - StreamSettings map[string]interface{} `json:"streamSettings,omitempty"` - Tag string `json:"tag"` - Sniffing interface{} `json:"sniffing,omitempty"` -} - -type API struct { - Services []string `json:"services"` - Tag string `json:"tag"` -} - -type Stats struct{} - -type Policy struct { - Levels Levels `json:"levels"` - System System `json:"system"` -} - -type Levels struct { - Zero Level `json:"0"` -} - -type Level struct { - Handshake int `json:"handshake,omitempty"` - ConnIdle int `json:"connIdle,omitempty"` - UplinkOnly int `json:"uplinkOnly,omitempty"` - DownlinkOnly int `json:"downlinkOnly,omitempty"` - StatsUserUplink bool `json:"statsUserUplink"` - StatsUserDownlink bool `json:"statsUserDownlink"` - BufferSize int `json:"bufferSize,omitempty"` -} - -type System struct { - StatsInboundDownlink bool `json:"statsInboundDownlink"` - StatsInboundUplink bool `json:"statsInboundUplink"` - StatsOutboundDownlink bool `json:"statsOutboundDownlink"` - StatsOutboundUplink bool `json:"statsOutboundUplink"` -} - -type Routing struct { - Rules []Rule `json:"rules"` -} - -type Rule struct { - DomainMatcher string `json:"domainMatcher,omitempty"` - Type string `json:"type,omitempty"` - Domain []string `json:"domain,omitempty"` - IP []string `json:"ip,omitempty"` - Port string `json:"port,omitempty"` - SourcePort string `json:"sourcePort,omitempty"` - Network string `json:"network,omitempty"` - Source []string `json:"source,omitempty"` - User []string `json:"user,omitempty"` - InboundTag []string `json:"inboundTag,omitempty"` - Protocol []string `json:"protocol,omitempty"` - Attrs map[string]string `json:"attrs,omitempty"` - OutboundTag string `json:"outboundTag,omitempty"` - BalancerTag string `json:"balancerTag,omitempty"` -} - -type Settings struct { - Address string `json:"address"` -} - -type StreamSettings struct { - Security string `json:"security"` - TLSSettings TLSSettings `json:"tlsSettings"` -} - -type TLSSettings struct { - Certificates []Certificate `json:"certificates"` -} - -type Certificate struct { - CertificateFile string `json:"certificateFile"` - KeyFile string `json:"keyFile"` -} - -func (c *Config) ToJSON() (string, error) { - b, err := json.Marshal(c) - if err != nil { - return "", err - } - return string(b), nil -} - -func NewXRayConfig(config string) (*Config, error) { - var xrayConfig Config - err := json.Unmarshal([]byte(config), &xrayConfig) - if err != nil { - return nil, err - } - - return &xrayConfig, nil -} - -func (c *Config) ApplyAPI(apiPort int) error { - // Remove the existing inbound with the API_INBOUND tag - for i := len(c.Inbounds) - 1; i >= 0; i-- { - if c.Inbounds[i].Tag == "API_INBOUND" { - c.Inbounds = append(c.Inbounds[:i], c.Inbounds[i+1:]...) - } - } - - if c.API.Tag != "" { - apiTag := c.API.Tag - for i, rule := range c.Routing.Rules { - if apiTag != "" && rule.OutboundTag == apiTag { - c.Routing.Rules = append(c.Routing.Rules[:i], c.Routing.Rules[i+1:]...) - } - } - } - - c.API.Services = []string{"HandlerService", "LoggerService", "StatsService"} - c.API.Tag = "API" - - c.Stats = Stats{} - - c.checkPolicy() - - inbound := Inbound{ - Listen: "127.0.0.1", - Port: apiPort, - Protocol: "dokodemo-door", - Settings: map[string]interface{}{ - "address": "127.0.0.1", - }, - Tag: "API_INBOUND", - } - c.Inbounds = append([]Inbound{inbound}, c.Inbounds...) - - rule := Rule{ - InboundTag: []string{"API_INBOUND"}, - Source: []string{"127.0.0.1"}, - OutboundTag: "API", - Type: "field", - } - c.Routing.Rules = append([]Rule{rule}, c.Routing.Rules...) - return nil -} - -func (c *Config) checkPolicy() { - c.Policy.Levels.Zero.StatsUserDownlink = true - c.Policy.Levels.Zero.StatsUserUplink = true - - c.Policy.System = System{ - StatsInboundDownlink: false, - StatsInboundUplink: false, - StatsOutboundDownlink: true, - StatsOutboundUplink: true, - } -} - -func (c *Config) RemoveLogFiles() (accessFile, errorFile string) { - accessFile = c.Log.Access - c.Log.Access = "" - errorFile = c.Log.Error - c.Log.Error = "" - - return accessFile, errorFile -} diff --git a/xray/core.go b/xray/core.go deleted file mode 100644 index 82ff40e..0000000 --- a/xray/core.go +++ /dev/null @@ -1,216 +0,0 @@ -package xray - -import ( - "bufio" - "bytes" - "context" - "encoding/json" - "errors" - "io" - cnf "marzban-node/config" - log "marzban-node/logger" - "os" - "os/exec" - "regexp" - "sync" -) - -type Core struct { - executablePath string - assetsPath string - version string - process *exec.Cmd - restarting bool - logsChan chan string - cancelFunc context.CancelFunc - mu sync.Mutex -} - -func NewXRayCore() (*Core, error) { - core := &Core{ - executablePath: cnf.XrayExecutablePath, - assetsPath: cnf.XrayAssetsPath, - logsChan: make(chan string), - } - - version, err := core.refreshVersion() - if err != nil { - return nil, err - } - core.setVersion(version) - - return core, nil -} - -func (x *Core) refreshVersion() (string, error) { - cmd := exec.Command(x.executablePath, "version") - var out bytes.Buffer - cmd.Stdout = &out - err := cmd.Run() - if err != nil { - return "", err - } - - r := regexp.MustCompile(`^Xray (\d+\.\d+\.\d+)`) - matches := r.FindStringSubmatch(out.String()) - if len(matches) > 1 { - return matches[1], nil - } - - return "", errors.New("could not parse Xray version") -} - -func (x *Core) setVersion(version string) { - x.mu.Lock() - defer x.mu.Unlock() - x.version = version -} - -func (x *Core) GetVersion() string { - x.mu.Lock() - defer x.mu.Unlock() - return x.version -} - -func (x *Core) Started() bool { - x.mu.Lock() - defer x.mu.Unlock() - if x.process == nil || x.process.Process == nil { - return false - } - if x.process.ProcessState == nil { - return true - } - return false -} - -func (x *Core) Start(config *Config) error { - if x.Started() { - return errors.New("Xray is started already") - } - - logLevel := config.Log.LogLevel - if logLevel == "none" || logLevel == "error" { - config.Log.LogLevel = "warning" - } - - accessFile, errorFile := config.RemoveLogFiles() - - cmd := exec.Command(x.executablePath, "run", "-config", "stdin:") - cmd.Env = append(os.Environ(), "XRAY_LOCATION_ASSET="+x.assetsPath) - - xrayJson, err := config.ToJSON() - if err != nil { - return err - } - - stdout, err := cmd.StdoutPipe() - if err != nil { - return err - } - - stderr, err := cmd.StderrPipe() - if err != nil { - return err - } - - cmd.Stdin = bytes.NewBufferString(xrayJson) - - err = cmd.Start() - if err != nil { - return err - } - - log.SetLogFile(accessFile, errorFile) - - ctx := x.makeContext() - - x.process = cmd - - // Start capturing process logs - go x.captureProcessLogs(ctx, stdout) - go x.captureProcessLogs(ctx, stderr) - - if cnf.Debug { - var prettyJSON bytes.Buffer - var jsonFile *os.File - err = json.Indent(&prettyJSON, []byte(xrayJson), "", " ") - if err != nil { - log.Error("Problem in formatting JSON: ", err) - } else { - jsonFile, err = os.Create(cnf.GeneratedConfigPath) - if err != nil { - log.Error("Can't create generated config json file", err) - } else { - _, err = jsonFile.WriteString(prettyJSON.String()) - if err != nil { - log.Error("Problem in writing generated config json File: ", err) - } - } - } - } - - return nil -} - -func (x *Core) Stop() { - if !x.Started() { - return - } - - _ = x.process.Process.Kill() - x.mu.Lock() - defer x.mu.Unlock() - x.process = nil - - x.cancelFunc() - - log.Warning("Xray core stopped") -} - -func (x *Core) Restart(config *Config) error { - x.mu.Lock() - defer x.mu.Unlock() - if x.restarting { - return errors.New("Xray is already restarted") - } - - x.restarting = true - defer func() { x.restarting = false }() - - log.Warning("restarting Xray core...") - x.Stop() - err := x.Start(config) - if err != nil { - return err - } - return nil -} - -func (x *Core) captureProcessLogs(ctx context.Context, pipe io.Reader) { - scanner := bufio.NewScanner(pipe) - for scanner.Scan() { - select { - case <-ctx.Done(): - return // Exit gracefully if stop signal received - default: - output := scanner.Text() - log.DetectLogType(output) - x.logsChan <- output - } - } -} - -func (x *Core) GetLogs() chan string { - x.mu.Lock() - defer x.mu.Unlock() - return x.logsChan -} - -func (x *Core) makeContext() context.Context { - ctx, cancel := context.WithCancel(context.Background()) - x.mu.Lock() - defer x.mu.Unlock() - x.cancelFunc = cancel - return ctx -} diff --git a/xray/user.go b/xray/user.go deleted file mode 100644 index 8228257..0000000 --- a/xray/user.go +++ /dev/null @@ -1,157 +0,0 @@ -package xray - -import ( - "github.com/google/uuid" - "marzban-node/xray_api/proto/proxy/shadowsocks" - "marzban-node/xray_api/types" - "slices" - "strings" -) - -func SetupUserAccount(user *User) types.ProxySettings { - settings := types.ProxySettings{} - - if user.Proxies.Vmess != nil && user.Proxies.Vmess.ID != uuid.Nil { - settings.Vmess = &types.VMessAccount{ - BaseAccount: types.BaseAccount{ - Email: user.Email, - Level: uint32(0), - }, - ID: user.Proxies.Vmess.ID, - } - } - - if user.Proxies.Vless != nil && user.Proxies.Vless.ID != uuid.Nil { - settings.Vless = &types.VLESSAccount{ - BaseAccount: types.BaseAccount{ - Email: user.Email, - Level: uint32(0), - }, - ID: user.Proxies.Vless.ID, - Flow: user.Proxies.Vless.Flow, - } - } - - if user.Proxies.Trojan != nil && user.Proxies.Trojan.Password != "" { - settings.Trojan = &types.TrojanAccount{ - BaseAccount: types.BaseAccount{ - Email: user.Email, - Level: uint32(0), - }, - Password: user.Proxies.Trojan.Password, - } - } - - if user.Proxies.Shadowsocks != nil && user.Proxies.Shadowsocks.Password != "" { - settings.Shadowsocks = &types.ShadowsocksAccount{ - BaseAccount: types.BaseAccount{ - Email: user.Email, - Level: uint32(0), - }, - Password: user.Proxies.Trojan.Password, - } - if val, ok := shadowsocks.CipherType_value[strings.ToUpper(user.Proxies.Shadowsocks.Method)]; ok { - settings.Shadowsocks.Method = shadowsocks.CipherType(val) - } else { - settings.Shadowsocks.Method = shadowsocks.CipherType_NONE - } - - settings.Shadowsocks2022 = &types.Shadowsocks2022Account{ - BaseAccount: types.BaseAccount{ - Email: user.Email, - Level: uint32(0), - }, - Key: user.Proxies.Shadowsocks.Password, - } - } - - return settings -} - -func IsActiveInbound(inbound Inbound, user *User, settings types.ProxySettings) (types.Account, bool) { - switch inbound.Protocol { - case Vmess: - if slices.Contains(user.Inbounds.Vmess, inbound.Tag) { - return settings.Vmess, true - } - case Vless: - if slices.Contains(user.Inbounds.Vless, inbound.Tag) { - account := *settings.Vless - - if user.Proxies.Vless.Flow == types.VISION { - - network, networkOk := inbound.StreamSettings["network"].(string) - tls, tlsOk := inbound.StreamSettings["security"].(string) - - headerMap, headerMapOk := inbound.StreamSettings["header"].(map[string]interface{}) - headerType, headerTypeOk := "", false - if headerMapOk { - headerType, headerTypeOk = headerMap["Type"].(string) - } - - if networkOk && (network == "tcp" || network == "kcp") { - if !(tlsOk && (tls == "tls" || tls == "reality")) || (headerTypeOk && headerType == "http") { - account.Flow = types.NONE - } - } else if headerTypeOk && headerType == "http" { - account.Flow = types.NONE - } else { - account.Flow = types.NONE - } - } - return &account, true - } - case Trojan: - if slices.Contains(user.Inbounds.Trojan, inbound.Tag) { - return settings.Trojan, true - } - case Shadowsocks: - if slices.Contains(user.Inbounds.Shadowsocks, inbound.Tag) { - method, methodOk := inbound.Settings["method"].(string) - if methodOk && strings.HasPrefix("2022-blake3", method) { - return settings.Shadowsocks2022, true - } - return settings.Shadowsocks, true - } - } - return nil, false -} - -type VmessSetting struct { - ID uuid.UUID `json:"id"` -} - -type VlessSetting struct { - ID uuid.UUID `json:"id"` - Flow types.XTLSFlows `json:"flow"` -} - -type TrojanSetting struct { - Password string `json:"password"` -} - -type ShadowsocksSetting struct { - Password string `json:"password"` - Method string `json:"method"` -} - -type Proxy struct { - Vmess *VmessSetting `json:"vmess,omitempty"` - Vless *VlessSetting `json:"vless,omitempty"` - Trojan *TrojanSetting `json:"trojan,omitempty"` - Shadowsocks *ShadowsocksSetting `json:"shadowsocks,omitempty"` -} - -type Inbounds struct { - Vmess []string `json:"vmess,omitempty"` - Vless []string `json:"vless,omitempty"` - Trojan []string `json:"trojan,omitempty"` - Shadowsocks []string `json:"shadowsocks,omitempty"` -} - -// User struct used to get detail of a user from main panel -type User struct { - Email string `json:"email"` - Proxies *Proxy `json:"proxies,omitempty"` - Inbounds *Inbounds `json:"inbounds,omitempty"` -} diff --git a/xray_api/proto/app/commander/config.pb.go b/xray_api/proto/app/commander/config.pb.go deleted file mode 100644 index 6c733ca..0000000 --- a/xray_api/proto/app/commander/config.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/commander/config.proto - -package commander - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Config is the settings for Commander. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tag of the outbound handler that handles grpc connections. - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - // Network address of commander grpc service. - Listen string `protobuf:"bytes,3,opt,name=listen,proto3" json:"listen,omitempty"` - // Services that supported by this server. All services must implement Service - // interface. - Service []*serial.TypedMessage `protobuf:"bytes,2,rep,name=service,proto3" json:"service,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_commander_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_commander_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_commander_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *Config) GetListen() string { - if x != nil { - return x.Listen - } - return "" -} - -func (x *Config) GetService() []*serial.TypedMessage { - if x != nil { - return x.Service - } - return nil -} - -// ReflectionConfig is the placeholder config for ReflectionService. -type ReflectionConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ReflectionConfig) Reset() { - *x = ReflectionConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_commander_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReflectionConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReflectionConfig) ProtoMessage() {} - -func (x *ReflectionConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_commander_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReflectionConfig.ProtoReflect.Descriptor instead. -func (*ReflectionConfig) Descriptor() ([]byte, []int) { - return file_app_commander_config_proto_rawDescGZIP(), []int{1} -} - -var File_app_commander_config_proto protoreflect.FileDescriptor - -var file_app_commander_config_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, - 0x1a, 0x21, 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, 0x6f, 0x22, 0x6e, 0x0a, 0x06, 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, - 0x16, 0x0a, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x18, 0x02, 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, 0x07, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, - 0x72, 0x50, 0x01, 0x5a, 0x27, 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, 0x61, - 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x12, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_commander_config_proto_rawDescOnce sync.Once - file_app_commander_config_proto_rawDescData = file_app_commander_config_proto_rawDesc -) - -func file_app_commander_config_proto_rawDescGZIP() []byte { - file_app_commander_config_proto_rawDescOnce.Do(func() { - file_app_commander_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_commander_config_proto_rawDescData) - }) - return file_app_commander_config_proto_rawDescData -} - -var file_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_app_commander_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.app.commander.Config - (*ReflectionConfig)(nil), // 1: xray.app.commander.ReflectionConfig - (*serial.TypedMessage)(nil), // 2: xray.common.serial.TypedMessage -} -var file_app_commander_config_proto_depIdxs = []int32{ - 2, // 0: xray.app.commander.Config.service:type_name -> xray.common.serial.TypedMessage - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_app_commander_config_proto_init() } -func file_app_commander_config_proto_init() { - if File_app_commander_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_commander_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_commander_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReflectionConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_commander_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_commander_config_proto_goTypes, - DependencyIndexes: file_app_commander_config_proto_depIdxs, - MessageInfos: file_app_commander_config_proto_msgTypes, - }.Build() - File_app_commander_config_proto = out.File - file_app_commander_config_proto_rawDesc = nil - file_app_commander_config_proto_goTypes = nil - file_app_commander_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/dispatcher/config.pb.go b/xray_api/proto/app/dispatcher/config.pb.go deleted file mode 100644 index 13af96e..0000000 --- a/xray_api/proto/app/dispatcher/config.pb.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/dispatcher/config.proto - -package dispatcher - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SessionConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SessionConfig) Reset() { - *x = SessionConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dispatcher_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SessionConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionConfig) ProtoMessage() {} - -func (x *SessionConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_dispatcher_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SessionConfig.ProtoReflect.Descriptor instead. -func (*SessionConfig) Descriptor() ([]byte, []int) { - return file_app_dispatcher_config_proto_rawDescGZIP(), []int{0} -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Settings *SessionConfig `protobuf:"bytes,1,opt,name=settings,proto3" json:"settings,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dispatcher_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_dispatcher_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_dispatcher_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Config) GetSettings() *SessionConfig { - if x != nil { - return x.Settings - } - return nil -} - -var File_app_dispatcher_config_proto protoreflect.FileDescriptor - -var file_app_dispatcher_config_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x72, 0x22, 0x15, 0x0a, 0x0d, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0x48, 0x0a, 0x06, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x42, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x01, - 0x5a, 0x28, 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, 0x61, 0x70, 0x70, 0x2f, - 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_dispatcher_config_proto_rawDescOnce sync.Once - file_app_dispatcher_config_proto_rawDescData = file_app_dispatcher_config_proto_rawDesc -) - -func file_app_dispatcher_config_proto_rawDescGZIP() []byte { - file_app_dispatcher_config_proto_rawDescOnce.Do(func() { - file_app_dispatcher_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_dispatcher_config_proto_rawDescData) - }) - return file_app_dispatcher_config_proto_rawDescData -} - -var file_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_app_dispatcher_config_proto_goTypes = []interface{}{ - (*SessionConfig)(nil), // 0: xray.app.dispatcher.SessionConfig - (*Config)(nil), // 1: xray.app.dispatcher.Config -} -var file_app_dispatcher_config_proto_depIdxs = []int32{ - 0, // 0: xray.app.dispatcher.Config.settings:type_name -> xray.app.dispatcher.SessionConfig - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_app_dispatcher_config_proto_init() } -func file_app_dispatcher_config_proto_init() { - if File_app_dispatcher_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_dispatcher_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SessionConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dispatcher_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_dispatcher_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_dispatcher_config_proto_goTypes, - DependencyIndexes: file_app_dispatcher_config_proto_depIdxs, - MessageInfos: file_app_dispatcher_config_proto_msgTypes, - }.Build() - File_app_dispatcher_config_proto = out.File - file_app_dispatcher_config_proto_rawDesc = nil - file_app_dispatcher_config_proto_goTypes = nil - file_app_dispatcher_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/dns/config.pb.go b/xray_api/proto/app/dns/config.pb.go deleted file mode 100644 index 89cfb13..0000000 --- a/xray_api/proto/app/dns/config.pb.go +++ /dev/null @@ -1,781 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/dns/config.proto - -package dns - -import ( - router "marzban-node/xray_api/proto/app/router" - net "marzban-node/xray_api/proto/common/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DomainMatchingType int32 - -const ( - DomainMatchingType_Full DomainMatchingType = 0 - DomainMatchingType_Subdomain DomainMatchingType = 1 - DomainMatchingType_Keyword DomainMatchingType = 2 - DomainMatchingType_Regex DomainMatchingType = 3 -) - -// Enum value maps for DomainMatchingType. -var ( - DomainMatchingType_name = map[int32]string{ - 0: "Full", - 1: "Subdomain", - 2: "Keyword", - 3: "Regex", - } - DomainMatchingType_value = map[string]int32{ - "Full": 0, - "Subdomain": 1, - "Keyword": 2, - "Regex": 3, - } -) - -func (x DomainMatchingType) Enum() *DomainMatchingType { - p := new(DomainMatchingType) - *p = x - return p -} - -func (x DomainMatchingType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DomainMatchingType) Descriptor() protoreflect.EnumDescriptor { - return file_app_dns_config_proto_enumTypes[0].Descriptor() -} - -func (DomainMatchingType) Type() protoreflect.EnumType { - return &file_app_dns_config_proto_enumTypes[0] -} - -func (x DomainMatchingType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DomainMatchingType.Descriptor instead. -func (DomainMatchingType) EnumDescriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{0} -} - -type QueryStrategy int32 - -const ( - QueryStrategy_USE_IP QueryStrategy = 0 - QueryStrategy_USE_IP4 QueryStrategy = 1 - QueryStrategy_USE_IP6 QueryStrategy = 2 -) - -// Enum value maps for QueryStrategy. -var ( - QueryStrategy_name = map[int32]string{ - 0: "USE_IP", - 1: "USE_IP4", - 2: "USE_IP6", - } - QueryStrategy_value = map[string]int32{ - "USE_IP": 0, - "USE_IP4": 1, - "USE_IP6": 2, - } -) - -func (x QueryStrategy) Enum() *QueryStrategy { - p := new(QueryStrategy) - *p = x - return p -} - -func (x QueryStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (QueryStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_app_dns_config_proto_enumTypes[1].Descriptor() -} - -func (QueryStrategy) Type() protoreflect.EnumType { - return &file_app_dns_config_proto_enumTypes[1] -} - -func (x QueryStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use QueryStrategy.Descriptor instead. -func (QueryStrategy) EnumDescriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{1} -} - -type NameServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *net.Endpoint `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - ClientIp []byte `protobuf:"bytes,5,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` - SkipFallback bool `protobuf:"varint,6,opt,name=skipFallback,proto3" json:"skipFallback,omitempty"` - PrioritizedDomain []*NameServer_PriorityDomain `protobuf:"bytes,2,rep,name=prioritized_domain,json=prioritizedDomain,proto3" json:"prioritized_domain,omitempty"` - Geoip []*router.GeoIP `protobuf:"bytes,3,rep,name=geoip,proto3" json:"geoip,omitempty"` - OriginalRules []*NameServer_OriginalRule `protobuf:"bytes,4,rep,name=original_rules,json=originalRules,proto3" json:"original_rules,omitempty"` - QueryStrategy QueryStrategy `protobuf:"varint,7,opt,name=query_strategy,json=queryStrategy,proto3,enum=xray.app.dns.QueryStrategy" json:"query_strategy,omitempty"` -} - -func (x *NameServer) Reset() { - *x = NameServer{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NameServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NameServer) ProtoMessage() {} - -func (x *NameServer) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NameServer.ProtoReflect.Descriptor instead. -func (*NameServer) Descriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{0} -} - -func (x *NameServer) GetAddress() *net.Endpoint { - if x != nil { - return x.Address - } - return nil -} - -func (x *NameServer) GetClientIp() []byte { - if x != nil { - return x.ClientIp - } - return nil -} - -func (x *NameServer) GetSkipFallback() bool { - if x != nil { - return x.SkipFallback - } - return false -} - -func (x *NameServer) GetPrioritizedDomain() []*NameServer_PriorityDomain { - if x != nil { - return x.PrioritizedDomain - } - return nil -} - -func (x *NameServer) GetGeoip() []*router.GeoIP { - if x != nil { - return x.Geoip - } - return nil -} - -func (x *NameServer) GetOriginalRules() []*NameServer_OriginalRule { - if x != nil { - return x.OriginalRules - } - return nil -} - -func (x *NameServer) GetQueryStrategy() QueryStrategy { - if x != nil { - return x.QueryStrategy - } - return QueryStrategy_USE_IP -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Nameservers used by this DNS. Only traditional UDP servers are support at - // the moment. A special value 'localhost' as a domain address can be set to - // use DNS on local system. - // - // Deprecated: Marked as deprecated in app/dns/config.proto. - NameServers []*net.Endpoint `protobuf:"bytes,1,rep,name=NameServers,proto3" json:"NameServers,omitempty"` - // NameServer list used by this DNS client. - NameServer []*NameServer `protobuf:"bytes,5,rep,name=name_server,json=nameServer,proto3" json:"name_server,omitempty"` - // Static hosts. Domain to IP. - // Deprecated. Use static_hosts. - // - // Deprecated: Marked as deprecated in app/dns/config.proto. - Hosts map[string]*net.IPOrDomain `protobuf:"bytes,2,rep,name=Hosts,proto3" json:"Hosts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes - // (IPv6). - ClientIp []byte `protobuf:"bytes,3,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"` - StaticHosts []*Config_HostMapping `protobuf:"bytes,4,rep,name=static_hosts,json=staticHosts,proto3" json:"static_hosts,omitempty"` - // Tag is the inbound tag of DNS client. - Tag string `protobuf:"bytes,6,opt,name=tag,proto3" json:"tag,omitempty"` - // DisableCache disables DNS cache - DisableCache bool `protobuf:"varint,8,opt,name=disableCache,proto3" json:"disableCache,omitempty"` - QueryStrategy QueryStrategy `protobuf:"varint,9,opt,name=query_strategy,json=queryStrategy,proto3,enum=xray.app.dns.QueryStrategy" json:"query_strategy,omitempty"` - DisableFallback bool `protobuf:"varint,10,opt,name=disableFallback,proto3" json:"disableFallback,omitempty"` - DisableFallbackIfMatch bool `protobuf:"varint,11,opt,name=disableFallbackIfMatch,proto3" json:"disableFallbackIfMatch,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{1} -} - -// Deprecated: Marked as deprecated in app/dns/config.proto. -func (x *Config) GetNameServers() []*net.Endpoint { - if x != nil { - return x.NameServers - } - return nil -} - -func (x *Config) GetNameServer() []*NameServer { - if x != nil { - return x.NameServer - } - return nil -} - -// Deprecated: Marked as deprecated in app/dns/config.proto. -func (x *Config) GetHosts() map[string]*net.IPOrDomain { - if x != nil { - return x.Hosts - } - return nil -} - -func (x *Config) GetClientIp() []byte { - if x != nil { - return x.ClientIp - } - return nil -} - -func (x *Config) GetStaticHosts() []*Config_HostMapping { - if x != nil { - return x.StaticHosts - } - return nil -} - -func (x *Config) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *Config) GetDisableCache() bool { - if x != nil { - return x.DisableCache - } - return false -} - -func (x *Config) GetQueryStrategy() QueryStrategy { - if x != nil { - return x.QueryStrategy - } - return QueryStrategy_USE_IP -} - -func (x *Config) GetDisableFallback() bool { - if x != nil { - return x.DisableFallback - } - return false -} - -func (x *Config) GetDisableFallbackIfMatch() bool { - if x != nil { - return x.DisableFallbackIfMatch - } - return false -} - -type NameServer_PriorityDomain struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=xray.app.dns.DomainMatchingType" json:"type,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` -} - -func (x *NameServer_PriorityDomain) Reset() { - *x = NameServer_PriorityDomain{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NameServer_PriorityDomain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NameServer_PriorityDomain) ProtoMessage() {} - -func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NameServer_PriorityDomain.ProtoReflect.Descriptor instead. -func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *NameServer_PriorityDomain) GetType() DomainMatchingType { - if x != nil { - return x.Type - } - return DomainMatchingType_Full -} - -func (x *NameServer_PriorityDomain) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -type NameServer_OriginalRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"` - Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *NameServer_OriginalRule) Reset() { - *x = NameServer_OriginalRule{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NameServer_OriginalRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NameServer_OriginalRule) ProtoMessage() {} - -func (x *NameServer_OriginalRule) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NameServer_OriginalRule.ProtoReflect.Descriptor instead. -func (*NameServer_OriginalRule) Descriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *NameServer_OriginalRule) GetRule() string { - if x != nil { - return x.Rule - } - return "" -} - -func (x *NameServer_OriginalRule) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -type Config_HostMapping struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=xray.app.dns.DomainMatchingType" json:"type,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - Ip [][]byte `protobuf:"bytes,3,rep,name=ip,proto3" json:"ip,omitempty"` - // ProxiedDomain indicates the mapped domain has the same IP address on this - // domain. Xray will use this domain for IP queries. - ProxiedDomain string `protobuf:"bytes,4,opt,name=proxied_domain,json=proxiedDomain,proto3" json:"proxied_domain,omitempty"` -} - -func (x *Config_HostMapping) Reset() { - *x = Config_HostMapping{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config_HostMapping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config_HostMapping) ProtoMessage() {} - -func (x *Config_HostMapping) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config_HostMapping.ProtoReflect.Descriptor instead. -func (*Config_HostMapping) Descriptor() ([]byte, []int) { - return file_app_dns_config_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *Config_HostMapping) GetType() DomainMatchingType { - if x != nil { - return x.Type - } - return DomainMatchingType_Full -} - -func (x *Config_HostMapping) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -func (x *Config_HostMapping) GetIp() [][]byte { - if x != nil { - return x.Ip - } - return nil -} - -func (x *Config_HostMapping) GetProxiedDomain() string { - if x != nil { - return x.ProxiedDomain - } - return "" -} - -var File_app_dns_config_proto protoreflect.FileDescriptor - -var file_app_dns_config_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x64, 0x6e, 0x73, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, - 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x61, 0x70, - 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x04, 0x0a, 0x0a, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x49, 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x6b, 0x69, 0x70, 0x46, 0x61, - 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x6b, - 0x69, 0x70, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x56, 0x0a, 0x12, 0x70, 0x72, - 0x69, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x11, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x69, 0x7a, 0x65, 0x64, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, - 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, - 0x12, 0x4c, 0x0a, 0x0e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x52, - 0x0d, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x42, - 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x52, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x1a, 0x5e, 0x0a, 0x0e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, - 0x73, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x1a, 0x36, 0x0a, 0x0c, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x75, - 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0xef, 0x05, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x39, 0x0a, 0x05, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x42, 0x02, 0x18, 0x01, 0x52, 0x05, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x73, 0x74, 0x61, - 0x74, 0x69, 0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, - 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x42, 0x0a, 0x0e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x73, 0x74, - 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, - 0x62, 0x6c, 0x65, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x12, 0x36, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x66, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x49, 0x66, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0x55, 0x0a, 0x0a, 0x48, 0x6f, - 0x73, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x31, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x92, 0x01, 0x0a, 0x0b, 0x48, 0x6f, 0x73, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x70, 0x12, - 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x65, 0x64, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4a, 0x04, 0x08, 0x07, 0x10, 0x08, 0x2a, 0x45, 0x0a, 0x12, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, - 0x53, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4b, - 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, - 0x78, 0x10, 0x03, 0x2a, 0x35, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x00, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x01, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x02, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, - 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, - 0x5a, 0x21, 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, 0x61, 0x70, 0x70, 0x2f, - 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, - 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_dns_config_proto_rawDescOnce sync.Once - file_app_dns_config_proto_rawDescData = file_app_dns_config_proto_rawDesc -) - -func file_app_dns_config_proto_rawDescGZIP() []byte { - file_app_dns_config_proto_rawDescOnce.Do(func() { - file_app_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_dns_config_proto_rawDescData) - }) - return file_app_dns_config_proto_rawDescData -} - -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_goTypes = []interface{}{ - (DomainMatchingType)(0), // 0: xray.app.dns.DomainMatchingType - (QueryStrategy)(0), // 1: xray.app.dns.QueryStrategy - (*NameServer)(nil), // 2: xray.app.dns.NameServer - (*Config)(nil), // 3: xray.app.dns.Config - (*NameServer_PriorityDomain)(nil), // 4: xray.app.dns.NameServer.PriorityDomain - (*NameServer_OriginalRule)(nil), // 5: xray.app.dns.NameServer.OriginalRule - nil, // 6: xray.app.dns.Config.HostsEntry - (*Config_HostMapping)(nil), // 7: xray.app.dns.Config.HostMapping - (*net.Endpoint)(nil), // 8: xray.common.net.Endpoint - (*router.GeoIP)(nil), // 9: xray.app.router.GeoIP - (*net.IPOrDomain)(nil), // 10: xray.common.net.IPOrDomain -} -var file_app_dns_config_proto_depIdxs = []int32{ - 8, // 0: xray.app.dns.NameServer.address:type_name -> xray.common.net.Endpoint - 4, // 1: xray.app.dns.NameServer.prioritized_domain:type_name -> xray.app.dns.NameServer.PriorityDomain - 9, // 2: xray.app.dns.NameServer.geoip:type_name -> xray.app.router.GeoIP - 5, // 3: xray.app.dns.NameServer.original_rules:type_name -> xray.app.dns.NameServer.OriginalRule - 1, // 4: xray.app.dns.NameServer.query_strategy:type_name -> xray.app.dns.QueryStrategy - 8, // 5: xray.app.dns.Config.NameServers:type_name -> xray.common.net.Endpoint - 2, // 6: xray.app.dns.Config.name_server:type_name -> xray.app.dns.NameServer - 6, // 7: xray.app.dns.Config.Hosts:type_name -> xray.app.dns.Config.HostsEntry - 7, // 8: xray.app.dns.Config.static_hosts:type_name -> xray.app.dns.Config.HostMapping - 1, // 9: xray.app.dns.Config.query_strategy:type_name -> xray.app.dns.QueryStrategy - 0, // 10: xray.app.dns.NameServer.PriorityDomain.type:type_name -> xray.app.dns.DomainMatchingType - 10, // 11: xray.app.dns.Config.HostsEntry.value:type_name -> xray.common.net.IPOrDomain - 0, // 12: xray.app.dns.Config.HostMapping.type:type_name -> xray.app.dns.DomainMatchingType - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_app_dns_config_proto_init() } -func file_app_dns_config_proto_init() { - if File_app_dns_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NameServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dns_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dns_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NameServer_PriorityDomain); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dns_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NameServer_OriginalRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dns_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config_HostMapping); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_dns_config_proto_rawDesc, - NumEnums: 2, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_dns_config_proto_goTypes, - DependencyIndexes: file_app_dns_config_proto_depIdxs, - EnumInfos: file_app_dns_config_proto_enumTypes, - MessageInfos: file_app_dns_config_proto_msgTypes, - }.Build() - File_app_dns_config_proto = out.File - file_app_dns_config_proto_rawDesc = nil - file_app_dns_config_proto_goTypes = nil - file_app_dns_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/dns/fakedns/fakedns.pb.go b/xray_api/proto/app/dns/fakedns/fakedns.pb.go deleted file mode 100644 index 7e3615f..0000000 --- a/xray_api/proto/app/dns/fakedns/fakedns.pb.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/dns/fakedns/fakedns.proto - -package fakedns - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type FakeDnsPool struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - IpPool string `protobuf:"bytes,1,opt,name=ip_pool,json=ipPool,proto3" json:"ip_pool,omitempty"` //CIDR of IP pool used as fake DNS IP - LruSize int64 `protobuf:"varint,2,opt,name=lruSize,proto3" json:"lruSize,omitempty"` //Size of Pool for remembering relationship between domain name and IP address -} - -func (x *FakeDnsPool) Reset() { - *x = FakeDnsPool{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_fakedns_fakedns_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FakeDnsPool) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FakeDnsPool) ProtoMessage() {} - -func (x *FakeDnsPool) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_fakedns_fakedns_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FakeDnsPool.ProtoReflect.Descriptor instead. -func (*FakeDnsPool) Descriptor() ([]byte, []int) { - return file_app_dns_fakedns_fakedns_proto_rawDescGZIP(), []int{0} -} - -func (x *FakeDnsPool) GetIpPool() string { - if x != nil { - return x.IpPool - } - return "" -} - -func (x *FakeDnsPool) GetLruSize() int64 { - if x != nil { - return x.LruSize - } - return 0 -} - -type FakeDnsPoolMulti struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pools []*FakeDnsPool `protobuf:"bytes,1,rep,name=pools,proto3" json:"pools,omitempty"` -} - -func (x *FakeDnsPoolMulti) Reset() { - *x = FakeDnsPoolMulti{} - if protoimpl.UnsafeEnabled { - mi := &file_app_dns_fakedns_fakedns_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FakeDnsPoolMulti) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FakeDnsPoolMulti) ProtoMessage() {} - -func (x *FakeDnsPoolMulti) ProtoReflect() protoreflect.Message { - mi := &file_app_dns_fakedns_fakedns_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FakeDnsPoolMulti.ProtoReflect.Descriptor instead. -func (*FakeDnsPoolMulti) Descriptor() ([]byte, []int) { - return file_app_dns_fakedns_fakedns_proto_rawDescGZIP(), []int{1} -} - -func (x *FakeDnsPoolMulti) GetPools() []*FakeDnsPool { - if x != nil { - return x.Pools - } - return nil -} - -var File_app_dns_fakedns_fakedns_proto protoreflect.FileDescriptor - -var file_app_dns_fakedns_fakedns_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, - 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x14, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x66, 0x61, - 0x6b, 0x65, 0x64, 0x6e, 0x73, 0x22, 0x40, 0x0a, 0x0b, 0x46, 0x61, 0x6b, 0x65, 0x44, 0x6e, 0x73, - 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x18, 0x0a, - 0x07, 0x6c, 0x72, 0x75, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, - 0x6c, 0x72, 0x75, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x4b, 0x0a, 0x10, 0x46, 0x61, 0x6b, 0x65, 0x44, - 0x6e, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x37, 0x0a, 0x05, 0x70, - 0x6f, 0x6f, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, - 0x73, 0x2e, 0x46, 0x61, 0x6b, 0x65, 0x44, 0x6e, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x52, 0x05, 0x70, - 0x6f, 0x6f, 0x6c, 0x73, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, - 0x50, 0x01, 0x5a, 0x29, 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, 0x61, 0x70, - 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x14, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x2e, 0x46, 0x61, 0x6b, - 0x65, 0x64, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_dns_fakedns_fakedns_proto_rawDescOnce sync.Once - file_app_dns_fakedns_fakedns_proto_rawDescData = file_app_dns_fakedns_fakedns_proto_rawDesc -) - -func file_app_dns_fakedns_fakedns_proto_rawDescGZIP() []byte { - file_app_dns_fakedns_fakedns_proto_rawDescOnce.Do(func() { - file_app_dns_fakedns_fakedns_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_dns_fakedns_fakedns_proto_rawDescData) - }) - return file_app_dns_fakedns_fakedns_proto_rawDescData -} - -var file_app_dns_fakedns_fakedns_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_app_dns_fakedns_fakedns_proto_goTypes = []interface{}{ - (*FakeDnsPool)(nil), // 0: xray.app.dns.fakedns.FakeDnsPool - (*FakeDnsPoolMulti)(nil), // 1: xray.app.dns.fakedns.FakeDnsPoolMulti -} -var file_app_dns_fakedns_fakedns_proto_depIdxs = []int32{ - 0, // 0: xray.app.dns.fakedns.FakeDnsPoolMulti.pools:type_name -> xray.app.dns.fakedns.FakeDnsPool - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_app_dns_fakedns_fakedns_proto_init() } -func file_app_dns_fakedns_fakedns_proto_init() { - if File_app_dns_fakedns_fakedns_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_dns_fakedns_fakedns_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FakeDnsPool); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_dns_fakedns_fakedns_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FakeDnsPoolMulti); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_dns_fakedns_fakedns_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_dns_fakedns_fakedns_proto_goTypes, - DependencyIndexes: file_app_dns_fakedns_fakedns_proto_depIdxs, - MessageInfos: file_app_dns_fakedns_fakedns_proto_msgTypes, - }.Build() - File_app_dns_fakedns_fakedns_proto = out.File - file_app_dns_fakedns_fakedns_proto_rawDesc = nil - file_app_dns_fakedns_fakedns_proto_goTypes = nil - file_app_dns_fakedns_fakedns_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/log/command/config.pb.go b/xray_api/proto/app/log/command/config.pb.go deleted file mode 100644 index c39f466..0000000 --- a/xray_api/proto/app/log/command/config.pb.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/log/command/config.proto - -package command - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_log_command_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_log_command_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_log_command_config_proto_rawDescGZIP(), []int{0} -} - -type RestartLoggerRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RestartLoggerRequest) Reset() { - *x = RestartLoggerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_log_command_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RestartLoggerRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartLoggerRequest) ProtoMessage() {} - -func (x *RestartLoggerRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_log_command_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartLoggerRequest.ProtoReflect.Descriptor instead. -func (*RestartLoggerRequest) Descriptor() ([]byte, []int) { - return file_app_log_command_config_proto_rawDescGZIP(), []int{1} -} - -type RestartLoggerResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RestartLoggerResponse) Reset() { - *x = RestartLoggerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_log_command_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RestartLoggerResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RestartLoggerResponse) ProtoMessage() {} - -func (x *RestartLoggerResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_log_command_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RestartLoggerResponse.ProtoReflect.Descriptor instead. -func (*RestartLoggerResponse) Descriptor() ([]byte, []int) { - return file_app_log_command_config_proto_rawDescGZIP(), []int{2} -} - -var File_app_log_command_config_proto protoreflect.FileDescriptor - -var file_app_log_command_config_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x16, - 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0x7b, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x6a, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, 0x65, - 0x72, 0x12, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x5e, 0x0a, 0x18, - 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x29, 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, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, - 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_log_command_config_proto_rawDescOnce sync.Once - file_app_log_command_config_proto_rawDescData = file_app_log_command_config_proto_rawDesc -) - -func file_app_log_command_config_proto_rawDescGZIP() []byte { - file_app_log_command_config_proto_rawDescOnce.Do(func() { - file_app_log_command_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_log_command_config_proto_rawDescData) - }) - return file_app_log_command_config_proto_rawDescData -} - -var file_app_log_command_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_app_log_command_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.app.log.command.Config - (*RestartLoggerRequest)(nil), // 1: xray.app.log.command.RestartLoggerRequest - (*RestartLoggerResponse)(nil), // 2: xray.app.log.command.RestartLoggerResponse -} -var file_app_log_command_config_proto_depIdxs = []int32{ - 1, // 0: xray.app.log.command.LoggerService.RestartLogger:input_type -> xray.app.log.command.RestartLoggerRequest - 2, // 1: xray.app.log.command.LoggerService.RestartLogger:output_type -> xray.app.log.command.RestartLoggerResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_app_log_command_config_proto_init() } -func file_app_log_command_config_proto_init() { - if File_app_log_command_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_log_command_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_log_command_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestartLoggerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_log_command_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestartLoggerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_log_command_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_app_log_command_config_proto_goTypes, - DependencyIndexes: file_app_log_command_config_proto_depIdxs, - MessageInfos: file_app_log_command_config_proto_msgTypes, - }.Build() - File_app_log_command_config_proto = out.File - file_app_log_command_config_proto_rawDesc = nil - file_app_log_command_config_proto_goTypes = nil - file_app_log_command_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/log/command/config_grpc.pb.go b/xray_api/proto/app/log/command/config_grpc.pb.go deleted file mode 100644 index 3ad1528..0000000 --- a/xray_api/proto/app/log/command/config_grpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: app/log/command/config.proto - -package command - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - LoggerService_RestartLogger_FullMethodName = "/xray.app.log.command.LoggerService/RestartLogger" -) - -// LoggerServiceClient is the client API for LoggerService service. -// -// 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 LoggerServiceClient interface { - RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) -} - -type loggerServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewLoggerServiceClient(cc grpc.ClientConnInterface) LoggerServiceClient { - return &loggerServiceClient{cc} -} - -func (c *loggerServiceClient) RestartLogger(ctx context.Context, in *RestartLoggerRequest, opts ...grpc.CallOption) (*RestartLoggerResponse, error) { - out := new(RestartLoggerResponse) - err := c.cc.Invoke(ctx, LoggerService_RestartLogger_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LoggerServiceServer is the server API for LoggerService service. -// All implementations must embed UnimplementedLoggerServiceServer -// for forward compatibility -type LoggerServiceServer interface { - RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) - mustEmbedUnimplementedLoggerServiceServer() -} - -// UnimplementedLoggerServiceServer must be embedded to have forward compatible implementations. -type UnimplementedLoggerServiceServer struct { -} - -func (UnimplementedLoggerServiceServer) RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RestartLogger not implemented") -} -func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerServiceServer() {} - -// 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 -// result in compilation errors. -type UnsafeLoggerServiceServer interface { - mustEmbedUnimplementedLoggerServiceServer() -} - -func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) { - s.RegisterService(&LoggerService_ServiceDesc, srv) -} - -func _LoggerService_RestartLogger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RestartLoggerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LoggerServiceServer).RestartLogger(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LoggerService_RestartLogger_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LoggerServiceServer).RestartLogger(ctx, req.(*RestartLoggerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// LoggerService_ServiceDesc is the grpc.ServiceDesc for LoggerService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var LoggerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.app.log.command.LoggerService", - HandlerType: (*LoggerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RestartLogger", - Handler: _LoggerService_RestartLogger_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "app/log/command/config.proto", -} diff --git a/xray_api/proto/app/log/config.pb.go b/xray_api/proto/app/log/config.pb.go deleted file mode 100644 index 7c7e743..0000000 --- a/xray_api/proto/app/log/config.pb.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/log/config.proto - -package log - -import ( - log "marzban-node/xray_api/proto/common/log" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type LogType int32 - -const ( - LogType_None LogType = 0 - LogType_Console LogType = 1 - LogType_File LogType = 2 - LogType_Event LogType = 3 -) - -// Enum value maps for LogType. -var ( - LogType_name = map[int32]string{ - 0: "None", - 1: "Console", - 2: "File", - 3: "Event", - } - LogType_value = map[string]int32{ - "None": 0, - "Console": 1, - "File": 2, - "Event": 3, - } -) - -func (x LogType) Enum() *LogType { - p := new(LogType) - *p = x - return p -} - -func (x LogType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (LogType) Descriptor() protoreflect.EnumDescriptor { - return file_app_log_config_proto_enumTypes[0].Descriptor() -} - -func (LogType) Type() protoreflect.EnumType { - return &file_app_log_config_proto_enumTypes[0] -} - -func (x LogType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use LogType.Descriptor instead. -func (LogType) EnumDescriptor() ([]byte, []int) { - return file_app_log_config_proto_rawDescGZIP(), []int{0} -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrorLogType LogType `protobuf:"varint,1,opt,name=error_log_type,json=errorLogType,proto3,enum=xray.app.log.LogType" json:"error_log_type,omitempty"` - ErrorLogLevel log.Severity `protobuf:"varint,2,opt,name=error_log_level,json=errorLogLevel,proto3,enum=xray.common.log.Severity" json:"error_log_level,omitempty"` - ErrorLogPath string `protobuf:"bytes,3,opt,name=error_log_path,json=errorLogPath,proto3" json:"error_log_path,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"` - EnableDnsLog bool `protobuf:"varint,6,opt,name=enable_dns_log,json=enableDnsLog,proto3" json:"enable_dns_log,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_log_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_log_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_log_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetErrorLogType() LogType { - if x != nil { - return x.ErrorLogType - } - return LogType_None -} - -func (x *Config) GetErrorLogLevel() log.Severity { - if x != nil { - return x.ErrorLogLevel - } - return log.Severity(0) -} - -func (x *Config) GetErrorLogPath() string { - if x != nil { - return x.ErrorLogPath - } - return "" -} - -func (x *Config) GetAccessLogType() LogType { - if x != nil { - return x.AccessLogType - } - return LogType_None -} - -func (x *Config) GetAccessLogPath() string { - if x != nil { - return x.AccessLogPath - } - return "" -} - -func (x *Config) GetEnableDnsLog() bool { - if x != nil { - return x.EnableDnsLog - } - return false -} - -var File_app_log_config_proto protoreflect.FileDescriptor - -var file_app_log_config_proto_rawDesc = []byte{ - 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, 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, - 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, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x41, 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x53, 0x65, - 0x76, 0x65, 0x72, 0x69, 0x74, 0x79, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, - 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x12, 0x3d, 0x0a, 0x0f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x6c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, - 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, - 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, - 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, - 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, - 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x21, 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, 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 ( - file_app_log_config_proto_rawDescOnce sync.Once - file_app_log_config_proto_rawDescData = file_app_log_config_proto_rawDesc -) - -func file_app_log_config_proto_rawDescGZIP() []byte { - file_app_log_config_proto_rawDescOnce.Do(func() { - file_app_log_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_log_config_proto_rawDescData) - }) - return file_app_log_config_proto_rawDescData -} - -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_goTypes = []interface{}{ - (LogType)(0), // 0: xray.app.log.LogType - (*Config)(nil), // 1: xray.app.log.Config - (log.Severity)(0), // 2: xray.common.log.Severity -} -var file_app_log_config_proto_depIdxs = []int32{ - 0, // 0: xray.app.log.Config.error_log_type:type_name -> xray.app.log.LogType - 2, // 1: xray.app.log.Config.error_log_level:type_name -> xray.common.log.Severity - 0, // 2: xray.app.log.Config.access_log_type:type_name -> xray.app.log.LogType - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_app_log_config_proto_init() } -func file_app_log_config_proto_init() { - if File_app_log_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_log_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_log_config_proto_goTypes, - DependencyIndexes: file_app_log_config_proto_depIdxs, - EnumInfos: file_app_log_config_proto_enumTypes, - MessageInfos: file_app_log_config_proto_msgTypes, - }.Build() - File_app_log_config_proto = out.File - file_app_log_config_proto_rawDesc = nil - file_app_log_config_proto_goTypes = nil - file_app_log_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/metrics/config.pb.go b/xray_api/proto/app/metrics/config.pb.go deleted file mode 100644 index fd0e6b0..0000000 --- a/xray_api/proto/app/metrics/config.pb.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/metrics/config.proto - -package metrics - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Config is the settings for metrics. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tag of the outbound handler that handles metrics http connections. - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_metrics_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_metrics_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_metrics_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -var File_app_metrics_config_proto protoreflect.FileDescriptor - -var file_app_metrics_config_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x61, 0x70, 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x22, 0x1a, 0x0a, 0x06, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, - 0x50, 0x01, 0x5a, 0x25, 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, 0x61, 0x70, - 0x70, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_metrics_config_proto_rawDescOnce sync.Once - file_app_metrics_config_proto_rawDescData = file_app_metrics_config_proto_rawDesc -) - -func file_app_metrics_config_proto_rawDescGZIP() []byte { - file_app_metrics_config_proto_rawDescOnce.Do(func() { - file_app_metrics_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_metrics_config_proto_rawDescData) - }) - return file_app_metrics_config_proto_rawDescData -} - -var file_app_metrics_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_app_metrics_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.app.metrics.Config -} -var file_app_metrics_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_app_metrics_config_proto_init() } -func file_app_metrics_config_proto_init() { - if File_app_metrics_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_metrics_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_metrics_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_metrics_config_proto_goTypes, - DependencyIndexes: file_app_metrics_config_proto_depIdxs, - MessageInfos: file_app_metrics_config_proto_msgTypes, - }.Build() - File_app_metrics_config_proto = out.File - file_app_metrics_config_proto_rawDesc = nil - file_app_metrics_config_proto_goTypes = nil - file_app_metrics_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/observatory/burst/config.pb.go b/xray_api/proto/app/observatory/burst/config.pb.go deleted file mode 100644 index bdbcd8c..0000000 --- a/xray_api/proto/app/observatory/burst/config.pb.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/observatory/burst/config.proto - -package burst - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // @Document The selectors for outbound under observation - SubjectSelector []string `protobuf:"bytes,2,rep,name=subject_selector,json=subjectSelector,proto3" json:"subject_selector,omitempty"` - PingConfig *HealthPingConfig `protobuf:"bytes,3,opt,name=ping_config,json=pingConfig,proto3" json:"ping_config,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_burst_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_burst_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_observatory_burst_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetSubjectSelector() []string { - if x != nil { - return x.SubjectSelector - } - return nil -} - -func (x *Config) GetPingConfig() *HealthPingConfig { - if x != nil { - return x.PingConfig - } - return nil -} - -type HealthPingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // destination url, need 204 for success return - // default https://connectivitycheck.gstatic.com/generate_204 - Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // connectivity check url - Connectivity string `protobuf:"bytes,2,opt,name=connectivity,proto3" json:"connectivity,omitempty"` - // health check interval, int64 values of time.Duration - Interval int64 `protobuf:"varint,3,opt,name=interval,proto3" json:"interval,omitempty"` - // sampling count is the amount of recent ping results which are kept for calculation - SamplingCount int32 `protobuf:"varint,4,opt,name=samplingCount,proto3" json:"samplingCount,omitempty"` - // ping timeout, int64 values of time.Duration - Timeout int64 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"` -} - -func (x *HealthPingConfig) Reset() { - *x = HealthPingConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_burst_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthPingConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthPingConfig) ProtoMessage() {} - -func (x *HealthPingConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_burst_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthPingConfig.ProtoReflect.Descriptor instead. -func (*HealthPingConfig) Descriptor() ([]byte, []int) { - return file_app_observatory_burst_config_proto_rawDescGZIP(), []int{1} -} - -func (x *HealthPingConfig) GetDestination() string { - if x != nil { - return x.Destination - } - return "" -} - -func (x *HealthPingConfig) GetConnectivity() string { - if x != nil { - return x.Connectivity - } - return "" -} - -func (x *HealthPingConfig) GetInterval() int64 { - if x != nil { - return x.Interval - } - return 0 -} - -func (x *HealthPingConfig) GetSamplingCount() int32 { - if x != nil { - return x.SamplingCount - } - return 0 -} - -func (x *HealthPingConfig) GetTimeout() int64 { - if x != nil { - return x.Timeout - } - return 0 -} - -var File_app_observatory_burst_config_proto protoreflect.FileDescriptor - -var file_app_observatory_burst_config_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, - 0x79, 0x2f, 0x62, 0x75, 0x72, 0x73, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, - 0x62, 0x75, 0x72, 0x73, 0x74, 0x22, 0x87, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x29, 0x0a, 0x10, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x52, 0x0a, 0x0b, 0x70, - 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x62, 0x75, 0x72, - 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x50, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x0a, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, - 0xb4, 0x01, 0x0a, 0x10, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x50, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x69, - 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, - 0x61, 0x6d, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x42, 0x70, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x62, 0x75, 0x72, 0x73, 0x74, 0x50, 0x01, 0x5a, 0x2f, 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, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x62, 0x75, 0x72, 0x73, 0x74, 0xaa, 0x02, 0x1a, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x42, 0x75, 0x72, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_observatory_burst_config_proto_rawDescOnce sync.Once - file_app_observatory_burst_config_proto_rawDescData = file_app_observatory_burst_config_proto_rawDesc -) - -func file_app_observatory_burst_config_proto_rawDescGZIP() []byte { - file_app_observatory_burst_config_proto_rawDescOnce.Do(func() { - file_app_observatory_burst_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_observatory_burst_config_proto_rawDescData) - }) - return file_app_observatory_burst_config_proto_rawDescData -} - -var file_app_observatory_burst_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_app_observatory_burst_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.core.app.observatory.burst.Config - (*HealthPingConfig)(nil), // 1: xray.core.app.observatory.burst.HealthPingConfig -} -var file_app_observatory_burst_config_proto_depIdxs = []int32{ - 1, // 0: xray.core.app.observatory.burst.Config.ping_config:type_name -> xray.core.app.observatory.burst.HealthPingConfig - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_app_observatory_burst_config_proto_init() } -func file_app_observatory_burst_config_proto_init() { - if File_app_observatory_burst_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_observatory_burst_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_burst_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthPingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_observatory_burst_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_observatory_burst_config_proto_goTypes, - DependencyIndexes: file_app_observatory_burst_config_proto_depIdxs, - MessageInfos: file_app_observatory_burst_config_proto_msgTypes, - }.Build() - File_app_observatory_burst_config_proto = out.File - file_app_observatory_burst_config_proto_rawDesc = nil - file_app_observatory_burst_config_proto_goTypes = nil - file_app_observatory_burst_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/observatory/command/command.pb.go b/xray_api/proto/app/observatory/command/command.pb.go deleted file mode 100644 index 581abfa..0000000 --- a/xray_api/proto/app/observatory/command/command.pb.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/observatory/command/command.proto - -package command - -import ( - observatory "marzban-node/xray_api/proto/app/observatory" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetOutboundStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetOutboundStatusRequest) Reset() { - *x = GetOutboundStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOutboundStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOutboundStatusRequest) ProtoMessage() {} - -func (x *GetOutboundStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOutboundStatusRequest.ProtoReflect.Descriptor instead. -func (*GetOutboundStatusRequest) Descriptor() ([]byte, []int) { - return file_app_observatory_command_command_proto_rawDescGZIP(), []int{0} -} - -type GetOutboundStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status *observatory.ObservationResult `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *GetOutboundStatusResponse) Reset() { - *x = GetOutboundStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOutboundStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOutboundStatusResponse) ProtoMessage() {} - -func (x *GetOutboundStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOutboundStatusResponse.ProtoReflect.Descriptor instead. -func (*GetOutboundStatusResponse) Descriptor() ([]byte, []int) { - return file_app_observatory_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *GetOutboundStatusResponse) GetStatus() *observatory.ObservationResult { - if x != nil { - return x.Status - } - return nil -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_observatory_command_command_proto_rawDescGZIP(), []int{2} -} - -var File_app_observatory_command_command_proto protoreflect.FileDescriptor - -var file_app_observatory_command_command_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, - 0x79, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x1c, 0x61, 0x70, 0x70, 0x2f, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x61, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x44, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4f, 0x62, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x32, 0xa7, 0x01, 0x0a, 0x12, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, - 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, - 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, - 0x47, 0x65, 0x74, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x80, 0x01, 0x0a, 0x25, - 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 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, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, - 0x72, 0x79, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4f, 0x62, 0x73, 0x65, 0x72, - 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_observatory_command_command_proto_rawDescOnce sync.Once - file_app_observatory_command_command_proto_rawDescData = file_app_observatory_command_command_proto_rawDesc -) - -func file_app_observatory_command_command_proto_rawDescGZIP() []byte { - file_app_observatory_command_command_proto_rawDescOnce.Do(func() { - file_app_observatory_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_observatory_command_command_proto_rawDescData) - }) - return file_app_observatory_command_command_proto_rawDescData -} - -var file_app_observatory_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_app_observatory_command_command_proto_goTypes = []interface{}{ - (*GetOutboundStatusRequest)(nil), // 0: xray.core.app.observatory.command.GetOutboundStatusRequest - (*GetOutboundStatusResponse)(nil), // 1: xray.core.app.observatory.command.GetOutboundStatusResponse - (*Config)(nil), // 2: xray.core.app.observatory.command.Config - (*observatory.ObservationResult)(nil), // 3: xray.core.app.observatory.ObservationResult -} -var file_app_observatory_command_command_proto_depIdxs = []int32{ - 3, // 0: xray.core.app.observatory.command.GetOutboundStatusResponse.status:type_name -> xray.core.app.observatory.ObservationResult - 0, // 1: xray.core.app.observatory.command.ObservatoryService.GetOutboundStatus:input_type -> xray.core.app.observatory.command.GetOutboundStatusRequest - 1, // 2: xray.core.app.observatory.command.ObservatoryService.GetOutboundStatus:output_type -> xray.core.app.observatory.command.GetOutboundStatusResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_app_observatory_command_command_proto_init() } -func file_app_observatory_command_command_proto_init() { - if File_app_observatory_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_observatory_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOutboundStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOutboundStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_observatory_command_command_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_app_observatory_command_command_proto_goTypes, - DependencyIndexes: file_app_observatory_command_command_proto_depIdxs, - MessageInfos: file_app_observatory_command_command_proto_msgTypes, - }.Build() - File_app_observatory_command_command_proto = out.File - file_app_observatory_command_command_proto_rawDesc = nil - file_app_observatory_command_command_proto_goTypes = nil - file_app_observatory_command_command_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/observatory/command/command_grpc.pb.go b/xray_api/proto/app/observatory/command/command_grpc.pb.go deleted file mode 100644 index 035cee0..0000000 --- a/xray_api/proto/app/observatory/command/command_grpc.pb.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: app/observatory/command/command.proto - -package command - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - ObservatoryService_GetOutboundStatus_FullMethodName = "/xray.core.app.observatory.command.ObservatoryService/GetOutboundStatus" -) - -// ObservatoryServiceClient is the client API for ObservatoryService service. -// -// 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 ObservatoryServiceClient interface { - GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error) -} - -type observatoryServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewObservatoryServiceClient(cc grpc.ClientConnInterface) ObservatoryServiceClient { - return &observatoryServiceClient{cc} -} - -func (c *observatoryServiceClient) GetOutboundStatus(ctx context.Context, in *GetOutboundStatusRequest, opts ...grpc.CallOption) (*GetOutboundStatusResponse, error) { - out := new(GetOutboundStatusResponse) - err := c.cc.Invoke(ctx, ObservatoryService_GetOutboundStatus_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ObservatoryServiceServer is the server API for ObservatoryService service. -// All implementations must embed UnimplementedObservatoryServiceServer -// for forward compatibility -type ObservatoryServiceServer interface { - GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error) - mustEmbedUnimplementedObservatoryServiceServer() -} - -// UnimplementedObservatoryServiceServer must be embedded to have forward compatible implementations. -type UnimplementedObservatoryServiceServer struct { -} - -func (UnimplementedObservatoryServiceServer) GetOutboundStatus(context.Context, *GetOutboundStatusRequest) (*GetOutboundStatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOutboundStatus not implemented") -} -func (UnimplementedObservatoryServiceServer) mustEmbedUnimplementedObservatoryServiceServer() {} - -// 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 -// result in compilation errors. -type UnsafeObservatoryServiceServer interface { - mustEmbedUnimplementedObservatoryServiceServer() -} - -func RegisterObservatoryServiceServer(s grpc.ServiceRegistrar, srv ObservatoryServiceServer) { - s.RegisterService(&ObservatoryService_ServiceDesc, srv) -} - -func _ObservatoryService_GetOutboundStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOutboundStatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ObservatoryServiceServer).GetOutboundStatus(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ObservatoryService_GetOutboundStatus_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ObservatoryServiceServer).GetOutboundStatus(ctx, req.(*GetOutboundStatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ObservatoryService_ServiceDesc is the grpc.ServiceDesc for ObservatoryService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ObservatoryService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.core.app.observatory.command.ObservatoryService", - HandlerType: (*ObservatoryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetOutboundStatus", - Handler: _ObservatoryService_GetOutboundStatus_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "app/observatory/command/command.proto", -} diff --git a/xray_api/proto/app/observatory/config.pb.go b/xray_api/proto/app/observatory/config.pb.go deleted file mode 100644 index c1ff512..0000000 --- a/xray_api/proto/app/observatory/config.pb.go +++ /dev/null @@ -1,654 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/observatory/config.proto - -package observatory - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ObservationResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status []*OutboundStatus `protobuf:"bytes,1,rep,name=status,proto3" json:"status,omitempty"` -} - -func (x *ObservationResult) Reset() { - *x = ObservationResult{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ObservationResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ObservationResult) ProtoMessage() {} - -func (x *ObservationResult) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ObservationResult.ProtoReflect.Descriptor instead. -func (*ObservationResult) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{0} -} - -func (x *ObservationResult) GetStatus() []*OutboundStatus { - if x != nil { - return x.Status - } - return nil -} - -type HealthPingMeasurementResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - All int64 `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` - Fail int64 `protobuf:"varint,2,opt,name=fail,proto3" json:"fail,omitempty"` - Deviation int64 `protobuf:"varint,3,opt,name=deviation,proto3" json:"deviation,omitempty"` - Average int64 `protobuf:"varint,4,opt,name=average,proto3" json:"average,omitempty"` - Max int64 `protobuf:"varint,5,opt,name=max,proto3" json:"max,omitempty"` - Min int64 `protobuf:"varint,6,opt,name=min,proto3" json:"min,omitempty"` -} - -func (x *HealthPingMeasurementResult) Reset() { - *x = HealthPingMeasurementResult{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HealthPingMeasurementResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HealthPingMeasurementResult) ProtoMessage() {} - -func (x *HealthPingMeasurementResult) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HealthPingMeasurementResult.ProtoReflect.Descriptor instead. -func (*HealthPingMeasurementResult) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{1} -} - -func (x *HealthPingMeasurementResult) GetAll() int64 { - if x != nil { - return x.All - } - return 0 -} - -func (x *HealthPingMeasurementResult) GetFail() int64 { - if x != nil { - return x.Fail - } - return 0 -} - -func (x *HealthPingMeasurementResult) GetDeviation() int64 { - if x != nil { - return x.Deviation - } - return 0 -} - -func (x *HealthPingMeasurementResult) GetAverage() int64 { - if x != nil { - return x.Average - } - return 0 -} - -func (x *HealthPingMeasurementResult) GetMax() int64 { - if x != nil { - return x.Max - } - return 0 -} - -func (x *HealthPingMeasurementResult) GetMin() int64 { - if x != nil { - return x.Min - } - return 0 -} - -type OutboundStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // @Document Whether this outbound is usable - // @Restriction ReadOnlyForUser - Alive bool `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"` - // @Document The time for probe request to finish. - // @Type time.ms - // @Restriction ReadOnlyForUser - Delay int64 `protobuf:"varint,2,opt,name=delay,proto3" json:"delay,omitempty"` - // @Document The last error caused this outbound failed to relay probe request - // @Restriction NotMachineReadable - LastErrorReason string `protobuf:"bytes,3,opt,name=last_error_reason,json=lastErrorReason,proto3" json:"last_error_reason,omitempty"` - // @Document The outbound tag for this Server - // @Type id.outboundTag - OutboundTag string `protobuf:"bytes,4,opt,name=outbound_tag,json=outboundTag,proto3" json:"outbound_tag,omitempty"` - // @Document The time this outbound is known to be alive - // @Type id.outboundTag - LastSeenTime int64 `protobuf:"varint,5,opt,name=last_seen_time,json=lastSeenTime,proto3" json:"last_seen_time,omitempty"` - // @Document The time this outbound is tried - // @Type id.outboundTag - LastTryTime int64 `protobuf:"varint,6,opt,name=last_try_time,json=lastTryTime,proto3" json:"last_try_time,omitempty"` - HealthPing *HealthPingMeasurementResult `protobuf:"bytes,7,opt,name=health_ping,json=healthPing,proto3" json:"health_ping,omitempty"` -} - -func (x *OutboundStatus) Reset() { - *x = OutboundStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OutboundStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OutboundStatus) ProtoMessage() {} - -func (x *OutboundStatus) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OutboundStatus.ProtoReflect.Descriptor instead. -func (*OutboundStatus) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{2} -} - -func (x *OutboundStatus) GetAlive() bool { - if x != nil { - return x.Alive - } - return false -} - -func (x *OutboundStatus) GetDelay() int64 { - if x != nil { - return x.Delay - } - return 0 -} - -func (x *OutboundStatus) GetLastErrorReason() string { - if x != nil { - return x.LastErrorReason - } - return "" -} - -func (x *OutboundStatus) GetOutboundTag() string { - if x != nil { - return x.OutboundTag - } - return "" -} - -func (x *OutboundStatus) GetLastSeenTime() int64 { - if x != nil { - return x.LastSeenTime - } - return 0 -} - -func (x *OutboundStatus) GetLastTryTime() int64 { - if x != nil { - return x.LastTryTime - } - return 0 -} - -func (x *OutboundStatus) GetHealthPing() *HealthPingMeasurementResult { - if x != nil { - return x.HealthPing - } - return nil -} - -type ProbeResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // @Document Whether this outbound is usable - // @Restriction ReadOnlyForUser - Alive bool `protobuf:"varint,1,opt,name=alive,proto3" json:"alive,omitempty"` - // @Document The time for probe request to finish. - // @Type time.ms - // @Restriction ReadOnlyForUser - Delay int64 `protobuf:"varint,2,opt,name=delay,proto3" json:"delay,omitempty"` - // @Document The error caused this outbound failed to relay probe request - // @Restriction NotMachineReadable - LastErrorReason string `protobuf:"bytes,3,opt,name=last_error_reason,json=lastErrorReason,proto3" json:"last_error_reason,omitempty"` -} - -func (x *ProbeResult) Reset() { - *x = ProbeResult{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProbeResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProbeResult) ProtoMessage() {} - -func (x *ProbeResult) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProbeResult.ProtoReflect.Descriptor instead. -func (*ProbeResult) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{3} -} - -func (x *ProbeResult) GetAlive() bool { - if x != nil { - return x.Alive - } - return false -} - -func (x *ProbeResult) GetDelay() int64 { - if x != nil { - return x.Delay - } - return 0 -} - -func (x *ProbeResult) GetLastErrorReason() string { - if x != nil { - return x.LastErrorReason - } - return "" -} - -type Intensity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // @Document The time interval for a probe request in ms. - // @Type time.ms - ProbeInterval uint32 `protobuf:"varint,1,opt,name=probe_interval,json=probeInterval,proto3" json:"probe_interval,omitempty"` -} - -func (x *Intensity) Reset() { - *x = Intensity{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Intensity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Intensity) ProtoMessage() {} - -func (x *Intensity) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Intensity.ProtoReflect.Descriptor instead. -func (*Intensity) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{4} -} - -func (x *Intensity) GetProbeInterval() uint32 { - if x != nil { - return x.ProbeInterval - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // @Document The selectors for outbound under observation - SubjectSelector []string `protobuf:"bytes,2,rep,name=subject_selector,json=subjectSelector,proto3" json:"subject_selector,omitempty"` - ProbeUrl string `protobuf:"bytes,3,opt,name=probe_url,json=probeUrl,proto3" json:"probe_url,omitempty"` - ProbeInterval int64 `protobuf:"varint,4,opt,name=probe_interval,json=probeInterval,proto3" json:"probe_interval,omitempty"` - EnableConcurrency bool `protobuf:"varint,5,opt,name=enable_concurrency,json=enableConcurrency,proto3" json:"enable_concurrency,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_observatory_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_observatory_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_observatory_config_proto_rawDescGZIP(), []int{5} -} - -func (x *Config) GetSubjectSelector() []string { - if x != nil { - return x.SubjectSelector - } - return nil -} - -func (x *Config) GetProbeUrl() string { - if x != nil { - return x.ProbeUrl - } - return "" -} - -func (x *Config) GetProbeInterval() int64 { - if x != nil { - return x.ProbeInterval - } - return 0 -} - -func (x *Config) GetEnableConcurrency() bool { - if x != nil { - return x.EnableConcurrency - } - return false -} - -var File_app_observatory_config_proto protoreflect.FileDescriptor - -var file_app_observatory_config_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, - 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x56, 0x0a, 0x11, 0x4f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x41, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x1b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x50, 0x69, 0x6e, 0x67, - 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x61, 0x6c, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x66, 0x61, 0x69, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x76, 0x69, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x64, 0x65, 0x76, 0x69, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x61, 0x76, 0x65, 0x72, 0x61, 0x67, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x61, - 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, - 0x6d, 0x69, 0x6e, 0x22, 0xae, 0x02, 0x0a, 0x0e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x5f, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, - 0x61, 0x73, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, - 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, - 0x67, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, - 0x65, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, - 0x74, 0x72, 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, - 0x6c, 0x61, 0x73, 0x74, 0x54, 0x72, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x0b, 0x68, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x36, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x50, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0a, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x50, 0x69, 0x6e, 0x67, 0x22, 0x65, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, - 0x61, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, - 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x09, 0x49, - 0x6e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x62, - 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, - 0xa6, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x75, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x5f, 0x75, - 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x55, - 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x62, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x62, - 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x12, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x6f, 0x72, 0x79, 0x50, 0x01, 0x5a, 0x29, 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, 0x61, 0x70, 0x70, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, - 0x79, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_observatory_config_proto_rawDescOnce sync.Once - file_app_observatory_config_proto_rawDescData = file_app_observatory_config_proto_rawDesc -) - -func file_app_observatory_config_proto_rawDescGZIP() []byte { - file_app_observatory_config_proto_rawDescOnce.Do(func() { - file_app_observatory_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_observatory_config_proto_rawDescData) - }) - return file_app_observatory_config_proto_rawDescData -} - -var file_app_observatory_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_app_observatory_config_proto_goTypes = []interface{}{ - (*ObservationResult)(nil), // 0: xray.core.app.observatory.ObservationResult - (*HealthPingMeasurementResult)(nil), // 1: xray.core.app.observatory.HealthPingMeasurementResult - (*OutboundStatus)(nil), // 2: xray.core.app.observatory.OutboundStatus - (*ProbeResult)(nil), // 3: xray.core.app.observatory.ProbeResult - (*Intensity)(nil), // 4: xray.core.app.observatory.Intensity - (*Config)(nil), // 5: xray.core.app.observatory.Config -} -var file_app_observatory_config_proto_depIdxs = []int32{ - 2, // 0: xray.core.app.observatory.ObservationResult.status:type_name -> xray.core.app.observatory.OutboundStatus - 1, // 1: xray.core.app.observatory.OutboundStatus.health_ping:type_name -> xray.core.app.observatory.HealthPingMeasurementResult - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_app_observatory_config_proto_init() } -func file_app_observatory_config_proto_init() { - if File_app_observatory_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_observatory_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ObservationResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HealthPingMeasurementResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OutboundStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProbeResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Intensity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_observatory_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_observatory_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_observatory_config_proto_goTypes, - DependencyIndexes: file_app_observatory_config_proto_depIdxs, - MessageInfos: file_app_observatory_config_proto_msgTypes, - }.Build() - File_app_observatory_config_proto = out.File - file_app_observatory_config_proto_rawDesc = nil - file_app_observatory_config_proto_goTypes = nil - file_app_observatory_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/policy/config.pb.go b/xray_api/proto/app/policy/config.pb.go deleted file mode 100644 index adcb363..0000000 --- a/xray_api/proto/app/policy/config.pb.go +++ /dev/null @@ -1,724 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/policy/config.proto - -package policy - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Second struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Second) Reset() { - *x = Second{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Second) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Second) ProtoMessage() {} - -func (x *Second) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Second.ProtoReflect.Descriptor instead. -func (*Second) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Second) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -type Policy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Timeout *Policy_Timeout `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` - Stats *Policy_Stats `protobuf:"bytes,2,opt,name=stats,proto3" json:"stats,omitempty"` - Buffer *Policy_Buffer `protobuf:"bytes,3,opt,name=buffer,proto3" json:"buffer,omitempty"` -} - -func (x *Policy) Reset() { - *x = Policy{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Policy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Policy) ProtoMessage() {} - -func (x *Policy) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Policy.ProtoReflect.Descriptor instead. -func (*Policy) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Policy) GetTimeout() *Policy_Timeout { - if x != nil { - return x.Timeout - } - return nil -} - -func (x *Policy) GetStats() *Policy_Stats { - if x != nil { - return x.Stats - } - return nil -} - -func (x *Policy) GetBuffer() *Policy_Buffer { - if x != nil { - return x.Buffer - } - return nil -} - -type SystemPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stats *SystemPolicy_Stats `protobuf:"bytes,1,opt,name=stats,proto3" json:"stats,omitempty"` -} - -func (x *SystemPolicy) Reset() { - *x = SystemPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SystemPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SystemPolicy) ProtoMessage() {} - -func (x *SystemPolicy) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SystemPolicy.ProtoReflect.Descriptor instead. -func (*SystemPolicy) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{2} -} - -func (x *SystemPolicy) GetStats() *SystemPolicy_Stats { - if x != nil { - return x.Stats - } - return nil -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Level map[uint32]*Policy `protobuf:"bytes,1,rep,name=level,proto3" json:"level,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - System *SystemPolicy `protobuf:"bytes,2,opt,name=system,proto3" json:"system,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{3} -} - -func (x *Config) GetLevel() map[uint32]*Policy { - if x != nil { - return x.Level - } - return nil -} - -func (x *Config) GetSystem() *SystemPolicy { - if x != nil { - return x.System - } - return nil -} - -// Timeout is a message for timeout settings in various stages, in seconds. -type Policy_Timeout struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Handshake *Second `protobuf:"bytes,1,opt,name=handshake,proto3" json:"handshake,omitempty"` - ConnectionIdle *Second `protobuf:"bytes,2,opt,name=connection_idle,json=connectionIdle,proto3" json:"connection_idle,omitempty"` - UplinkOnly *Second `protobuf:"bytes,3,opt,name=uplink_only,json=uplinkOnly,proto3" json:"uplink_only,omitempty"` - DownlinkOnly *Second `protobuf:"bytes,4,opt,name=downlink_only,json=downlinkOnly,proto3" json:"downlink_only,omitempty"` -} - -func (x *Policy_Timeout) Reset() { - *x = Policy_Timeout{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Policy_Timeout) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Policy_Timeout) ProtoMessage() {} - -func (x *Policy_Timeout) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Policy_Timeout.ProtoReflect.Descriptor instead. -func (*Policy_Timeout) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *Policy_Timeout) GetHandshake() *Second { - if x != nil { - return x.Handshake - } - return nil -} - -func (x *Policy_Timeout) GetConnectionIdle() *Second { - if x != nil { - return x.ConnectionIdle - } - return nil -} - -func (x *Policy_Timeout) GetUplinkOnly() *Second { - if x != nil { - return x.UplinkOnly - } - return nil -} - -func (x *Policy_Timeout) GetDownlinkOnly() *Second { - if x != nil { - return x.DownlinkOnly - } - return nil -} - -type Policy_Stats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserUplink bool `protobuf:"varint,1,opt,name=user_uplink,json=userUplink,proto3" json:"user_uplink,omitempty"` - UserDownlink bool `protobuf:"varint,2,opt,name=user_downlink,json=userDownlink,proto3" json:"user_downlink,omitempty"` -} - -func (x *Policy_Stats) Reset() { - *x = Policy_Stats{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Policy_Stats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Policy_Stats) ProtoMessage() {} - -func (x *Policy_Stats) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Policy_Stats.ProtoReflect.Descriptor instead. -func (*Policy_Stats) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *Policy_Stats) GetUserUplink() bool { - if x != nil { - return x.UserUplink - } - return false -} - -func (x *Policy_Stats) GetUserDownlink() bool { - if x != nil { - return x.UserDownlink - } - return false -} - -type Policy_Buffer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Buffer size per connection, in bytes. -1 for unlimited buffer. - Connection int32 `protobuf:"varint,1,opt,name=connection,proto3" json:"connection,omitempty"` -} - -func (x *Policy_Buffer) Reset() { - *x = Policy_Buffer{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Policy_Buffer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Policy_Buffer) ProtoMessage() {} - -func (x *Policy_Buffer) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Policy_Buffer.ProtoReflect.Descriptor instead. -func (*Policy_Buffer) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{1, 2} -} - -func (x *Policy_Buffer) GetConnection() int32 { - if x != nil { - return x.Connection - } - return 0 -} - -type SystemPolicy_Stats struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InboundUplink bool `protobuf:"varint,1,opt,name=inbound_uplink,json=inboundUplink,proto3" json:"inbound_uplink,omitempty"` - InboundDownlink bool `protobuf:"varint,2,opt,name=inbound_downlink,json=inboundDownlink,proto3" json:"inbound_downlink,omitempty"` - OutboundUplink bool `protobuf:"varint,3,opt,name=outbound_uplink,json=outboundUplink,proto3" json:"outbound_uplink,omitempty"` - OutboundDownlink bool `protobuf:"varint,4,opt,name=outbound_downlink,json=outboundDownlink,proto3" json:"outbound_downlink,omitempty"` -} - -func (x *SystemPolicy_Stats) Reset() { - *x = SystemPolicy_Stats{} - if protoimpl.UnsafeEnabled { - mi := &file_app_policy_config_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SystemPolicy_Stats) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SystemPolicy_Stats) ProtoMessage() {} - -func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message { - mi := &file_app_policy_config_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SystemPolicy_Stats.ProtoReflect.Descriptor instead. -func (*SystemPolicy_Stats) Descriptor() ([]byte, []int) { - return file_app_policy_config_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *SystemPolicy_Stats) GetInboundUplink() bool { - if x != nil { - return x.InboundUplink - } - return false -} - -func (x *SystemPolicy_Stats) GetInboundDownlink() bool { - if x != nil { - return x.InboundDownlink - } - return false -} - -func (x *SystemPolicy_Stats) GetOutboundUplink() bool { - if x != nil { - return x.OutboundUplink - } - return false -} - -func (x *SystemPolicy_Stats) GetOutboundDownlink() bool { - if x != nil { - return x.OutboundDownlink - } - return false -} - -var File_app_policy_config_proto protoreflect.FileDescriptor - -var file_app_policy_config_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x1e, 0x0a, 0x06, 0x53, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xa6, 0x04, 0x0a, 0x06, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x39, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x12, 0x33, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x42, - 0x75, 0x66, 0x66, 0x65, 0x72, 0x52, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x1a, 0xfa, 0x01, - 0x0a, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x35, 0x0a, 0x09, 0x68, 0x61, 0x6e, - 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x52, 0x09, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, - 0x12, 0x40, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6f, 0x6e, 0x6c, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, - 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x52, 0x0a, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x3c, 0x0a, 0x0d, - 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x52, 0x0c, 0x64, 0x6f, - 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x4f, 0x6e, 0x6c, 0x79, 0x1a, 0x4d, 0x0a, 0x05, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x75, 0x70, 0x6c, 0x69, - 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x55, 0x70, - 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x64, 0x6f, 0x77, - 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x73, 0x65, - 0x72, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x1a, 0x28, 0x0a, 0x06, 0x42, 0x75, 0x66, - 0x66, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xfb, 0x01, 0x0a, 0x0c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, - 0xaf, 0x01, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, - 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x64, 0x6f, 0x77, 0x6e, - 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x6e, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x6f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x55, 0x70, - 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x2b, 0x0a, 0x11, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x5f, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, - 0x6b, 0x22, 0xcc, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x05, - 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x1a, 0x51, 0x0a, - 0x0a, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x24, 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, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0xaa, - 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_policy_config_proto_rawDescOnce sync.Once - file_app_policy_config_proto_rawDescData = file_app_policy_config_proto_rawDesc -) - -func file_app_policy_config_proto_rawDescGZIP() []byte { - file_app_policy_config_proto_rawDescOnce.Do(func() { - file_app_policy_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_policy_config_proto_rawDescData) - }) - return file_app_policy_config_proto_rawDescData -} - -var file_app_policy_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_app_policy_config_proto_goTypes = []interface{}{ - (*Second)(nil), // 0: xray.app.policy.Second - (*Policy)(nil), // 1: xray.app.policy.Policy - (*SystemPolicy)(nil), // 2: xray.app.policy.SystemPolicy - (*Config)(nil), // 3: xray.app.policy.Config - (*Policy_Timeout)(nil), // 4: xray.app.policy.Policy.Timeout - (*Policy_Stats)(nil), // 5: xray.app.policy.Policy.Stats - (*Policy_Buffer)(nil), // 6: xray.app.policy.Policy.Buffer - (*SystemPolicy_Stats)(nil), // 7: xray.app.policy.SystemPolicy.Stats - nil, // 8: xray.app.policy.Config.LevelEntry -} -var file_app_policy_config_proto_depIdxs = []int32{ - 4, // 0: xray.app.policy.Policy.timeout:type_name -> xray.app.policy.Policy.Timeout - 5, // 1: xray.app.policy.Policy.stats:type_name -> xray.app.policy.Policy.Stats - 6, // 2: xray.app.policy.Policy.buffer:type_name -> xray.app.policy.Policy.Buffer - 7, // 3: xray.app.policy.SystemPolicy.stats:type_name -> xray.app.policy.SystemPolicy.Stats - 8, // 4: xray.app.policy.Config.level:type_name -> xray.app.policy.Config.LevelEntry - 2, // 5: xray.app.policy.Config.system:type_name -> xray.app.policy.SystemPolicy - 0, // 6: xray.app.policy.Policy.Timeout.handshake:type_name -> xray.app.policy.Second - 0, // 7: xray.app.policy.Policy.Timeout.connection_idle:type_name -> xray.app.policy.Second - 0, // 8: xray.app.policy.Policy.Timeout.uplink_only:type_name -> xray.app.policy.Second - 0, // 9: xray.app.policy.Policy.Timeout.downlink_only:type_name -> xray.app.policy.Second - 1, // 10: xray.app.policy.Config.LevelEntry.value:type_name -> xray.app.policy.Policy - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_app_policy_config_proto_init() } -func file_app_policy_config_proto_init() { - if File_app_policy_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_policy_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Second); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Policy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SystemPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Policy_Timeout); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Policy_Stats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Policy_Buffer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_policy_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SystemPolicy_Stats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_policy_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_policy_config_proto_goTypes, - DependencyIndexes: file_app_policy_config_proto_depIdxs, - MessageInfos: file_app_policy_config_proto_msgTypes, - }.Build() - File_app_policy_config_proto = out.File - file_app_policy_config_proto_rawDesc = nil - file_app_policy_config_proto_goTypes = nil - file_app_policy_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/proxyman/command/command.pb.go b/xray_api/proto/app/proxyman/command/command.pb.go deleted file mode 100644 index 4de8af6..0000000 --- a/xray_api/proto/app/proxyman/command/command.pb.go +++ /dev/null @@ -1,1060 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/proxyman/command/command.proto - -package command - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - serial "marzban-node/xray_api/proto/common/serial" - core "marzban-node/xray_api/proto/core" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AddUserOperation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *protocol.User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *AddUserOperation) Reset() { - *x = AddUserOperation{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddUserOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddUserOperation) ProtoMessage() {} - -func (x *AddUserOperation) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddUserOperation.ProtoReflect.Descriptor instead. -func (*AddUserOperation) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{0} -} - -func (x *AddUserOperation) GetUser() *protocol.User { - if x != nil { - return x.User - } - return nil -} - -type RemoveUserOperation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` -} - -func (x *RemoveUserOperation) Reset() { - *x = RemoveUserOperation{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveUserOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveUserOperation) ProtoMessage() {} - -func (x *RemoveUserOperation) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveUserOperation.ProtoReflect.Descriptor instead. -func (*RemoveUserOperation) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *RemoveUserOperation) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -type AddInboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Inbound *core.InboundHandlerConfig `protobuf:"bytes,1,opt,name=inbound,proto3" json:"inbound,omitempty"` -} - -func (x *AddInboundRequest) Reset() { - *x = AddInboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddInboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddInboundRequest) ProtoMessage() {} - -func (x *AddInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddInboundRequest.ProtoReflect.Descriptor instead. -func (*AddInboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{2} -} - -func (x *AddInboundRequest) GetInbound() *core.InboundHandlerConfig { - if x != nil { - return x.Inbound - } - return nil -} - -type AddInboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AddInboundResponse) Reset() { - *x = AddInboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddInboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddInboundResponse) ProtoMessage() {} - -func (x *AddInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddInboundResponse.ProtoReflect.Descriptor instead. -func (*AddInboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{3} -} - -type RemoveInboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` -} - -func (x *RemoveInboundRequest) Reset() { - *x = RemoveInboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveInboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveInboundRequest) ProtoMessage() {} - -func (x *RemoveInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveInboundRequest.ProtoReflect.Descriptor instead. -func (*RemoveInboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{4} -} - -func (x *RemoveInboundRequest) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -type RemoveInboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveInboundResponse) Reset() { - *x = RemoveInboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveInboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveInboundResponse) ProtoMessage() {} - -func (x *RemoveInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveInboundResponse.ProtoReflect.Descriptor instead. -func (*RemoveInboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{5} -} - -type AlterInboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Operation *serial.TypedMessage `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` -} - -func (x *AlterInboundRequest) Reset() { - *x = AlterInboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlterInboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlterInboundRequest) ProtoMessage() {} - -func (x *AlterInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlterInboundRequest.ProtoReflect.Descriptor instead. -func (*AlterInboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{6} -} - -func (x *AlterInboundRequest) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *AlterInboundRequest) GetOperation() *serial.TypedMessage { - if x != nil { - return x.Operation - } - return nil -} - -type AlterInboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AlterInboundResponse) Reset() { - *x = AlterInboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlterInboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlterInboundResponse) ProtoMessage() {} - -func (x *AlterInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlterInboundResponse.ProtoReflect.Descriptor instead. -func (*AlterInboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{7} -} - -type AddOutboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Outbound *core.OutboundHandlerConfig `protobuf:"bytes,1,opt,name=outbound,proto3" json:"outbound,omitempty"` -} - -func (x *AddOutboundRequest) Reset() { - *x = AddOutboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOutboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOutboundRequest) ProtoMessage() {} - -func (x *AddOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOutboundRequest.ProtoReflect.Descriptor instead. -func (*AddOutboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{8} -} - -func (x *AddOutboundRequest) GetOutbound() *core.OutboundHandlerConfig { - if x != nil { - return x.Outbound - } - return nil -} - -type AddOutboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AddOutboundResponse) Reset() { - *x = AddOutboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOutboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOutboundResponse) ProtoMessage() {} - -func (x *AddOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOutboundResponse.ProtoReflect.Descriptor instead. -func (*AddOutboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{9} -} - -type RemoveOutboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` -} - -func (x *RemoveOutboundRequest) Reset() { - *x = RemoveOutboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOutboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOutboundRequest) ProtoMessage() {} - -func (x *RemoveOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOutboundRequest.ProtoReflect.Descriptor instead. -func (*RemoveOutboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{10} -} - -func (x *RemoveOutboundRequest) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -type RemoveOutboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveOutboundResponse) Reset() { - *x = RemoveOutboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOutboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOutboundResponse) ProtoMessage() {} - -func (x *RemoveOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOutboundResponse.ProtoReflect.Descriptor instead. -func (*RemoveOutboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{11} -} - -type AlterOutboundRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Operation *serial.TypedMessage `protobuf:"bytes,2,opt,name=operation,proto3" json:"operation,omitempty"` -} - -func (x *AlterOutboundRequest) Reset() { - *x = AlterOutboundRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlterOutboundRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlterOutboundRequest) ProtoMessage() {} - -func (x *AlterOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlterOutboundRequest.ProtoReflect.Descriptor instead. -func (*AlterOutboundRequest) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{12} -} - -func (x *AlterOutboundRequest) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *AlterOutboundRequest) GetOperation() *serial.TypedMessage { - if x != nil { - return x.Operation - } - return nil -} - -type AlterOutboundResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AlterOutboundResponse) Reset() { - *x = AlterOutboundResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlterOutboundResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlterOutboundResponse) ProtoMessage() {} - -func (x *AlterOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlterOutboundResponse.ProtoReflect.Descriptor instead. -func (*AlterOutboundResponse) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{13} -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_command_command_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_command_command_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{14} -} - -var File_app_proxyman_command_command_proto protoreflect.FileDescriptor - -var file_app_proxyman_command_command_proto_rawDesc = []byte{ - 0x0a, 0x22, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, - 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 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, 0x6f, 0x1a, 0x11, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x42, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2b, 0x0a, 0x13, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x22, 0x4e, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, - 0x61, 0x67, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, 0x0a, 0x13, 0x41, - 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x74, 0x61, 0x67, 0x12, 0x3e, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 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, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x16, 0x0a, 0x14, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x0a, 0x12, - 0x41, 0x64, 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x22, 0x15, 0x0a, 0x13, 0x41, 0x64, 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, - 0x61, 0x67, 0x22, 0x18, 0x0a, 0x16, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x68, 0x0a, 0x14, - 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x3e, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 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, 0x09, 0x6f, 0x70, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x17, 0x0a, 0x15, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xc5, 0x05, 0x0a, 0x0e, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0a, - 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2c, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x0d, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2f, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x71, 0x0a, 0x0c, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, - 0x2e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, - 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, - 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x6e, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x12, 0x2d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x64, - 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x64, 0x64, - 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x77, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x0d, 0x41, - 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x2f, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, - 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 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, - 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_proxyman_command_command_proto_rawDescOnce sync.Once - file_app_proxyman_command_command_proto_rawDescData = file_app_proxyman_command_command_proto_rawDesc -) - -func file_app_proxyman_command_command_proto_rawDescGZIP() []byte { - file_app_proxyman_command_command_proto_rawDescOnce.Do(func() { - file_app_proxyman_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_proxyman_command_command_proto_rawDescData) - }) - return file_app_proxyman_command_command_proto_rawDescData -} - -var file_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_app_proxyman_command_command_proto_goTypes = []interface{}{ - (*AddUserOperation)(nil), // 0: xray.app.proxyman.command.AddUserOperation - (*RemoveUserOperation)(nil), // 1: xray.app.proxyman.command.RemoveUserOperation - (*AddInboundRequest)(nil), // 2: xray.app.proxyman.command.AddInboundRequest - (*AddInboundResponse)(nil), // 3: xray.app.proxyman.command.AddInboundResponse - (*RemoveInboundRequest)(nil), // 4: xray.app.proxyman.command.RemoveInboundRequest - (*RemoveInboundResponse)(nil), // 5: xray.app.proxyman.command.RemoveInboundResponse - (*AlterInboundRequest)(nil), // 6: xray.app.proxyman.command.AlterInboundRequest - (*AlterInboundResponse)(nil), // 7: xray.app.proxyman.command.AlterInboundResponse - (*AddOutboundRequest)(nil), // 8: xray.app.proxyman.command.AddOutboundRequest - (*AddOutboundResponse)(nil), // 9: xray.app.proxyman.command.AddOutboundResponse - (*RemoveOutboundRequest)(nil), // 10: xray.app.proxyman.command.RemoveOutboundRequest - (*RemoveOutboundResponse)(nil), // 11: xray.app.proxyman.command.RemoveOutboundResponse - (*AlterOutboundRequest)(nil), // 12: xray.app.proxyman.command.AlterOutboundRequest - (*AlterOutboundResponse)(nil), // 13: xray.app.proxyman.command.AlterOutboundResponse - (*Config)(nil), // 14: xray.app.proxyman.command.Config - (*protocol.User)(nil), // 15: xray.common.protocol.User - (*core.InboundHandlerConfig)(nil), // 16: xray.core.InboundHandlerConfig - (*serial.TypedMessage)(nil), // 17: xray.common.serial.TypedMessage - (*core.OutboundHandlerConfig)(nil), // 18: xray.core.OutboundHandlerConfig -} -var file_app_proxyman_command_command_proto_depIdxs = []int32{ - 15, // 0: xray.app.proxyman.command.AddUserOperation.user:type_name -> xray.common.protocol.User - 16, // 1: xray.app.proxyman.command.AddInboundRequest.inbound:type_name -> xray.core.InboundHandlerConfig - 17, // 2: xray.app.proxyman.command.AlterInboundRequest.operation:type_name -> xray.common.serial.TypedMessage - 18, // 3: xray.app.proxyman.command.AddOutboundRequest.outbound:type_name -> xray.core.OutboundHandlerConfig - 17, // 4: xray.app.proxyman.command.AlterOutboundRequest.operation:type_name -> xray.common.serial.TypedMessage - 2, // 5: xray.app.proxyman.command.HandlerService.AddInbound:input_type -> xray.app.proxyman.command.AddInboundRequest - 4, // 6: xray.app.proxyman.command.HandlerService.RemoveInbound:input_type -> xray.app.proxyman.command.RemoveInboundRequest - 6, // 7: xray.app.proxyman.command.HandlerService.AlterInbound:input_type -> xray.app.proxyman.command.AlterInboundRequest - 8, // 8: xray.app.proxyman.command.HandlerService.AddOutbound:input_type -> xray.app.proxyman.command.AddOutboundRequest - 10, // 9: xray.app.proxyman.command.HandlerService.RemoveOutbound:input_type -> xray.app.proxyman.command.RemoveOutboundRequest - 12, // 10: xray.app.proxyman.command.HandlerService.AlterOutbound:input_type -> xray.app.proxyman.command.AlterOutboundRequest - 3, // 11: xray.app.proxyman.command.HandlerService.AddInbound:output_type -> xray.app.proxyman.command.AddInboundResponse - 5, // 12: xray.app.proxyman.command.HandlerService.RemoveInbound:output_type -> xray.app.proxyman.command.RemoveInboundResponse - 7, // 13: xray.app.proxyman.command.HandlerService.AlterInbound:output_type -> xray.app.proxyman.command.AlterInboundResponse - 9, // 14: xray.app.proxyman.command.HandlerService.AddOutbound:output_type -> xray.app.proxyman.command.AddOutboundResponse - 11, // 15: xray.app.proxyman.command.HandlerService.RemoveOutbound:output_type -> xray.app.proxyman.command.RemoveOutboundResponse - 13, // 16: xray.app.proxyman.command.HandlerService.AlterOutbound:output_type -> xray.app.proxyman.command.AlterOutboundResponse - 11, // [11:17] is the sub-list for method output_type - 5, // [5:11] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_app_proxyman_command_command_proto_init() } -func file_app_proxyman_command_command_proto_init() { - if File_app_proxyman_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_proxyman_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddUserOperation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveUserOperation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddInboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddInboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveInboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveInboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlterInboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlterInboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOutboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOutboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOutboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOutboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlterOutboundRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlterOutboundResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_proxyman_command_command_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_app_proxyman_command_command_proto_goTypes, - DependencyIndexes: file_app_proxyman_command_command_proto_depIdxs, - MessageInfos: file_app_proxyman_command_command_proto_msgTypes, - }.Build() - File_app_proxyman_command_command_proto = out.File - file_app_proxyman_command_command_proto_rawDesc = nil - file_app_proxyman_command_command_proto_goTypes = nil - file_app_proxyman_command_command_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/proxyman/command/command_grpc.pb.go b/xray_api/proto/app/proxyman/command/command_grpc.pb.go deleted file mode 100644 index 8478780..0000000 --- a/xray_api/proto/app/proxyman/command/command_grpc.pb.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: app/proxyman/command/command.proto - -package command - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - HandlerService_AddInbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AddInbound" - HandlerService_RemoveInbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/RemoveInbound" - HandlerService_AlterInbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AlterInbound" - HandlerService_AddOutbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AddOutbound" - HandlerService_RemoveOutbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/RemoveOutbound" - HandlerService_AlterOutbound_FullMethodName = "/xray.app.proxyman.command.HandlerService/AlterOutbound" -) - -// HandlerServiceClient is the client API for HandlerService service. -// -// 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 HandlerServiceClient interface { - AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error) - RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error) - AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error) - AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error) - RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error) - AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error) -} - -type handlerServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewHandlerServiceClient(cc grpc.ClientConnInterface) HandlerServiceClient { - return &handlerServiceClient{cc} -} - -func (c *handlerServiceClient) AddInbound(ctx context.Context, in *AddInboundRequest, opts ...grpc.CallOption) (*AddInboundResponse, error) { - out := new(AddInboundResponse) - err := c.cc.Invoke(ctx, HandlerService_AddInbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *handlerServiceClient) RemoveInbound(ctx context.Context, in *RemoveInboundRequest, opts ...grpc.CallOption) (*RemoveInboundResponse, error) { - out := new(RemoveInboundResponse) - err := c.cc.Invoke(ctx, HandlerService_RemoveInbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *handlerServiceClient) AlterInbound(ctx context.Context, in *AlterInboundRequest, opts ...grpc.CallOption) (*AlterInboundResponse, error) { - out := new(AlterInboundResponse) - err := c.cc.Invoke(ctx, HandlerService_AlterInbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *handlerServiceClient) AddOutbound(ctx context.Context, in *AddOutboundRequest, opts ...grpc.CallOption) (*AddOutboundResponse, error) { - out := new(AddOutboundResponse) - err := c.cc.Invoke(ctx, HandlerService_AddOutbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *handlerServiceClient) RemoveOutbound(ctx context.Context, in *RemoveOutboundRequest, opts ...grpc.CallOption) (*RemoveOutboundResponse, error) { - out := new(RemoveOutboundResponse) - err := c.cc.Invoke(ctx, HandlerService_RemoveOutbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *handlerServiceClient) AlterOutbound(ctx context.Context, in *AlterOutboundRequest, opts ...grpc.CallOption) (*AlterOutboundResponse, error) { - out := new(AlterOutboundResponse) - err := c.cc.Invoke(ctx, HandlerService_AlterOutbound_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HandlerServiceServer is the server API for HandlerService service. -// All implementations must embed UnimplementedHandlerServiceServer -// for forward compatibility -type HandlerServiceServer interface { - AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error) - RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error) - AlterInbound(context.Context, *AlterInboundRequest) (*AlterInboundResponse, error) - AddOutbound(context.Context, *AddOutboundRequest) (*AddOutboundResponse, error) - RemoveOutbound(context.Context, *RemoveOutboundRequest) (*RemoveOutboundResponse, error) - AlterOutbound(context.Context, *AlterOutboundRequest) (*AlterOutboundResponse, error) - mustEmbedUnimplementedHandlerServiceServer() -} - -// UnimplementedHandlerServiceServer must be embedded to have forward compatible implementations. -type UnimplementedHandlerServiceServer struct { -} - -func (UnimplementedHandlerServiceServer) AddInbound(context.Context, *AddInboundRequest) (*AddInboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddInbound not implemented") -} -func (UnimplementedHandlerServiceServer) RemoveInbound(context.Context, *RemoveInboundRequest) (*RemoveInboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveInbound not implemented") -} -func (UnimplementedHandlerServiceServer) AlterInbound(context.Context, *AlterInboundRequest) (*AlterInboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AlterInbound not implemented") -} -func (UnimplementedHandlerServiceServer) AddOutbound(context.Context, *AddOutboundRequest) (*AddOutboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddOutbound not implemented") -} -func (UnimplementedHandlerServiceServer) RemoveOutbound(context.Context, *RemoveOutboundRequest) (*RemoveOutboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveOutbound not implemented") -} -func (UnimplementedHandlerServiceServer) AlterOutbound(context.Context, *AlterOutboundRequest) (*AlterOutboundResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AlterOutbound not implemented") -} -func (UnimplementedHandlerServiceServer) mustEmbedUnimplementedHandlerServiceServer() {} - -// 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 -// result in compilation errors. -type UnsafeHandlerServiceServer interface { - mustEmbedUnimplementedHandlerServiceServer() -} - -func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) { - s.RegisterService(&HandlerService_ServiceDesc, srv) -} - -func _HandlerService_AddInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddInboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).AddInbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_AddInbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).AddInbound(ctx, req.(*AddInboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _HandlerService_RemoveInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveInboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).RemoveInbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_RemoveInbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).RemoveInbound(ctx, req.(*RemoveInboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _HandlerService_AlterInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AlterInboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).AlterInbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_AlterInbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).AlterInbound(ctx, req.(*AlterInboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _HandlerService_AddOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddOutboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).AddOutbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_AddOutbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).AddOutbound(ctx, req.(*AddOutboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _HandlerService_RemoveOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveOutboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).RemoveOutbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_RemoveOutbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).RemoveOutbound(ctx, req.(*RemoveOutboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _HandlerService_AlterOutbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AlterOutboundRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(HandlerServiceServer).AlterOutbound(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: HandlerService_AlterOutbound_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).AlterOutbound(ctx, req.(*AlterOutboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// HandlerService_ServiceDesc is the grpc.ServiceDesc for HandlerService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var HandlerService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.app.proxyman.command.HandlerService", - HandlerType: (*HandlerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "AddInbound", - Handler: _HandlerService_AddInbound_Handler, - }, - { - MethodName: "RemoveInbound", - Handler: _HandlerService_RemoveInbound_Handler, - }, - { - MethodName: "AlterInbound", - Handler: _HandlerService_AlterInbound_Handler, - }, - { - MethodName: "AddOutbound", - Handler: _HandlerService_AddOutbound_Handler, - }, - { - MethodName: "RemoveOutbound", - Handler: _HandlerService_RemoveOutbound_Handler, - }, - { - MethodName: "AlterOutbound", - Handler: _HandlerService_AlterOutbound_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "app/proxyman/command/command.proto", -} diff --git a/xray_api/proto/app/proxyman/config.pb.go b/xray_api/proto/app/proxyman/config.pb.go deleted file mode 100644 index 2046e57..0000000 --- a/xray_api/proto/app/proxyman/config.pb.go +++ /dev/null @@ -1,1111 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/proxyman/config.proto - -package proxyman - -import ( - net "marzban-node/xray_api/proto/common/net" - serial "marzban-node/xray_api/proto/common/serial" - internet "marzban-node/xray_api/proto/transport/internet" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = 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 - -const ( - // Always allocate all connection handlers. - AllocationStrategy_Always AllocationStrategy_Type = 0 - // Randomly allocate specific range of handlers. - AllocationStrategy_Random AllocationStrategy_Type = 1 - // External. Not supported yet. - AllocationStrategy_External AllocationStrategy_Type = 2 -) - -// Enum value maps for AllocationStrategy_Type. -var ( - AllocationStrategy_Type_name = map[int32]string{ - 0: "Always", - 1: "Random", - 2: "External", - } - AllocationStrategy_Type_value = map[string]int32{ - "Always": 0, - "Random": 1, - "External": 2, - } -) - -func (x AllocationStrategy_Type) Enum() *AllocationStrategy_Type { - p := new(AllocationStrategy_Type) - *p = x - return p -} - -func (x AllocationStrategy_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AllocationStrategy_Type) Descriptor() protoreflect.EnumDescriptor { - return file_app_proxyman_config_proto_enumTypes[1].Descriptor() -} - -func (AllocationStrategy_Type) Type() protoreflect.EnumType { - return &file_app_proxyman_config_proto_enumTypes[1] -} - -func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AllocationStrategy_Type.Descriptor instead. -func (AllocationStrategy_Type) EnumDescriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} -} - -type InboundConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *InboundConfig) Reset() { - *x = InboundConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InboundConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InboundConfig) ProtoMessage() {} - -func (x *InboundConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InboundConfig.ProtoReflect.Descriptor instead. -func (*InboundConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{0} -} - -type AllocationStrategy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type AllocationStrategy_Type `protobuf:"varint,1,opt,name=type,proto3,enum=xray.app.proxyman.AllocationStrategy_Type" json:"type,omitempty"` - // Number of handlers (ports) running in parallel. - // Default value is 3 if unset. - Concurrency *AllocationStrategy_AllocationStrategyConcurrency `protobuf:"bytes,2,opt,name=concurrency,proto3" json:"concurrency,omitempty"` - // Number of minutes before a handler is regenerated. - // Default value is 5 if unset. - Refresh *AllocationStrategy_AllocationStrategyRefresh `protobuf:"bytes,3,opt,name=refresh,proto3" json:"refresh,omitempty"` -} - -func (x *AllocationStrategy) Reset() { - *x = AllocationStrategy{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AllocationStrategy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AllocationStrategy) ProtoMessage() {} - -func (x *AllocationStrategy) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AllocationStrategy.ProtoReflect.Descriptor instead. -func (*AllocationStrategy) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{1} -} - -func (x *AllocationStrategy) GetType() AllocationStrategy_Type { - if x != nil { - return x.Type - } - return AllocationStrategy_Always -} - -func (x *AllocationStrategy) GetConcurrency() *AllocationStrategy_AllocationStrategyConcurrency { - if x != nil { - return x.Concurrency - } - return nil -} - -func (x *AllocationStrategy) GetRefresh() *AllocationStrategy_AllocationStrategyRefresh { - if x != nil { - return x.Refresh - } - return nil -} - -type SniffingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Whether or not to enable content sniffing on an inbound connection. - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - // Override target destination if sniff'ed protocol is in the given list. - // Supported values are "http", "tls", "fakedns". - DestinationOverride []string `protobuf:"bytes,2,rep,name=destination_override,json=destinationOverride,proto3" json:"destination_override,omitempty"` - DomainsExcluded []string `protobuf:"bytes,3,rep,name=domains_excluded,json=domainsExcluded,proto3" json:"domains_excluded,omitempty"` - // Whether should only try to sniff metadata without waiting for client input. - // Can be used to support SMTP like protocol where server send the first - // message. - MetadataOnly bool `protobuf:"varint,4,opt,name=metadata_only,json=metadataOnly,proto3" json:"metadata_only,omitempty"` - RouteOnly bool `protobuf:"varint,5,opt,name=route_only,json=routeOnly,proto3" json:"route_only,omitempty"` -} - -func (x *SniffingConfig) Reset() { - *x = SniffingConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SniffingConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SniffingConfig) ProtoMessage() {} - -func (x *SniffingConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SniffingConfig.ProtoReflect.Descriptor instead. -func (*SniffingConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{2} -} - -func (x *SniffingConfig) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *SniffingConfig) GetDestinationOverride() []string { - if x != nil { - return x.DestinationOverride - } - return nil -} - -func (x *SniffingConfig) GetDomainsExcluded() []string { - if x != nil { - return x.DomainsExcluded - } - return nil -} - -func (x *SniffingConfig) GetMetadataOnly() bool { - if x != nil { - return x.MetadataOnly - } - return false -} - -func (x *SniffingConfig) GetRouteOnly() bool { - if x != nil { - return x.RouteOnly - } - return false -} - -type ReceiverConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // PortList specifies the ports which the Receiver should listen on. - PortList *net.PortList `protobuf:"bytes,1,opt,name=port_list,json=portList,proto3" json:"port_list,omitempty"` - // Listen specifies the IP address that the Receiver should listen on. - Listen *net.IPOrDomain `protobuf:"bytes,2,opt,name=listen,proto3" json:"listen,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"` - ReceiveOriginalDestination bool `protobuf:"varint,5,opt,name=receive_original_destination,json=receiveOriginalDestination,proto3" json:"receive_original_destination,omitempty"` - // Override domains for the given protocol. - // 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() { - *x = ReceiverConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReceiverConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReceiverConfig) ProtoMessage() {} - -func (x *ReceiverConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReceiverConfig.ProtoReflect.Descriptor instead. -func (*ReceiverConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{3} -} - -func (x *ReceiverConfig) GetPortList() *net.PortList { - if x != nil { - return x.PortList - } - return nil -} - -func (x *ReceiverConfig) GetListen() *net.IPOrDomain { - if x != nil { - return x.Listen - } - return nil -} - -func (x *ReceiverConfig) GetAllocationStrategy() *AllocationStrategy { - if x != nil { - return x.AllocationStrategy - } - return nil -} - -func (x *ReceiverConfig) GetStreamSettings() *internet.StreamConfig { - if x != nil { - return x.StreamSettings - } - return nil -} - -func (x *ReceiverConfig) GetReceiveOriginalDestination() bool { - if x != nil { - return x.ReceiveOriginalDestination - } - 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 { - if x != nil { - return x.SniffingSettings - } - return nil -} - -type InboundHandlerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - ReceiverSettings *serial.TypedMessage `protobuf:"bytes,2,opt,name=receiver_settings,json=receiverSettings,proto3" json:"receiver_settings,omitempty"` - ProxySettings *serial.TypedMessage `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings,proto3" json:"proxy_settings,omitempty"` -} - -func (x *InboundHandlerConfig) Reset() { - *x = InboundHandlerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InboundHandlerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InboundHandlerConfig) ProtoMessage() {} - -func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InboundHandlerConfig.ProtoReflect.Descriptor instead. -func (*InboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{4} -} - -func (x *InboundHandlerConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *InboundHandlerConfig) GetReceiverSettings() *serial.TypedMessage { - if x != nil { - return x.ReceiverSettings - } - return nil -} - -func (x *InboundHandlerConfig) GetProxySettings() *serial.TypedMessage { - if x != nil { - return x.ProxySettings - } - return nil -} - -type OutboundConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *OutboundConfig) Reset() { - *x = OutboundConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OutboundConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OutboundConfig) ProtoMessage() {} - -func (x *OutboundConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OutboundConfig.ProtoReflect.Descriptor instead. -func (*OutboundConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{5} -} - -type SenderConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Send traffic through the given IP. Only IP is allowed. - Via *net.IPOrDomain `protobuf:"bytes,1,opt,name=via,proto3" json:"via,omitempty"` - StreamSettings *internet.StreamConfig `protobuf:"bytes,2,opt,name=stream_settings,json=streamSettings,proto3" json:"stream_settings,omitempty"` - ProxySettings *internet.ProxyConfig `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings,proto3" json:"proxy_settings,omitempty"` - MultiplexSettings *MultiplexingConfig `protobuf:"bytes,4,opt,name=multiplex_settings,json=multiplexSettings,proto3" json:"multiplex_settings,omitempty"` - ViaCidr string `protobuf:"bytes,5,opt,name=via_cidr,json=viaCidr,proto3" json:"via_cidr,omitempty"` -} - -func (x *SenderConfig) Reset() { - *x = SenderConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SenderConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SenderConfig) ProtoMessage() {} - -func (x *SenderConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SenderConfig.ProtoReflect.Descriptor instead. -func (*SenderConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{6} -} - -func (x *SenderConfig) GetVia() *net.IPOrDomain { - if x != nil { - return x.Via - } - return nil -} - -func (x *SenderConfig) GetStreamSettings() *internet.StreamConfig { - if x != nil { - return x.StreamSettings - } - return nil -} - -func (x *SenderConfig) GetProxySettings() *internet.ProxyConfig { - if x != nil { - return x.ProxySettings - } - return nil -} - -func (x *SenderConfig) GetMultiplexSettings() *MultiplexingConfig { - if x != nil { - return x.MultiplexSettings - } - return nil -} - -func (x *SenderConfig) GetViaCidr() string { - if x != nil { - return x.ViaCidr - } - return "" -} - -type MultiplexingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Whether or not Mux is enabled. - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - // Max number of concurrent connections that one Mux connection can handle. - Concurrency int32 `protobuf:"varint,2,opt,name=concurrency,proto3" json:"concurrency,omitempty"` - // Transport XUDP in another Mux. - XudpConcurrency int32 `protobuf:"varint,3,opt,name=xudpConcurrency,proto3" json:"xudpConcurrency,omitempty"` - // "reject" (default), "allow" or "skip". - XudpProxyUDP443 string `protobuf:"bytes,4,opt,name=xudpProxyUDP443,proto3" json:"xudpProxyUDP443,omitempty"` -} - -func (x *MultiplexingConfig) Reset() { - *x = MultiplexingConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MultiplexingConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiplexingConfig) ProtoMessage() {} - -func (x *MultiplexingConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MultiplexingConfig.ProtoReflect.Descriptor instead. -func (*MultiplexingConfig) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{7} -} - -func (x *MultiplexingConfig) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *MultiplexingConfig) GetConcurrency() int32 { - if x != nil { - return x.Concurrency - } - return 0 -} - -func (x *MultiplexingConfig) GetXudpConcurrency() int32 { - if x != nil { - return x.XudpConcurrency - } - return 0 -} - -func (x *MultiplexingConfig) GetXudpProxyUDP443() string { - if x != nil { - return x.XudpProxyUDP443 - } - return "" -} - -type AllocationStrategy_AllocationStrategyConcurrency struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *AllocationStrategy_AllocationStrategyConcurrency) Reset() { - *x = AllocationStrategy_AllocationStrategyConcurrency{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AllocationStrategy_AllocationStrategyConcurrency) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AllocationStrategy_AllocationStrategyConcurrency) ProtoMessage() {} - -func (x *AllocationStrategy_AllocationStrategyConcurrency) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AllocationStrategy_AllocationStrategyConcurrency.ProtoReflect.Descriptor instead. -func (*AllocationStrategy_AllocationStrategyConcurrency) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *AllocationStrategy_AllocationStrategyConcurrency) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -type AllocationStrategy_AllocationStrategyRefresh struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *AllocationStrategy_AllocationStrategyRefresh) Reset() { - *x = AllocationStrategy_AllocationStrategyRefresh{} - if protoimpl.UnsafeEnabled { - mi := &file_app_proxyman_config_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AllocationStrategy_AllocationStrategyRefresh) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AllocationStrategy_AllocationStrategyRefresh) ProtoMessage() {} - -func (x *AllocationStrategy_AllocationStrategyRefresh) ProtoReflect() protoreflect.Message { - mi := &file_app_proxyman_config_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AllocationStrategy_AllocationStrategyRefresh.ProtoReflect.Descriptor instead. -func (*AllocationStrategy_AllocationStrategyRefresh) Descriptor() ([]byte, []int) { - return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *AllocationStrategy_AllocationStrategyRefresh) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -var File_app_proxyman_config_proto protoreflect.FileDescriptor - -var file_app_proxyman_config_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x1a, 0x18, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x21, 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, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x22, 0xae, 0x03, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x3e, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x65, 0x0a, 0x0b, 0x63, - 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x43, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, - 0x72, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x63, 0x79, 0x12, 0x59, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x65, 0x66, - 0x72, 0x65, 0x73, 0x68, 0x52, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x1a, 0x35, 0x0a, - 0x1d, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x31, 0x0a, 0x19, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, - 0x68, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0a, 0x0a, 0x06, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x52, - 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x78, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x10, 0x02, 0x22, 0xcc, 0x01, 0x0a, 0x0e, 0x53, 0x6e, 0x69, 0x66, 0x66, 0x69, - 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x12, 0x31, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, - 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, - 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6f, 0x6e, 0x6c, - 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, - 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, - 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, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x08, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x33, 0x0a, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, - 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x6c, 0x69, - 0x73, 0x74, 0x65, 0x6e, 0x12, 0x56, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x4e, 0x0a, 0x0f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x73, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x40, 0x0a, 0x1c, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, - 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, - 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, - 0x6e, 0x67, 0x73, 0x18, 0x08, 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, - 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, - 0x08, 0x06, 0x10, 0x07, 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, 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, 0x22, 0x10, 0x0a, 0x0e, 0x4f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xcb, 0x02, 0x0a, 0x0c, 0x53, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, 0x0a, 0x03, 0x76, 0x69, - 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x03, 0x76, 0x69, 0x61, 0x12, 0x4e, 0x0a, 0x0f, 0x73, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4b, 0x0a, 0x0e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x54, 0x0a, 0x12, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, - 0x6c, 0x65, 0x78, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x78, - 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x6d, 0x75, 0x6c, 0x74, 0x69, - 0x70, 0x6c, 0x65, 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x19, 0x0a, 0x08, - 0x76, 0x69, 0x61, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x69, 0x61, 0x43, 0x69, 0x64, 0x72, 0x22, 0xa4, 0x01, 0x0a, 0x12, 0x4d, 0x75, 0x6c, 0x74, - 0x69, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, - 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x78, 0x75, - 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, - 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, - 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, - 0x0a, 0x0e, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x73, - 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4c, - 0x53, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x26, - 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, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, - 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 ( - file_app_proxyman_config_proto_rawDescOnce sync.Once - file_app_proxyman_config_proto_rawDescData = file_app_proxyman_config_proto_rawDesc -) - -func file_app_proxyman_config_proto_rawDescGZIP() []byte { - file_app_proxyman_config_proto_rawDescOnce.Do(func() { - file_app_proxyman_config_proto_rawDescData = protoimpl.X.CompressGZIP(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_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_app_proxyman_config_proto_goTypes = []interface{}{ - (KnownProtocols)(0), // 0: xray.app.proxyman.KnownProtocols - (AllocationStrategy_Type)(0), // 1: xray.app.proxyman.AllocationStrategy.Type - (*InboundConfig)(nil), // 2: xray.app.proxyman.InboundConfig - (*AllocationStrategy)(nil), // 3: xray.app.proxyman.AllocationStrategy - (*SniffingConfig)(nil), // 4: xray.app.proxyman.SniffingConfig - (*ReceiverConfig)(nil), // 5: xray.app.proxyman.ReceiverConfig - (*InboundHandlerConfig)(nil), // 6: xray.app.proxyman.InboundHandlerConfig - (*OutboundConfig)(nil), // 7: xray.app.proxyman.OutboundConfig - (*SenderConfig)(nil), // 8: xray.app.proxyman.SenderConfig - (*MultiplexingConfig)(nil), // 9: xray.app.proxyman.MultiplexingConfig - (*AllocationStrategy_AllocationStrategyConcurrency)(nil), // 10: xray.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency - (*AllocationStrategy_AllocationStrategyRefresh)(nil), // 11: xray.app.proxyman.AllocationStrategy.AllocationStrategyRefresh - (*net.PortList)(nil), // 12: xray.common.net.PortList - (*net.IPOrDomain)(nil), // 13: xray.common.net.IPOrDomain - (*internet.StreamConfig)(nil), // 14: xray.transport.internet.StreamConfig - (*serial.TypedMessage)(nil), // 15: xray.common.serial.TypedMessage - (*internet.ProxyConfig)(nil), // 16: xray.transport.internet.ProxyConfig -} -var file_app_proxyman_config_proto_depIdxs = []int32{ - 1, // 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 - 11, // 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 - 13, // 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 - 14, // 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 - 4, // 8: xray.app.proxyman.ReceiverConfig.sniffing_settings:type_name -> xray.app.proxyman.SniffingConfig - 15, // 9: xray.app.proxyman.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage - 15, // 10: xray.app.proxyman.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage - 13, // 11: xray.app.proxyman.SenderConfig.via:type_name -> xray.common.net.IPOrDomain - 14, // 12: xray.app.proxyman.SenderConfig.stream_settings:type_name -> xray.transport.internet.StreamConfig - 16, // 13: xray.app.proxyman.SenderConfig.proxy_settings:type_name -> xray.transport.internet.ProxyConfig - 9, // 14: xray.app.proxyman.SenderConfig.multiplex_settings:type_name -> xray.app.proxyman.MultiplexingConfig - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name -} - -func init() { file_app_proxyman_config_proto_init() } -func file_app_proxyman_config_proto_init() { - if File_app_proxyman_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_proxyman_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InboundConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AllocationStrategy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SniffingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReceiverConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InboundHandlerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OutboundConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SenderConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MultiplexingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AllocationStrategy_AllocationStrategyConcurrency); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_proxyman_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AllocationStrategy_AllocationStrategyRefresh); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_proxyman_config_proto_rawDesc, - NumEnums: 2, - NumMessages: 10, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_proxyman_config_proto_goTypes, - DependencyIndexes: file_app_proxyman_config_proto_depIdxs, - EnumInfos: file_app_proxyman_config_proto_enumTypes, - MessageInfos: file_app_proxyman_config_proto_msgTypes, - }.Build() - File_app_proxyman_config_proto = out.File - file_app_proxyman_config_proto_rawDesc = nil - file_app_proxyman_config_proto_goTypes = nil - file_app_proxyman_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/reverse/config.pb.go b/xray_api/proto/app/reverse/config.pb.go deleted file mode 100644 index c7572e2..0000000 --- a/xray_api/proto/app/reverse/config.pb.go +++ /dev/null @@ -1,433 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/reverse/config.proto - -package reverse - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Control_State int32 - -const ( - Control_ACTIVE Control_State = 0 - Control_DRAIN Control_State = 1 -) - -// Enum value maps for Control_State. -var ( - Control_State_name = map[int32]string{ - 0: "ACTIVE", - 1: "DRAIN", - } - Control_State_value = map[string]int32{ - "ACTIVE": 0, - "DRAIN": 1, - } -) - -func (x Control_State) Enum() *Control_State { - p := new(Control_State) - *p = x - return p -} - -func (x Control_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Control_State) Descriptor() protoreflect.EnumDescriptor { - return file_app_reverse_config_proto_enumTypes[0].Descriptor() -} - -func (Control_State) Type() protoreflect.EnumType { - return &file_app_reverse_config_proto_enumTypes[0] -} - -func (x Control_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Control_State.Descriptor instead. -func (Control_State) EnumDescriptor() ([]byte, []int) { - return file_app_reverse_config_proto_rawDescGZIP(), []int{0, 0} -} - -type Control struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - State Control_State `protobuf:"varint,1,opt,name=state,proto3,enum=xray.app.reverse.Control_State" json:"state,omitempty"` - Random []byte `protobuf:"bytes,99,opt,name=random,proto3" json:"random,omitempty"` -} - -func (x *Control) Reset() { - *x = Control{} - if protoimpl.UnsafeEnabled { - mi := &file_app_reverse_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Control) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Control) ProtoMessage() {} - -func (x *Control) ProtoReflect() protoreflect.Message { - mi := &file_app_reverse_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Control.ProtoReflect.Descriptor instead. -func (*Control) Descriptor() ([]byte, []int) { - return file_app_reverse_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Control) GetState() Control_State { - if x != nil { - return x.State - } - return Control_ACTIVE -} - -func (x *Control) GetRandom() []byte { - if x != nil { - return x.Random - } - return nil -} - -type BridgeConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` -} - -func (x *BridgeConfig) Reset() { - *x = BridgeConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_reverse_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BridgeConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BridgeConfig) ProtoMessage() {} - -func (x *BridgeConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_reverse_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BridgeConfig.ProtoReflect.Descriptor instead. -func (*BridgeConfig) Descriptor() ([]byte, []int) { - return file_app_reverse_config_proto_rawDescGZIP(), []int{1} -} - -func (x *BridgeConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *BridgeConfig) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -type PortalConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` -} - -func (x *PortalConfig) Reset() { - *x = PortalConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_reverse_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PortalConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PortalConfig) ProtoMessage() {} - -func (x *PortalConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_reverse_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PortalConfig.ProtoReflect.Descriptor instead. -func (*PortalConfig) Descriptor() ([]byte, []int) { - return file_app_reverse_config_proto_rawDescGZIP(), []int{2} -} - -func (x *PortalConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *PortalConfig) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BridgeConfig []*BridgeConfig `protobuf:"bytes,1,rep,name=bridge_config,json=bridgeConfig,proto3" json:"bridge_config,omitempty"` - PortalConfig []*PortalConfig `protobuf:"bytes,2,rep,name=portal_config,json=portalConfig,proto3" json:"portal_config,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_reverse_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_reverse_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_reverse_config_proto_rawDescGZIP(), []int{3} -} - -func (x *Config) GetBridgeConfig() []*BridgeConfig { - if x != nil { - return x.BridgeConfig - } - return nil -} - -func (x *Config) GetPortalConfig() []*PortalConfig { - if x != nil { - return x.PortalConfig - } - return nil -} - -var File_app_reverse_config_proto protoreflect.FileDescriptor - -var file_app_reverse_config_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x78, 0x0a, 0x07, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x35, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, - 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x22, 0x1e, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, - 0x52, 0x41, 0x49, 0x4e, 0x10, 0x01, 0x22, 0x38, 0x0a, 0x0c, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, - 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, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x22, 0x38, 0x0a, 0x0c, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 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, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x92, 0x01, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 0x0d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, - 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x62, 0x72, - 0x69, 0x64, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 0x0d, 0x70, 0x6f, - 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x0c, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x56, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x25, 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, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_reverse_config_proto_rawDescOnce sync.Once - file_app_reverse_config_proto_rawDescData = file_app_reverse_config_proto_rawDesc -) - -func file_app_reverse_config_proto_rawDescGZIP() []byte { - file_app_reverse_config_proto_rawDescOnce.Do(func() { - file_app_reverse_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_reverse_config_proto_rawDescData) - }) - return file_app_reverse_config_proto_rawDescData -} - -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_goTypes = []interface{}{ - (Control_State)(0), // 0: xray.app.reverse.Control.State - (*Control)(nil), // 1: xray.app.reverse.Control - (*BridgeConfig)(nil), // 2: xray.app.reverse.BridgeConfig - (*PortalConfig)(nil), // 3: xray.app.reverse.PortalConfig - (*Config)(nil), // 4: xray.app.reverse.Config -} -var file_app_reverse_config_proto_depIdxs = []int32{ - 0, // 0: xray.app.reverse.Control.state:type_name -> xray.app.reverse.Control.State - 2, // 1: xray.app.reverse.Config.bridge_config:type_name -> xray.app.reverse.BridgeConfig - 3, // 2: xray.app.reverse.Config.portal_config:type_name -> xray.app.reverse.PortalConfig - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_app_reverse_config_proto_init() } -func file_app_reverse_config_proto_init() { - if File_app_reverse_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_reverse_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Control); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_reverse_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BridgeConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_reverse_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PortalConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_reverse_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_reverse_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_reverse_config_proto_goTypes, - DependencyIndexes: file_app_reverse_config_proto_depIdxs, - EnumInfos: file_app_reverse_config_proto_enumTypes, - MessageInfos: file_app_reverse_config_proto_msgTypes, - }.Build() - File_app_reverse_config_proto = out.File - file_app_reverse_config_proto_rawDesc = nil - file_app_reverse_config_proto_goTypes = nil - file_app_reverse_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/router/command/command.pb.go b/xray_api/proto/app/router/command/command.pb.go deleted file mode 100644 index d8459a0..0000000 --- a/xray_api/proto/app/router/command/command.pb.go +++ /dev/null @@ -1,1274 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/router/command/command.proto - -package command - -import ( - net "marzban-node/xray_api/proto/common/net" - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// RoutingContext is the context with information relative to routing process. -// It conforms to the structure of xray.features.routing.Context and -// xray.features.routing.Route. -type RoutingContext struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InboundTag string `protobuf:"bytes,1,opt,name=InboundTag,proto3" json:"InboundTag,omitempty"` - Network net.Network `protobuf:"varint,2,opt,name=Network,proto3,enum=xray.common.net.Network" json:"Network,omitempty"` - SourceIPs [][]byte `protobuf:"bytes,3,rep,name=SourceIPs,proto3" json:"SourceIPs,omitempty"` - TargetIPs [][]byte `protobuf:"bytes,4,rep,name=TargetIPs,proto3" json:"TargetIPs,omitempty"` - SourcePort uint32 `protobuf:"varint,5,opt,name=SourcePort,proto3" json:"SourcePort,omitempty"` - TargetPort uint32 `protobuf:"varint,6,opt,name=TargetPort,proto3" json:"TargetPort,omitempty"` - TargetDomain string `protobuf:"bytes,7,opt,name=TargetDomain,proto3" json:"TargetDomain,omitempty"` - Protocol string `protobuf:"bytes,8,opt,name=Protocol,proto3" json:"Protocol,omitempty"` - User string `protobuf:"bytes,9,opt,name=User,proto3" json:"User,omitempty"` - Attributes map[string]string `protobuf:"bytes,10,rep,name=Attributes,proto3" json:"Attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - OutboundGroupTags []string `protobuf:"bytes,11,rep,name=OutboundGroupTags,proto3" json:"OutboundGroupTags,omitempty"` - OutboundTag string `protobuf:"bytes,12,opt,name=OutboundTag,proto3" json:"OutboundTag,omitempty"` -} - -func (x *RoutingContext) Reset() { - *x = RoutingContext{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoutingContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutingContext) ProtoMessage() {} - -func (x *RoutingContext) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutingContext.ProtoReflect.Descriptor instead. -func (*RoutingContext) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{0} -} - -func (x *RoutingContext) GetInboundTag() string { - if x != nil { - return x.InboundTag - } - return "" -} - -func (x *RoutingContext) GetNetwork() net.Network { - if x != nil { - return x.Network - } - return net.Network(0) -} - -func (x *RoutingContext) GetSourceIPs() [][]byte { - if x != nil { - return x.SourceIPs - } - return nil -} - -func (x *RoutingContext) GetTargetIPs() [][]byte { - if x != nil { - return x.TargetIPs - } - return nil -} - -func (x *RoutingContext) GetSourcePort() uint32 { - if x != nil { - return x.SourcePort - } - return 0 -} - -func (x *RoutingContext) GetTargetPort() uint32 { - if x != nil { - return x.TargetPort - } - return 0 -} - -func (x *RoutingContext) GetTargetDomain() string { - if x != nil { - return x.TargetDomain - } - return "" -} - -func (x *RoutingContext) GetProtocol() string { - if x != nil { - return x.Protocol - } - return "" -} - -func (x *RoutingContext) GetUser() string { - if x != nil { - return x.User - } - return "" -} - -func (x *RoutingContext) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *RoutingContext) GetOutboundGroupTags() []string { - if x != nil { - return x.OutboundGroupTags - } - return nil -} - -func (x *RoutingContext) GetOutboundTag() string { - if x != nil { - return x.OutboundTag - } - return "" -} - -// SubscribeRoutingStatsRequest subscribes to routing statistics channel if -// opened by xray-core. -// * FieldSelectors selects a subset of fields in routing statistics to return. -// Valid selectors: -// - inbound: Selects connection's inbound tag. -// - network: Selects connection's network. -// - ip: Equivalent as "ip_source" and "ip_target", selects both source and -// target IP. -// - port: Equivalent as "port_source" and "port_target", selects both source -// and target port. -// - domain: Selects target domain. -// - protocol: Select connection's protocol. -// - user: Select connection's inbound user email. -// - attributes: Select connection's additional attributes. -// - outbound: Equivalent as "outbound" and "outbound_group", select both -// outbound tag and outbound group tags. -// -// * If FieldSelectors is left empty, all fields will be returned. -type SubscribeRoutingStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FieldSelectors []string `protobuf:"bytes,1,rep,name=FieldSelectors,proto3" json:"FieldSelectors,omitempty"` -} - -func (x *SubscribeRoutingStatsRequest) Reset() { - *x = SubscribeRoutingStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubscribeRoutingStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubscribeRoutingStatsRequest) ProtoMessage() {} - -func (x *SubscribeRoutingStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubscribeRoutingStatsRequest.ProtoReflect.Descriptor instead. -func (*SubscribeRoutingStatsRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *SubscribeRoutingStatsRequest) GetFieldSelectors() []string { - if x != nil { - return x.FieldSelectors - } - return nil -} - -// TestRouteRequest manually tests a routing result according to the routing -// context message. -// * RoutingContext is the routing message without outbound information. -// * FieldSelectors selects the fields to return in the routing result. All -// fields are returned if left empty. -// * PublishResult broadcasts the routing result to routing statistics channel -// if set true. -type TestRouteRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RoutingContext *RoutingContext `protobuf:"bytes,1,opt,name=RoutingContext,proto3" json:"RoutingContext,omitempty"` - FieldSelectors []string `protobuf:"bytes,2,rep,name=FieldSelectors,proto3" json:"FieldSelectors,omitempty"` - PublishResult bool `protobuf:"varint,3,opt,name=PublishResult,proto3" json:"PublishResult,omitempty"` -} - -func (x *TestRouteRequest) Reset() { - *x = TestRouteRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TestRouteRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TestRouteRequest) ProtoMessage() {} - -func (x *TestRouteRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TestRouteRequest.ProtoReflect.Descriptor instead. -func (*TestRouteRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{2} -} - -func (x *TestRouteRequest) GetRoutingContext() *RoutingContext { - if x != nil { - return x.RoutingContext - } - return nil -} - -func (x *TestRouteRequest) GetFieldSelectors() []string { - if x != nil { - return x.FieldSelectors - } - return nil -} - -func (x *TestRouteRequest) GetPublishResult() bool { - if x != nil { - return x.PublishResult - } - return false -} - -type PrincipleTargetInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag []string `protobuf:"bytes,1,rep,name=tag,proto3" json:"tag,omitempty"` -} - -func (x *PrincipleTargetInfo) Reset() { - *x = PrincipleTargetInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PrincipleTargetInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PrincipleTargetInfo) ProtoMessage() {} - -func (x *PrincipleTargetInfo) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PrincipleTargetInfo.ProtoReflect.Descriptor instead. -func (*PrincipleTargetInfo) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{3} -} - -func (x *PrincipleTargetInfo) GetTag() []string { - if x != nil { - return x.Tag - } - return nil -} - -type OverrideInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` -} - -func (x *OverrideInfo) Reset() { - *x = OverrideInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OverrideInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OverrideInfo) ProtoMessage() {} - -func (x *OverrideInfo) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OverrideInfo.ProtoReflect.Descriptor instead. -func (*OverrideInfo) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{4} -} - -func (x *OverrideInfo) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -type BalancerMsg struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Override *OverrideInfo `protobuf:"bytes,5,opt,name=override,proto3" json:"override,omitempty"` - PrincipleTarget *PrincipleTargetInfo `protobuf:"bytes,6,opt,name=principle_target,json=principleTarget,proto3" json:"principle_target,omitempty"` -} - -func (x *BalancerMsg) Reset() { - *x = BalancerMsg{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalancerMsg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalancerMsg) ProtoMessage() {} - -func (x *BalancerMsg) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalancerMsg.ProtoReflect.Descriptor instead. -func (*BalancerMsg) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{5} -} - -func (x *BalancerMsg) GetOverride() *OverrideInfo { - if x != nil { - return x.Override - } - return nil -} - -func (x *BalancerMsg) GetPrincipleTarget() *PrincipleTargetInfo { - if x != nil { - return x.PrincipleTarget - } - return nil -} - -type GetBalancerInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` -} - -func (x *GetBalancerInfoRequest) Reset() { - *x = GetBalancerInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalancerInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalancerInfoRequest) ProtoMessage() {} - -func (x *GetBalancerInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBalancerInfoRequest.ProtoReflect.Descriptor instead. -func (*GetBalancerInfoRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{6} -} - -func (x *GetBalancerInfoRequest) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -type GetBalancerInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Balancer *BalancerMsg `protobuf:"bytes,1,opt,name=balancer,proto3" json:"balancer,omitempty"` -} - -func (x *GetBalancerInfoResponse) Reset() { - *x = GetBalancerInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBalancerInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalancerInfoResponse) ProtoMessage() {} - -func (x *GetBalancerInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBalancerInfoResponse.ProtoReflect.Descriptor instead. -func (*GetBalancerInfoResponse) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{7} -} - -func (x *GetBalancerInfoResponse) GetBalancer() *BalancerMsg { - if x != nil { - return x.Balancer - } - return nil -} - -type OverrideBalancerTargetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BalancerTag string `protobuf:"bytes,1,opt,name=balancerTag,proto3" json:"balancerTag,omitempty"` - Target string `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` -} - -func (x *OverrideBalancerTargetRequest) Reset() { - *x = OverrideBalancerTargetRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OverrideBalancerTargetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OverrideBalancerTargetRequest) ProtoMessage() {} - -func (x *OverrideBalancerTargetRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OverrideBalancerTargetRequest.ProtoReflect.Descriptor instead. -func (*OverrideBalancerTargetRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{8} -} - -func (x *OverrideBalancerTargetRequest) GetBalancerTag() string { - if x != nil { - return x.BalancerTag - } - return "" -} - -func (x *OverrideBalancerTargetRequest) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -type OverrideBalancerTargetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *OverrideBalancerTargetResponse) Reset() { - *x = OverrideBalancerTargetResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OverrideBalancerTargetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OverrideBalancerTargetResponse) ProtoMessage() {} - -func (x *OverrideBalancerTargetResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OverrideBalancerTargetResponse.ProtoReflect.Descriptor instead. -func (*OverrideBalancerTargetResponse) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{9} -} - -type AddRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Config *serial.TypedMessage `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` - ShouldAppend bool `protobuf:"varint,2,opt,name=shouldAppend,proto3" json:"shouldAppend,omitempty"` -} - -func (x *AddRuleRequest) Reset() { - *x = AddRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRuleRequest) ProtoMessage() {} - -func (x *AddRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddRuleRequest.ProtoReflect.Descriptor instead. -func (*AddRuleRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{10} -} - -func (x *AddRuleRequest) GetConfig() *serial.TypedMessage { - if x != nil { - return x.Config - } - return nil -} - -func (x *AddRuleRequest) GetShouldAppend() bool { - if x != nil { - return x.ShouldAppend - } - return false -} - -type AddRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AddRuleResponse) Reset() { - *x = AddRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddRuleResponse) ProtoMessage() {} - -func (x *AddRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddRuleResponse.ProtoReflect.Descriptor instead. -func (*AddRuleResponse) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{11} -} - -type RemoveRuleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RuleTag string `protobuf:"bytes,1,opt,name=ruleTag,proto3" json:"ruleTag,omitempty"` -} - -func (x *RemoveRuleRequest) Reset() { - *x = RemoveRuleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveRuleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveRuleRequest) ProtoMessage() {} - -func (x *RemoveRuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveRuleRequest.ProtoReflect.Descriptor instead. -func (*RemoveRuleRequest) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{12} -} - -func (x *RemoveRuleRequest) GetRuleTag() string { - if x != nil { - return x.RuleTag - } - return "" -} - -type RemoveRuleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveRuleResponse) Reset() { - *x = RemoveRuleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveRuleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveRuleResponse) ProtoMessage() {} - -func (x *RemoveRuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveRuleResponse.ProtoReflect.Descriptor instead. -func (*RemoveRuleResponse) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{13} -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_command_command_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_router_command_command_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_router_command_command_proto_rawDescGZIP(), []int{14} -} - -var File_app_router_command_command_proto protoreflect.FileDescriptor - -var file_app_router_command_command_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x17, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, - 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x18, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 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, 0x6f, 0x22, 0x9c, 0x04, 0x0a, 0x0e, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x49, - 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x12, 0x32, 0x0a, 0x07, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, - 0x1c, 0x0a, 0x09, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x50, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x09, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x50, 0x73, 0x12, 0x1c, 0x0a, - 0x09, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x50, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x09, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x50, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0a, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, - 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x55, - 0x73, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x57, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, - 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x11, 0x4f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x61, 0x67, 0x73, 0x18, 0x0b, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x11, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x54, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x54, 0x61, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x75, 0x74, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x1a, 0x3d, 0x0a, 0x0f, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x46, 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, - 0xb1, 0x01, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x0e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x24, 0x0a, - 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, - 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x26, 0x0a, 0x0c, - 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x22, 0xa9, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x4d, 0x73, 0x67, 0x12, 0x41, 0x0a, 0x08, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6f, - 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x57, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6e, 0x63, - 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, - 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x72, 0x69, 0x6e, - 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x0f, 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x22, 0x2a, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, - 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x5b, 0x0a, 0x17, - 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x4d, 0x73, 0x67, 0x52, - 0x08, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x1d, 0x4f, 0x76, 0x65, - 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x22, 0x20, 0x0a, 0x1e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6e, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x01, 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, 0x06, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x41, 0x70, 0x70, 0x65, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, - 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x52, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x08, - 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xbf, 0x05, 0x0a, 0x0e, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x15, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x12, 0x35, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, - 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x30, 0x01, 0x12, 0x61, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, - 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, - 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x12, 0x76, 0x0a, 0x0f, 0x47, - 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2f, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, 0x61, - 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x8b, 0x01, 0x0a, 0x16, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x36, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, - 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, - 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, - 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x5e, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x27, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, - 0x41, 0x64, 0x64, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x67, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x75, 0x6c, 0x65, 0x12, - 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x52, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x52, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f, - 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2c, 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, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_router_command_command_proto_rawDescOnce sync.Once - file_app_router_command_command_proto_rawDescData = file_app_router_command_command_proto_rawDesc -) - -func file_app_router_command_command_proto_rawDescGZIP() []byte { - file_app_router_command_command_proto_rawDescOnce.Do(func() { - file_app_router_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_router_command_command_proto_rawDescData) - }) - return file_app_router_command_command_proto_rawDescData -} - -var file_app_router_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_app_router_command_command_proto_goTypes = []interface{}{ - (*RoutingContext)(nil), // 0: xray.app.router.command.RoutingContext - (*SubscribeRoutingStatsRequest)(nil), // 1: xray.app.router.command.SubscribeRoutingStatsRequest - (*TestRouteRequest)(nil), // 2: xray.app.router.command.TestRouteRequest - (*PrincipleTargetInfo)(nil), // 3: xray.app.router.command.PrincipleTargetInfo - (*OverrideInfo)(nil), // 4: xray.app.router.command.OverrideInfo - (*BalancerMsg)(nil), // 5: xray.app.router.command.BalancerMsg - (*GetBalancerInfoRequest)(nil), // 6: xray.app.router.command.GetBalancerInfoRequest - (*GetBalancerInfoResponse)(nil), // 7: xray.app.router.command.GetBalancerInfoResponse - (*OverrideBalancerTargetRequest)(nil), // 8: xray.app.router.command.OverrideBalancerTargetRequest - (*OverrideBalancerTargetResponse)(nil), // 9: xray.app.router.command.OverrideBalancerTargetResponse - (*AddRuleRequest)(nil), // 10: xray.app.router.command.AddRuleRequest - (*AddRuleResponse)(nil), // 11: xray.app.router.command.AddRuleResponse - (*RemoveRuleRequest)(nil), // 12: xray.app.router.command.RemoveRuleRequest - (*RemoveRuleResponse)(nil), // 13: xray.app.router.command.RemoveRuleResponse - (*Config)(nil), // 14: xray.app.router.command.Config - nil, // 15: xray.app.router.command.RoutingContext.AttributesEntry - (net.Network)(0), // 16: xray.common.net.Network - (*serial.TypedMessage)(nil), // 17: xray.common.serial.TypedMessage -} -var file_app_router_command_command_proto_depIdxs = []int32{ - 16, // 0: xray.app.router.command.RoutingContext.Network:type_name -> xray.common.net.Network - 15, // 1: xray.app.router.command.RoutingContext.Attributes:type_name -> xray.app.router.command.RoutingContext.AttributesEntry - 0, // 2: xray.app.router.command.TestRouteRequest.RoutingContext:type_name -> xray.app.router.command.RoutingContext - 4, // 3: xray.app.router.command.BalancerMsg.override:type_name -> xray.app.router.command.OverrideInfo - 3, // 4: xray.app.router.command.BalancerMsg.principle_target:type_name -> xray.app.router.command.PrincipleTargetInfo - 5, // 5: xray.app.router.command.GetBalancerInfoResponse.balancer:type_name -> xray.app.router.command.BalancerMsg - 17, // 6: xray.app.router.command.AddRuleRequest.config:type_name -> xray.common.serial.TypedMessage - 1, // 7: xray.app.router.command.RoutingService.SubscribeRoutingStats:input_type -> xray.app.router.command.SubscribeRoutingStatsRequest - 2, // 8: xray.app.router.command.RoutingService.TestRoute:input_type -> xray.app.router.command.TestRouteRequest - 6, // 9: xray.app.router.command.RoutingService.GetBalancerInfo:input_type -> xray.app.router.command.GetBalancerInfoRequest - 8, // 10: xray.app.router.command.RoutingService.OverrideBalancerTarget:input_type -> xray.app.router.command.OverrideBalancerTargetRequest - 10, // 11: xray.app.router.command.RoutingService.AddRule:input_type -> xray.app.router.command.AddRuleRequest - 12, // 12: xray.app.router.command.RoutingService.RemoveRule:input_type -> xray.app.router.command.RemoveRuleRequest - 0, // 13: xray.app.router.command.RoutingService.SubscribeRoutingStats:output_type -> xray.app.router.command.RoutingContext - 0, // 14: xray.app.router.command.RoutingService.TestRoute:output_type -> xray.app.router.command.RoutingContext - 7, // 15: xray.app.router.command.RoutingService.GetBalancerInfo:output_type -> xray.app.router.command.GetBalancerInfoResponse - 9, // 16: xray.app.router.command.RoutingService.OverrideBalancerTarget:output_type -> xray.app.router.command.OverrideBalancerTargetResponse - 11, // 17: xray.app.router.command.RoutingService.AddRule:output_type -> xray.app.router.command.AddRuleResponse - 13, // 18: xray.app.router.command.RoutingService.RemoveRule:output_type -> xray.app.router.command.RemoveRuleResponse - 13, // [13:19] is the sub-list for method output_type - 7, // [7:13] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_app_router_command_command_proto_init() } -func file_app_router_command_command_proto_init() { - if File_app_router_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_router_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoutingContext); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscribeRoutingStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestRouteRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrincipleTargetInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OverrideInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalancerMsg); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalancerInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBalancerInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OverrideBalancerTargetRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OverrideBalancerTargetResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveRuleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveRuleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_router_command_command_proto_rawDesc, - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_app_router_command_command_proto_goTypes, - DependencyIndexes: file_app_router_command_command_proto_depIdxs, - MessageInfos: file_app_router_command_command_proto_msgTypes, - }.Build() - File_app_router_command_command_proto = out.File - file_app_router_command_command_proto_rawDesc = nil - file_app_router_command_command_proto_goTypes = nil - file_app_router_command_command_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/router/command/command_grpc.pb.go b/xray_api/proto/app/router/command/command_grpc.pb.go deleted file mode 100644 index 157fd57..0000000 --- a/xray_api/proto/app/router/command/command_grpc.pb.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: app/router/command/command.proto - -package command - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - RoutingService_SubscribeRoutingStats_FullMethodName = "/xray.app.router.command.RoutingService/SubscribeRoutingStats" - RoutingService_TestRoute_FullMethodName = "/xray.app.router.command.RoutingService/TestRoute" - RoutingService_GetBalancerInfo_FullMethodName = "/xray.app.router.command.RoutingService/GetBalancerInfo" - RoutingService_OverrideBalancerTarget_FullMethodName = "/xray.app.router.command.RoutingService/OverrideBalancerTarget" - RoutingService_AddRule_FullMethodName = "/xray.app.router.command.RoutingService/AddRule" - RoutingService_RemoveRule_FullMethodName = "/xray.app.router.command.RoutingService/RemoveRule" -) - -// RoutingServiceClient is the client API for RoutingService service. -// -// 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 { - SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) - TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) - GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) - OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) - AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) - RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) -} - -type routingServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient { - return &routingServiceClient{cc} -} - -func (c *routingServiceClient) SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) { - stream, err := c.cc.NewStream(ctx, &RoutingService_ServiceDesc.Streams[0], RoutingService_SubscribeRoutingStats_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &routingServiceSubscribeRoutingStatsClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type RoutingService_SubscribeRoutingStatsClient interface { - Recv() (*RoutingContext, error) - 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) { - out := new(RoutingContext) - err := c.cc.Invoke(ctx, RoutingService_TestRoute_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routingServiceClient) GetBalancerInfo(ctx context.Context, in *GetBalancerInfoRequest, opts ...grpc.CallOption) (*GetBalancerInfoResponse, error) { - out := new(GetBalancerInfoResponse) - err := c.cc.Invoke(ctx, RoutingService_GetBalancerInfo_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routingServiceClient) OverrideBalancerTarget(ctx context.Context, in *OverrideBalancerTargetRequest, opts ...grpc.CallOption) (*OverrideBalancerTargetResponse, error) { - out := new(OverrideBalancerTargetResponse) - err := c.cc.Invoke(ctx, RoutingService_OverrideBalancerTarget_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routingServiceClient) AddRule(ctx context.Context, in *AddRuleRequest, opts ...grpc.CallOption) (*AddRuleResponse, error) { - out := new(AddRuleResponse) - err := c.cc.Invoke(ctx, RoutingService_AddRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *routingServiceClient) RemoveRule(ctx context.Context, in *RemoveRuleRequest, opts ...grpc.CallOption) (*RemoveRuleResponse, error) { - out := new(RemoveRuleResponse) - err := c.cc.Invoke(ctx, RoutingService_RemoveRule_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RoutingServiceServer is the server API for RoutingService service. -// All implementations must embed UnimplementedRoutingServiceServer -// for forward compatibility -type RoutingServiceServer interface { - SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error - TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) - GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error) - OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error) - AddRule(context.Context, *AddRuleRequest) (*AddRuleResponse, error) - RemoveRule(context.Context, *RemoveRuleRequest) (*RemoveRuleResponse, error) - mustEmbedUnimplementedRoutingServiceServer() -} - -// UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations. -type UnimplementedRoutingServiceServer struct { -} - -func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeRoutingStats not implemented") -} -func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) { - return nil, status.Errorf(codes.Unimplemented, "method TestRoute not implemented") -} -func (UnimplementedRoutingServiceServer) GetBalancerInfo(context.Context, *GetBalancerInfoRequest) (*GetBalancerInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBalancerInfo not implemented") -} -func (UnimplementedRoutingServiceServer) OverrideBalancerTarget(context.Context, *OverrideBalancerTargetRequest) (*OverrideBalancerTargetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OverrideBalancerTarget not implemented") -} -func (UnimplementedRoutingServiceServer) AddRule(context.Context, *AddRuleRequest) (*AddRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddRule not implemented") -} -func (UnimplementedRoutingServiceServer) RemoveRule(context.Context, *RemoveRuleRequest) (*RemoveRuleResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RemoveRule not implemented") -} -func (UnimplementedRoutingServiceServer) mustEmbedUnimplementedRoutingServiceServer() {} - -// 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 -// result in compilation errors. -type UnsafeRoutingServiceServer interface { - mustEmbedUnimplementedRoutingServiceServer() -} - -func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) { - s.RegisterService(&RoutingService_ServiceDesc, srv) -} - -func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(SubscribeRoutingStatsRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RoutingServiceServer).SubscribeRoutingStats(m, &routingServiceSubscribeRoutingStatsServer{stream}) -} - -type RoutingService_SubscribeRoutingStatsServer interface { - Send(*RoutingContext) error - 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) { - in := new(TestRouteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoutingServiceServer).TestRoute(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RoutingService_TestRoute_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoutingServiceServer).TestRoute(ctx, req.(*TestRouteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoutingService_GetBalancerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBalancerInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoutingServiceServer).GetBalancerInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RoutingService_GetBalancerInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoutingServiceServer).GetBalancerInfo(ctx, req.(*GetBalancerInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoutingService_OverrideBalancerTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(OverrideBalancerTargetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoutingServiceServer).OverrideBalancerTarget(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RoutingService_OverrideBalancerTarget_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoutingServiceServer).OverrideBalancerTarget(ctx, req.(*OverrideBalancerTargetRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoutingService_AddRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoutingServiceServer).AddRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RoutingService_AddRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoutingServiceServer).AddRule(ctx, req.(*AddRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RoutingService_RemoveRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveRuleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RoutingServiceServer).RemoveRule(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RoutingService_RemoveRule_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RoutingServiceServer).RemoveRule(ctx, req.(*RemoveRuleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// RoutingService_ServiceDesc is the grpc.ServiceDesc for RoutingService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var RoutingService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.app.router.command.RoutingService", - HandlerType: (*RoutingServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "TestRoute", - Handler: _RoutingService_TestRoute_Handler, - }, - { - MethodName: "GetBalancerInfo", - Handler: _RoutingService_GetBalancerInfo_Handler, - }, - { - MethodName: "OverrideBalancerTarget", - Handler: _RoutingService_OverrideBalancerTarget_Handler, - }, - { - MethodName: "AddRule", - Handler: _RoutingService_AddRule_Handler, - }, - { - MethodName: "RemoveRule", - Handler: _RoutingService_RemoveRule_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeRoutingStats", - Handler: _RoutingService_SubscribeRoutingStats_Handler, - ServerStreams: true, - }, - }, - Metadata: "app/router/command/command.proto", -} diff --git a/xray_api/proto/app/router/config.pb.go b/xray_api/proto/app/router/config.pb.go deleted file mode 100644 index 4635545..0000000 --- a/xray_api/proto/app/router/config.pb.go +++ /dev/null @@ -1,1508 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/router/config.proto - -package router - -import ( - net "marzban-node/xray_api/proto/common/net" - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Type of domain value. -type Domain_Type int32 - -const ( - // The value is used as is. - Domain_Plain Domain_Type = 0 - // The value is used as a regular expression. - Domain_Regex Domain_Type = 1 - // The value is a root domain. - Domain_Domain Domain_Type = 2 - // The value is a domain. - Domain_Full Domain_Type = 3 -) - -// Enum value maps for Domain_Type. -var ( - Domain_Type_name = map[int32]string{ - 0: "Plain", - 1: "Regex", - 2: "Domain", - 3: "Full", - } - Domain_Type_value = map[string]int32{ - "Plain": 0, - "Regex": 1, - "Domain": 2, - "Full": 3, - } -) - -func (x Domain_Type) Enum() *Domain_Type { - p := new(Domain_Type) - *p = x - return p -} - -func (x Domain_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Domain_Type) Descriptor() protoreflect.EnumDescriptor { - return file_app_router_config_proto_enumTypes[0].Descriptor() -} - -func (Domain_Type) Type() protoreflect.EnumType { - return &file_app_router_config_proto_enumTypes[0] -} - -func (x Domain_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Domain_Type.Descriptor instead. -func (Domain_Type) EnumDescriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{0, 0} -} - -type Config_DomainStrategy int32 - -const ( - // Use domain as is. - Config_AsIs Config_DomainStrategy = 0 - // Always resolve IP for domains. - Config_UseIp Config_DomainStrategy = 1 - // Resolve to IP if the domain doesn't match any rules. - Config_IpIfNonMatch Config_DomainStrategy = 2 - // Resolve to IP if any rule requires IP matching. - Config_IpOnDemand Config_DomainStrategy = 3 -) - -// Enum value maps for Config_DomainStrategy. -var ( - Config_DomainStrategy_name = map[int32]string{ - 0: "AsIs", - 1: "UseIp", - 2: "IpIfNonMatch", - 3: "IpOnDemand", - } - Config_DomainStrategy_value = map[string]int32{ - "AsIs": 0, - "UseIp": 1, - "IpIfNonMatch": 2, - "IpOnDemand": 3, - } -) - -func (x Config_DomainStrategy) Enum() *Config_DomainStrategy { - p := new(Config_DomainStrategy) - *p = x - return p -} - -func (x Config_DomainStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Config_DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_app_router_config_proto_enumTypes[1].Descriptor() -} - -func (Config_DomainStrategy) Type() protoreflect.EnumType { - return &file_app_router_config_proto_enumTypes[1] -} - -func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Config_DomainStrategy.Descriptor instead. -func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{10, 0} -} - -// Domain for routing decision. -type Domain struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Domain matching type. - Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=xray.app.router.Domain_Type" json:"type,omitempty"` - // Domain value. - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - // Attributes of this domain. May be used for filtering. - Attribute []*Domain_Attribute `protobuf:"bytes,3,rep,name=attribute,proto3" json:"attribute,omitempty"` -} - -func (x *Domain) Reset() { - *x = Domain{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Domain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Domain) ProtoMessage() {} - -func (x *Domain) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Domain.ProtoReflect.Descriptor instead. -func (*Domain) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Domain) GetType() Domain_Type { - if x != nil { - return x.Type - } - return Domain_Plain -} - -func (x *Domain) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Domain) GetAttribute() []*Domain_Attribute { - if x != nil { - return x.Attribute - } - return nil -} - -// IP for routing decision, in CIDR form. -type CIDR struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // IP address, should be either 4 or 16 bytes. - Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` - // Number of leading ones in the network mask. - Prefix uint32 `protobuf:"varint,2,opt,name=prefix,proto3" json:"prefix,omitempty"` -} - -func (x *CIDR) Reset() { - *x = CIDR{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CIDR) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CIDR) ProtoMessage() {} - -func (x *CIDR) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CIDR.ProtoReflect.Descriptor instead. -func (*CIDR) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{1} -} - -func (x *CIDR) GetIp() []byte { - if x != nil { - return x.Ip - } - return nil -} - -func (x *CIDR) GetPrefix() uint32 { - if x != nil { - return x.Prefix - } - return 0 -} - -type GeoIP struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` - Cidr []*CIDR `protobuf:"bytes,2,rep,name=cidr,proto3" json:"cidr,omitempty"` - ReverseMatch bool `protobuf:"varint,3,opt,name=reverse_match,json=reverseMatch,proto3" json:"reverse_match,omitempty"` -} - -func (x *GeoIP) Reset() { - *x = GeoIP{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeoIP) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeoIP) ProtoMessage() {} - -func (x *GeoIP) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeoIP.ProtoReflect.Descriptor instead. -func (*GeoIP) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{2} -} - -func (x *GeoIP) GetCountryCode() string { - if x != nil { - return x.CountryCode - } - return "" -} - -func (x *GeoIP) GetCidr() []*CIDR { - if x != nil { - return x.Cidr - } - return nil -} - -func (x *GeoIP) GetReverseMatch() bool { - if x != nil { - return x.ReverseMatch - } - return false -} - -type GeoIPList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Entry []*GeoIP `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` -} - -func (x *GeoIPList) Reset() { - *x = GeoIPList{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeoIPList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeoIPList) ProtoMessage() {} - -func (x *GeoIPList) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeoIPList.ProtoReflect.Descriptor instead. -func (*GeoIPList) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{3} -} - -func (x *GeoIPList) GetEntry() []*GeoIP { - if x != nil { - return x.Entry - } - return nil -} - -type GeoSite struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CountryCode string `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"` - Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"` -} - -func (x *GeoSite) Reset() { - *x = GeoSite{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeoSite) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeoSite) ProtoMessage() {} - -func (x *GeoSite) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeoSite.ProtoReflect.Descriptor instead. -func (*GeoSite) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{4} -} - -func (x *GeoSite) GetCountryCode() string { - if x != nil { - return x.CountryCode - } - return "" -} - -func (x *GeoSite) GetDomain() []*Domain { - if x != nil { - return x.Domain - } - return nil -} - -type GeoSiteList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Entry []*GeoSite `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` -} - -func (x *GeoSiteList) Reset() { - *x = GeoSiteList{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeoSiteList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeoSiteList) ProtoMessage() {} - -func (x *GeoSiteList) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeoSiteList.ProtoReflect.Descriptor instead. -func (*GeoSiteList) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{5} -} - -func (x *GeoSiteList) GetEntry() []*GeoSite { - if x != nil { - return x.Entry - } - return nil -} - -type RoutingRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to TargetTag: - // - // *RoutingRule_Tag - // *RoutingRule_BalancingTag - TargetTag isRoutingRule_TargetTag `protobuf_oneof:"target_tag"` - RuleTag string `protobuf:"bytes,18,opt,name=rule_tag,json=ruleTag,proto3" json:"rule_tag,omitempty"` - // List of domains for target domain matching. - Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"` - // List of CIDRs for target IP address matching. - // Deprecated. Use geoip below. - // - // Deprecated: Marked as deprecated in app/router/config.proto. - Cidr []*CIDR `protobuf:"bytes,3,rep,name=cidr,proto3" json:"cidr,omitempty"` - // List of GeoIPs for target IP address matching. If this entry exists, the - // cidr above will have no effect. GeoIP fields with the same country code are - // supposed to contain exactly same content. They will be merged during - // runtime. For customized GeoIPs, please leave country code empty. - Geoip []*GeoIP `protobuf:"bytes,10,rep,name=geoip,proto3" json:"geoip,omitempty"` - // A range of port [from, to]. If the destination port is in this range, this - // rule takes effect. Deprecated. Use port_list. - // - // Deprecated: Marked as deprecated in app/router/config.proto. - PortRange *net.PortRange `protobuf:"bytes,4,opt,name=port_range,json=portRange,proto3" json:"port_range,omitempty"` - // List of ports. - PortList *net.PortList `protobuf:"bytes,14,opt,name=port_list,json=portList,proto3" json:"port_list,omitempty"` - // List of networks. Deprecated. Use networks. - // - // Deprecated: Marked as deprecated in app/router/config.proto. - NetworkList *net.NetworkList `protobuf:"bytes,5,opt,name=network_list,json=networkList,proto3" json:"network_list,omitempty"` - // List of networks for matching. - Networks []net.Network `protobuf:"varint,13,rep,packed,name=networks,proto3,enum=xray.common.net.Network" json:"networks,omitempty"` - // List of CIDRs for source IP address matching. - // - // Deprecated: Marked as deprecated in app/router/config.proto. - SourceCidr []*CIDR `protobuf:"bytes,6,rep,name=source_cidr,json=sourceCidr,proto3" json:"source_cidr,omitempty"` - // List of GeoIPs for source IP address matching. If this entry exists, the - // source_cidr above will have no effect. - SourceGeoip []*GeoIP `protobuf:"bytes,11,rep,name=source_geoip,json=sourceGeoip,proto3" json:"source_geoip,omitempty"` - // List of ports for source port matching. - SourcePortList *net.PortList `protobuf:"bytes,16,opt,name=source_port_list,json=sourcePortList,proto3" json:"source_port_list,omitempty"` - UserEmail []string `protobuf:"bytes,7,rep,name=user_email,json=userEmail,proto3" json:"user_email,omitempty"` - InboundTag []string `protobuf:"bytes,8,rep,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"` - Protocol []string `protobuf:"bytes,9,rep,name=protocol,proto3" json:"protocol,omitempty"` - Attributes map[string]string `protobuf:"bytes,15,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - DomainMatcher string `protobuf:"bytes,17,opt,name=domain_matcher,json=domainMatcher,proto3" json:"domain_matcher,omitempty"` -} - -func (x *RoutingRule) Reset() { - *x = RoutingRule{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RoutingRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RoutingRule) ProtoMessage() {} - -func (x *RoutingRule) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. -func (*RoutingRule) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{6} -} - -func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag { - if m != nil { - return m.TargetTag - } - return nil -} - -func (x *RoutingRule) GetTag() string { - if x, ok := x.GetTargetTag().(*RoutingRule_Tag); ok { - return x.Tag - } - return "" -} - -func (x *RoutingRule) GetBalancingTag() string { - if x, ok := x.GetTargetTag().(*RoutingRule_BalancingTag); ok { - return x.BalancingTag - } - return "" -} - -func (x *RoutingRule) GetRuleTag() string { - if x != nil { - return x.RuleTag - } - return "" -} - -func (x *RoutingRule) GetDomain() []*Domain { - if x != nil { - return x.Domain - } - return nil -} - -// Deprecated: Marked as deprecated in app/router/config.proto. -func (x *RoutingRule) GetCidr() []*CIDR { - if x != nil { - return x.Cidr - } - return nil -} - -func (x *RoutingRule) GetGeoip() []*GeoIP { - if x != nil { - return x.Geoip - } - return nil -} - -// Deprecated: Marked as deprecated in app/router/config.proto. -func (x *RoutingRule) GetPortRange() *net.PortRange { - if x != nil { - return x.PortRange - } - return nil -} - -func (x *RoutingRule) GetPortList() *net.PortList { - if x != nil { - return x.PortList - } - return nil -} - -// Deprecated: Marked as deprecated in app/router/config.proto. -func (x *RoutingRule) GetNetworkList() *net.NetworkList { - if x != nil { - return x.NetworkList - } - return nil -} - -func (x *RoutingRule) GetNetworks() []net.Network { - if x != nil { - return x.Networks - } - return nil -} - -// Deprecated: Marked as deprecated in app/router/config.proto. -func (x *RoutingRule) GetSourceCidr() []*CIDR { - if x != nil { - return x.SourceCidr - } - return nil -} - -func (x *RoutingRule) GetSourceGeoip() []*GeoIP { - if x != nil { - return x.SourceGeoip - } - return nil -} - -func (x *RoutingRule) GetSourcePortList() *net.PortList { - if x != nil { - return x.SourcePortList - } - return nil -} - -func (x *RoutingRule) GetUserEmail() []string { - if x != nil { - return x.UserEmail - } - return nil -} - -func (x *RoutingRule) GetInboundTag() []string { - if x != nil { - return x.InboundTag - } - return nil -} - -func (x *RoutingRule) GetProtocol() []string { - if x != nil { - return x.Protocol - } - return nil -} - -func (x *RoutingRule) GetAttributes() map[string]string { - if x != nil { - return x.Attributes - } - return nil -} - -func (x *RoutingRule) GetDomainMatcher() string { - if x != nil { - return x.DomainMatcher - } - return "" -} - -type isRoutingRule_TargetTag interface { - isRoutingRule_TargetTag() -} - -type RoutingRule_Tag struct { - // Tag of outbound that this rule is pointing to. - Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"` -} - -type RoutingRule_BalancingTag struct { - // Tag of routing balancer. - BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"` -} - -func (*RoutingRule_Tag) isRoutingRule_TargetTag() {} - -func (*RoutingRule_BalancingTag) isRoutingRule_TargetTag() {} - -type BalancingRule struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - OutboundSelector []string `protobuf:"bytes,2,rep,name=outbound_selector,json=outboundSelector,proto3" json:"outbound_selector,omitempty"` - Strategy string `protobuf:"bytes,3,opt,name=strategy,proto3" json:"strategy,omitempty"` - StrategySettings *serial.TypedMessage `protobuf:"bytes,4,opt,name=strategy_settings,json=strategySettings,proto3" json:"strategy_settings,omitempty"` - FallbackTag string `protobuf:"bytes,5,opt,name=fallback_tag,json=fallbackTag,proto3" json:"fallback_tag,omitempty"` -} - -func (x *BalancingRule) Reset() { - *x = BalancingRule{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalancingRule) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalancingRule) ProtoMessage() {} - -func (x *BalancingRule) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BalancingRule.ProtoReflect.Descriptor instead. -func (*BalancingRule) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{7} -} - -func (x *BalancingRule) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *BalancingRule) GetOutboundSelector() []string { - if x != nil { - return x.OutboundSelector - } - return nil -} - -func (x *BalancingRule) GetStrategy() string { - if x != nil { - return x.Strategy - } - return "" -} - -func (x *BalancingRule) GetStrategySettings() *serial.TypedMessage { - if x != nil { - return x.StrategySettings - } - return nil -} - -func (x *BalancingRule) GetFallbackTag() string { - if x != nil { - return x.FallbackTag - } - return "" -} - -type StrategyWeight struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Regexp bool `protobuf:"varint,1,opt,name=regexp,proto3" json:"regexp,omitempty"` - Match string `protobuf:"bytes,2,opt,name=match,proto3" json:"match,omitempty"` - Value float32 `protobuf:"fixed32,3,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *StrategyWeight) Reset() { - *x = StrategyWeight{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StrategyWeight) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StrategyWeight) ProtoMessage() {} - -func (x *StrategyWeight) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StrategyWeight.ProtoReflect.Descriptor instead. -func (*StrategyWeight) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{8} -} - -func (x *StrategyWeight) GetRegexp() bool { - if x != nil { - return x.Regexp - } - return false -} - -func (x *StrategyWeight) GetMatch() string { - if x != nil { - return x.Match - } - return "" -} - -func (x *StrategyWeight) GetValue() float32 { - if x != nil { - return x.Value - } - return 0 -} - -type StrategyLeastLoadConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // weight settings - Costs []*StrategyWeight `protobuf:"bytes,2,rep,name=costs,proto3" json:"costs,omitempty"` - // RTT baselines for selecting, int64 values of time.Duration - Baselines []int64 `protobuf:"varint,3,rep,packed,name=baselines,proto3" json:"baselines,omitempty"` - // expected nodes count to select - Expected int32 `protobuf:"varint,4,opt,name=expected,proto3" json:"expected,omitempty"` - // max acceptable rtt, filter away high delay nodes. default 0 - MaxRTT int64 `protobuf:"varint,5,opt,name=maxRTT,proto3" json:"maxRTT,omitempty"` - // acceptable failure rate - Tolerance float32 `protobuf:"fixed32,6,opt,name=tolerance,proto3" json:"tolerance,omitempty"` -} - -func (x *StrategyLeastLoadConfig) Reset() { - *x = StrategyLeastLoadConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StrategyLeastLoadConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StrategyLeastLoadConfig) ProtoMessage() {} - -func (x *StrategyLeastLoadConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StrategyLeastLoadConfig.ProtoReflect.Descriptor instead. -func (*StrategyLeastLoadConfig) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{9} -} - -func (x *StrategyLeastLoadConfig) GetCosts() []*StrategyWeight { - if x != nil { - return x.Costs - } - return nil -} - -func (x *StrategyLeastLoadConfig) GetBaselines() []int64 { - if x != nil { - return x.Baselines - } - return nil -} - -func (x *StrategyLeastLoadConfig) GetExpected() int32 { - if x != nil { - return x.Expected - } - return 0 -} - -func (x *StrategyLeastLoadConfig) GetMaxRTT() int64 { - if x != nil { - return x.MaxRTT - } - return 0 -} - -func (x *StrategyLeastLoadConfig) GetTolerance() float32 { - if x != nil { - return x.Tolerance - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=xray.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"` - Rule []*RoutingRule `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"` - BalancingRule []*BalancingRule `protobuf:"bytes,3,rep,name=balancing_rule,json=balancingRule,proto3" json:"balancing_rule,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{10} -} - -func (x *Config) GetDomainStrategy() Config_DomainStrategy { - if x != nil { - return x.DomainStrategy - } - return Config_AsIs -} - -func (x *Config) GetRule() []*RoutingRule { - if x != nil { - return x.Rule - } - return nil -} - -func (x *Config) GetBalancingRule() []*BalancingRule { - if x != nil { - return x.BalancingRule - } - return nil -} - -type Domain_Attribute struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Types that are assignable to TypedValue: - // - // *Domain_Attribute_BoolValue - // *Domain_Attribute_IntValue - TypedValue isDomain_Attribute_TypedValue `protobuf_oneof:"typed_value"` -} - -func (x *Domain_Attribute) Reset() { - *x = Domain_Attribute{} - if protoimpl.UnsafeEnabled { - mi := &file_app_router_config_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Domain_Attribute) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Domain_Attribute) ProtoMessage() {} - -func (x *Domain_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_app_router_config_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Domain_Attribute.ProtoReflect.Descriptor instead. -func (*Domain_Attribute) Descriptor() ([]byte, []int) { - return file_app_router_config_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *Domain_Attribute) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue { - if m != nil { - return m.TypedValue - } - return nil -} - -func (x *Domain_Attribute) GetBoolValue() bool { - if x, ok := x.GetTypedValue().(*Domain_Attribute_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (x *Domain_Attribute) GetIntValue() int64 { - if x, ok := x.GetTypedValue().(*Domain_Attribute_IntValue); ok { - return x.IntValue - } - return 0 -} - -type isDomain_Attribute_TypedValue interface { - isDomain_Attribute_TypedValue() -} - -type Domain_Attribute_BoolValue struct { - BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"` -} - -type Domain_Attribute_IntValue struct { - IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` -} - -func (*Domain_Attribute_BoolValue) isDomain_Attribute_TypedValue() {} - -func (*Domain_Attribute_IntValue) isDomain_Attribute_TypedValue() {} - -var File_app_router_config_proto protoreflect.FileDescriptor - -var file_app_router_config_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x1a, 0x21, 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, 0x6f, 0x1a, 0x15, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, - 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb3, - 0x02, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, - 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x3f, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x41, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, - 0x74, 0x65, 0x1a, 0x6c, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x6c, 0x61, 0x69, - 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, - 0x6c, 0x6c, 0x10, 0x03, 0x22, 0x2e, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x22, 0x7a, 0x0a, 0x05, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x12, 0x21, 0x0a, - 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x29, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x22, 0x39, 0x0a, 0x09, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, - 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, - 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x5d, 0x0a, 0x07, 0x47, - 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, - 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x3d, 0x0a, 0x0b, 0x47, 0x65, - 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x65, 0x6e, 0x74, - 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x53, 0x69, - 0x74, 0x65, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0xbd, 0x07, 0x0a, 0x0b, 0x52, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x03, 0x74, 0x61, 0x67, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x25, 0x0a, - 0x0d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, - 0x67, 0x54, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x61, 0x67, - 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x72, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x12, - 0x2f, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x12, 0x2d, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x2e, 0x43, 0x49, 0x44, 0x52, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, 0x12, - 0x2c, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x12, 0x3d, 0x0a, - 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x09, - 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0e, 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, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x08, 0x70, 0x6f, 0x72, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, - 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0b, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x12, - 0x3a, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x69, 0x64, 0x72, 0x12, 0x39, 0x0a, 0x0c, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x16, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, - 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x47, 0x65, 0x6f, 0x69, 0x70, 0x12, 0x43, 0x0a, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x10, 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, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x0e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x50, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x09, 0x75, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0a, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x4c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x1a, 0x3d, 0x0a, 0x0f, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x22, 0xdc, 0x01, 0x0a, 0x0d, 0x42, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, - 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x2b, 0x0a, - 0x11, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x74, - 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, - 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x4d, 0x0a, 0x11, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 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, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x54, 0x61, 0x67, 0x22, 0x54, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x67, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x67, 0x65, - 0x78, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc0, - 0x01, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x4c, 0x65, 0x61, 0x73, 0x74, - 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, 0x0a, 0x05, 0x63, 0x6f, - 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x05, 0x63, 0x6f, 0x73, 0x74, - 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x62, 0x61, 0x73, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x12, - 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x08, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, - 0x61, 0x78, 0x52, 0x54, 0x54, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6d, 0x61, 0x78, - 0x52, 0x54, 0x54, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x74, 0x6f, 0x6c, 0x65, 0x72, 0x61, 0x6e, 0x63, - 0x65, 0x22, 0x9b, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4f, 0x0a, 0x0f, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x30, 0x0a, - 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x12, - 0x45, 0x0a, 0x0e, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x5f, 0x72, 0x75, 0x6c, - 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, - 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0d, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, - 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x22, 0x47, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x73, 0x65, 0x49, 0x70, 0x10, 0x01, 0x12, 0x10, 0x0a, - 0x0c, 0x49, 0x70, 0x49, 0x66, 0x4e, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x49, 0x70, 0x4f, 0x6e, 0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x42, - 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x24, 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, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0xaa, 0x02, - 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_router_config_proto_rawDescOnce sync.Once - file_app_router_config_proto_rawDescData = file_app_router_config_proto_rawDesc -) - -func file_app_router_config_proto_rawDescGZIP() []byte { - file_app_router_config_proto_rawDescOnce.Do(func() { - file_app_router_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_router_config_proto_rawDescData) - }) - return file_app_router_config_proto_rawDescData -} - -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_goTypes = []interface{}{ - (Domain_Type)(0), // 0: xray.app.router.Domain.Type - (Config_DomainStrategy)(0), // 1: xray.app.router.Config.DomainStrategy - (*Domain)(nil), // 2: xray.app.router.Domain - (*CIDR)(nil), // 3: xray.app.router.CIDR - (*GeoIP)(nil), // 4: xray.app.router.GeoIP - (*GeoIPList)(nil), // 5: xray.app.router.GeoIPList - (*GeoSite)(nil), // 6: xray.app.router.GeoSite - (*GeoSiteList)(nil), // 7: xray.app.router.GeoSiteList - (*RoutingRule)(nil), // 8: xray.app.router.RoutingRule - (*BalancingRule)(nil), // 9: xray.app.router.BalancingRule - (*StrategyWeight)(nil), // 10: xray.app.router.StrategyWeight - (*StrategyLeastLoadConfig)(nil), // 11: xray.app.router.StrategyLeastLoadConfig - (*Config)(nil), // 12: xray.app.router.Config - (*Domain_Attribute)(nil), // 13: xray.app.router.Domain.Attribute - nil, // 14: xray.app.router.RoutingRule.AttributesEntry - (*net.PortRange)(nil), // 15: xray.common.net.PortRange - (*net.PortList)(nil), // 16: xray.common.net.PortList - (*net.NetworkList)(nil), // 17: xray.common.net.NetworkList - (net.Network)(0), // 18: xray.common.net.Network - (*serial.TypedMessage)(nil), // 19: xray.common.serial.TypedMessage -} -var file_app_router_config_proto_depIdxs = []int32{ - 0, // 0: xray.app.router.Domain.type:type_name -> xray.app.router.Domain.Type - 13, // 1: xray.app.router.Domain.attribute:type_name -> xray.app.router.Domain.Attribute - 3, // 2: xray.app.router.GeoIP.cidr:type_name -> xray.app.router.CIDR - 4, // 3: xray.app.router.GeoIPList.entry:type_name -> xray.app.router.GeoIP - 2, // 4: xray.app.router.GeoSite.domain:type_name -> xray.app.router.Domain - 6, // 5: xray.app.router.GeoSiteList.entry:type_name -> xray.app.router.GeoSite - 2, // 6: xray.app.router.RoutingRule.domain:type_name -> xray.app.router.Domain - 3, // 7: xray.app.router.RoutingRule.cidr:type_name -> xray.app.router.CIDR - 4, // 8: xray.app.router.RoutingRule.geoip:type_name -> xray.app.router.GeoIP - 15, // 9: xray.app.router.RoutingRule.port_range:type_name -> xray.common.net.PortRange - 16, // 10: xray.app.router.RoutingRule.port_list:type_name -> xray.common.net.PortList - 17, // 11: xray.app.router.RoutingRule.network_list:type_name -> xray.common.net.NetworkList - 18, // 12: xray.app.router.RoutingRule.networks:type_name -> xray.common.net.Network - 3, // 13: xray.app.router.RoutingRule.source_cidr:type_name -> xray.app.router.CIDR - 4, // 14: xray.app.router.RoutingRule.source_geoip:type_name -> xray.app.router.GeoIP - 16, // 15: xray.app.router.RoutingRule.source_port_list:type_name -> xray.common.net.PortList - 14, // 16: xray.app.router.RoutingRule.attributes:type_name -> xray.app.router.RoutingRule.AttributesEntry - 19, // 17: xray.app.router.BalancingRule.strategy_settings:type_name -> xray.common.serial.TypedMessage - 10, // 18: xray.app.router.StrategyLeastLoadConfig.costs:type_name -> xray.app.router.StrategyWeight - 1, // 19: xray.app.router.Config.domain_strategy:type_name -> xray.app.router.Config.DomainStrategy - 8, // 20: xray.app.router.Config.rule:type_name -> xray.app.router.RoutingRule - 9, // 21: xray.app.router.Config.balancing_rule:type_name -> xray.app.router.BalancingRule - 22, // [22:22] is the sub-list for method output_type - 22, // [22:22] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_app_router_config_proto_init() } -func file_app_router_config_proto_init() { - if File_app_router_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Domain); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CIDR); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeoIP); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeoIPList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeoSite); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeoSiteList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RoutingRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalancingRule); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StrategyWeight); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StrategyLeastLoadConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_router_config_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Domain_Attribute); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_app_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{ - (*RoutingRule_Tag)(nil), - (*RoutingRule_BalancingTag)(nil), - } - file_app_router_config_proto_msgTypes[11].OneofWrappers = []interface{}{ - (*Domain_Attribute_BoolValue)(nil), - (*Domain_Attribute_IntValue)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_router_config_proto_rawDesc, - NumEnums: 2, - NumMessages: 13, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_router_config_proto_goTypes, - DependencyIndexes: file_app_router_config_proto_depIdxs, - EnumInfos: file_app_router_config_proto_enumTypes, - MessageInfos: file_app_router_config_proto_msgTypes, - }.Build() - File_app_router_config_proto = out.File - file_app_router_config_proto_rawDesc = nil - file_app_router_config_proto_goTypes = nil - file_app_router_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/stats/command/command.pb.go b/xray_api/proto/app/stats/command/command.pb.go deleted file mode 100644 index 418e7fb..0000000 --- a/xray_api/proto/app/stats/command/command.pb.go +++ /dev/null @@ -1,715 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/stats/command/command.proto - -package command - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the stat counter. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Whether or not to reset the counter to fetching its value. - Reset_ bool `protobuf:"varint,2,opt,name=reset,proto3" json:"reset,omitempty"` -} - -func (x *GetStatsRequest) Reset() { - *x = GetStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStatsRequest) ProtoMessage() {} - -func (x *GetStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetStatsRequest.ProtoReflect.Descriptor instead. -func (*GetStatsRequest) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{0} -} - -func (x *GetStatsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetStatsRequest) GetReset_() bool { - if x != nil { - return x.Reset_ - } - return false -} - -type Stat struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Stat) Reset() { - *x = Stat{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Stat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Stat) ProtoMessage() {} - -func (x *Stat) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Stat.ProtoReflect.Descriptor instead. -func (*Stat) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{1} -} - -func (x *Stat) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Stat) GetValue() int64 { - if x != nil { - return x.Value - } - return 0 -} - -type GetStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stat *Stat `protobuf:"bytes,1,opt,name=stat,proto3" json:"stat,omitempty"` -} - -func (x *GetStatsResponse) Reset() { - *x = GetStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStatsResponse) ProtoMessage() {} - -func (x *GetStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetStatsResponse.ProtoReflect.Descriptor instead. -func (*GetStatsResponse) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{2} -} - -func (x *GetStatsResponse) GetStat() *Stat { - if x != nil { - return x.Stat - } - return nil -} - -type QueryStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Pattern string `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"` - Reset_ bool `protobuf:"varint,2,opt,name=reset,proto3" json:"reset,omitempty"` -} - -func (x *QueryStatsRequest) Reset() { - *x = QueryStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryStatsRequest) ProtoMessage() {} - -func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryStatsRequest.ProtoReflect.Descriptor instead. -func (*QueryStatsRequest) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{3} -} - -func (x *QueryStatsRequest) GetPattern() string { - if x != nil { - return x.Pattern - } - return "" -} - -func (x *QueryStatsRequest) GetReset_() bool { - if x != nil { - return x.Reset_ - } - return false -} - -type QueryStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Stat []*Stat `protobuf:"bytes,1,rep,name=stat,proto3" json:"stat,omitempty"` -} - -func (x *QueryStatsResponse) Reset() { - *x = QueryStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueryStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueryStatsResponse) ProtoMessage() {} - -func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueryStatsResponse.ProtoReflect.Descriptor instead. -func (*QueryStatsResponse) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{4} -} - -func (x *QueryStatsResponse) GetStat() []*Stat { - if x != nil { - return x.Stat - } - return nil -} - -type SysStatsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SysStatsRequest) Reset() { - *x = SysStatsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SysStatsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SysStatsRequest) ProtoMessage() {} - -func (x *SysStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SysStatsRequest.ProtoReflect.Descriptor instead. -func (*SysStatsRequest) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{5} -} - -type SysStatsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - NumGoroutine uint32 `protobuf:"varint,1,opt,name=NumGoroutine,proto3" json:"NumGoroutine,omitempty"` - NumGC uint32 `protobuf:"varint,2,opt,name=NumGC,proto3" json:"NumGC,omitempty"` - Alloc uint64 `protobuf:"varint,3,opt,name=Alloc,proto3" json:"Alloc,omitempty"` - TotalAlloc uint64 `protobuf:"varint,4,opt,name=TotalAlloc,proto3" json:"TotalAlloc,omitempty"` - Sys uint64 `protobuf:"varint,5,opt,name=Sys,proto3" json:"Sys,omitempty"` - Mallocs uint64 `protobuf:"varint,6,opt,name=Mallocs,proto3" json:"Mallocs,omitempty"` - Frees uint64 `protobuf:"varint,7,opt,name=Frees,proto3" json:"Frees,omitempty"` - LiveObjects uint64 `protobuf:"varint,8,opt,name=LiveObjects,proto3" json:"LiveObjects,omitempty"` - PauseTotalNs uint64 `protobuf:"varint,9,opt,name=PauseTotalNs,proto3" json:"PauseTotalNs,omitempty"` - Uptime uint32 `protobuf:"varint,10,opt,name=Uptime,proto3" json:"Uptime,omitempty"` -} - -func (x *SysStatsResponse) Reset() { - *x = SysStatsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SysStatsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SysStatsResponse) ProtoMessage() {} - -func (x *SysStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SysStatsResponse.ProtoReflect.Descriptor instead. -func (*SysStatsResponse) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{6} -} - -func (x *SysStatsResponse) GetNumGoroutine() uint32 { - if x != nil { - return x.NumGoroutine - } - return 0 -} - -func (x *SysStatsResponse) GetNumGC() uint32 { - if x != nil { - return x.NumGC - } - return 0 -} - -func (x *SysStatsResponse) GetAlloc() uint64 { - if x != nil { - return x.Alloc - } - return 0 -} - -func (x *SysStatsResponse) GetTotalAlloc() uint64 { - if x != nil { - return x.TotalAlloc - } - return 0 -} - -func (x *SysStatsResponse) GetSys() uint64 { - if x != nil { - return x.Sys - } - return 0 -} - -func (x *SysStatsResponse) GetMallocs() uint64 { - if x != nil { - return x.Mallocs - } - return 0 -} - -func (x *SysStatsResponse) GetFrees() uint64 { - if x != nil { - return x.Frees - } - return 0 -} - -func (x *SysStatsResponse) GetLiveObjects() uint64 { - if x != nil { - return x.LiveObjects - } - return 0 -} - -func (x *SysStatsResponse) GetPauseTotalNs() uint64 { - if x != nil { - return x.PauseTotalNs - } - return 0 -} - -func (x *SysStatsResponse) GetUptime() uint32 { - if x != nil { - return x.Uptime - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_command_command_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_command_command_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_stats_command_command_proto_rawDescGZIP(), []int{7} -} - -var File_app_stats_command_command_proto protoreflect.FileDescriptor - -var file_app_stats_command_command_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x16, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x3b, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x22, 0x30, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x44, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, - 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x43, - 0x0a, 0x11, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x14, 0x0a, - 0x05, 0x72, 0x65, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, - 0x73, 0x65, 0x74, 0x22, 0x46, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x73, 0x74, 0x61, - 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, - 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x52, 0x04, 0x73, 0x74, 0x61, 0x74, 0x22, 0x11, 0x0a, 0x0f, 0x53, - 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xa2, - 0x02, 0x0a, 0x10, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x4e, 0x75, 0x6d, 0x47, 0x6f, 0x72, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x4e, 0x75, 0x6d, 0x47, 0x6f, - 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4e, 0x75, 0x6d, 0x47, 0x43, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x4e, 0x75, 0x6d, 0x47, 0x43, 0x12, 0x14, 0x0a, - 0x05, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x6f, - 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x6c, - 0x6c, 0x6f, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x79, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x03, 0x53, 0x79, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x4d, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x73, 0x12, - 0x14, 0x0a, 0x05, 0x46, 0x72, 0x65, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, - 0x46, 0x72, 0x65, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x4c, 0x69, 0x76, 0x65, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x4c, 0x69, 0x76, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x61, 0x75, 0x73, 0x65, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x50, - 0x61, 0x75, 0x73, 0x65, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x4e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x55, - 0x70, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x55, 0x70, 0x74, - 0x69, 0x6d, 0x65, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0xba, 0x02, - 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, - 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x27, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, - 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x65, 0x0a, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x29, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, - 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, - 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2b, 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, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_stats_command_command_proto_rawDescOnce sync.Once - file_app_stats_command_command_proto_rawDescData = file_app_stats_command_command_proto_rawDesc -) - -func file_app_stats_command_command_proto_rawDescGZIP() []byte { - file_app_stats_command_command_proto_rawDescOnce.Do(func() { - file_app_stats_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_stats_command_command_proto_rawDescData) - }) - return file_app_stats_command_command_proto_rawDescData -} - -var file_app_stats_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_app_stats_command_command_proto_goTypes = []interface{}{ - (*GetStatsRequest)(nil), // 0: xray.app.stats.command.GetStatsRequest - (*Stat)(nil), // 1: xray.app.stats.command.Stat - (*GetStatsResponse)(nil), // 2: xray.app.stats.command.GetStatsResponse - (*QueryStatsRequest)(nil), // 3: xray.app.stats.command.QueryStatsRequest - (*QueryStatsResponse)(nil), // 4: xray.app.stats.command.QueryStatsResponse - (*SysStatsRequest)(nil), // 5: xray.app.stats.command.SysStatsRequest - (*SysStatsResponse)(nil), // 6: xray.app.stats.command.SysStatsResponse - (*Config)(nil), // 7: xray.app.stats.command.Config -} -var file_app_stats_command_command_proto_depIdxs = []int32{ - 1, // 0: xray.app.stats.command.GetStatsResponse.stat:type_name -> xray.app.stats.command.Stat - 1, // 1: xray.app.stats.command.QueryStatsResponse.stat:type_name -> xray.app.stats.command.Stat - 0, // 2: xray.app.stats.command.StatsService.GetStats:input_type -> xray.app.stats.command.GetStatsRequest - 3, // 3: xray.app.stats.command.StatsService.QueryStats:input_type -> xray.app.stats.command.QueryStatsRequest - 5, // 4: xray.app.stats.command.StatsService.GetSysStats:input_type -> xray.app.stats.command.SysStatsRequest - 2, // 5: xray.app.stats.command.StatsService.GetStats:output_type -> xray.app.stats.command.GetStatsResponse - 4, // 6: xray.app.stats.command.StatsService.QueryStats:output_type -> xray.app.stats.command.QueryStatsResponse - 6, // 7: xray.app.stats.command.StatsService.GetSysStats:output_type -> xray.app.stats.command.SysStatsResponse - 5, // [5:8] is the sub-list for method output_type - 2, // [2:5] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_app_stats_command_command_proto_init() } -func file_app_stats_command_command_proto_init() { - if File_app_stats_command_command_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_stats_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Stat); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SysStatsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SysStatsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_stats_command_command_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_app_stats_command_command_proto_goTypes, - DependencyIndexes: file_app_stats_command_command_proto_depIdxs, - MessageInfos: file_app_stats_command_command_proto_msgTypes, - }.Build() - File_app_stats_command_command_proto = out.File - file_app_stats_command_command_proto_rawDesc = nil - file_app_stats_command_command_proto_goTypes = nil - file_app_stats_command_command_proto_depIdxs = nil -} diff --git a/xray_api/proto/app/stats/command/command_grpc.pb.go b/xray_api/proto/app/stats/command/command_grpc.pb.go deleted file mode 100644 index e942029..0000000 --- a/xray_api/proto/app/stats/command/command_grpc.pb.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: app/stats/command/command.proto - -package command - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - StatsService_GetStats_FullMethodName = "/xray.app.stats.command.StatsService/GetStats" - StatsService_QueryStats_FullMethodName = "/xray.app.stats.command.StatsService/QueryStats" - StatsService_GetSysStats_FullMethodName = "/xray.app.stats.command.StatsService/GetSysStats" -) - -// StatsServiceClient is the client API for StatsService service. -// -// 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 StatsServiceClient interface { - GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) - QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) - GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) -} - -type statsServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewStatsServiceClient(cc grpc.ClientConnInterface) StatsServiceClient { - return &statsServiceClient{cc} -} - -func (c *statsServiceClient) GetStats(ctx context.Context, in *GetStatsRequest, opts ...grpc.CallOption) (*GetStatsResponse, error) { - out := new(GetStatsResponse) - err := c.cc.Invoke(ctx, StatsService_GetStats_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *statsServiceClient) QueryStats(ctx context.Context, in *QueryStatsRequest, opts ...grpc.CallOption) (*QueryStatsResponse, error) { - out := new(QueryStatsResponse) - err := c.cc.Invoke(ctx, StatsService_QueryStats_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *statsServiceClient) GetSysStats(ctx context.Context, in *SysStatsRequest, opts ...grpc.CallOption) (*SysStatsResponse, error) { - out := new(SysStatsResponse) - err := c.cc.Invoke(ctx, StatsService_GetSysStats_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StatsServiceServer is the server API for StatsService service. -// All implementations must embed UnimplementedStatsServiceServer -// for forward compatibility -type StatsServiceServer interface { - GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) - QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error) - GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error) - mustEmbedUnimplementedStatsServiceServer() -} - -// UnimplementedStatsServiceServer must be embedded to have forward compatible implementations. -type UnimplementedStatsServiceServer struct { -} - -func (UnimplementedStatsServiceServer) GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented") -} -func (UnimplementedStatsServiceServer) QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryStats not implemented") -} -func (UnimplementedStatsServiceServer) GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSysStats not implemented") -} -func (UnimplementedStatsServiceServer) mustEmbedUnimplementedStatsServiceServer() {} - -// 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 -// result in compilation errors. -type UnsafeStatsServiceServer interface { - mustEmbedUnimplementedStatsServiceServer() -} - -func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) { - s.RegisterService(&StatsService_ServiceDesc, srv) -} - -func _StatsService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StatsServiceServer).GetStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: StatsService_GetStats_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StatsServiceServer).GetStats(ctx, req.(*GetStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _StatsService_QueryStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StatsServiceServer).QueryStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: StatsService_QueryStats_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StatsServiceServer).QueryStats(ctx, req.(*QueryStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _StatsService_GetSysStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SysStatsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(StatsServiceServer).GetSysStats(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: StatsService_GetSysStats_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StatsServiceServer).GetSysStats(ctx, req.(*SysStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// StatsService_ServiceDesc is the grpc.ServiceDesc for StatsService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var StatsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.app.stats.command.StatsService", - HandlerType: (*StatsServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetStats", - Handler: _StatsService_GetStats_Handler, - }, - { - MethodName: "QueryStats", - Handler: _StatsService_QueryStats_Handler, - }, - { - MethodName: "GetSysStats", - Handler: _StatsService_GetSysStats_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "app/stats/command/command.proto", -} diff --git a/xray_api/proto/app/stats/config.pb.go b/xray_api/proto/app/stats/config.pb.go deleted file mode 100644 index 4f5e04d..0000000 --- a/xray_api/proto/app/stats/config.pb.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: app/stats/config.proto - -package stats - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_app_stats_config_proto_rawDescGZIP(), []int{0} -} - -type ChannelConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Blocking bool `protobuf:"varint,1,opt,name=Blocking,proto3" json:"Blocking,omitempty"` - SubscriberLimit int32 `protobuf:"varint,2,opt,name=SubscriberLimit,proto3" json:"SubscriberLimit,omitempty"` - BufferSize int32 `protobuf:"varint,3,opt,name=BufferSize,proto3" json:"BufferSize,omitempty"` -} - -func (x *ChannelConfig) Reset() { - *x = ChannelConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_app_stats_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChannelConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChannelConfig) ProtoMessage() {} - -func (x *ChannelConfig) ProtoReflect() protoreflect.Message { - mi := &file_app_stats_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChannelConfig.ProtoReflect.Descriptor instead. -func (*ChannelConfig) Descriptor() ([]byte, []int) { - return file_app_stats_config_proto_rawDescGZIP(), []int{1} -} - -func (x *ChannelConfig) GetBlocking() bool { - if x != nil { - return x.Blocking - } - return false -} - -func (x *ChannelConfig) GetSubscriberLimit() int32 { - if x != nil { - return x.SubscriberLimit - } - return 0 -} - -func (x *ChannelConfig) GetBufferSize() int32 { - if x != nil { - return x.BufferSize - } - return 0 -} - -var File_app_stats_config_proto protoreflect.FileDescriptor - -var file_app_stats_config_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, - 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x22, 0x75, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x12, - 0x28, 0x0a, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, - 0x69, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x75, 0x66, - 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x42, - 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x50, - 0x01, 0x5a, 0x23, 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, 0x61, 0x70, 0x70, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, - 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_app_stats_config_proto_rawDescOnce sync.Once - file_app_stats_config_proto_rawDescData = file_app_stats_config_proto_rawDesc -) - -func file_app_stats_config_proto_rawDescGZIP() []byte { - file_app_stats_config_proto_rawDescOnce.Do(func() { - file_app_stats_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_app_stats_config_proto_rawDescData) - }) - return file_app_stats_config_proto_rawDescData -} - -var file_app_stats_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_app_stats_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.app.stats.Config - (*ChannelConfig)(nil), // 1: xray.app.stats.ChannelConfig -} -var file_app_stats_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_app_stats_config_proto_init() } -func file_app_stats_config_proto_init() { - if File_app_stats_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_app_stats_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_app_stats_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChannelConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_app_stats_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_app_stats_config_proto_goTypes, - DependencyIndexes: file_app_stats_config_proto_depIdxs, - MessageInfos: file_app_stats_config_proto_msgTypes, - }.Build() - File_app_stats_config_proto = out.File - file_app_stats_config_proto_rawDesc = nil - file_app_stats_config_proto_goTypes = nil - file_app_stats_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/log/log.pb.go b/xray_api/proto/common/log/log.pb.go deleted file mode 100644 index 2a970b5..0000000 --- a/xray_api/proto/common/log/log.pb.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/log/log.proto - -package log - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Severity int32 - -const ( - Severity_Unknown Severity = 0 - Severity_Error Severity = 1 - Severity_Warning Severity = 2 - Severity_Info Severity = 3 - Severity_Debug Severity = 4 -) - -// Enum value maps for Severity. -var ( - Severity_name = map[int32]string{ - 0: "Unknown", - 1: "Error", - 2: "Warning", - 3: "Info", - 4: "Debug", - } - Severity_value = map[string]int32{ - "Unknown": 0, - "Error": 1, - "Warning": 2, - "Info": 3, - "Debug": 4, - } -) - -func (x Severity) Enum() *Severity { - p := new(Severity) - *p = x - return p -} - -func (x Severity) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Severity) Descriptor() protoreflect.EnumDescriptor { - return file_common_log_log_proto_enumTypes[0].Descriptor() -} - -func (Severity) Type() protoreflect.EnumType { - return &file_common_log_log_proto_enumTypes[0] -} - -func (x Severity) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Severity.Descriptor instead. -func (Severity) EnumDescriptor() ([]byte, []int) { - return file_common_log_log_proto_rawDescGZIP(), []int{0} -} - -var File_common_log_log_proto protoreflect.FileDescriptor - -var file_common_log_log_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x6f, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f, 0x67, 0x2a, 0x44, 0x0a, 0x08, 0x53, 0x65, 0x76, 0x65, 0x72, - 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, - 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, - 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, - 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, 0x04, 0x42, 0x4f, 0x0a, - 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0f, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_log_log_proto_rawDescOnce sync.Once - file_common_log_log_proto_rawDescData = file_common_log_log_proto_rawDesc -) - -func file_common_log_log_proto_rawDescGZIP() []byte { - file_common_log_log_proto_rawDescOnce.Do(func() { - file_common_log_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_log_log_proto_rawDescData) - }) - return file_common_log_log_proto_rawDescData -} - -var file_common_log_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_common_log_log_proto_goTypes = []interface{}{ - (Severity)(0), // 0: xray.common.log.Severity -} -var file_common_log_log_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_common_log_log_proto_init() } -func file_common_log_log_proto_init() { - if File_common_log_log_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_log_log_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_log_log_proto_goTypes, - DependencyIndexes: file_common_log_log_proto_depIdxs, - EnumInfos: file_common_log_log_proto_enumTypes, - }.Build() - File_common_log_log_proto = out.File - file_common_log_log_proto_rawDesc = nil - file_common_log_log_proto_goTypes = nil - file_common_log_log_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/net/address.pb.go b/xray_api/proto/common/net/address.pb.go deleted file mode 100644 index fd61b16..0000000 --- a/xray_api/proto/common/net/address.pb.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/net/address.proto - -package net - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Address of a network host. It may be either an IP address or a domain -// address. -type IPOrDomain struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Address: - // - // *IPOrDomain_Ip - // *IPOrDomain_Domain - Address isIPOrDomain_Address `protobuf_oneof:"address"` -} - -func (x *IPOrDomain) Reset() { - *x = IPOrDomain{} - if protoimpl.UnsafeEnabled { - mi := &file_common_net_address_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IPOrDomain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IPOrDomain) ProtoMessage() {} - -func (x *IPOrDomain) ProtoReflect() protoreflect.Message { - mi := &file_common_net_address_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IPOrDomain.ProtoReflect.Descriptor instead. -func (*IPOrDomain) Descriptor() ([]byte, []int) { - return file_common_net_address_proto_rawDescGZIP(), []int{0} -} - -func (m *IPOrDomain) GetAddress() isIPOrDomain_Address { - if m != nil { - return m.Address - } - return nil -} - -func (x *IPOrDomain) GetIp() []byte { - if x, ok := x.GetAddress().(*IPOrDomain_Ip); ok { - return x.Ip - } - return nil -} - -func (x *IPOrDomain) GetDomain() string { - if x, ok := x.GetAddress().(*IPOrDomain_Domain); ok { - return x.Domain - } - return "" -} - -type isIPOrDomain_Address interface { - isIPOrDomain_Address() -} - -type IPOrDomain_Ip struct { - // IP address. Must by either 4 or 16 bytes. - Ip []byte `protobuf:"bytes,1,opt,name=ip,proto3,oneof"` -} - -type IPOrDomain_Domain struct { - // Domain address. - Domain string `protobuf:"bytes,2,opt,name=domain,proto3,oneof"` -} - -func (*IPOrDomain_Ip) isIPOrDomain_Address() {} - -func (*IPOrDomain_Domain) isIPOrDomain_Address() {} - -var File_common_net_address_proto protoreflect.FileDescriptor - -var file_common_net_address_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x22, 0x43, 0x0a, 0x0a, 0x49, - 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x02, 0x69, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x06, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, - 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_net_address_proto_rawDescOnce sync.Once - file_common_net_address_proto_rawDescData = file_common_net_address_proto_rawDesc -) - -func file_common_net_address_proto_rawDescGZIP() []byte { - file_common_net_address_proto_rawDescOnce.Do(func() { - file_common_net_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_net_address_proto_rawDescData) - }) - return file_common_net_address_proto_rawDescData -} - -var file_common_net_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_net_address_proto_goTypes = []interface{}{ - (*IPOrDomain)(nil), // 0: xray.common.net.IPOrDomain -} -var file_common_net_address_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_common_net_address_proto_init() } -func file_common_net_address_proto_init() { - if File_common_net_address_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_net_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IPOrDomain); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_common_net_address_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*IPOrDomain_Ip)(nil), - (*IPOrDomain_Domain)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_net_address_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_net_address_proto_goTypes, - DependencyIndexes: file_common_net_address_proto_depIdxs, - MessageInfos: file_common_net_address_proto_msgTypes, - }.Build() - File_common_net_address_proto = out.File - file_common_net_address_proto_rawDesc = nil - file_common_net_address_proto_goTypes = nil - file_common_net_address_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/net/destination.pb.go b/xray_api/proto/common/net/destination.pb.go deleted file mode 100644 index 3e4de52..0000000 --- a/xray_api/proto/common/net/destination.pb.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/net/destination.proto - -package net - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Endpoint of a network connection. -type Endpoint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Network Network `protobuf:"varint,1,opt,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` - Address *IPOrDomain `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` -} - -func (x *Endpoint) Reset() { - *x = Endpoint{} - if protoimpl.UnsafeEnabled { - mi := &file_common_net_destination_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Endpoint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Endpoint) ProtoMessage() {} - -func (x *Endpoint) ProtoReflect() protoreflect.Message { - mi := &file_common_net_destination_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Endpoint.ProtoReflect.Descriptor instead. -func (*Endpoint) Descriptor() ([]byte, []int) { - return file_common_net_destination_proto_rawDescGZIP(), []int{0} -} - -func (x *Endpoint) GetNetwork() Network { - if x != nil { - return x.Network - } - return Network_Unknown -} - -func (x *Endpoint) GetAddress() *IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *Endpoint) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -var File_common_net_destination_proto protoreflect.FileDescriptor - -var file_common_net_destination_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x65, 0x73, - 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x1a, - 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x65, 0x74, 0x77, - 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, - 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, - 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_net_destination_proto_rawDescOnce sync.Once - file_common_net_destination_proto_rawDescData = file_common_net_destination_proto_rawDesc -) - -func file_common_net_destination_proto_rawDescGZIP() []byte { - file_common_net_destination_proto_rawDescOnce.Do(func() { - file_common_net_destination_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_net_destination_proto_rawDescData) - }) - return file_common_net_destination_proto_rawDescData -} - -var file_common_net_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_net_destination_proto_goTypes = []interface{}{ - (*Endpoint)(nil), // 0: xray.common.net.Endpoint - (Network)(0), // 1: xray.common.net.Network - (*IPOrDomain)(nil), // 2: xray.common.net.IPOrDomain -} -var file_common_net_destination_proto_depIdxs = []int32{ - 1, // 0: xray.common.net.Endpoint.network:type_name -> xray.common.net.Network - 2, // 1: xray.common.net.Endpoint.address:type_name -> xray.common.net.IPOrDomain - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_common_net_destination_proto_init() } -func file_common_net_destination_proto_init() { - if File_common_net_destination_proto != nil { - return - } - file_common_net_network_proto_init() - file_common_net_address_proto_init() - if !protoimpl.UnsafeEnabled { - file_common_net_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Endpoint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_net_destination_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_net_destination_proto_goTypes, - DependencyIndexes: file_common_net_destination_proto_depIdxs, - MessageInfos: file_common_net_destination_proto_msgTypes, - }.Build() - File_common_net_destination_proto = out.File - file_common_net_destination_proto_rawDesc = nil - file_common_net_destination_proto_goTypes = nil - file_common_net_destination_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/net/network.pb.go b/xray_api/proto/common/net/network.pb.go deleted file mode 100644 index f720ca5..0000000 --- a/xray_api/proto/common/net/network.pb.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/net/network.proto - -package net - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Network int32 - -const ( - Network_Unknown Network = 0 - // Deprecated: Marked as deprecated in common/net/network.proto. - Network_RawTCP Network = 1 - Network_TCP Network = 2 - Network_UDP Network = 3 - Network_UNIX Network = 4 -) - -// Enum value maps for Network. -var ( - Network_name = map[int32]string{ - 0: "Unknown", - 1: "RawTCP", - 2: "TCP", - 3: "UDP", - 4: "UNIX", - } - Network_value = map[string]int32{ - "Unknown": 0, - "RawTCP": 1, - "TCP": 2, - "UDP": 3, - "UNIX": 4, - } -) - -func (x Network) Enum() *Network { - p := new(Network) - *p = x - return p -} - -func (x Network) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Network) Descriptor() protoreflect.EnumDescriptor { - return file_common_net_network_proto_enumTypes[0].Descriptor() -} - -func (Network) Type() protoreflect.EnumType { - return &file_common_net_network_proto_enumTypes[0] -} - -func (x Network) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Network.Descriptor instead. -func (Network) EnumDescriptor() ([]byte, []int) { - return file_common_net_network_proto_rawDescGZIP(), []int{0} -} - -// NetworkList is a list of Networks. -type NetworkList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Network []Network `protobuf:"varint,1,rep,packed,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` -} - -func (x *NetworkList) Reset() { - *x = NetworkList{} - if protoimpl.UnsafeEnabled { - mi := &file_common_net_network_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NetworkList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NetworkList) ProtoMessage() {} - -func (x *NetworkList) ProtoReflect() protoreflect.Message { - mi := &file_common_net_network_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NetworkList.ProtoReflect.Descriptor instead. -func (*NetworkList) Descriptor() ([]byte, []int) { - return file_common_net_network_proto_rawDescGZIP(), []int{0} -} - -func (x *NetworkList) GetNetwork() []Network { - if x != nil { - return x.Network - } - return nil -} - -var File_common_net_network_proto protoreflect.FileDescriptor - -var file_common_net_network_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x22, 0x41, 0x0a, 0x0b, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x42, - 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, - 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x06, 0x52, 0x61, 0x77, 0x54, 0x43, 0x50, - 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, - 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58, - 0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, - 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_net_network_proto_rawDescOnce sync.Once - file_common_net_network_proto_rawDescData = file_common_net_network_proto_rawDesc -) - -func file_common_net_network_proto_rawDescGZIP() []byte { - file_common_net_network_proto_rawDescOnce.Do(func() { - file_common_net_network_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_net_network_proto_rawDescData) - }) - return file_common_net_network_proto_rawDescData -} - -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_goTypes = []interface{}{ - (Network)(0), // 0: xray.common.net.Network - (*NetworkList)(nil), // 1: xray.common.net.NetworkList -} -var file_common_net_network_proto_depIdxs = []int32{ - 0, // 0: xray.common.net.NetworkList.network:type_name -> xray.common.net.Network - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_common_net_network_proto_init() } -func file_common_net_network_proto_init() { - if File_common_net_network_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_net_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NetworkList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_net_network_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_net_network_proto_goTypes, - DependencyIndexes: file_common_net_network_proto_depIdxs, - EnumInfos: file_common_net_network_proto_enumTypes, - MessageInfos: file_common_net_network_proto_msgTypes, - }.Build() - File_common_net_network_proto = out.File - file_common_net_network_proto_rawDesc = nil - file_common_net_network_proto_goTypes = nil - file_common_net_network_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/net/port.pb.go b/xray_api/proto/common/net/port.pb.go deleted file mode 100644 index 36af494..0000000 --- a/xray_api/proto/common/net/port.pb.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/net/port.proto - -package net - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// PortRange represents a range of ports. -type PortRange struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The port that this range starts from. - From uint32 `protobuf:"varint,1,opt,name=From,proto3" json:"From,omitempty"` - // The port that this range ends with (inclusive). - To uint32 `protobuf:"varint,2,opt,name=To,proto3" json:"To,omitempty"` -} - -func (x *PortRange) Reset() { - *x = PortRange{} - if protoimpl.UnsafeEnabled { - mi := &file_common_net_port_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PortRange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PortRange) ProtoMessage() {} - -func (x *PortRange) ProtoReflect() protoreflect.Message { - mi := &file_common_net_port_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PortRange.ProtoReflect.Descriptor instead. -func (*PortRange) Descriptor() ([]byte, []int) { - return file_common_net_port_proto_rawDescGZIP(), []int{0} -} - -func (x *PortRange) GetFrom() uint32 { - if x != nil { - return x.From - } - return 0 -} - -func (x *PortRange) GetTo() uint32 { - if x != nil { - return x.To - } - return 0 -} - -// PortList is a list of ports. -type PortList struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Range []*PortRange `protobuf:"bytes,1,rep,name=range,proto3" json:"range,omitempty"` -} - -func (x *PortList) Reset() { - *x = PortList{} - if protoimpl.UnsafeEnabled { - mi := &file_common_net_port_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PortList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PortList) ProtoMessage() {} - -func (x *PortList) ProtoReflect() protoreflect.Message { - mi := &file_common_net_port_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PortList.ProtoReflect.Descriptor instead. -func (*PortList) Descriptor() ([]byte, []int) { - return file_common_net_port_proto_rawDescGZIP(), []int{1} -} - -func (x *PortList) GetRange() []*PortRange { - if x != nil { - return x.Range - } - return nil -} - -var File_common_net_port_proto protoreflect.FileDescriptor - -var file_common_net_port_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, - 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x22, 0x2f, 0x0a, 0x09, 0x50, 0x6f, 0x72, 0x74, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x6f, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x54, 0x6f, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x6f, 0x72, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, - 0x5a, 0x24, 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, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_net_port_proto_rawDescOnce sync.Once - file_common_net_port_proto_rawDescData = file_common_net_port_proto_rawDesc -) - -func file_common_net_port_proto_rawDescGZIP() []byte { - file_common_net_port_proto_rawDescOnce.Do(func() { - file_common_net_port_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_net_port_proto_rawDescData) - }) - return file_common_net_port_proto_rawDescData -} - -var file_common_net_port_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_common_net_port_proto_goTypes = []interface{}{ - (*PortRange)(nil), // 0: xray.common.net.PortRange - (*PortList)(nil), // 1: xray.common.net.PortList -} -var file_common_net_port_proto_depIdxs = []int32{ - 0, // 0: xray.common.net.PortList.range:type_name -> xray.common.net.PortRange - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_common_net_port_proto_init() } -func file_common_net_port_proto_init() { - if File_common_net_port_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_net_port_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PortRange); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_common_net_port_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PortList); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_net_port_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_net_port_proto_goTypes, - DependencyIndexes: file_common_net_port_proto_depIdxs, - MessageInfos: file_common_net_port_proto_msgTypes, - }.Build() - File_common_net_port_proto = out.File - file_common_net_port_proto_rawDesc = nil - file_common_net_port_proto_goTypes = nil - file_common_net_port_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/protocol/headers.pb.go b/xray_api/proto/common/protocol/headers.pb.go deleted file mode 100644 index bb6e810..0000000 --- a/xray_api/proto/common/protocol/headers.pb.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/protocol/headers.proto - -package protocol - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SecurityType int32 - -const ( - SecurityType_UNKNOWN SecurityType = 0 - SecurityType_AUTO SecurityType = 2 - SecurityType_AES128_GCM SecurityType = 3 - SecurityType_CHACHA20_POLY1305 SecurityType = 4 - SecurityType_NONE SecurityType = 5 // [DEPRECATED 2023-06] - SecurityType_ZERO SecurityType = 6 -) - -// Enum value maps for SecurityType. -var ( - SecurityType_name = map[int32]string{ - 0: "UNKNOWN", - 2: "AUTO", - 3: "AES128_GCM", - 4: "CHACHA20_POLY1305", - 5: "NONE", - 6: "ZERO", - } - SecurityType_value = map[string]int32{ - "UNKNOWN": 0, - "AUTO": 2, - "AES128_GCM": 3, - "CHACHA20_POLY1305": 4, - "NONE": 5, - "ZERO": 6, - } -) - -func (x SecurityType) Enum() *SecurityType { - p := new(SecurityType) - *p = x - return p -} - -func (x SecurityType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SecurityType) Descriptor() protoreflect.EnumDescriptor { - return file_common_protocol_headers_proto_enumTypes[0].Descriptor() -} - -func (SecurityType) Type() protoreflect.EnumType { - return &file_common_protocol_headers_proto_enumTypes[0] -} - -func (x SecurityType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SecurityType.Descriptor instead. -func (SecurityType) EnumDescriptor() ([]byte, []int) { - return file_common_protocol_headers_proto_rawDescGZIP(), []int{0} -} - -type SecurityConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type SecurityType `protobuf:"varint,1,opt,name=type,proto3,enum=xray.common.protocol.SecurityType" json:"type,omitempty"` -} - -func (x *SecurityConfig) Reset() { - *x = SecurityConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_common_protocol_headers_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SecurityConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SecurityConfig) ProtoMessage() {} - -func (x *SecurityConfig) ProtoReflect() protoreflect.Message { - mi := &file_common_protocol_headers_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SecurityConfig.ProtoReflect.Descriptor instead. -func (*SecurityConfig) Descriptor() ([]byte, []int) { - return file_common_protocol_headers_proto_rawDescGZIP(), []int{0} -} - -func (x *SecurityConfig) GetType() SecurityType { - if x != nil { - return x.Type - } - return SecurityType_UNKNOWN -} - -var File_common_protocol_headers_proto protoreflect.FileDescriptor - -var file_common_protocol_headers_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x14, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x48, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, - 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x2a, - 0x60, 0x0a, 0x0c, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, - 0x41, 0x55, 0x54, 0x4f, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x45, 0x53, 0x31, 0x32, 0x38, - 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, - 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x04, 0x12, 0x08, 0x0a, - 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x05, 0x12, 0x08, 0x0a, 0x04, 0x5a, 0x45, 0x52, 0x4f, 0x10, - 0x06, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, - 0x29, 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, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_protocol_headers_proto_rawDescOnce sync.Once - file_common_protocol_headers_proto_rawDescData = file_common_protocol_headers_proto_rawDesc -) - -func file_common_protocol_headers_proto_rawDescGZIP() []byte { - file_common_protocol_headers_proto_rawDescOnce.Do(func() { - file_common_protocol_headers_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_protocol_headers_proto_rawDescData) - }) - return file_common_protocol_headers_proto_rawDescData -} - -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_goTypes = []interface{}{ - (SecurityType)(0), // 0: xray.common.protocol.SecurityType - (*SecurityConfig)(nil), // 1: xray.common.protocol.SecurityConfig -} -var file_common_protocol_headers_proto_depIdxs = []int32{ - 0, // 0: xray.common.protocol.SecurityConfig.type:type_name -> xray.common.protocol.SecurityType - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_common_protocol_headers_proto_init() } -func file_common_protocol_headers_proto_init() { - if File_common_protocol_headers_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_protocol_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_protocol_headers_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_protocol_headers_proto_goTypes, - DependencyIndexes: file_common_protocol_headers_proto_depIdxs, - EnumInfos: file_common_protocol_headers_proto_enumTypes, - MessageInfos: file_common_protocol_headers_proto_msgTypes, - }.Build() - File_common_protocol_headers_proto = out.File - file_common_protocol_headers_proto_rawDesc = nil - file_common_protocol_headers_proto_goTypes = nil - file_common_protocol_headers_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/protocol/server_spec.pb.go b/xray_api/proto/common/protocol/server_spec.pb.go deleted file mode 100644 index 58dedc4..0000000 --- a/xray_api/proto/common/protocol/server_spec.pb.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/protocol/server_spec.proto - -package protocol - -import ( - net "marzban-node/xray_api/proto/common/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ServerEndpoint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *net.IPOrDomain `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - User []*User `protobuf:"bytes,3,rep,name=user,proto3" json:"user,omitempty"` -} - -func (x *ServerEndpoint) Reset() { - *x = ServerEndpoint{} - if protoimpl.UnsafeEnabled { - mi := &file_common_protocol_server_spec_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerEndpoint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerEndpoint) ProtoMessage() {} - -func (x *ServerEndpoint) ProtoReflect() protoreflect.Message { - mi := &file_common_protocol_server_spec_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerEndpoint.ProtoReflect.Descriptor instead. -func (*ServerEndpoint) Descriptor() ([]byte, []int) { - return file_common_protocol_server_spec_proto_rawDescGZIP(), []int{0} -} - -func (x *ServerEndpoint) GetAddress() *net.IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *ServerEndpoint) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ServerEndpoint) GetUser() []*User { - if x != nil { - return x.User - } - return nil -} - -var File_common_protocol_server_spec_proto protoreflect.FileDescriptor - -var file_common_protocol_server_spec_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x8b, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, - 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2e, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x5e, 0x0a, - 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x29, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_protocol_server_spec_proto_rawDescOnce sync.Once - file_common_protocol_server_spec_proto_rawDescData = file_common_protocol_server_spec_proto_rawDesc -) - -func file_common_protocol_server_spec_proto_rawDescGZIP() []byte { - file_common_protocol_server_spec_proto_rawDescOnce.Do(func() { - file_common_protocol_server_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_protocol_server_spec_proto_rawDescData) - }) - return file_common_protocol_server_spec_proto_rawDescData -} - -var file_common_protocol_server_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_protocol_server_spec_proto_goTypes = []interface{}{ - (*ServerEndpoint)(nil), // 0: xray.common.protocol.ServerEndpoint - (*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain - (*User)(nil), // 2: xray.common.protocol.User -} -var file_common_protocol_server_spec_proto_depIdxs = []int32{ - 1, // 0: xray.common.protocol.ServerEndpoint.address:type_name -> xray.common.net.IPOrDomain - 2, // 1: xray.common.protocol.ServerEndpoint.user:type_name -> xray.common.protocol.User - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_common_protocol_server_spec_proto_init() } -func file_common_protocol_server_spec_proto_init() { - if File_common_protocol_server_spec_proto != nil { - return - } - file_common_protocol_user_proto_init() - if !protoimpl.UnsafeEnabled { - file_common_protocol_server_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerEndpoint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_protocol_server_spec_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_protocol_server_spec_proto_goTypes, - DependencyIndexes: file_common_protocol_server_spec_proto_depIdxs, - MessageInfos: file_common_protocol_server_spec_proto_msgTypes, - }.Build() - File_common_protocol_server_spec_proto = out.File - file_common_protocol_server_spec_proto_rawDesc = nil - file_common_protocol_server_spec_proto_goTypes = nil - file_common_protocol_server_spec_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/protocol/user.pb.go b/xray_api/proto/common/protocol/user.pb.go deleted file mode 100644 index a78382a..0000000 --- a/xray_api/proto/common/protocol/user.pb.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/protocol/user.proto - -package protocol - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// User is a generic user for all procotols. -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Level uint32 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // Protocol specific account information. Must be the account proto in one of - // the proxies. - Account *serial.TypedMessage `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_common_protocol_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_common_protocol_user_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_common_protocol_user_proto_rawDescGZIP(), []int{0} -} - -func (x *User) GetLevel() uint32 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *User) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *User) GetAccount() *serial.TypedMessage { - if x != nil { - return x.Account - } - return nil -} - -var File_common_protocol_user_proto protoreflect.FileDescriptor - -var file_common_protocol_user_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x1a, 0x21, 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, 0x6f, 0x22, 0x6e, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x0a, - 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x3a, 0x0a, 0x07, 0x61, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 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, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x50, 0x01, 0x5a, 0x29, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, - 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_common_protocol_user_proto_rawDescOnce sync.Once - file_common_protocol_user_proto_rawDescData = file_common_protocol_user_proto_rawDesc -) - -func file_common_protocol_user_proto_rawDescGZIP() []byte { - file_common_protocol_user_proto_rawDescOnce.Do(func() { - file_common_protocol_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_protocol_user_proto_rawDescData) - }) - return file_common_protocol_user_proto_rawDescData -} - -var file_common_protocol_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_protocol_user_proto_goTypes = []interface{}{ - (*User)(nil), // 0: xray.common.protocol.User - (*serial.TypedMessage)(nil), // 1: xray.common.serial.TypedMessage -} -var file_common_protocol_user_proto_depIdxs = []int32{ - 1, // 0: xray.common.protocol.User.account:type_name -> xray.common.serial.TypedMessage - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_common_protocol_user_proto_init() } -func file_common_protocol_user_proto_init() { - if File_common_protocol_user_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_protocol_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_protocol_user_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_protocol_user_proto_goTypes, - DependencyIndexes: file_common_protocol_user_proto_depIdxs, - MessageInfos: file_common_protocol_user_proto_msgTypes, - }.Build() - File_common_protocol_user_proto = out.File - file_common_protocol_user_proto_rawDesc = nil - file_common_protocol_user_proto_goTypes = nil - file_common_protocol_user_proto_depIdxs = nil -} diff --git a/xray_api/proto/common/serial/typed_message.pb.go b/xray_api/proto/common/serial/typed_message.pb.go deleted file mode 100644 index 719a2d0..0000000 --- a/xray_api/proto/common/serial/typed_message.pb.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: common/serial/typed_message.proto - -package serial - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// TypedMessage is a serialized proto message along with its type name. -type TypedMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the message type, retrieved from protobuf API. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Serialized proto message. - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *TypedMessage) Reset() { - *x = TypedMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_common_serial_typed_message_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TypedMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypedMessage) ProtoMessage() {} - -func (x *TypedMessage) ProtoReflect() protoreflect.Message { - mi := &file_common_serial_typed_message_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TypedMessage.ProtoReflect.Descriptor instead. -func (*TypedMessage) Descriptor() ([]byte, []int) { - return file_common_serial_typed_message_proto_rawDescGZIP(), []int{0} -} - -func (x *TypedMessage) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *TypedMessage) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -var File_common_serial_typed_message_proto protoreflect.FileDescriptor - -var file_common_serial_typed_message_proto_rawDesc = []byte{ - 0x0a, 0x21, 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, 0x6f, 0x12, 0x12, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x22, 0x38, 0x0a, 0x0c, 0x54, 0x79, 0x70, 0x65, 0x64, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x27, 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, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, - 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_common_serial_typed_message_proto_rawDescOnce sync.Once - file_common_serial_typed_message_proto_rawDescData = file_common_serial_typed_message_proto_rawDesc -) - -func file_common_serial_typed_message_proto_rawDescGZIP() []byte { - file_common_serial_typed_message_proto_rawDescOnce.Do(func() { - file_common_serial_typed_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_serial_typed_message_proto_rawDescData) - }) - return file_common_serial_typed_message_proto_rawDescData -} - -var file_common_serial_typed_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_common_serial_typed_message_proto_goTypes = []interface{}{ - (*TypedMessage)(nil), // 0: xray.common.serial.TypedMessage -} -var file_common_serial_typed_message_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_common_serial_typed_message_proto_init() } -func file_common_serial_typed_message_proto_init() { - if File_common_serial_typed_message_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_common_serial_typed_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TypedMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_common_serial_typed_message_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_common_serial_typed_message_proto_goTypes, - DependencyIndexes: file_common_serial_typed_message_proto_depIdxs, - MessageInfos: file_common_serial_typed_message_proto_msgTypes, - }.Build() - File_common_serial_typed_message_proto = out.File - file_common_serial_typed_message_proto_rawDesc = nil - file_common_serial_typed_message_proto_goTypes = nil - file_common_serial_typed_message_proto_depIdxs = nil -} diff --git a/xray_api/proto/compile.go b/xray_api/proto/compile.go deleted file mode 100644 index a129586..0000000 --- a/xray_api/proto/compile.go +++ /dev/null @@ -1,215 +0,0 @@ -package main - -import ( - "archive/tar" - "compress/gzip" - "encoding/json" - "fmt" - "io" - "net/http" - "os" - "path/filepath" - "regexp" - "strings" -) - -func check(e error) { - if e != nil { - panic(e) - } -} - -// Function to download the latest release tarball -func downloadLatestRelease(url string, dest string) { - resp, err := http.Get(url) - check(err) - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - panic(fmt.Sprintf("Failed to download file: %s", resp.Status)) - } - - out, err := os.Create(dest) - check(err) - defer out.Close() - - _, err = io.Copy(out, resp.Body) - check(err) -} - -// Function to extract tarball while ignoring the top-level directory -func extractTarGz(src, dest string) (string, error) { - file, err := os.Open(src) - check(err) - defer file.Close() - - gzr, err := gzip.NewReader(file) - check(err) - defer gzr.Close() - - tr := tar.NewReader(gzr) - var topLevelDir string - - for { - header, err := tr.Next() - if err == io.EOF { - break - } - check(err) - - // Skip pax_global_header - if header.Name == "pax_global_header" { - continue - } - - // Extract only the top-level directory - if topLevelDir == "" { - topLevelDir = strings.Split(header.Name, string(filepath.Separator))[0] - } - target := filepath.Join(dest, strings.TrimPrefix(header.Name, topLevelDir+string(filepath.Separator))) - - switch header.Typeflag { - case tar.TypeDir: - err = os.MkdirAll(target, 0755) - check(err) - case tar.TypeReg: - err = os.MkdirAll(filepath.Dir(target), 0755) - check(err) - outFile, err := os.Create(target) - check(err) - defer outFile.Close() - _, err = io.Copy(outFile, tr) - check(err) - } - } - return filepath.Join(dest, topLevelDir), nil -} - -// Function to copy .pb.go files to the destination directory and modify imports -func copyAndModifyPbGoFiles(srcDir, destDir, oldPrefix, newPrefix string) { - err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error { - check(err) - if strings.HasSuffix(info.Name(), ".pb.go") { - relPath, err := filepath.Rel(srcDir, path) - check(err) - destPath := filepath.Join(destDir, relPath) - err = os.MkdirAll(filepath.Dir(destPath), 0755) - check(err) - _, err = copyAndModifyFile(path, destPath, oldPrefix, newPrefix) - check(err) - } - return nil - }) - check(err) -} - -// Function to copy a file and modify imports -func copyAndModifyFile(src, dest, oldPrefix, newPrefix string) (int64, error) { - sourceFile, err := os.Open(src) - if err != nil { - return 0, err - } - defer sourceFile.Close() - - destFile, err := os.Create(dest) - if err != nil { - return 0, err - } - defer destFile.Close() - - content, err := io.ReadAll(sourceFile) - if err != nil { - return 0, err - } - - modifiedContent := modifyImports(string(content), oldPrefix, newPrefix) - _, err = destFile.Write([]byte(modifiedContent)) - if err != nil { - return 0, err - } - - return int64(len(modifiedContent)), nil -} - -// Function to modify import paths -func modifyImports(content, oldPrefix, newPrefix string) string { - re := regexp.MustCompile(`(` + regexp.QuoteMeta(oldPrefix) + `)`) - return re.ReplaceAllString(content, newPrefix) -} - -// Function to move contents of srcDir to destDir -func moveContents(srcDir, destDir string) { - err := filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error { - check(err) - relPath, err := filepath.Rel(srcDir, path) - check(err) - destPath := filepath.Join(destDir, relPath) - if info.IsDir() { - err := os.MkdirAll(destPath, 0755) - check(err) - } else { - err := os.Rename(path, destPath) - check(err) - } - return nil - }) - check(err) -} - -// init function to run the downloader and file modifier -func main() { - // Get latest version tag from GitHub API - resp, err := http.Get("https://api.github.com/repos/XTLS/xray-core/releases/latest") - check(err) - defer resp.Body.Close() - - if resp.StatusCode != http.StatusOK { - panic(fmt.Sprintf("Failed to fetch latest release: %s", resp.Status)) - } - - type GitHubRelease struct { - TagName string `json:"tag_name"` - } - - var release GitHubRelease - err = json.NewDecoder(resp.Body).Decode(&release) - check(err) - - version := release.TagName - fmt.Println("Latest version is", version) - - // Download source tarball - downloadUrl := fmt.Sprintf("https://github.com/XTLS/xray-core/archive/refs/tags/%s.tar.gz", version) - tmpDir, err := os.MkdirTemp("", "xray-core-*") - check(err) - defer os.RemoveAll(tmpDir) - - tarballPath := filepath.Join(tmpDir, "source.tar.gz") - fmt.Println("Downloading source", version, "...") - downloadLatestRelease(downloadUrl, tarballPath) - fmt.Println("Source downloaded. Extracting...") - - // Extract tarball and get the top-level directory - extractDir := filepath.Join(tmpDir, "extracted") - err = os.MkdirAll(extractDir, 0755) - check(err) - topLevelDir, err := extractTarGz(tarballPath, extractDir) - check(err) - fmt.Println("Source extracted.") - - // Move contents to the destination directory - finalExtractDir := filepath.Join(tmpDir, "final") - err = os.MkdirAll(finalExtractDir, 0755) - check(err) - moveContents(topLevelDir, finalExtractDir) - fmt.Println("Top-level directory ignored.") - - // Copy .pb.go files to the destination directory and modify imports - destDir := "." // or any directory you want to copy files to - oldPrefix := "github.com/xtls/xray-core" - newPrefix := "marzban-node/xray_api/proto" - - fmt.Println("Copying .pb.go files and modifying imports...") - copyAndModifyPbGoFiles(finalExtractDir, destDir, oldPrefix, newPrefix) - fmt.Println("Done.") -} diff --git a/xray_api/proto/core/config.pb.go b/xray_api/proto/core/config.pb.go deleted file mode 100644 index b2033b4..0000000 --- a/xray_api/proto/core/config.pb.go +++ /dev/null @@ -1,435 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: core/config.proto - -package core - -import ( - serial "marzban-node/xray_api/proto/common/serial" - global "marzban-node/xray_api/proto/transport/global" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Config is the master config of Xray. Xray takes this config as input and -// functions accordingly. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Inbound handler configurations. Must have at least one item. - Inbound []*InboundHandlerConfig `protobuf:"bytes,1,rep,name=inbound,proto3" json:"inbound,omitempty"` - // Outbound handler configurations. Must have at least one item. The first - // item is used as default for routing. - Outbound []*OutboundHandlerConfig `protobuf:"bytes,2,rep,name=outbound,proto3" json:"outbound,omitempty"` - // App is for configurations of all features in Xray. A feature must - // implement the Feature interface, and its config type must be registered - // through common.RegisterConfig. - 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 - // extension is not loaded into Xray. Xray will ignore such config during - // initialization. - Extension []*serial.TypedMessage `protobuf:"bytes,6,rep,name=extension,proto3" json:"extension,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_core_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_core_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_core_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetInbound() []*InboundHandlerConfig { - if x != nil { - return x.Inbound - } - return nil -} - -func (x *Config) GetOutbound() []*OutboundHandlerConfig { - if x != nil { - return x.Outbound - } - return nil -} - -func (x *Config) GetApp() []*serial.TypedMessage { - if x != nil { - return x.App - } - 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 { - if x != nil { - return x.Extension - } - return nil -} - -// InboundHandlerConfig is the configuration for inbound handler. -type InboundHandlerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tag of the inbound handler. The tag must be unique among all inbound - // handlers - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - // Settings for how this inbound proxy is handled. - ReceiverSettings *serial.TypedMessage `protobuf:"bytes,2,opt,name=receiver_settings,json=receiverSettings,proto3" json:"receiver_settings,omitempty"` - // Settings for inbound proxy. Must be one of the inbound proxies. - ProxySettings *serial.TypedMessage `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings,proto3" json:"proxy_settings,omitempty"` -} - -func (x *InboundHandlerConfig) Reset() { - *x = InboundHandlerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_core_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InboundHandlerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InboundHandlerConfig) ProtoMessage() {} - -func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_core_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InboundHandlerConfig.ProtoReflect.Descriptor instead. -func (*InboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_core_config_proto_rawDescGZIP(), []int{1} -} - -func (x *InboundHandlerConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *InboundHandlerConfig) GetReceiverSettings() *serial.TypedMessage { - if x != nil { - return x.ReceiverSettings - } - return nil -} - -func (x *InboundHandlerConfig) GetProxySettings() *serial.TypedMessage { - if x != nil { - return x.ProxySettings - } - return nil -} - -// OutboundHandlerConfig is the configuration for outbound handler. -type OutboundHandlerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tag of this outbound handler. - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - // Settings for how to dial connection for this outbound handler. - SenderSettings *serial.TypedMessage `protobuf:"bytes,2,opt,name=sender_settings,json=senderSettings,proto3" json:"sender_settings,omitempty"` - // Settings for this outbound proxy. Must be one of the outbound proxies. - ProxySettings *serial.TypedMessage `protobuf:"bytes,3,opt,name=proxy_settings,json=proxySettings,proto3" json:"proxy_settings,omitempty"` - // If not zero, this outbound will be expired in seconds. Not used for now. - Expire int64 `protobuf:"varint,4,opt,name=expire,proto3" json:"expire,omitempty"` - // Comment of this outbound handler. Not used for now. - Comment string `protobuf:"bytes,5,opt,name=comment,proto3" json:"comment,omitempty"` -} - -func (x *OutboundHandlerConfig) Reset() { - *x = OutboundHandlerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_core_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OutboundHandlerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OutboundHandlerConfig) ProtoMessage() {} - -func (x *OutboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_core_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OutboundHandlerConfig.ProtoReflect.Descriptor instead. -func (*OutboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_core_config_proto_rawDescGZIP(), []int{2} -} - -func (x *OutboundHandlerConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *OutboundHandlerConfig) GetSenderSettings() *serial.TypedMessage { - if x != nil { - return x.SenderSettings - } - return nil -} - -func (x *OutboundHandlerConfig) GetProxySettings() *serial.TypedMessage { - if x != nil { - return x.ProxySettings - } - return nil -} - -func (x *OutboundHandlerConfig) GetExpire() int64 { - if x != nil { - return x.Expire - } - return 0 -} - -func (x *OutboundHandlerConfig) GetComment() string { - if x != nil { - return x.Comment - } - return "" -} - -var File_core_config_proto protoreflect.FileDescriptor - -var file_core_config_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 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, - 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, - 0x62, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xb5, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x07, 0x69, - 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x69, - 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x3c, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x6f, 0x75, 0x74, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, 0x04, 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, 0x03, 0x61, 0x70, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x42, 0x02, 0x18, 0x01, 0x52, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 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, 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, 0x22, 0xef, 0x01, 0x0a, 0x15, - 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 ( - file_core_config_proto_rawDescOnce sync.Once - file_core_config_proto_rawDescData = file_core_config_proto_rawDesc -) - -func file_core_config_proto_rawDescGZIP() []byte { - file_core_config_proto_rawDescOnce.Do(func() { - file_core_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_core_config_proto_rawDescData) - }) - return file_core_config_proto_rawDescData -} - -var file_core_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_core_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.core.Config - (*InboundHandlerConfig)(nil), // 1: xray.core.InboundHandlerConfig - (*OutboundHandlerConfig)(nil), // 2: xray.core.OutboundHandlerConfig - (*serial.TypedMessage)(nil), // 3: xray.common.serial.TypedMessage - (*global.Config)(nil), // 4: xray.transport.Config -} -var file_core_config_proto_depIdxs = []int32{ - 1, // 0: xray.core.Config.inbound:type_name -> xray.core.InboundHandlerConfig - 2, // 1: xray.core.Config.outbound:type_name -> xray.core.OutboundHandlerConfig - 3, // 2: xray.core.Config.app:type_name -> xray.common.serial.TypedMessage - 4, // 3: xray.core.Config.transport:type_name -> xray.transport.Config - 3, // 4: xray.core.Config.extension:type_name -> xray.common.serial.TypedMessage - 3, // 5: xray.core.InboundHandlerConfig.receiver_settings:type_name -> xray.common.serial.TypedMessage - 3, // 6: xray.core.InboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage - 3, // 7: xray.core.OutboundHandlerConfig.sender_settings:type_name -> xray.common.serial.TypedMessage - 3, // 8: xray.core.OutboundHandlerConfig.proxy_settings:type_name -> xray.common.serial.TypedMessage - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_core_config_proto_init() } -func file_core_config_proto_init() { - if File_core_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_core_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_core_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InboundHandlerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_core_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OutboundHandlerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_core_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_core_config_proto_goTypes, - DependencyIndexes: file_core_config_proto_depIdxs, - MessageInfos: file_core_config_proto_msgTypes, - }.Build() - File_core_config_proto = out.File - file_core_config_proto_rawDesc = nil - file_core_config_proto_goTypes = nil - file_core_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/blackhole/config.pb.go b/xray_api/proto/proxy/blackhole/config.pb.go deleted file mode 100644 index f413433..0000000 --- a/xray_api/proto/proxy/blackhole/config.pb.go +++ /dev/null @@ -1,260 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/blackhole/config.proto - -package blackhole - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type NoneResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *NoneResponse) Reset() { - *x = NoneResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_blackhole_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NoneResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NoneResponse) ProtoMessage() {} - -func (x *NoneResponse) ProtoReflect() protoreflect.Message { - mi := &file_proxy_blackhole_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NoneResponse.ProtoReflect.Descriptor instead. -func (*NoneResponse) Descriptor() ([]byte, []int) { - return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{0} -} - -type HTTPResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *HTTPResponse) Reset() { - *x = HTTPResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_blackhole_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HTTPResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HTTPResponse) ProtoMessage() {} - -func (x *HTTPResponse) ProtoReflect() protoreflect.Message { - mi := &file_proxy_blackhole_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use HTTPResponse.ProtoReflect.Descriptor instead. -func (*HTTPResponse) Descriptor() ([]byte, []int) { - return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{1} -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Response *serial.TypedMessage `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_blackhole_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_blackhole_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{2} -} - -func (x *Config) GetResponse() *serial.TypedMessage { - if x != nil { - return x.Response - } - return nil -} - -var File_proxy_blackhole_config_proto protoreflect.FileDescriptor - -var file_proxy_blackhole_config_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, - 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, - 0x68, 0x6f, 0x6c, 0x65, 0x1a, 0x21, 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, 0x6f, 0x22, 0x0e, 0x0a, 0x0c, 0x4e, 0x6f, 0x6e, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0e, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x3c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 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, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x29, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x62, - 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_blackhole_config_proto_rawDescOnce sync.Once - file_proxy_blackhole_config_proto_rawDescData = file_proxy_blackhole_config_proto_rawDesc -) - -func file_proxy_blackhole_config_proto_rawDescGZIP() []byte { - file_proxy_blackhole_config_proto_rawDescOnce.Do(func() { - file_proxy_blackhole_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_blackhole_config_proto_rawDescData) - }) - return file_proxy_blackhole_config_proto_rawDescData -} - -var file_proxy_blackhole_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_proxy_blackhole_config_proto_goTypes = []interface{}{ - (*NoneResponse)(nil), // 0: xray.proxy.blackhole.NoneResponse - (*HTTPResponse)(nil), // 1: xray.proxy.blackhole.HTTPResponse - (*Config)(nil), // 2: xray.proxy.blackhole.Config - (*serial.TypedMessage)(nil), // 3: xray.common.serial.TypedMessage -} -var file_proxy_blackhole_config_proto_depIdxs = []int32{ - 3, // 0: xray.proxy.blackhole.Config.response:type_name -> xray.common.serial.TypedMessage - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proxy_blackhole_config_proto_init() } -func file_proxy_blackhole_config_proto_init() { - if File_proxy_blackhole_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_blackhole_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoneResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_blackhole_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HTTPResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_blackhole_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_blackhole_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_blackhole_config_proto_goTypes, - DependencyIndexes: file_proxy_blackhole_config_proto_depIdxs, - MessageInfos: file_proxy_blackhole_config_proto_msgTypes, - }.Build() - File_proxy_blackhole_config_proto = out.File - file_proxy_blackhole_config_proto_rawDesc = nil - file_proxy_blackhole_config_proto_goTypes = nil - file_proxy_blackhole_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/dns/config.pb.go b/xray_api/proto/proxy/dns/config.pb.go deleted file mode 100644 index 094faa3..0000000 --- a/xray_api/proto/proxy/dns/config.pb.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/dns/config.proto - -package dns - -import ( - net "marzban-node/xray_api/proto/common/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Server is the DNS server address. If specified, this address overrides the - // original one. - Server *net.Endpoint `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - UserLevel uint32 `protobuf:"varint,2,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` - Non_IPQuery string `protobuf:"bytes,3,opt,name=non_IP_query,json=nonIPQuery,proto3" json:"non_IP_query,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_dns_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_dns_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_dns_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetServer() *net.Endpoint { - if x != nil { - return x.Server - } - return nil -} - -func (x *Config) GetUserLevel() uint32 { - if x != nil { - return x.UserLevel - } - return 0 -} - -func (x *Config) GetNon_IPQuery() string { - if x != nil { - return x.Non_IPQuery - } - return "" -} - -var File_proxy_dns_config_proto protoreflect.FileDescriptor - -var file_proxy_dns_config_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x1a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x31, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 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, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x12, 0x20, 0x0a, 0x0c, 0x6e, 0x6f, 0x6e, 0x5f, 0x49, 0x50, 0x5f, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x6f, 0x6e, 0x49, 0x50, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x23, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, - 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, - 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_dns_config_proto_rawDescOnce sync.Once - file_proxy_dns_config_proto_rawDescData = file_proxy_dns_config_proto_rawDesc -) - -func file_proxy_dns_config_proto_rawDescGZIP() []byte { - file_proxy_dns_config_proto_rawDescOnce.Do(func() { - file_proxy_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_dns_config_proto_rawDescData) - }) - return file_proxy_dns_config_proto_rawDescData -} - -var file_proxy_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_dns_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.proxy.dns.Config - (*net.Endpoint)(nil), // 1: xray.common.net.Endpoint -} -var file_proxy_dns_config_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.dns.Config.server:type_name -> xray.common.net.Endpoint - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proxy_dns_config_proto_init() } -func file_proxy_dns_config_proto_init() { - if File_proxy_dns_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_dns_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_dns_config_proto_goTypes, - DependencyIndexes: file_proxy_dns_config_proto_depIdxs, - MessageInfos: file_proxy_dns_config_proto_msgTypes, - }.Build() - File_proxy_dns_config_proto = out.File - file_proxy_dns_config_proto_rawDesc = nil - file_proxy_dns_config_proto_goTypes = nil - file_proxy_dns_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/dokodemo/config.pb.go b/xray_api/proto/proxy/dokodemo/config.pb.go deleted file mode 100644 index 9f76181..0000000 --- a/xray_api/proto/proxy/dokodemo/config.pb.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/dokodemo/config.proto - -package dokodemo - -import ( - net "marzban-node/xray_api/proto/common/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *net.IPOrDomain `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - // List of networks that the Dokodemo accepts. - // Deprecated. Use networks. - // - // Deprecated: Marked as deprecated in proxy/dokodemo/config.proto. - NetworkList *net.NetworkList `protobuf:"bytes,3,opt,name=network_list,json=networkList,proto3" json:"network_list,omitempty"` - // List of networks that the Dokodemo accepts. - Networks []net.Network `protobuf:"varint,7,rep,packed,name=networks,proto3,enum=xray.common.net.Network" json:"networks,omitempty"` - // Deprecated: Marked as deprecated in proxy/dokodemo/config.proto. - Timeout uint32 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` - FollowRedirect bool `protobuf:"varint,5,opt,name=follow_redirect,json=followRedirect,proto3" json:"follow_redirect,omitempty"` - UserLevel uint32 `protobuf:"varint,6,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_dokodemo_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_dokodemo_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_dokodemo_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetAddress() *net.IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *Config) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -// Deprecated: Marked as deprecated in proxy/dokodemo/config.proto. -func (x *Config) GetNetworkList() *net.NetworkList { - if x != nil { - return x.NetworkList - } - return nil -} - -func (x *Config) GetNetworks() []net.Network { - if x != nil { - return x.Networks - } - return nil -} - -// Deprecated: Marked as deprecated in proxy/dokodemo/config.proto. -func (x *Config) GetTimeout() uint32 { - if x != nil { - return x.Timeout - } - return 0 -} - -func (x *Config) GetFollowRedirect() bool { - if x != nil { - return x.FollowRedirect - } - return false -} - -func (x *Config) GetUserLevel() uint32 { - if x != nil { - return x.UserLevel - } - return 0 -} - -var File_proxy_dokodemo_config_proto protoreflect.FileDescriptor - -var file_proxy_dokodemo_config_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, - 0x6d, 0x6f, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x43, 0x0a, 0x0c, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, - 0x42, 0x02, 0x18, 0x01, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x34, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x08, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, - 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5b, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x28, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6f, 0x6b, 0x6f, - 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x44, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_proxy_dokodemo_config_proto_rawDescOnce sync.Once - file_proxy_dokodemo_config_proto_rawDescData = file_proxy_dokodemo_config_proto_rawDesc -) - -func file_proxy_dokodemo_config_proto_rawDescGZIP() []byte { - file_proxy_dokodemo_config_proto_rawDescOnce.Do(func() { - file_proxy_dokodemo_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_dokodemo_config_proto_rawDescData) - }) - return file_proxy_dokodemo_config_proto_rawDescData -} - -var file_proxy_dokodemo_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_dokodemo_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.proxy.dokodemo.Config - (*net.IPOrDomain)(nil), // 1: xray.common.net.IPOrDomain - (*net.NetworkList)(nil), // 2: xray.common.net.NetworkList - (net.Network)(0), // 3: xray.common.net.Network -} -var file_proxy_dokodemo_config_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.dokodemo.Config.address:type_name -> xray.common.net.IPOrDomain - 2, // 1: xray.proxy.dokodemo.Config.network_list:type_name -> xray.common.net.NetworkList - 3, // 2: xray.proxy.dokodemo.Config.networks:type_name -> xray.common.net.Network - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_proxy_dokodemo_config_proto_init() } -func file_proxy_dokodemo_config_proto_init() { - if File_proxy_dokodemo_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_dokodemo_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_dokodemo_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_dokodemo_config_proto_goTypes, - DependencyIndexes: file_proxy_dokodemo_config_proto_depIdxs, - MessageInfos: file_proxy_dokodemo_config_proto_msgTypes, - }.Build() - File_proxy_dokodemo_config_proto = out.File - file_proxy_dokodemo_config_proto_rawDesc = nil - file_proxy_dokodemo_config_proto_goTypes = nil - file_proxy_dokodemo_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/freedom/config.pb.go b/xray_api/proto/proxy/freedom/config.pb.go deleted file mode 100644 index db1304a..0000000 --- a/xray_api/proto/proxy/freedom/config.pb.go +++ /dev/null @@ -1,483 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/freedom/config.proto - -package freedom - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config_DomainStrategy int32 - -const ( - Config_AS_IS Config_DomainStrategy = 0 - Config_USE_IP Config_DomainStrategy = 1 - Config_USE_IP4 Config_DomainStrategy = 2 - Config_USE_IP6 Config_DomainStrategy = 3 - Config_USE_IP46 Config_DomainStrategy = 4 - Config_USE_IP64 Config_DomainStrategy = 5 - Config_FORCE_IP Config_DomainStrategy = 6 - Config_FORCE_IP4 Config_DomainStrategy = 7 - Config_FORCE_IP6 Config_DomainStrategy = 8 - Config_FORCE_IP46 Config_DomainStrategy = 9 - Config_FORCE_IP64 Config_DomainStrategy = 10 -) - -// Enum value maps for Config_DomainStrategy. -var ( - Config_DomainStrategy_name = map[int32]string{ - 0: "AS_IS", - 1: "USE_IP", - 2: "USE_IP4", - 3: "USE_IP6", - 4: "USE_IP46", - 5: "USE_IP64", - 6: "FORCE_IP", - 7: "FORCE_IP4", - 8: "FORCE_IP6", - 9: "FORCE_IP46", - 10: "FORCE_IP64", - } - Config_DomainStrategy_value = map[string]int32{ - "AS_IS": 0, - "USE_IP": 1, - "USE_IP4": 2, - "USE_IP6": 3, - "USE_IP46": 4, - "USE_IP64": 5, - "FORCE_IP": 6, - "FORCE_IP4": 7, - "FORCE_IP6": 8, - "FORCE_IP46": 9, - "FORCE_IP64": 10, - } -) - -func (x Config_DomainStrategy) Enum() *Config_DomainStrategy { - p := new(Config_DomainStrategy) - *p = x - return p -} - -func (x Config_DomainStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Config_DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_proxy_freedom_config_proto_enumTypes[0].Descriptor() -} - -func (Config_DomainStrategy) Type() protoreflect.EnumType { - return &file_proxy_freedom_config_proto_enumTypes[0] -} - -func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Config_DomainStrategy.Descriptor instead. -func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_proxy_freedom_config_proto_rawDescGZIP(), []int{2, 0} -} - -type DestinationOverride struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Server *protocol.ServerEndpoint `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` -} - -func (x *DestinationOverride) Reset() { - *x = DestinationOverride{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_freedom_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DestinationOverride) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DestinationOverride) ProtoMessage() {} - -func (x *DestinationOverride) ProtoReflect() protoreflect.Message { - mi := &file_proxy_freedom_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DestinationOverride.ProtoReflect.Descriptor instead. -func (*DestinationOverride) Descriptor() ([]byte, []int) { - return file_proxy_freedom_config_proto_rawDescGZIP(), []int{0} -} - -func (x *DestinationOverride) GetServer() *protocol.ServerEndpoint { - if x != nil { - return x.Server - } - return nil -} - -type Fragment struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PacketsFrom uint64 `protobuf:"varint,1,opt,name=packets_from,json=packetsFrom,proto3" json:"packets_from,omitempty"` - PacketsTo uint64 `protobuf:"varint,2,opt,name=packets_to,json=packetsTo,proto3" json:"packets_to,omitempty"` - LengthMin uint64 `protobuf:"varint,3,opt,name=length_min,json=lengthMin,proto3" json:"length_min,omitempty"` - LengthMax uint64 `protobuf:"varint,4,opt,name=length_max,json=lengthMax,proto3" json:"length_max,omitempty"` - IntervalMin uint64 `protobuf:"varint,5,opt,name=interval_min,json=intervalMin,proto3" json:"interval_min,omitempty"` - IntervalMax uint64 `protobuf:"varint,6,opt,name=interval_max,json=intervalMax,proto3" json:"interval_max,omitempty"` -} - -func (x *Fragment) Reset() { - *x = Fragment{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_freedom_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Fragment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Fragment) ProtoMessage() {} - -func (x *Fragment) ProtoReflect() protoreflect.Message { - mi := &file_proxy_freedom_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Fragment.ProtoReflect.Descriptor instead. -func (*Fragment) Descriptor() ([]byte, []int) { - return file_proxy_freedom_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Fragment) GetPacketsFrom() uint64 { - if x != nil { - return x.PacketsFrom - } - return 0 -} - -func (x *Fragment) GetPacketsTo() uint64 { - if x != nil { - return x.PacketsTo - } - return 0 -} - -func (x *Fragment) GetLengthMin() uint64 { - if x != nil { - return x.LengthMin - } - return 0 -} - -func (x *Fragment) GetLengthMax() uint64 { - if x != nil { - return x.LengthMax - } - return 0 -} - -func (x *Fragment) GetIntervalMin() uint64 { - if x != nil { - return x.IntervalMin - } - return 0 -} - -func (x *Fragment) GetIntervalMax() uint64 { - if x != nil { - return x.IntervalMax - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - DomainStrategy Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=xray.proxy.freedom.Config_DomainStrategy" json:"domain_strategy,omitempty"` - // Deprecated: Marked as deprecated in proxy/freedom/config.proto. - Timeout uint32 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` - DestinationOverride *DestinationOverride `protobuf:"bytes,3,opt,name=destination_override,json=destinationOverride,proto3" json:"destination_override,omitempty"` - UserLevel uint32 `protobuf:"varint,4,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` - Fragment *Fragment `protobuf:"bytes,5,opt,name=fragment,proto3" json:"fragment,omitempty"` - ProxyProtocol uint32 `protobuf:"varint,6,opt,name=proxy_protocol,json=proxyProtocol,proto3" json:"proxy_protocol,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_freedom_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_freedom_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_freedom_config_proto_rawDescGZIP(), []int{2} -} - -func (x *Config) GetDomainStrategy() Config_DomainStrategy { - if x != nil { - return x.DomainStrategy - } - return Config_AS_IS -} - -// Deprecated: Marked as deprecated in proxy/freedom/config.proto. -func (x *Config) GetTimeout() uint32 { - if x != nil { - return x.Timeout - } - return 0 -} - -func (x *Config) GetDestinationOverride() *DestinationOverride { - if x != nil { - return x.DestinationOverride - } - return nil -} - -func (x *Config) GetUserLevel() uint32 { - if x != nil { - return x.UserLevel - } - return 0 -} - -func (x *Config) GetFragment() *Fragment { - if x != nil { - return x.Fragment - } - return nil -} - -func (x *Config) GetProxyProtocol() uint32 { - if x != nil { - return x.ProxyProtocol - } - return 0 -} - -var File_proxy_freedom_config_proto protoreflect.FileDescriptor - -var file_proxy_freedom_config_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, - 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x53, 0x0a, 0x13, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0xd0, 0x01, 0x0a, 0x08, 0x46, 0x72, 0x61, - 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x73, - 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x70, 0x61, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, - 0x65, 0x74, 0x73, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x61, - 0x63, 0x6b, 0x65, 0x74, 0x73, 0x54, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x4d, 0x69, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, - 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x6c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x4d, 0x61, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, - 0x6c, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x69, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x61, 0x78, 0x22, 0x82, 0x04, 0x0a, 0x06, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x52, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x29, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, - 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x5a, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x44, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x52, - 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, - 0x72, 0x69, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, - 0x76, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x2e, 0x46, 0x72, 0x61, 0x67, 0x6d, - 0x65, 0x6e, 0x74, 0x52, 0x08, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, - 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0xa9, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, - 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, - 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, - 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, - 0x49, 0x50, 0x34, 0x36, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, - 0x36, 0x34, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, - 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, - 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x08, - 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x09, - 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x0a, - 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x50, 0x01, 0x5a, 0x27, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x66, 0x72, - 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x46, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_proxy_freedom_config_proto_rawDescOnce sync.Once - file_proxy_freedom_config_proto_rawDescData = file_proxy_freedom_config_proto_rawDesc -) - -func file_proxy_freedom_config_proto_rawDescGZIP() []byte { - file_proxy_freedom_config_proto_rawDescOnce.Do(func() { - file_proxy_freedom_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_freedom_config_proto_rawDescData) - }) - return file_proxy_freedom_config_proto_rawDescData -} - -var file_proxy_freedom_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proxy_freedom_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_proxy_freedom_config_proto_goTypes = []interface{}{ - (Config_DomainStrategy)(0), // 0: xray.proxy.freedom.Config.DomainStrategy - (*DestinationOverride)(nil), // 1: xray.proxy.freedom.DestinationOverride - (*Fragment)(nil), // 2: xray.proxy.freedom.Fragment - (*Config)(nil), // 3: xray.proxy.freedom.Config - (*protocol.ServerEndpoint)(nil), // 4: xray.common.protocol.ServerEndpoint -} -var file_proxy_freedom_config_proto_depIdxs = []int32{ - 4, // 0: xray.proxy.freedom.DestinationOverride.server:type_name -> xray.common.protocol.ServerEndpoint - 0, // 1: xray.proxy.freedom.Config.domain_strategy:type_name -> xray.proxy.freedom.Config.DomainStrategy - 1, // 2: xray.proxy.freedom.Config.destination_override:type_name -> xray.proxy.freedom.DestinationOverride - 2, // 3: xray.proxy.freedom.Config.fragment:type_name -> xray.proxy.freedom.Fragment - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_proxy_freedom_config_proto_init() } -func file_proxy_freedom_config_proto_init() { - if File_proxy_freedom_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_freedom_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DestinationOverride); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_freedom_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Fragment); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_freedom_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_freedom_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_freedom_config_proto_goTypes, - DependencyIndexes: file_proxy_freedom_config_proto_depIdxs, - EnumInfos: file_proxy_freedom_config_proto_enumTypes, - MessageInfos: file_proxy_freedom_config_proto_msgTypes, - }.Build() - File_proxy_freedom_config_proto = out.File - file_proxy_freedom_config_proto_rawDesc = nil - file_proxy_freedom_config_proto_goTypes = nil - file_proxy_freedom_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/http/config.pb.go b/xray_api/proto/proxy/http/config.pb.go deleted file mode 100644 index fd0e5eb..0000000 --- a/xray_api/proto/proxy/http/config.pb.go +++ /dev/null @@ -1,417 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/http/config.proto - -package http - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_http_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_http_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_http_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *Account) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// Config for HTTP proxy server. -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: Marked as deprecated in proxy/http/config.proto. - Timeout uint32 `protobuf:"varint,1,opt,name=timeout,proto3" json:"timeout,omitempty"` - Accounts map[string]string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - AllowTransparent bool `protobuf:"varint,3,opt,name=allow_transparent,json=allowTransparent,proto3" json:"allow_transparent,omitempty"` - UserLevel uint32 `protobuf:"varint,4,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_http_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_http_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_http_config_proto_rawDescGZIP(), []int{1} -} - -// Deprecated: Marked as deprecated in proxy/http/config.proto. -func (x *ServerConfig) GetTimeout() uint32 { - if x != nil { - return x.Timeout - } - return 0 -} - -func (x *ServerConfig) GetAccounts() map[string]string { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *ServerConfig) GetAllowTransparent() bool { - if x != nil { - return x.AllowTransparent - } - return false -} - -func (x *ServerConfig) GetUserLevel() uint32 { - if x != nil { - return x.UserLevel - } - return 0 -} - -type Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Header) Reset() { - *x = Header{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_http_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header) ProtoMessage() {} - -func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_proxy_http_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { - return file_proxy_http_config_proto_rawDescGZIP(), []int{2} -} - -func (x *Header) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Header) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// ClientConfig is the protobuf config for HTTP proxy client. -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Sever is a list of HTTP server addresses. - Server []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=server,proto3" json:"server,omitempty"` - Header []*Header `protobuf:"bytes,2,rep,name=header,proto3" json:"header,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_http_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_http_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_proxy_http_config_proto_rawDescGZIP(), []int{3} -} - -func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { - if x != nil { - return x.Server - } - return nil -} - -func (x *ClientConfig) GetHeader() []*Header { - if x != nil { - return x.Header - } - return nil -} - -var File_proxy_http_config_proto protoreflect.FileDescriptor - -var file_proxy_http_config_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, - 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x22, 0xfe, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, - 0x47, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, - 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x30, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x7d, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x24, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, - 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_http_config_proto_rawDescOnce sync.Once - file_proxy_http_config_proto_rawDescData = file_proxy_http_config_proto_rawDesc -) - -func file_proxy_http_config_proto_rawDescGZIP() []byte { - file_proxy_http_config_proto_rawDescOnce.Do(func() { - file_proxy_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_http_config_proto_rawDescData) - }) - return file_proxy_http_config_proto_rawDescData -} - -var file_proxy_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_proxy_http_config_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: xray.proxy.http.Account - (*ServerConfig)(nil), // 1: xray.proxy.http.ServerConfig - (*Header)(nil), // 2: xray.proxy.http.Header - (*ClientConfig)(nil), // 3: xray.proxy.http.ClientConfig - nil, // 4: xray.proxy.http.ServerConfig.AccountsEntry - (*protocol.ServerEndpoint)(nil), // 5: xray.common.protocol.ServerEndpoint -} -var file_proxy_http_config_proto_depIdxs = []int32{ - 4, // 0: xray.proxy.http.ServerConfig.accounts:type_name -> xray.proxy.http.ServerConfig.AccountsEntry - 5, // 1: xray.proxy.http.ClientConfig.server:type_name -> xray.common.protocol.ServerEndpoint - 2, // 2: xray.proxy.http.ClientConfig.header:type_name -> xray.proxy.http.Header - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_proxy_http_config_proto_init() } -func file_proxy_http_config_proto_init() { - if File_proxy_http_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_http_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_http_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_http_config_proto_goTypes, - DependencyIndexes: file_proxy_http_config_proto_depIdxs, - MessageInfos: file_proxy_http_config_proto_msgTypes, - }.Build() - File_proxy_http_config_proto = out.File - file_proxy_http_config_proto_rawDesc = nil - file_proxy_http_config_proto_goTypes = nil - file_proxy_http_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/loopback/config.pb.go b/xray_api/proto/proxy/loopback/config.pb.go deleted file mode 100644 index f66696e..0000000 --- a/xray_api/proto/proxy/loopback/config.pb.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/loopback/config.proto - -package loopback - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - InboundTag string `protobuf:"bytes,1,opt,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_loopback_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_loopback_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_loopback_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetInboundTag() string { - if x != nil { - return x.InboundTag - } - return "" -} - -var File_proxy_loopback_config_proto protoreflect.FileDescriptor - -var file_proxy_loopback_config_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, - 0x63, 0x6b, 0x22, 0x29, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, - 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x54, 0x61, 0x67, 0x42, 0x5b, 0x0a, - 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x50, 0x01, 0x5a, 0x28, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, - 0x62, 0x61, 0x63, 0x6b, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x4c, 0x6f, 0x6f, 0x70, 0x62, 0x61, 0x63, 0x6b, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_proxy_loopback_config_proto_rawDescOnce sync.Once - file_proxy_loopback_config_proto_rawDescData = file_proxy_loopback_config_proto_rawDesc -) - -func file_proxy_loopback_config_proto_rawDescGZIP() []byte { - file_proxy_loopback_config_proto_rawDescOnce.Do(func() { - file_proxy_loopback_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_loopback_config_proto_rawDescData) - }) - return file_proxy_loopback_config_proto_rawDescData -} - -var file_proxy_loopback_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_loopback_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.proxy.loopback.Config -} -var file_proxy_loopback_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_proxy_loopback_config_proto_init() } -func file_proxy_loopback_config_proto_init() { - if File_proxy_loopback_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_loopback_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_loopback_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_loopback_config_proto_goTypes, - DependencyIndexes: file_proxy_loopback_config_proto_depIdxs, - MessageInfos: file_proxy_loopback_config_proto_msgTypes, - }.Build() - File_proxy_loopback_config_proto = out.File - file_proxy_loopback_config_proto_rawDesc = nil - file_proxy_loopback_config_proto_goTypes = nil - file_proxy_loopback_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/shadowsocks/config.pb.go b/xray_api/proto/proxy/shadowsocks/config.pb.go deleted file mode 100644 index a5b32a9..0000000 --- a/xray_api/proto/proxy/shadowsocks/config.pb.go +++ /dev/null @@ -1,395 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/shadowsocks/config.proto - -package shadowsocks - -import ( - net "marzban-node/xray_api/proto/common/net" - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CipherType int32 - -const ( - CipherType_UNKNOWN CipherType = 0 - CipherType_AES_128_GCM CipherType = 5 - CipherType_AES_256_GCM CipherType = 6 - CipherType_CHACHA20_POLY1305 CipherType = 7 - CipherType_XCHACHA20_POLY1305 CipherType = 8 - CipherType_NONE CipherType = 9 -) - -// Enum value maps for CipherType. -var ( - CipherType_name = map[int32]string{ - 0: "UNKNOWN", - 5: "AES_128_GCM", - 6: "AES_256_GCM", - 7: "CHACHA20_POLY1305", - 8: "XCHACHA20_POLY1305", - 9: "NONE", - } - CipherType_value = map[string]int32{ - "UNKNOWN": 0, - "AES_128_GCM": 5, - "AES_256_GCM": 6, - "CHACHA20_POLY1305": 7, - "XCHACHA20_POLY1305": 8, - "NONE": 9, - } -) - -func (x CipherType) Enum() *CipherType { - p := new(CipherType) - *p = x - return p -} - -func (x CipherType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CipherType) Descriptor() protoreflect.EnumDescriptor { - return file_proxy_shadowsocks_config_proto_enumTypes[0].Descriptor() -} - -func (CipherType) Type() protoreflect.EnumType { - return &file_proxy_shadowsocks_config_proto_enumTypes[0] -} - -func (x CipherType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CipherType.Descriptor instead. -func (CipherType) EnumDescriptor() ([]byte, []int) { - return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} -} - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` - CipherType CipherType `protobuf:"varint,2,opt,name=cipher_type,json=cipherType,proto3,enum=xray.proxy.shadowsocks.CipherType" json:"cipher_type,omitempty"` - IvCheck bool `protobuf:"varint,3,opt,name=iv_check,json=ivCheck,proto3" json:"iv_check,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *Account) GetCipherType() CipherType { - if x != nil { - return x.CipherType - } - return CipherType_UNKNOWN -} - -func (x *Account) GetIvCheck() bool { - if x != nil { - return x.IvCheck - } - return false -} - -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Users []*protocol.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - Network []net.Network `protobuf:"varint,2,rep,packed,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{1} -} - -func (x *ServerConfig) GetUsers() []*protocol.User { - if x != nil { - return x.Users - } - return nil -} - -func (x *ServerConfig) GetNetwork() []net.Network { - if x != nil { - return x.Network - } - return nil -} - -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Server []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=server,proto3" json:"server,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{2} -} - -func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { - if x != nil { - return x.Server - } - return nil -} - -var File_proxy_shadowsocks_config_proto protoreflect.FileDescriptor - -var file_proxy_shadowsocks_config_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, - 0x63, 0x6b, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x16, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, - 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x85, 0x01, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x43, 0x0a, 0x0b, 0x63, 0x69, 0x70, - 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, - 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x69, 0x76, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x69, 0x76, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x22, 0x74, 0x0a, 0x0c, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x22, - 0x4c, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x3c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2a, 0x74, 0x0a, - 0x0a, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, - 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, - 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, - 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, - 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, - 0x07, 0x12, 0x16, 0x0a, 0x12, 0x58, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, - 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x08, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, - 0x45, 0x10, 0x09, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, - 0x73, 0x50, 0x01, 0x5a, 0x2b, 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, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, - 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x68, - 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_proxy_shadowsocks_config_proto_rawDescOnce sync.Once - file_proxy_shadowsocks_config_proto_rawDescData = file_proxy_shadowsocks_config_proto_rawDesc -) - -func file_proxy_shadowsocks_config_proto_rawDescGZIP() []byte { - file_proxy_shadowsocks_config_proto_rawDescOnce.Do(func() { - file_proxy_shadowsocks_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_shadowsocks_config_proto_rawDescData) - }) - return file_proxy_shadowsocks_config_proto_rawDescData -} - -var file_proxy_shadowsocks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proxy_shadowsocks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_proxy_shadowsocks_config_proto_goTypes = []interface{}{ - (CipherType)(0), // 0: xray.proxy.shadowsocks.CipherType - (*Account)(nil), // 1: xray.proxy.shadowsocks.Account - (*ServerConfig)(nil), // 2: xray.proxy.shadowsocks.ServerConfig - (*ClientConfig)(nil), // 3: xray.proxy.shadowsocks.ClientConfig - (*protocol.User)(nil), // 4: xray.common.protocol.User - (net.Network)(0), // 5: xray.common.net.Network - (*protocol.ServerEndpoint)(nil), // 6: xray.common.protocol.ServerEndpoint -} -var file_proxy_shadowsocks_config_proto_depIdxs = []int32{ - 0, // 0: xray.proxy.shadowsocks.Account.cipher_type:type_name -> xray.proxy.shadowsocks.CipherType - 4, // 1: xray.proxy.shadowsocks.ServerConfig.users:type_name -> xray.common.protocol.User - 5, // 2: xray.proxy.shadowsocks.ServerConfig.network:type_name -> xray.common.net.Network - 6, // 3: xray.proxy.shadowsocks.ClientConfig.server:type_name -> xray.common.protocol.ServerEndpoint - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_proxy_shadowsocks_config_proto_init() } -func file_proxy_shadowsocks_config_proto_init() { - if File_proxy_shadowsocks_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_shadowsocks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_shadowsocks_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_shadowsocks_config_proto_goTypes, - DependencyIndexes: file_proxy_shadowsocks_config_proto_depIdxs, - EnumInfos: file_proxy_shadowsocks_config_proto_enumTypes, - MessageInfos: file_proxy_shadowsocks_config_proto_msgTypes, - }.Build() - File_proxy_shadowsocks_config_proto = out.File - file_proxy_shadowsocks_config_proto_rawDesc = nil - file_proxy_shadowsocks_config_proto_goTypes = nil - file_proxy_shadowsocks_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/shadowsocks_2022/config.pb.go b/xray_api/proto/proxy/shadowsocks_2022/config.pb.go deleted file mode 100644 index a3021d6..0000000 --- a/xray_api/proto/proxy/shadowsocks_2022/config.pb.go +++ /dev/null @@ -1,691 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/shadowsocks_2022/config.proto - -package shadowsocks_2022 - -import ( - net "marzban-node/xray_api/proto/common/net" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Level int32 `protobuf:"varint,4,opt,name=level,proto3" json:"level,omitempty"` - Network []net.Network `protobuf:"varint,5,rep,packed,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{0} -} - -func (x *ServerConfig) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *ServerConfig) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ServerConfig) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *ServerConfig) GetLevel() int32 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *ServerConfig) GetNetwork() []net.Network { - if x != nil { - return x.Network - } - return nil -} - -type MultiUserServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Users []*User `protobuf:"bytes,3,rep,name=users,proto3" json:"users,omitempty"` - Network []net.Network `protobuf:"varint,4,rep,packed,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` -} - -func (x *MultiUserServerConfig) Reset() { - *x = MultiUserServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MultiUserServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiUserServerConfig) ProtoMessage() {} - -func (x *MultiUserServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MultiUserServerConfig.ProtoReflect.Descriptor instead. -func (*MultiUserServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{1} -} - -func (x *MultiUserServerConfig) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *MultiUserServerConfig) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *MultiUserServerConfig) GetUsers() []*User { - if x != nil { - return x.Users - } - return nil -} - -func (x *MultiUserServerConfig) GetNetwork() []net.Network { - if x != nil { - return x.Network - } - return nil -} - -type RelayDestination struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Address *net.IPOrDomain `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` - Level int32 `protobuf:"varint,5,opt,name=level,proto3" json:"level,omitempty"` -} - -func (x *RelayDestination) Reset() { - *x = RelayDestination{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RelayDestination) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RelayDestination) ProtoMessage() {} - -func (x *RelayDestination) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RelayDestination.ProtoReflect.Descriptor instead. -func (*RelayDestination) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{2} -} - -func (x *RelayDestination) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *RelayDestination) GetAddress() *net.IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *RelayDestination) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *RelayDestination) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *RelayDestination) GetLevel() int32 { - if x != nil { - return x.Level - } - return 0 -} - -type RelayServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Destinations []*RelayDestination `protobuf:"bytes,3,rep,name=destinations,proto3" json:"destinations,omitempty"` - Network []net.Network `protobuf:"varint,4,rep,packed,name=network,proto3,enum=xray.common.net.Network" json:"network,omitempty"` -} - -func (x *RelayServerConfig) Reset() { - *x = RelayServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RelayServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RelayServerConfig) ProtoMessage() {} - -func (x *RelayServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RelayServerConfig.ProtoReflect.Descriptor instead. -func (*RelayServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{3} -} - -func (x *RelayServerConfig) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *RelayServerConfig) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *RelayServerConfig) GetDestinations() []*RelayDestination { - if x != nil { - return x.Destinations - } - return nil -} - -func (x *RelayServerConfig) GetNetwork() []net.Network { - if x != nil { - return x.Network - } - return nil -} - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - Level int32 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{4} -} - -func (x *User) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *User) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *User) GetLevel() int32 { - if x != nil { - return x.Level - } - return 0 -} - -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Address *net.IPOrDomain `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` - Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` - Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` - UdpOverTcp bool `protobuf:"varint,5,opt,name=udp_over_tcp,json=udpOverTcp,proto3" json:"udp_over_tcp,omitempty"` - UdpOverTcpVersion uint32 `protobuf:"varint,6,opt,name=udp_over_tcp_version,json=udpOverTcpVersion,proto3" json:"udp_over_tcp_version,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_shadowsocks_2022_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_proxy_shadowsocks_2022_config_proto_rawDescGZIP(), []int{5} -} - -func (x *ClientConfig) GetAddress() *net.IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *ClientConfig) GetPort() uint32 { - if x != nil { - return x.Port - } - return 0 -} - -func (x *ClientConfig) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *ClientConfig) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *ClientConfig) GetUdpOverTcp() bool { - if x != nil { - return x.UdpOverTcp - } - return false -} - -func (x *ClientConfig) GetUdpOverTcpVersion() uint32 { - if x != nil { - return x.UdpOverTcpVersion - } - return 0 -} - -var File_proxy_shadowsocks_2022_config_proto protoreflect.FileDescriptor - -var file_proxy_shadowsocks_2022_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, - 0x63, 0x6b, 0x73, 0x5f, 0x32, 0x30, 0x32, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x32, 0x30, - 0x32, 0x32, 0x1a, 0x18, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x32, 0x0a, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, - 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x22, 0xae, 0x01, 0x0a, 0x15, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x6d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x37, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x32, 0x30, - 0x32, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x32, - 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x18, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, - 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x22, 0x9b, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x44, 0x65, 0x73, 0x74, - 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x07, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, - 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x70, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x22, 0xc4, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x51, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x5f, - 0x32, 0x30, 0x32, 0x32, 0x2e, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, - 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x22, 0x44, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xd6, 0x01, - 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x35, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, - 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0c, 0x75, 0x64, 0x70, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x5f, - 0x74, 0x63, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x75, 0x64, 0x70, 0x4f, 0x76, - 0x65, 0x72, 0x54, 0x63, 0x70, 0x12, 0x2f, 0x0a, 0x14, 0x75, 0x64, 0x70, 0x5f, 0x6f, 0x76, 0x65, - 0x72, 0x5f, 0x74, 0x63, 0x70, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x11, 0x75, 0x64, 0x70, 0x4f, 0x76, 0x65, 0x72, 0x54, 0x63, 0x70, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x72, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, - 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x32, 0x30, 0x32, 0x32, 0x50, 0x01, 0x5a, 0x30, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, - 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x32, 0x30, 0x32, 0x32, 0xaa, 0x02, 0x1a, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, - 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x32, 0x30, 0x32, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_proxy_shadowsocks_2022_config_proto_rawDescOnce sync.Once - file_proxy_shadowsocks_2022_config_proto_rawDescData = file_proxy_shadowsocks_2022_config_proto_rawDesc -) - -func file_proxy_shadowsocks_2022_config_proto_rawDescGZIP() []byte { - file_proxy_shadowsocks_2022_config_proto_rawDescOnce.Do(func() { - file_proxy_shadowsocks_2022_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_shadowsocks_2022_config_proto_rawDescData) - }) - return file_proxy_shadowsocks_2022_config_proto_rawDescData -} - -var file_proxy_shadowsocks_2022_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_proxy_shadowsocks_2022_config_proto_goTypes = []interface{}{ - (*ServerConfig)(nil), // 0: xray.proxy.shadowsocks_2022.ServerConfig - (*MultiUserServerConfig)(nil), // 1: xray.proxy.shadowsocks_2022.MultiUserServerConfig - (*RelayDestination)(nil), // 2: xray.proxy.shadowsocks_2022.RelayDestination - (*RelayServerConfig)(nil), // 3: xray.proxy.shadowsocks_2022.RelayServerConfig - (*User)(nil), // 4: xray.proxy.shadowsocks_2022.User - (*ClientConfig)(nil), // 5: xray.proxy.shadowsocks_2022.ClientConfig - (net.Network)(0), // 6: xray.common.net.Network - (*net.IPOrDomain)(nil), // 7: xray.common.net.IPOrDomain -} -var file_proxy_shadowsocks_2022_config_proto_depIdxs = []int32{ - 6, // 0: xray.proxy.shadowsocks_2022.ServerConfig.network:type_name -> xray.common.net.Network - 4, // 1: xray.proxy.shadowsocks_2022.MultiUserServerConfig.users:type_name -> xray.proxy.shadowsocks_2022.User - 6, // 2: xray.proxy.shadowsocks_2022.MultiUserServerConfig.network:type_name -> xray.common.net.Network - 7, // 3: xray.proxy.shadowsocks_2022.RelayDestination.address:type_name -> xray.common.net.IPOrDomain - 2, // 4: xray.proxy.shadowsocks_2022.RelayServerConfig.destinations:type_name -> xray.proxy.shadowsocks_2022.RelayDestination - 6, // 5: xray.proxy.shadowsocks_2022.RelayServerConfig.network:type_name -> xray.common.net.Network - 7, // 6: xray.proxy.shadowsocks_2022.ClientConfig.address:type_name -> xray.common.net.IPOrDomain - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_proxy_shadowsocks_2022_config_proto_init() } -func file_proxy_shadowsocks_2022_config_proto_init() { - if File_proxy_shadowsocks_2022_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_shadowsocks_2022_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_2022_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MultiUserServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_2022_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RelayDestination); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_2022_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RelayServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_2022_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_shadowsocks_2022_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_shadowsocks_2022_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_shadowsocks_2022_config_proto_goTypes, - DependencyIndexes: file_proxy_shadowsocks_2022_config_proto_depIdxs, - MessageInfos: file_proxy_shadowsocks_2022_config_proto_msgTypes, - }.Build() - File_proxy_shadowsocks_2022_config_proto = out.File - file_proxy_shadowsocks_2022_config_proto_rawDesc = nil - file_proxy_shadowsocks_2022_config_proto_goTypes = nil - file_proxy_shadowsocks_2022_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/socks/config.pb.go b/xray_api/proto/proxy/socks/config.pb.go deleted file mode 100644 index b8c62a9..0000000 --- a/xray_api/proto/proxy/socks/config.pb.go +++ /dev/null @@ -1,483 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/socks/config.proto - -package socks - -import ( - net "marzban-node/xray_api/proto/common/net" - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// AuthType is the authentication type of Socks proxy. -type AuthType int32 - -const ( - // NO_AUTH is for anounymous authentication. - AuthType_NO_AUTH AuthType = 0 - // PASSWORD is for username/password authentication. - AuthType_PASSWORD AuthType = 1 -) - -// Enum value maps for AuthType. -var ( - AuthType_name = map[int32]string{ - 0: "NO_AUTH", - 1: "PASSWORD", - } - AuthType_value = map[string]int32{ - "NO_AUTH": 0, - "PASSWORD": 1, - } -) - -func (x AuthType) Enum() *AuthType { - p := new(AuthType) - *p = x - return p -} - -func (x AuthType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AuthType) Descriptor() protoreflect.EnumDescriptor { - return file_proxy_socks_config_proto_enumTypes[0].Descriptor() -} - -func (AuthType) Type() protoreflect.EnumType { - return &file_proxy_socks_config_proto_enumTypes[0] -} - -func (x AuthType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AuthType.Descriptor instead. -func (AuthType) EnumDescriptor() ([]byte, []int) { - return file_proxy_socks_config_proto_rawDescGZIP(), []int{0} -} - -type Version int32 - -const ( - Version_SOCKS5 Version = 0 - Version_SOCKS4 Version = 1 - Version_SOCKS4A Version = 2 -) - -// Enum value maps for Version. -var ( - Version_name = map[int32]string{ - 0: "SOCKS5", - 1: "SOCKS4", - 2: "SOCKS4A", - } - Version_value = map[string]int32{ - "SOCKS5": 0, - "SOCKS4": 1, - "SOCKS4A": 2, - } -) - -func (x Version) Enum() *Version { - p := new(Version) - *p = x - return p -} - -func (x Version) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Version) Descriptor() protoreflect.EnumDescriptor { - return file_proxy_socks_config_proto_enumTypes[1].Descriptor() -} - -func (Version) Type() protoreflect.EnumType { - return &file_proxy_socks_config_proto_enumTypes[1] -} - -func (x Version) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Version.Descriptor instead. -func (Version) EnumDescriptor() ([]byte, []int) { - return file_proxy_socks_config_proto_rawDescGZIP(), []int{1} -} - -// Account represents a Socks account. -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_socks_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_socks_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_socks_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *Account) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// ServerConfig is the protobuf config for Socks server. -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AuthType AuthType `protobuf:"varint,1,opt,name=auth_type,json=authType,proto3,enum=xray.proxy.socks.AuthType" json:"auth_type,omitempty"` - Accounts map[string]string `protobuf:"bytes,2,rep,name=accounts,proto3" json:"accounts,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Address *net.IPOrDomain `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` - UdpEnabled bool `protobuf:"varint,4,opt,name=udp_enabled,json=udpEnabled,proto3" json:"udp_enabled,omitempty"` - // Deprecated: Marked as deprecated in proxy/socks/config.proto. - Timeout uint32 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"` - UserLevel uint32 `protobuf:"varint,6,opt,name=user_level,json=userLevel,proto3" json:"user_level,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_socks_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_socks_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_socks_config_proto_rawDescGZIP(), []int{1} -} - -func (x *ServerConfig) GetAuthType() AuthType { - if x != nil { - return x.AuthType - } - return AuthType_NO_AUTH -} - -func (x *ServerConfig) GetAccounts() map[string]string { - if x != nil { - return x.Accounts - } - return nil -} - -func (x *ServerConfig) GetAddress() *net.IPOrDomain { - if x != nil { - return x.Address - } - return nil -} - -func (x *ServerConfig) GetUdpEnabled() bool { - if x != nil { - return x.UdpEnabled - } - return false -} - -// Deprecated: Marked as deprecated in proxy/socks/config.proto. -func (x *ServerConfig) GetTimeout() uint32 { - if x != nil { - return x.Timeout - } - return 0 -} - -func (x *ServerConfig) GetUserLevel() uint32 { - if x != nil { - return x.UserLevel - } - return 0 -} - -// ClientConfig is the protobuf config for Socks client. -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Sever is a list of Socks server addresses. - Server []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=server,proto3" json:"server,omitempty"` - Version Version `protobuf:"varint,2,opt,name=version,proto3,enum=xray.proxy.socks.Version" json:"version,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_socks_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_socks_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_proxy_socks_config_proto_rawDescGZIP(), []int{2} -} - -func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { - if x != nil { - return x.Server - } - return nil -} - -func (x *ClientConfig) GetVersion() Version { - if x != nil { - return x.Version - } - return Version_SOCKS5 -} - -var File_proxy_socks_config_proto protoreflect.FileDescriptor - -var file_proxy_socks_config_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x18, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, - 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41, 0x0a, 0x07, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xe3, 0x02, 0x0a, - 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, - 0x63, 0x6b, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x61, 0x75, - 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x12, 0x35, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x64, 0x70, 0x5f, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x75, 0x64, - 0x70, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, - 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x1a, 0x3b, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x81, 0x01, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x33, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x25, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x10, 0x00, 0x12, - 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x53, 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x2a, 0x2e, 0x0a, - 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x4f, 0x43, 0x4b, - 0x53, 0x35, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x4f, 0x43, 0x4b, 0x53, 0x34, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x4f, 0x43, 0x4b, 0x53, 0x34, 0x41, 0x10, 0x02, 0x42, 0x52, 0x0a, - 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x25, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, - 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_socks_config_proto_rawDescOnce sync.Once - file_proxy_socks_config_proto_rawDescData = file_proxy_socks_config_proto_rawDesc -) - -func file_proxy_socks_config_proto_rawDescGZIP() []byte { - file_proxy_socks_config_proto_rawDescOnce.Do(func() { - file_proxy_socks_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_socks_config_proto_rawDescData) - }) - return file_proxy_socks_config_proto_rawDescData -} - -var file_proxy_socks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_proxy_socks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_proxy_socks_config_proto_goTypes = []interface{}{ - (AuthType)(0), // 0: xray.proxy.socks.AuthType - (Version)(0), // 1: xray.proxy.socks.Version - (*Account)(nil), // 2: xray.proxy.socks.Account - (*ServerConfig)(nil), // 3: xray.proxy.socks.ServerConfig - (*ClientConfig)(nil), // 4: xray.proxy.socks.ClientConfig - nil, // 5: xray.proxy.socks.ServerConfig.AccountsEntry - (*net.IPOrDomain)(nil), // 6: xray.common.net.IPOrDomain - (*protocol.ServerEndpoint)(nil), // 7: xray.common.protocol.ServerEndpoint -} -var file_proxy_socks_config_proto_depIdxs = []int32{ - 0, // 0: xray.proxy.socks.ServerConfig.auth_type:type_name -> xray.proxy.socks.AuthType - 5, // 1: xray.proxy.socks.ServerConfig.accounts:type_name -> xray.proxy.socks.ServerConfig.AccountsEntry - 6, // 2: xray.proxy.socks.ServerConfig.address:type_name -> xray.common.net.IPOrDomain - 7, // 3: xray.proxy.socks.ClientConfig.server:type_name -> xray.common.protocol.ServerEndpoint - 1, // 4: xray.proxy.socks.ClientConfig.version:type_name -> xray.proxy.socks.Version - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_proxy_socks_config_proto_init() } -func file_proxy_socks_config_proto_init() { - if File_proxy_socks_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_socks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_socks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_socks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_socks_config_proto_rawDesc, - NumEnums: 2, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_socks_config_proto_goTypes, - DependencyIndexes: file_proxy_socks_config_proto_depIdxs, - EnumInfos: file_proxy_socks_config_proto_enumTypes, - MessageInfos: file_proxy_socks_config_proto_msgTypes, - }.Build() - File_proxy_socks_config_proto = out.File - file_proxy_socks_config_proto_rawDesc = nil - file_proxy_socks_config_proto_goTypes = nil - file_proxy_socks_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/trojan/config.pb.go b/xray_api/proto/proxy/trojan/config.pb.go deleted file mode 100644 index 1e0c3bb..0000000 --- a/xray_api/proto/proxy/trojan/config.pb.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/trojan/config.proto - -package trojan - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_trojan_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_trojan_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_trojan_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type Fallback struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Alpn string `protobuf:"bytes,2,opt,name=alpn,proto3" json:"alpn,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Dest string `protobuf:"bytes,5,opt,name=dest,proto3" json:"dest,omitempty"` - Xver uint64 `protobuf:"varint,6,opt,name=xver,proto3" json:"xver,omitempty"` -} - -func (x *Fallback) Reset() { - *x = Fallback{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_trojan_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Fallback) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Fallback) ProtoMessage() {} - -func (x *Fallback) ProtoReflect() protoreflect.Message { - mi := &file_proxy_trojan_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Fallback.ProtoReflect.Descriptor instead. -func (*Fallback) Descriptor() ([]byte, []int) { - return file_proxy_trojan_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Fallback) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Fallback) GetAlpn() string { - if x != nil { - return x.Alpn - } - return "" -} - -func (x *Fallback) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Fallback) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Fallback) GetDest() string { - if x != nil { - return x.Dest - } - return "" -} - -func (x *Fallback) GetXver() uint64 { - if x != nil { - return x.Xver - } - return 0 -} - -type ClientConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Server []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=server,proto3" json:"server,omitempty"` -} - -func (x *ClientConfig) Reset() { - *x = ClientConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_trojan_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ClientConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientConfig) ProtoMessage() {} - -func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_trojan_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. -func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_proxy_trojan_config_proto_rawDescGZIP(), []int{2} -} - -func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { - if x != nil { - return x.Server - } - return nil -} - -type ServerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Users []*protocol.User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - Fallbacks []*Fallback `protobuf:"bytes,2,rep,name=fallbacks,proto3" json:"fallbacks,omitempty"` -} - -func (x *ServerConfig) Reset() { - *x = ServerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_trojan_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerConfig) ProtoMessage() {} - -func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_trojan_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. -func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_proxy_trojan_config_proto_rawDescGZIP(), []int{3} -} - -func (x *ServerConfig) GetUsers() []*protocol.User { - if x != nil { - return x.Users - } - return nil -} - -func (x *ServerConfig) GetFallbacks() []*Fallback { - if x != nil { - return x.Fallbacks - } - return nil -} - -var File_proxy_trojan_config_proto protoreflect.FileDescriptor - -var file_proxy_trojan_config_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x1a, 0x1a, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x25, 0x0a, - 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x76, 0x65, 0x72, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x04, 0x78, 0x76, 0x65, 0x72, 0x22, 0x4c, 0x0a, 0x0c, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x7b, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x30, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x66, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, - 0x2e, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, - 0x61, 0x63, 0x6b, 0x73, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, - 0x26, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2f, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_trojan_config_proto_rawDescOnce sync.Once - file_proxy_trojan_config_proto_rawDescData = file_proxy_trojan_config_proto_rawDesc -) - -func file_proxy_trojan_config_proto_rawDescGZIP() []byte { - file_proxy_trojan_config_proto_rawDescOnce.Do(func() { - file_proxy_trojan_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_trojan_config_proto_rawDescData) - }) - return file_proxy_trojan_config_proto_rawDescData -} - -var file_proxy_trojan_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_proxy_trojan_config_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: xray.proxy.trojan.Account - (*Fallback)(nil), // 1: xray.proxy.trojan.Fallback - (*ClientConfig)(nil), // 2: xray.proxy.trojan.ClientConfig - (*ServerConfig)(nil), // 3: xray.proxy.trojan.ServerConfig - (*protocol.ServerEndpoint)(nil), // 4: xray.common.protocol.ServerEndpoint - (*protocol.User)(nil), // 5: xray.common.protocol.User -} -var file_proxy_trojan_config_proto_depIdxs = []int32{ - 4, // 0: xray.proxy.trojan.ClientConfig.server:type_name -> xray.common.protocol.ServerEndpoint - 5, // 1: xray.proxy.trojan.ServerConfig.users:type_name -> xray.common.protocol.User - 1, // 2: xray.proxy.trojan.ServerConfig.fallbacks:type_name -> xray.proxy.trojan.Fallback - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_proxy_trojan_config_proto_init() } -func file_proxy_trojan_config_proto_init() { - if File_proxy_trojan_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_trojan_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_trojan_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Fallback); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_trojan_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_trojan_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_trojan_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_trojan_config_proto_goTypes, - DependencyIndexes: file_proxy_trojan_config_proto_depIdxs, - MessageInfos: file_proxy_trojan_config_proto_msgTypes, - }.Build() - File_proxy_trojan_config_proto = out.File - file_proxy_trojan_config_proto_rawDesc = nil - file_proxy_trojan_config_proto_goTypes = nil - file_proxy_trojan_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vless/account.pb.go b/xray_api/proto/proxy/vless/account.pb.go deleted file mode 100644 index 24564a3..0000000 --- a/xray_api/proto/proxy/vless/account.pb.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vless/account.proto - -package vless - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Flow settings. May be "xtls-rprx-vision". - Flow string `protobuf:"bytes,2,opt,name=flow,proto3" json:"flow,omitempty"` - // Encryption settings. Only applies to client side, and only accepts "none" for now. - Encryption string `protobuf:"bytes,3,opt,name=encryption,proto3" json:"encryption,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vless_account_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vless_account_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_vless_account_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Account) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Account) GetEncryption() string { - if x != nil { - return x.Encryption - } - return "" -} - -var File_proxy_vless_account_proto protoreflect.FileDescriptor - -var file_proxy_vless_account_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x22, 0x4d, 0x0a, - 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1e, 0x0a, 0x0a, - 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x52, 0x0a, 0x14, - 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x10, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vless_account_proto_rawDescOnce sync.Once - file_proxy_vless_account_proto_rawDescData = file_proxy_vless_account_proto_rawDesc -) - -func file_proxy_vless_account_proto_rawDescGZIP() []byte { - file_proxy_vless_account_proto_rawDescOnce.Do(func() { - file_proxy_vless_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vless_account_proto_rawDescData) - }) - return file_proxy_vless_account_proto_rawDescData -} - -var file_proxy_vless_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_vless_account_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: xray.proxy.vless.Account -} -var file_proxy_vless_account_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_proxy_vless_account_proto_init() } -func file_proxy_vless_account_proto_init() { - if File_proxy_vless_account_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vless_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vless_account_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vless_account_proto_goTypes, - DependencyIndexes: file_proxy_vless_account_proto_depIdxs, - MessageInfos: file_proxy_vless_account_proto_msgTypes, - }.Build() - File_proxy_vless_account_proto = out.File - file_proxy_vless_account_proto_rawDesc = nil - file_proxy_vless_account_proto_goTypes = nil - file_proxy_vless_account_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vless/encoding/addons.pb.go b/xray_api/proto/proxy/vless/encoding/addons.pb.go deleted file mode 100644 index c876d54..0000000 --- a/xray_api/proto/proxy/vless/encoding/addons.pb.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vless/encoding/addons.proto - -package encoding - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Addons struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Flow string `protobuf:"bytes,1,opt,name=Flow,proto3" json:"Flow,omitempty"` - Seed []byte `protobuf:"bytes,2,opt,name=Seed,proto3" json:"Seed,omitempty"` -} - -func (x *Addons) Reset() { - *x = Addons{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vless_encoding_addons_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Addons) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Addons) ProtoMessage() {} - -func (x *Addons) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vless_encoding_addons_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Addons.ProtoReflect.Descriptor instead. -func (*Addons) Descriptor() ([]byte, []int) { - return file_proxy_vless_encoding_addons_proto_rawDescGZIP(), []int{0} -} - -func (x *Addons) GetFlow() string { - if x != nil { - return x.Flow - } - return "" -} - -func (x *Addons) GetSeed() []byte { - if x != nil { - return x.Seed - } - return nil -} - -var File_proxy_vless_encoding_addons_proto protoreflect.FileDescriptor - -var file_proxy_vless_encoding_addons_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2f, 0x61, 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x30, - 0x0a, 0x06, 0x41, 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x6c, 0x6f, 0x77, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, - 0x53, 0x65, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x53, 0x65, 0x65, 0x64, - 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, - 0x67, 0x50, 0x01, 0x5a, 0x2e, 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, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x69, 0x6e, 0x67, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vless_encoding_addons_proto_rawDescOnce sync.Once - file_proxy_vless_encoding_addons_proto_rawDescData = file_proxy_vless_encoding_addons_proto_rawDesc -) - -func file_proxy_vless_encoding_addons_proto_rawDescGZIP() []byte { - file_proxy_vless_encoding_addons_proto_rawDescOnce.Do(func() { - file_proxy_vless_encoding_addons_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vless_encoding_addons_proto_rawDescData) - }) - return file_proxy_vless_encoding_addons_proto_rawDescData -} - -var file_proxy_vless_encoding_addons_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_vless_encoding_addons_proto_goTypes = []interface{}{ - (*Addons)(nil), // 0: xray.proxy.vless.encoding.Addons -} -var file_proxy_vless_encoding_addons_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_proxy_vless_encoding_addons_proto_init() } -func file_proxy_vless_encoding_addons_proto_init() { - if File_proxy_vless_encoding_addons_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vless_encoding_addons_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Addons); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vless_encoding_addons_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vless_encoding_addons_proto_goTypes, - DependencyIndexes: file_proxy_vless_encoding_addons_proto_depIdxs, - MessageInfos: file_proxy_vless_encoding_addons_proto_msgTypes, - }.Build() - File_proxy_vless_encoding_addons_proto = out.File - file_proxy_vless_encoding_addons_proto_rawDesc = nil - file_proxy_vless_encoding_addons_proto_goTypes = nil - file_proxy_vless_encoding_addons_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vless/inbound/config.pb.go b/xray_api/proto/proxy/vless/inbound/config.pb.go deleted file mode 100644 index 20f30b5..0000000 --- a/xray_api/proto/proxy/vless/inbound/config.pb.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vless/inbound/config.proto - -package inbound - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Fallback struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Alpn string `protobuf:"bytes,2,opt,name=alpn,proto3" json:"alpn,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` - Dest string `protobuf:"bytes,5,opt,name=dest,proto3" json:"dest,omitempty"` - Xver uint64 `protobuf:"varint,6,opt,name=xver,proto3" json:"xver,omitempty"` -} - -func (x *Fallback) Reset() { - *x = Fallback{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vless_inbound_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Fallback) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Fallback) ProtoMessage() {} - -func (x *Fallback) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vless_inbound_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Fallback.ProtoReflect.Descriptor instead. -func (*Fallback) Descriptor() ([]byte, []int) { - return file_proxy_vless_inbound_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Fallback) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Fallback) GetAlpn() string { - if x != nil { - return x.Alpn - } - return "" -} - -func (x *Fallback) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Fallback) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Fallback) GetDest() string { - if x != nil { - return x.Dest - } - return "" -} - -func (x *Fallback) GetXver() uint64 { - if x != nil { - return x.Xver - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Clients []*protocol.User `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` - // Decryption settings. Only applies to server side, and only accepts "none" - // for now. - Decryption string `protobuf:"bytes,2,opt,name=decryption,proto3" json:"decryption,omitempty"` - Fallbacks []*Fallback `protobuf:"bytes,3,rep,name=fallbacks,proto3" json:"fallbacks,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vless_inbound_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vless_inbound_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_vless_inbound_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Config) GetClients() []*protocol.User { - if x != nil { - return x.Clients - } - return nil -} - -func (x *Config) GetDecryption() string { - if x != nil { - return x.Decryption - } - return "" -} - -func (x *Config) GetFallbacks() []*Fallback { - if x != nil { - return x.Fallbacks - } - return nil -} - -var File_proxy_vless_inbound_config_proto protoreflect.FileDescriptor - -var file_proxy_vless_inbound_config_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x18, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x1a, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x46, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x6c, 0x70, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x76, 0x65, - 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x78, 0x76, 0x65, 0x72, 0x22, 0xa0, 0x01, - 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1e, - 0x0a, 0x0a, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, - 0x0a, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x46, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, - 0x42, 0x6a, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x50, 0x01, 0x5a, 0x2d, 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, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0xaa, 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, - 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vless_inbound_config_proto_rawDescOnce sync.Once - file_proxy_vless_inbound_config_proto_rawDescData = file_proxy_vless_inbound_config_proto_rawDesc -) - -func file_proxy_vless_inbound_config_proto_rawDescGZIP() []byte { - file_proxy_vless_inbound_config_proto_rawDescOnce.Do(func() { - file_proxy_vless_inbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vless_inbound_config_proto_rawDescData) - }) - return file_proxy_vless_inbound_config_proto_rawDescData -} - -var file_proxy_vless_inbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_proxy_vless_inbound_config_proto_goTypes = []interface{}{ - (*Fallback)(nil), // 0: xray.proxy.vless.inbound.Fallback - (*Config)(nil), // 1: xray.proxy.vless.inbound.Config - (*protocol.User)(nil), // 2: xray.common.protocol.User -} -var file_proxy_vless_inbound_config_proto_depIdxs = []int32{ - 2, // 0: xray.proxy.vless.inbound.Config.clients:type_name -> xray.common.protocol.User - 0, // 1: xray.proxy.vless.inbound.Config.fallbacks:type_name -> xray.proxy.vless.inbound.Fallback - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_proxy_vless_inbound_config_proto_init() } -func file_proxy_vless_inbound_config_proto_init() { - if File_proxy_vless_inbound_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vless_inbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Fallback); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_vless_inbound_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vless_inbound_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vless_inbound_config_proto_goTypes, - DependencyIndexes: file_proxy_vless_inbound_config_proto_depIdxs, - MessageInfos: file_proxy_vless_inbound_config_proto_msgTypes, - }.Build() - File_proxy_vless_inbound_config_proto = out.File - file_proxy_vless_inbound_config_proto_rawDesc = nil - file_proxy_vless_inbound_config_proto_goTypes = nil - file_proxy_vless_inbound_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vless/outbound/config.pb.go b/xray_api/proto/proxy/vless/outbound/config.pb.go deleted file mode 100644 index 9e9b485..0000000 --- a/xray_api/proto/proxy/vless/outbound/config.pb.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vless/outbound/config.proto - -package outbound - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Vnext []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=vnext,proto3" json:"vnext,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vless_outbound_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vless_outbound_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_vless_outbound_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetVnext() []*protocol.ServerEndpoint { - if x != nil { - return x.Vnext - } - return nil -} - -var File_proxy_vless_outbound_config_proto protoreflect.FileDescriptor - -var file_proxy_vless_outbound_config_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x21, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x44, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x05, 0x76, - 0x6e, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, - 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vless_outbound_config_proto_rawDescOnce sync.Once - file_proxy_vless_outbound_config_proto_rawDescData = file_proxy_vless_outbound_config_proto_rawDesc -) - -func file_proxy_vless_outbound_config_proto_rawDescGZIP() []byte { - file_proxy_vless_outbound_config_proto_rawDescOnce.Do(func() { - file_proxy_vless_outbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vless_outbound_config_proto_rawDescData) - }) - return file_proxy_vless_outbound_config_proto_rawDescData -} - -var file_proxy_vless_outbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_vless_outbound_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.proxy.vless.outbound.Config - (*protocol.ServerEndpoint)(nil), // 1: xray.common.protocol.ServerEndpoint -} -var file_proxy_vless_outbound_config_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.vless.outbound.Config.vnext:type_name -> xray.common.protocol.ServerEndpoint - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proxy_vless_outbound_config_proto_init() } -func file_proxy_vless_outbound_config_proto_init() { - if File_proxy_vless_outbound_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vless_outbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vless_outbound_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vless_outbound_config_proto_goTypes, - DependencyIndexes: file_proxy_vless_outbound_config_proto_depIdxs, - MessageInfos: file_proxy_vless_outbound_config_proto_msgTypes, - }.Build() - File_proxy_vless_outbound_config_proto = out.File - file_proxy_vless_outbound_config_proto_rawDesc = nil - file_proxy_vless_outbound_config_proto_goTypes = nil - file_proxy_vless_outbound_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vmess/account.pb.go b/xray_api/proto/proxy/vmess/account.pb.go deleted file mode 100644 index cc561fc..0000000 --- a/xray_api/proto/proxy/vmess/account.pb.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vmess/account.proto - -package vmess - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Account struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the account, in the form of a UUID, e.g., - // "66ad4540-b58c-4ad2-9926-ea63445a9b57". - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Security settings. Only applies to client side. - SecuritySettings *protocol.SecurityConfig `protobuf:"bytes,3,opt,name=security_settings,json=securitySettings,proto3" json:"security_settings,omitempty"` - // Define tests enabled for this account - TestsEnabled string `protobuf:"bytes,4,opt,name=tests_enabled,json=testsEnabled,proto3" json:"tests_enabled,omitempty"` -} - -func (x *Account) Reset() { - *x = Account{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vmess_account_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Account) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Account) ProtoMessage() {} - -func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vmess_account_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Account.ProtoReflect.Descriptor instead. -func (*Account) Descriptor() ([]byte, []int) { - return file_proxy_vmess_account_proto_rawDescGZIP(), []int{0} -} - -func (x *Account) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Account) GetSecuritySettings() *protocol.SecurityConfig { - if x != nil { - return x.SecuritySettings - } - return nil -} - -func (x *Account) GetTestsEnabled() string { - if x != nil { - return x.TestsEnabled - } - return "" -} - -var File_proxy_vmess_account_proto protoreflect.FileDescriptor - -var file_proxy_vmess_account_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x1a, 0x1d, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, - 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x51, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, - 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x74, - 0x65, 0x73, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, - 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, - 0x6d, 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vmess_account_proto_rawDescOnce sync.Once - file_proxy_vmess_account_proto_rawDescData = file_proxy_vmess_account_proto_rawDesc -) - -func file_proxy_vmess_account_proto_rawDescGZIP() []byte { - file_proxy_vmess_account_proto_rawDescOnce.Do(func() { - file_proxy_vmess_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vmess_account_proto_rawDescData) - }) - return file_proxy_vmess_account_proto_rawDescData -} - -var file_proxy_vmess_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_vmess_account_proto_goTypes = []interface{}{ - (*Account)(nil), // 0: xray.proxy.vmess.Account - (*protocol.SecurityConfig)(nil), // 1: xray.common.protocol.SecurityConfig -} -var file_proxy_vmess_account_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.vmess.Account.security_settings:type_name -> xray.common.protocol.SecurityConfig - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proxy_vmess_account_proto_init() } -func file_proxy_vmess_account_proto_init() { - if File_proxy_vmess_account_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vmess_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Account); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vmess_account_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vmess_account_proto_goTypes, - DependencyIndexes: file_proxy_vmess_account_proto_depIdxs, - MessageInfos: file_proxy_vmess_account_proto_msgTypes, - }.Build() - File_proxy_vmess_account_proto = out.File - file_proxy_vmess_account_proto_rawDesc = nil - file_proxy_vmess_account_proto_goTypes = nil - file_proxy_vmess_account_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vmess/inbound/config.pb.go b/xray_api/proto/proxy/vmess/inbound/config.pb.go deleted file mode 100644 index f813bcf..0000000 --- a/xray_api/proto/proxy/vmess/inbound/config.pb.go +++ /dev/null @@ -1,307 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vmess/inbound/config.proto - -package inbound - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DetourConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *DetourConfig) Reset() { - *x = DetourConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DetourConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DetourConfig) ProtoMessage() {} - -func (x *DetourConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DetourConfig.ProtoReflect.Descriptor instead. -func (*DetourConfig) Descriptor() ([]byte, []int) { - return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{0} -} - -func (x *DetourConfig) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -type DefaultConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Level uint32 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` -} - -func (x *DefaultConfig) Reset() { - *x = DefaultConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DefaultConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DefaultConfig) ProtoMessage() {} - -func (x *DefaultConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DefaultConfig.ProtoReflect.Descriptor instead. -func (*DefaultConfig) Descriptor() ([]byte, []int) { - return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{1} -} - -func (x *DefaultConfig) GetLevel() uint32 { - if x != nil { - return x.Level - } - return 0 -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User []*protocol.User `protobuf:"bytes,1,rep,name=user,proto3" json:"user,omitempty"` - Default *DefaultConfig `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"` - Detour *DetourConfig `protobuf:"bytes,3,opt,name=detour,proto3" json:"detour,omitempty"` // 4 is for legacy setting -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vmess_inbound_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{2} -} - -func (x *Config) GetUser() []*protocol.User { - if x != nil { - return x.User - } - return nil -} - -func (x *Config) GetDefault() *DefaultConfig { - if x != nil { - return x.Default - } - return nil -} - -func (x *Config) GetDetour() *DetourConfig { - if x != nil { - return x.Detour - } - return nil -} - -var File_proxy_vmess_inbound_config_proto protoreflect.FileDescriptor - -var file_proxy_vmess_inbound_config_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x18, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x1a, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x0c, 0x44, 0x65, 0x74, 0x6f, - 0x75, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0x25, 0x0a, 0x0d, 0x44, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, - 0xbb, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x04, 0x75, 0x73, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x07, 0x64, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, - 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x3e, 0x0a, - 0x06, 0x64, 0x65, 0x74, 0x6f, 0x75, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, - 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x44, 0x65, 0x74, 0x6f, 0x75, 0x72, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x64, 0x65, 0x74, 0x6f, 0x75, 0x72, 0x42, 0x6a, 0x0a, - 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, - 0x2d, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, - 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, 0x73, - 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_proxy_vmess_inbound_config_proto_rawDescOnce sync.Once - file_proxy_vmess_inbound_config_proto_rawDescData = file_proxy_vmess_inbound_config_proto_rawDesc -) - -func file_proxy_vmess_inbound_config_proto_rawDescGZIP() []byte { - file_proxy_vmess_inbound_config_proto_rawDescOnce.Do(func() { - file_proxy_vmess_inbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vmess_inbound_config_proto_rawDescData) - }) - return file_proxy_vmess_inbound_config_proto_rawDescData -} - -var file_proxy_vmess_inbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_proxy_vmess_inbound_config_proto_goTypes = []interface{}{ - (*DetourConfig)(nil), // 0: xray.proxy.vmess.inbound.DetourConfig - (*DefaultConfig)(nil), // 1: xray.proxy.vmess.inbound.DefaultConfig - (*Config)(nil), // 2: xray.proxy.vmess.inbound.Config - (*protocol.User)(nil), // 3: xray.common.protocol.User -} -var file_proxy_vmess_inbound_config_proto_depIdxs = []int32{ - 3, // 0: xray.proxy.vmess.inbound.Config.user:type_name -> xray.common.protocol.User - 1, // 1: xray.proxy.vmess.inbound.Config.default:type_name -> xray.proxy.vmess.inbound.DefaultConfig - 0, // 2: xray.proxy.vmess.inbound.Config.detour:type_name -> xray.proxy.vmess.inbound.DetourConfig - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_proxy_vmess_inbound_config_proto_init() } -func file_proxy_vmess_inbound_config_proto_init() { - if File_proxy_vmess_inbound_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vmess_inbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DetourConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_vmess_inbound_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DefaultConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_vmess_inbound_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vmess_inbound_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vmess_inbound_config_proto_goTypes, - DependencyIndexes: file_proxy_vmess_inbound_config_proto_depIdxs, - MessageInfos: file_proxy_vmess_inbound_config_proto_msgTypes, - }.Build() - File_proxy_vmess_inbound_config_proto = out.File - file_proxy_vmess_inbound_config_proto_rawDesc = nil - file_proxy_vmess_inbound_config_proto_goTypes = nil - file_proxy_vmess_inbound_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/vmess/outbound/config.pb.go b/xray_api/proto/proxy/vmess/outbound/config.pb.go deleted file mode 100644 index df6cd0e..0000000 --- a/xray_api/proto/proxy/vmess/outbound/config.pb.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/vmess/outbound/config.proto - -package outbound - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Receiver []*protocol.ServerEndpoint `protobuf:"bytes,1,rep,name=Receiver,proto3" json:"Receiver,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_vmess_outbound_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_proxy_vmess_outbound_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_proxy_vmess_outbound_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetReceiver() []*protocol.ServerEndpoint { - if x != nil { - return x.Receiver - } - return nil -} - -var File_proxy_vmess_outbound_config_proto protoreflect.FileDescriptor - -var file_proxy_vmess_outbound_config_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x1a, 0x21, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x4a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x40, 0x0a, 0x08, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x42, 0x6d, 0x0a, - 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x2e, 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, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, - 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_vmess_outbound_config_proto_rawDescOnce sync.Once - file_proxy_vmess_outbound_config_proto_rawDescData = file_proxy_vmess_outbound_config_proto_rawDesc -) - -func file_proxy_vmess_outbound_config_proto_rawDescGZIP() []byte { - file_proxy_vmess_outbound_config_proto_rawDescOnce.Do(func() { - file_proxy_vmess_outbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_vmess_outbound_config_proto_rawDescData) - }) - return file_proxy_vmess_outbound_config_proto_rawDescData -} - -var file_proxy_vmess_outbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_proxy_vmess_outbound_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.proxy.vmess.outbound.Config - (*protocol.ServerEndpoint)(nil), // 1: xray.common.protocol.ServerEndpoint -} -var file_proxy_vmess_outbound_config_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.vmess.outbound.Config.Receiver:type_name -> xray.common.protocol.ServerEndpoint - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_proxy_vmess_outbound_config_proto_init() } -func file_proxy_vmess_outbound_config_proto_init() { - if File_proxy_vmess_outbound_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_vmess_outbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_vmess_outbound_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_vmess_outbound_config_proto_goTypes, - DependencyIndexes: file_proxy_vmess_outbound_config_proto_depIdxs, - MessageInfos: file_proxy_vmess_outbound_config_proto_msgTypes, - }.Build() - File_proxy_vmess_outbound_config_proto = out.File - file_proxy_vmess_outbound_config_proto_rawDesc = nil - file_proxy_vmess_outbound_config_proto_goTypes = nil - file_proxy_vmess_outbound_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/proxy/wireguard/config.pb.go b/xray_api/proto/proxy/wireguard/config.pb.go deleted file mode 100644 index 25036ba..0000000 --- a/xray_api/proto/proxy/wireguard/config.pb.go +++ /dev/null @@ -1,402 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: proxy/wireguard/config.proto - -package wireguard - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DeviceConfig_DomainStrategy int32 - -const ( - DeviceConfig_FORCE_IP DeviceConfig_DomainStrategy = 0 - DeviceConfig_FORCE_IP4 DeviceConfig_DomainStrategy = 1 - DeviceConfig_FORCE_IP6 DeviceConfig_DomainStrategy = 2 - DeviceConfig_FORCE_IP46 DeviceConfig_DomainStrategy = 3 - DeviceConfig_FORCE_IP64 DeviceConfig_DomainStrategy = 4 -) - -// Enum value maps for DeviceConfig_DomainStrategy. -var ( - DeviceConfig_DomainStrategy_name = map[int32]string{ - 0: "FORCE_IP", - 1: "FORCE_IP4", - 2: "FORCE_IP6", - 3: "FORCE_IP46", - 4: "FORCE_IP64", - } - DeviceConfig_DomainStrategy_value = map[string]int32{ - "FORCE_IP": 0, - "FORCE_IP4": 1, - "FORCE_IP6": 2, - "FORCE_IP46": 3, - "FORCE_IP64": 4, - } -) - -func (x DeviceConfig_DomainStrategy) Enum() *DeviceConfig_DomainStrategy { - p := new(DeviceConfig_DomainStrategy) - *p = x - return p -} - -func (x DeviceConfig_DomainStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DeviceConfig_DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_proxy_wireguard_config_proto_enumTypes[0].Descriptor() -} - -func (DeviceConfig_DomainStrategy) Type() protoreflect.EnumType { - return &file_proxy_wireguard_config_proto_enumTypes[0] -} - -func (x DeviceConfig_DomainStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DeviceConfig_DomainStrategy.Descriptor instead. -func (DeviceConfig_DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_proxy_wireguard_config_proto_rawDescGZIP(), []int{1, 0} -} - -type PeerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PublicKey string `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - PreSharedKey string `protobuf:"bytes,2,opt,name=pre_shared_key,json=preSharedKey,proto3" json:"pre_shared_key,omitempty"` - Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - KeepAlive uint32 `protobuf:"varint,4,opt,name=keep_alive,json=keepAlive,proto3" json:"keep_alive,omitempty"` - AllowedIps []string `protobuf:"bytes,5,rep,name=allowed_ips,json=allowedIps,proto3" json:"allowed_ips,omitempty"` -} - -func (x *PeerConfig) Reset() { - *x = PeerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_wireguard_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PeerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PeerConfig) ProtoMessage() {} - -func (x *PeerConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_wireguard_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PeerConfig.ProtoReflect.Descriptor instead. -func (*PeerConfig) Descriptor() ([]byte, []int) { - return file_proxy_wireguard_config_proto_rawDescGZIP(), []int{0} -} - -func (x *PeerConfig) GetPublicKey() string { - if x != nil { - return x.PublicKey - } - return "" -} - -func (x *PeerConfig) GetPreSharedKey() string { - if x != nil { - return x.PreSharedKey - } - return "" -} - -func (x *PeerConfig) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *PeerConfig) GetKeepAlive() uint32 { - if x != nil { - return x.KeepAlive - } - return 0 -} - -func (x *PeerConfig) GetAllowedIps() []string { - if x != nil { - return x.AllowedIps - } - return nil -} - -type DeviceConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SecretKey string `protobuf:"bytes,1,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - Endpoint []string `protobuf:"bytes,2,rep,name=endpoint,proto3" json:"endpoint,omitempty"` - Peers []*PeerConfig `protobuf:"bytes,3,rep,name=peers,proto3" json:"peers,omitempty"` - Mtu int32 `protobuf:"varint,4,opt,name=mtu,proto3" json:"mtu,omitempty"` - NumWorkers int32 `protobuf:"varint,5,opt,name=num_workers,json=numWorkers,proto3" json:"num_workers,omitempty"` - Reserved []byte `protobuf:"bytes,6,opt,name=reserved,proto3" json:"reserved,omitempty"` - DomainStrategy DeviceConfig_DomainStrategy `protobuf:"varint,7,opt,name=domain_strategy,json=domainStrategy,proto3,enum=xray.proxy.wireguard.DeviceConfig_DomainStrategy" json:"domain_strategy,omitempty"` - IsClient bool `protobuf:"varint,8,opt,name=is_client,json=isClient,proto3" json:"is_client,omitempty"` - KernelMode bool `protobuf:"varint,9,opt,name=kernel_mode,json=kernelMode,proto3" json:"kernel_mode,omitempty"` -} - -func (x *DeviceConfig) Reset() { - *x = DeviceConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_proxy_wireguard_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeviceConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeviceConfig) ProtoMessage() {} - -func (x *DeviceConfig) ProtoReflect() protoreflect.Message { - mi := &file_proxy_wireguard_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeviceConfig.ProtoReflect.Descriptor instead. -func (*DeviceConfig) Descriptor() ([]byte, []int) { - return file_proxy_wireguard_config_proto_rawDescGZIP(), []int{1} -} - -func (x *DeviceConfig) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *DeviceConfig) GetEndpoint() []string { - if x != nil { - return x.Endpoint - } - return nil -} - -func (x *DeviceConfig) GetPeers() []*PeerConfig { - if x != nil { - return x.Peers - } - return nil -} - -func (x *DeviceConfig) GetMtu() int32 { - if x != nil { - return x.Mtu - } - return 0 -} - -func (x *DeviceConfig) GetNumWorkers() int32 { - if x != nil { - return x.NumWorkers - } - return 0 -} - -func (x *DeviceConfig) GetReserved() []byte { - if x != nil { - return x.Reserved - } - return nil -} - -func (x *DeviceConfig) GetDomainStrategy() DeviceConfig_DomainStrategy { - if x != nil { - return x.DomainStrategy - } - return DeviceConfig_FORCE_IP -} - -func (x *DeviceConfig) GetIsClient() bool { - if x != nil { - return x.IsClient - } - return false -} - -func (x *DeviceConfig) GetKernelMode() bool { - if x != nil { - return x.KernelMode - } - return false -} - -var File_proxy_wireguard_config_proto protoreflect.FileDescriptor - -var file_proxy_wireguard_config_proto_rawDesc = []byte{ - 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, - 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, - 0x75, 0x61, 0x72, 0x64, 0x22, 0xad, 0x01, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x5f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, - 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, - 0x69, 0x76, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, - 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, - 0x64, 0x49, 0x70, 0x73, 0x22, 0xc8, 0x03, 0x0a, 0x0c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x5f, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x12, 0x36, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x77, 0x69, 0x72, - 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x74, 0x75, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6d, 0x74, 0x75, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x75, - 0x6d, 0x5f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x6e, 0x75, 0x6d, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x12, 0x5a, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x31, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x77, 0x69, - 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x1f, 0x0a, 0x0b, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x4d, 0x6f, 0x64, - 0x65, 0x22, 0x5c, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x10, - 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x01, - 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x03, 0x12, - 0x0e, 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x04, 0x42, - 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x29, 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, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x77, - 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x47, 0x75, 0x61, 0x72, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_proxy_wireguard_config_proto_rawDescOnce sync.Once - file_proxy_wireguard_config_proto_rawDescData = file_proxy_wireguard_config_proto_rawDesc -) - -func file_proxy_wireguard_config_proto_rawDescGZIP() []byte { - file_proxy_wireguard_config_proto_rawDescOnce.Do(func() { - file_proxy_wireguard_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_wireguard_config_proto_rawDescData) - }) - return file_proxy_wireguard_config_proto_rawDescData -} - -var file_proxy_wireguard_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proxy_wireguard_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_proxy_wireguard_config_proto_goTypes = []interface{}{ - (DeviceConfig_DomainStrategy)(0), // 0: xray.proxy.wireguard.DeviceConfig.DomainStrategy - (*PeerConfig)(nil), // 1: xray.proxy.wireguard.PeerConfig - (*DeviceConfig)(nil), // 2: xray.proxy.wireguard.DeviceConfig -} -var file_proxy_wireguard_config_proto_depIdxs = []int32{ - 1, // 0: xray.proxy.wireguard.DeviceConfig.peers:type_name -> xray.proxy.wireguard.PeerConfig - 0, // 1: xray.proxy.wireguard.DeviceConfig.domain_strategy:type_name -> xray.proxy.wireguard.DeviceConfig.DomainStrategy - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_proxy_wireguard_config_proto_init() } -func file_proxy_wireguard_config_proto_init() { - if File_proxy_wireguard_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_proxy_wireguard_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proxy_wireguard_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_proxy_wireguard_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_proxy_wireguard_config_proto_goTypes, - DependencyIndexes: file_proxy_wireguard_config_proto_depIdxs, - EnumInfos: file_proxy_wireguard_config_proto_enumTypes, - MessageInfos: file_proxy_wireguard_config_proto_msgTypes, - }.Build() - File_proxy_wireguard_config_proto = out.File - file_proxy_wireguard_config_proto_rawDesc = nil - file_proxy_wireguard_config_proto_goTypes = nil - file_proxy_wireguard_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/global/config.pb.go b/xray_api/proto/transport/global/config.pb.go deleted file mode 100644 index 0d32542..0000000 --- a/xray_api/proto/transport/global/config.pb.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/global/config.proto - -package global - -import ( - internet "marzban-node/xray_api/proto/transport/internet" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Global transport settings. This affects all type of connections that go -// through Xray. Deprecated. Use each settings in StreamConfig. -// -// Deprecated: Marked as deprecated in transport/global/config.proto. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TransportSettings []*internet.TransportConfig `protobuf:"bytes,1,rep,name=transport_settings,json=transportSettings,proto3" json:"transport_settings,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_global_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_global_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_global_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetTransportSettings() []*internet.TransportConfig { - if x != nil { - return x.TransportSettings - } - return nil -} - -var File_transport_global_config_proto protoreflect.FileDescriptor - -var file_transport_global_config_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x1a, - 0x1f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x65, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x57, 0x0a, 0x12, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x3a, 0x02, 0x18, 0x01, 0x42, 0x61, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x67, 0x6c, - 0x6f, 0x62, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x2a, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x67, 0x6c, 0x6f, 0x62, - 0x61, 0x6c, 0xaa, 0x02, 0x15, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_transport_global_config_proto_rawDescOnce sync.Once - file_transport_global_config_proto_rawDescData = file_transport_global_config_proto_rawDesc -) - -func file_transport_global_config_proto_rawDescGZIP() []byte { - file_transport_global_config_proto_rawDescOnce.Do(func() { - file_transport_global_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_global_config_proto_rawDescData) - }) - return file_transport_global_config_proto_rawDescData -} - -var file_transport_global_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_global_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.Config - (*internet.TransportConfig)(nil), // 1: xray.transport.internet.TransportConfig -} -var file_transport_global_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.Config.transport_settings:type_name -> xray.transport.internet.TransportConfig - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_global_config_proto_init() } -func file_transport_global_config_proto_init() { - if File_transport_global_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_global_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_global_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_global_config_proto_goTypes, - DependencyIndexes: file_transport_global_config_proto_depIdxs, - MessageInfos: file_transport_global_config_proto_msgTypes, - }.Build() - File_transport_global_config_proto = out.File - file_transport_global_config_proto_rawDesc = nil - file_transport_global_config_proto_goTypes = nil - file_transport_global_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/config.pb.go b/xray_api/proto/transport/internet/config.pb.go deleted file mode 100644 index 0b5e81a..0000000 --- a/xray_api/proto/transport/internet/config.pb.go +++ /dev/null @@ -1,876 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/config.proto - -package internet - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type TransportProtocol int32 - -const ( - TransportProtocol_TCP TransportProtocol = 0 - TransportProtocol_UDP TransportProtocol = 1 - TransportProtocol_MKCP TransportProtocol = 2 - TransportProtocol_WebSocket TransportProtocol = 3 - TransportProtocol_HTTP TransportProtocol = 4 - TransportProtocol_DomainSocket TransportProtocol = 5 - TransportProtocol_HTTPUpgrade TransportProtocol = 6 - TransportProtocol_SplitHTTP TransportProtocol = 7 -) - -// Enum value maps for TransportProtocol. -var ( - TransportProtocol_name = map[int32]string{ - 0: "TCP", - 1: "UDP", - 2: "MKCP", - 3: "WebSocket", - 4: "HTTP", - 5: "DomainSocket", - 6: "HTTPUpgrade", - 7: "SplitHTTP", - } - TransportProtocol_value = map[string]int32{ - "TCP": 0, - "UDP": 1, - "MKCP": 2, - "WebSocket": 3, - "HTTP": 4, - "DomainSocket": 5, - "HTTPUpgrade": 6, - "SplitHTTP": 7, - } -) - -func (x TransportProtocol) Enum() *TransportProtocol { - p := new(TransportProtocol) - *p = x - return p -} - -func (x TransportProtocol) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_transport_internet_config_proto_enumTypes[0].Descriptor() -} - -func (TransportProtocol) Type() protoreflect.EnumType { - return &file_transport_internet_config_proto_enumTypes[0] -} - -func (x TransportProtocol) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TransportProtocol.Descriptor instead. -func (TransportProtocol) EnumDescriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{0} -} - -type DomainStrategy int32 - -const ( - DomainStrategy_AS_IS DomainStrategy = 0 - DomainStrategy_USE_IP DomainStrategy = 1 - DomainStrategy_USE_IP4 DomainStrategy = 2 - DomainStrategy_USE_IP6 DomainStrategy = 3 - DomainStrategy_USE_IP46 DomainStrategy = 4 - DomainStrategy_USE_IP64 DomainStrategy = 5 - DomainStrategy_FORCE_IP DomainStrategy = 6 - DomainStrategy_FORCE_IP4 DomainStrategy = 7 - DomainStrategy_FORCE_IP6 DomainStrategy = 8 - DomainStrategy_FORCE_IP46 DomainStrategy = 9 - DomainStrategy_FORCE_IP64 DomainStrategy = 10 -) - -// Enum value maps for DomainStrategy. -var ( - DomainStrategy_name = map[int32]string{ - 0: "AS_IS", - 1: "USE_IP", - 2: "USE_IP4", - 3: "USE_IP6", - 4: "USE_IP46", - 5: "USE_IP64", - 6: "FORCE_IP", - 7: "FORCE_IP4", - 8: "FORCE_IP6", - 9: "FORCE_IP46", - 10: "FORCE_IP64", - } - DomainStrategy_value = map[string]int32{ - "AS_IS": 0, - "USE_IP": 1, - "USE_IP4": 2, - "USE_IP6": 3, - "USE_IP46": 4, - "USE_IP64": 5, - "FORCE_IP": 6, - "FORCE_IP4": 7, - "FORCE_IP6": 8, - "FORCE_IP46": 9, - "FORCE_IP64": 10, - } -) - -func (x DomainStrategy) Enum() *DomainStrategy { - p := new(DomainStrategy) - *p = x - return p -} - -func (x DomainStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_transport_internet_config_proto_enumTypes[1].Descriptor() -} - -func (DomainStrategy) Type() protoreflect.EnumType { - return &file_transport_internet_config_proto_enumTypes[1] -} - -func (x DomainStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DomainStrategy.Descriptor instead. -func (DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{1} -} - -type SocketConfig_TProxyMode int32 - -const ( - // TProxy is off. - SocketConfig_Off SocketConfig_TProxyMode = 0 - // TProxy mode. - SocketConfig_TProxy SocketConfig_TProxyMode = 1 - // Redirect mode. - SocketConfig_Redirect SocketConfig_TProxyMode = 2 -) - -// Enum value maps for SocketConfig_TProxyMode. -var ( - SocketConfig_TProxyMode_name = map[int32]string{ - 0: "Off", - 1: "TProxy", - 2: "Redirect", - } - SocketConfig_TProxyMode_value = map[string]int32{ - "Off": 0, - "TProxy": 1, - "Redirect": 2, - } -) - -func (x SocketConfig_TProxyMode) Enum() *SocketConfig_TProxyMode { - p := new(SocketConfig_TProxyMode) - *p = x - return p -} - -func (x SocketConfig_TProxyMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor { - return file_transport_internet_config_proto_enumTypes[2].Descriptor() -} - -func (SocketConfig_TProxyMode) Type() protoreflect.EnumType { - return &file_transport_internet_config_proto_enumTypes[2] -} - -func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SocketConfig_TProxyMode.Descriptor instead. -func (SocketConfig_TProxyMode) EnumDescriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{3, 0} -} - -type TransportConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Type of network that this settings supports. - // Deprecated. Use the string form below. - // - // Deprecated: Marked as deprecated in transport/internet/config.proto. - Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=xray.transport.internet.TransportProtocol" json:"protocol,omitempty"` - // Type of network that this settings supports. - ProtocolName string `protobuf:"bytes,3,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"` - // Specific settings. Must be of the transports. - Settings *serial.TypedMessage `protobuf:"bytes,2,opt,name=settings,proto3" json:"settings,omitempty"` -} - -func (x *TransportConfig) Reset() { - *x = TransportConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TransportConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransportConfig) ProtoMessage() {} - -func (x *TransportConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TransportConfig.ProtoReflect.Descriptor instead. -func (*TransportConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{0} -} - -// Deprecated: Marked as deprecated in transport/internet/config.proto. -func (x *TransportConfig) GetProtocol() TransportProtocol { - if x != nil { - return x.Protocol - } - return TransportProtocol_TCP -} - -func (x *TransportConfig) GetProtocolName() string { - if x != nil { - return x.ProtocolName - } - return "" -} - -func (x *TransportConfig) GetSettings() *serial.TypedMessage { - if x != nil { - return x.Settings - } - return nil -} - -type StreamConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Effective network. Deprecated. Use the string form below. - // - // Deprecated: Marked as deprecated in transport/internet/config.proto. - Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=xray.transport.internet.TransportProtocol" json:"protocol,omitempty"` - // Effective network. - ProtocolName string `protobuf:"bytes,5,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"` - TransportSettings []*TransportConfig `protobuf:"bytes,2,rep,name=transport_settings,json=transportSettings,proto3" json:"transport_settings,omitempty"` - // Type of security. Must be a message name of the settings proto. - SecurityType string `protobuf:"bytes,3,opt,name=security_type,json=securityType,proto3" json:"security_type,omitempty"` - // Settings for transport security. For now the only choice is TLS. - SecuritySettings []*serial.TypedMessage `protobuf:"bytes,4,rep,name=security_settings,json=securitySettings,proto3" json:"security_settings,omitempty"` - SocketSettings *SocketConfig `protobuf:"bytes,6,opt,name=socket_settings,json=socketSettings,proto3" json:"socket_settings,omitempty"` -} - -func (x *StreamConfig) Reset() { - *x = StreamConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StreamConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StreamConfig) ProtoMessage() {} - -func (x *StreamConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StreamConfig.ProtoReflect.Descriptor instead. -func (*StreamConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{1} -} - -// Deprecated: Marked as deprecated in transport/internet/config.proto. -func (x *StreamConfig) GetProtocol() TransportProtocol { - if x != nil { - return x.Protocol - } - return TransportProtocol_TCP -} - -func (x *StreamConfig) GetProtocolName() string { - if x != nil { - return x.ProtocolName - } - return "" -} - -func (x *StreamConfig) GetTransportSettings() []*TransportConfig { - if x != nil { - return x.TransportSettings - } - return nil -} - -func (x *StreamConfig) GetSecurityType() string { - if x != nil { - return x.SecurityType - } - return "" -} - -func (x *StreamConfig) GetSecuritySettings() []*serial.TypedMessage { - if x != nil { - return x.SecuritySettings - } - return nil -} - -func (x *StreamConfig) GetSocketSettings() *SocketConfig { - if x != nil { - return x.SocketSettings - } - return nil -} - -type ProxyConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - TransportLayerProxy bool `protobuf:"varint,2,opt,name=transportLayerProxy,proto3" json:"transportLayerProxy,omitempty"` -} - -func (x *ProxyConfig) Reset() { - *x = ProxyConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProxyConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProxyConfig) ProtoMessage() {} - -func (x *ProxyConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProxyConfig.ProtoReflect.Descriptor instead. -func (*ProxyConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{2} -} - -func (x *ProxyConfig) GetTag() string { - if x != nil { - return x.Tag - } - return "" -} - -func (x *ProxyConfig) GetTransportLayerProxy() bool { - if x != nil { - return x.TransportLayerProxy - } - return false -} - -// SocketConfig is options to be applied on network sockets. -type SocketConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Mark of the connection. If non-zero, the value will be set to SO_MARK. - Mark int32 `protobuf:"varint,1,opt,name=mark,proto3" json:"mark,omitempty"` - // TFO is the state of TFO settings. - Tfo int32 `protobuf:"varint,2,opt,name=tfo,proto3" json:"tfo,omitempty"` - // TProxy is for enabling TProxy socket option. - Tproxy SocketConfig_TProxyMode `protobuf:"varint,3,opt,name=tproxy,proto3,enum=xray.transport.internet.SocketConfig_TProxyMode" json:"tproxy,omitempty"` - // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket - // option. This option is for UDP only. - ReceiveOriginalDestAddress bool `protobuf:"varint,4,opt,name=receive_original_dest_address,json=receiveOriginalDestAddress,proto3" json:"receive_original_dest_address,omitempty"` - BindAddress []byte `protobuf:"bytes,5,opt,name=bind_address,json=bindAddress,proto3" json:"bind_address,omitempty"` - BindPort uint32 `protobuf:"varint,6,opt,name=bind_port,json=bindPort,proto3" json:"bind_port,omitempty"` - AcceptProxyProtocol bool `protobuf:"varint,7,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` - DomainStrategy DomainStrategy `protobuf:"varint,8,opt,name=domain_strategy,json=domainStrategy,proto3,enum=xray.transport.internet.DomainStrategy" json:"domain_strategy,omitempty"` - DialerProxy string `protobuf:"bytes,9,opt,name=dialer_proxy,json=dialerProxy,proto3" json:"dialer_proxy,omitempty"` - TcpKeepAliveInterval int32 `protobuf:"varint,10,opt,name=tcp_keep_alive_interval,json=tcpKeepAliveInterval,proto3" json:"tcp_keep_alive_interval,omitempty"` - TcpKeepAliveIdle int32 `protobuf:"varint,11,opt,name=tcp_keep_alive_idle,json=tcpKeepAliveIdle,proto3" json:"tcp_keep_alive_idle,omitempty"` - TcpCongestion string `protobuf:"bytes,12,opt,name=tcp_congestion,json=tcpCongestion,proto3" json:"tcp_congestion,omitempty"` - Interface string `protobuf:"bytes,13,opt,name=interface,proto3" json:"interface,omitempty"` - V6Only bool `protobuf:"varint,14,opt,name=v6only,proto3" json:"v6only,omitempty"` - TcpWindowClamp int32 `protobuf:"varint,15,opt,name=tcp_window_clamp,json=tcpWindowClamp,proto3" json:"tcp_window_clamp,omitempty"` - TcpUserTimeout int32 `protobuf:"varint,16,opt,name=tcp_user_timeout,json=tcpUserTimeout,proto3" json:"tcp_user_timeout,omitempty"` - TcpMaxSeg int32 `protobuf:"varint,17,opt,name=tcp_max_seg,json=tcpMaxSeg,proto3" json:"tcp_max_seg,omitempty"` - TcpNoDelay bool `protobuf:"varint,18,opt,name=tcp_no_delay,json=tcpNoDelay,proto3" json:"tcp_no_delay,omitempty"` - TcpMptcp bool `protobuf:"varint,19,opt,name=tcp_mptcp,json=tcpMptcp,proto3" json:"tcp_mptcp,omitempty"` -} - -func (x *SocketConfig) Reset() { - *x = SocketConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SocketConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SocketConfig) ProtoMessage() {} - -func (x *SocketConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SocketConfig.ProtoReflect.Descriptor instead. -func (*SocketConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_config_proto_rawDescGZIP(), []int{3} -} - -func (x *SocketConfig) GetMark() int32 { - if x != nil { - return x.Mark - } - return 0 -} - -func (x *SocketConfig) GetTfo() int32 { - if x != nil { - return x.Tfo - } - return 0 -} - -func (x *SocketConfig) GetTproxy() SocketConfig_TProxyMode { - if x != nil { - return x.Tproxy - } - return SocketConfig_Off -} - -func (x *SocketConfig) GetReceiveOriginalDestAddress() bool { - if x != nil { - return x.ReceiveOriginalDestAddress - } - return false -} - -func (x *SocketConfig) GetBindAddress() []byte { - if x != nil { - return x.BindAddress - } - return nil -} - -func (x *SocketConfig) GetBindPort() uint32 { - if x != nil { - return x.BindPort - } - return 0 -} - -func (x *SocketConfig) GetAcceptProxyProtocol() bool { - if x != nil { - return x.AcceptProxyProtocol - } - return false -} - -func (x *SocketConfig) GetDomainStrategy() DomainStrategy { - if x != nil { - return x.DomainStrategy - } - return DomainStrategy_AS_IS -} - -func (x *SocketConfig) GetDialerProxy() string { - if x != nil { - return x.DialerProxy - } - return "" -} - -func (x *SocketConfig) GetTcpKeepAliveInterval() int32 { - if x != nil { - return x.TcpKeepAliveInterval - } - return 0 -} - -func (x *SocketConfig) GetTcpKeepAliveIdle() int32 { - if x != nil { - return x.TcpKeepAliveIdle - } - return 0 -} - -func (x *SocketConfig) GetTcpCongestion() string { - if x != nil { - return x.TcpCongestion - } - return "" -} - -func (x *SocketConfig) GetInterface() string { - if x != nil { - return x.Interface - } - return "" -} - -func (x *SocketConfig) GetV6Only() bool { - if x != nil { - return x.V6Only - } - return false -} - -func (x *SocketConfig) GetTcpWindowClamp() int32 { - if x != nil { - return x.TcpWindowClamp - } - return 0 -} - -func (x *SocketConfig) GetTcpUserTimeout() int32 { - if x != nil { - return x.TcpUserTimeout - } - return 0 -} - -func (x *SocketConfig) GetTcpMaxSeg() int32 { - if x != nil { - return x.TcpMaxSeg - } - return 0 -} - -func (x *SocketConfig) GetTcpNoDelay() bool { - if x != nil { - return x.TcpNoDelay - } - return false -} - -func (x *SocketConfig) GetTcpMptcp() bool { - if x != nil { - return x.TcpMptcp - } - return false -} - -var File_transport_internet_config_proto protoreflect.FileDescriptor - -var file_transport_internet_config_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x17, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x1a, 0x21, 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, 0x6f, 0x22, 0xc0, 0x01, - 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x4a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x23, 0x0a, - 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 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, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x22, 0x9c, 0x03, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x4a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x23, 0x0a, - 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x4d, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 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, 0x10, 0x73, - 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x4e, 0x0a, 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, - 0x51, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 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, 0x30, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x61, 0x79, - 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x22, 0xd1, 0x06, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x66, 0x6f, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x06, 0x74, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x74, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x69, - 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x69, 0x6e, - 0x64, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, - 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x50, 0x0a, 0x0f, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x21, 0x0a, 0x0c, - 0x64, 0x69, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, - 0x35, 0x0a, 0x17, 0x74, 0x63, 0x70, 0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, - 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x14, 0x74, 0x63, 0x70, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x13, 0x74, 0x63, 0x70, 0x5f, 0x6b, 0x65, - 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x10, 0x74, 0x63, 0x70, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, - 0x65, 0x49, 0x64, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x6e, - 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, - 0x63, 0x70, 0x43, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x36, - 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x36, 0x6f, 0x6e, - 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x63, 0x70, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, - 0x5f, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x63, - 0x70, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x43, 0x6c, 0x61, 0x6d, 0x70, 0x12, 0x28, 0x0a, 0x10, - 0x74, 0x63, 0x70, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x63, 0x70, 0x55, 0x73, 0x65, 0x72, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x74, 0x63, 0x70, 0x5f, 0x6d, 0x61, - 0x78, 0x5f, 0x73, 0x65, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x63, 0x70, - 0x4d, 0x61, 0x78, 0x53, 0x65, 0x67, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x63, 0x70, 0x5f, 0x6e, 0x6f, - 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x63, - 0x70, 0x4e, 0x6f, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x63, 0x70, 0x5f, - 0x6d, 0x70, 0x74, 0x63, 0x70, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x63, 0x70, - 0x4d, 0x70, 0x74, 0x63, 0x70, 0x22, 0x2f, 0x0a, 0x0a, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4d, - 0x6f, 0x64, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x66, 0x66, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x65, 0x64, 0x69, - 0x72, 0x65, 0x63, 0x74, 0x10, 0x02, 0x2a, 0x7a, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x07, 0x0a, 0x03, 0x54, - 0x43, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, - 0x04, 0x4d, 0x4b, 0x43, 0x50, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x53, 0x6f, - 0x63, 0x6b, 0x65, 0x74, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x04, - 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, - 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x48, 0x54, 0x54, 0x50, - 0x10, 0x07, 0x2a, 0xa9, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, - 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, - 0x5f, 0x49, 0x50, 0x36, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, - 0x34, 0x36, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, - 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x06, - 0x12, 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x07, 0x12, - 0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x08, 0x12, 0x0e, - 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x09, 0x12, 0x0e, - 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x0a, 0x42, 0x67, - 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, - 0x2c, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_config_proto_rawDescOnce sync.Once - file_transport_internet_config_proto_rawDescData = file_transport_internet_config_proto_rawDesc -) - -func file_transport_internet_config_proto_rawDescGZIP() []byte { - file_transport_internet_config_proto_rawDescOnce.Do(func() { - file_transport_internet_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_config_proto_rawDescData) - }) - return file_transport_internet_config_proto_rawDescData -} - -var file_transport_internet_config_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_transport_internet_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_transport_internet_config_proto_goTypes = []interface{}{ - (TransportProtocol)(0), // 0: xray.transport.internet.TransportProtocol - (DomainStrategy)(0), // 1: xray.transport.internet.DomainStrategy - (SocketConfig_TProxyMode)(0), // 2: xray.transport.internet.SocketConfig.TProxyMode - (*TransportConfig)(nil), // 3: xray.transport.internet.TransportConfig - (*StreamConfig)(nil), // 4: xray.transport.internet.StreamConfig - (*ProxyConfig)(nil), // 5: xray.transport.internet.ProxyConfig - (*SocketConfig)(nil), // 6: xray.transport.internet.SocketConfig - (*serial.TypedMessage)(nil), // 7: xray.common.serial.TypedMessage -} -var file_transport_internet_config_proto_depIdxs = []int32{ - 0, // 0: xray.transport.internet.TransportConfig.protocol:type_name -> xray.transport.internet.TransportProtocol - 7, // 1: xray.transport.internet.TransportConfig.settings:type_name -> xray.common.serial.TypedMessage - 0, // 2: xray.transport.internet.StreamConfig.protocol:type_name -> xray.transport.internet.TransportProtocol - 3, // 3: xray.transport.internet.StreamConfig.transport_settings:type_name -> xray.transport.internet.TransportConfig - 7, // 4: xray.transport.internet.StreamConfig.security_settings:type_name -> xray.common.serial.TypedMessage - 6, // 5: xray.transport.internet.StreamConfig.socket_settings:type_name -> xray.transport.internet.SocketConfig - 2, // 6: xray.transport.internet.SocketConfig.tproxy:type_name -> xray.transport.internet.SocketConfig.TProxyMode - 1, // 7: xray.transport.internet.SocketConfig.domain_strategy:type_name -> xray.transport.internet.DomainStrategy - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_transport_internet_config_proto_init() } -func file_transport_internet_config_proto_init() { - if File_transport_internet_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransportConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProxyConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SocketConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_config_proto_rawDesc, - NumEnums: 3, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_config_proto_goTypes, - DependencyIndexes: file_transport_internet_config_proto_depIdxs, - EnumInfos: file_transport_internet_config_proto_enumTypes, - MessageInfos: file_transport_internet_config_proto_msgTypes, - }.Build() - File_transport_internet_config_proto = out.File - file_transport_internet_config_proto_rawDesc = nil - file_transport_internet_config_proto_goTypes = nil - file_transport_internet_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/domainsocket/config.pb.go b/xray_api/proto/transport/internet/domainsocket/config.pb.go deleted file mode 100644 index 3ab1adc..0000000 --- a/xray_api/proto/transport/internet/domainsocket/config.pb.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/domainsocket/config.proto - -package domainsocket - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Path of the domain socket. This overrides the IP/Port parameter from - // upstream caller. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // Abstract speicifies whether to use abstract namespace or not. - // Traditionally Unix domain socket is file system based. Abstract domain - // socket can be used without acquiring file lock. - Abstract bool `protobuf:"varint,2,opt,name=abstract,proto3" json:"abstract,omitempty"` - // Some apps, eg. haproxy, use the full length of sockaddr_un.sun_path to - // connect(2) or bind(2) when using abstract UDS. - Padding bool `protobuf:"varint,3,opt,name=padding,proto3" json:"padding,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_domainsocket_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_domainsocket_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_domainsocket_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Config) GetAbstract() bool { - if x != nil { - return x.Abstract - } - return false -} - -func (x *Config) GetPadding() bool { - if x != nil { - return x.Padding - } - return false -} - -var File_transport_internet_domainsocket_config_proto protoreflect.FileDescriptor - -var file_transport_internet_domainsocket_config_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, 0x65, - 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, - 0x63, 0x6b, 0x65, 0x74, 0x22, 0x52, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, - 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, - 0x65, 0x74, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_transport_internet_domainsocket_config_proto_rawDescOnce sync.Once - file_transport_internet_domainsocket_config_proto_rawDescData = file_transport_internet_domainsocket_config_proto_rawDesc -) - -func file_transport_internet_domainsocket_config_proto_rawDescGZIP() []byte { - file_transport_internet_domainsocket_config_proto_rawDescOnce.Do(func() { - file_transport_internet_domainsocket_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_domainsocket_config_proto_rawDescData) - }) - return file_transport_internet_domainsocket_config_proto_rawDescData -} - -var file_transport_internet_domainsocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_domainsocket_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.domainsocket.Config -} -var file_transport_internet_domainsocket_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_domainsocket_config_proto_init() } -func file_transport_internet_domainsocket_config_proto_init() { - if File_transport_internet_domainsocket_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_domainsocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_domainsocket_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_domainsocket_config_proto_goTypes, - DependencyIndexes: file_transport_internet_domainsocket_config_proto_depIdxs, - MessageInfos: file_transport_internet_domainsocket_config_proto_msgTypes, - }.Build() - File_transport_internet_domainsocket_config_proto = out.File - file_transport_internet_domainsocket_config_proto_rawDesc = nil - file_transport_internet_domainsocket_config_proto_goTypes = nil - file_transport_internet_domainsocket_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/grpc/config.pb.go b/xray_api/proto/transport/internet/grpc/config.pb.go deleted file mode 100644 index a0996e5..0000000 --- a/xray_api/proto/transport/internet/grpc/config.pb.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/grpc/config.proto - -package grpc - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - MultiMode bool `protobuf:"varint,3,opt,name=multi_mode,json=multiMode,proto3" json:"multi_mode,omitempty"` - IdleTimeout int32 `protobuf:"varint,4,opt,name=idle_timeout,json=idleTimeout,proto3" json:"idle_timeout,omitempty"` - HealthCheckTimeout int32 `protobuf:"varint,5,opt,name=health_check_timeout,json=healthCheckTimeout,proto3" json:"health_check_timeout,omitempty"` - PermitWithoutStream bool `protobuf:"varint,6,opt,name=permit_without_stream,json=permitWithoutStream,proto3" json:"permit_without_stream,omitempty"` - InitialWindowsSize int32 `protobuf:"varint,7,opt,name=initial_windows_size,json=initialWindowsSize,proto3" json:"initial_windows_size,omitempty"` - UserAgent string `protobuf:"bytes,8,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_grpc_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_grpc_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_grpc_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetAuthority() string { - if x != nil { - return x.Authority - } - return "" -} - -func (x *Config) GetServiceName() string { - if x != nil { - return x.ServiceName - } - return "" -} - -func (x *Config) GetMultiMode() bool { - if x != nil { - return x.MultiMode - } - return false -} - -func (x *Config) GetIdleTimeout() int32 { - if x != nil { - return x.IdleTimeout - } - return 0 -} - -func (x *Config) GetHealthCheckTimeout() int32 { - if x != nil { - return x.HealthCheckTimeout - } - return 0 -} - -func (x *Config) GetPermitWithoutStream() bool { - if x != nil { - return x.PermitWithoutStream - } - return false -} - -func (x *Config) GetInitialWindowsSize() int32 { - if x != nil { - return x.InitialWindowsSize - } - return 0 -} - -func (x *Config) GetUserAgent() string { - if x != nil { - return x.UserAgent - } - return "" -} - -var File_transport_internet_grpc_config_proto protoreflect.FileDescriptor - -var file_transport_internet_grpc_config_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0xc2, 0x02, - 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x75, 0x6c, - 0x74, 0x69, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, - 0x75, 0x6c, 0x74, 0x69, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, - 0x69, 0x64, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x68, - 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x32, 0x0a, - 0x15, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x70, 0x65, - 0x72, 0x6d, 0x69, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x12, 0x30, 0x0a, 0x14, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x77, 0x69, 0x6e, - 0x64, 0x6f, 0x77, 0x73, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x12, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x42, 0x33, 0x5a, 0x31, 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, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_grpc_config_proto_rawDescOnce sync.Once - file_transport_internet_grpc_config_proto_rawDescData = file_transport_internet_grpc_config_proto_rawDesc -) - -func file_transport_internet_grpc_config_proto_rawDescGZIP() []byte { - file_transport_internet_grpc_config_proto_rawDescOnce.Do(func() { - file_transport_internet_grpc_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_grpc_config_proto_rawDescData) - }) - return file_transport_internet_grpc_config_proto_rawDescData -} - -var file_transport_internet_grpc_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_grpc_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.grpc.encoding.Config -} -var file_transport_internet_grpc_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_grpc_config_proto_init() } -func file_transport_internet_grpc_config_proto_init() { - if File_transport_internet_grpc_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_grpc_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_grpc_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_grpc_config_proto_goTypes, - DependencyIndexes: file_transport_internet_grpc_config_proto_depIdxs, - MessageInfos: file_transport_internet_grpc_config_proto_msgTypes, - }.Build() - File_transport_internet_grpc_config_proto = out.File - file_transport_internet_grpc_config_proto_rawDesc = nil - file_transport_internet_grpc_config_proto_goTypes = nil - file_transport_internet_grpc_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/grpc/encoding/stream.pb.go b/xray_api/proto/transport/internet/grpc/encoding/stream.pb.go deleted file mode 100644 index 519adb7..0000000 --- a/xray_api/proto/transport/internet/grpc/encoding/stream.pb.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/grpc/encoding/stream.proto - -package encoding - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Hunk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *Hunk) Reset() { - *x = Hunk{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_grpc_encoding_stream_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Hunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Hunk) ProtoMessage() {} - -func (x *Hunk) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_grpc_encoding_stream_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Hunk.ProtoReflect.Descriptor instead. -func (*Hunk) Descriptor() ([]byte, []int) { - return file_transport_internet_grpc_encoding_stream_proto_rawDescGZIP(), []int{0} -} - -func (x *Hunk) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -type MultiHunk struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` -} - -func (x *MultiHunk) Reset() { - *x = MultiHunk{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_grpc_encoding_stream_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MultiHunk) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiHunk) ProtoMessage() {} - -func (x *MultiHunk) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_grpc_encoding_stream_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MultiHunk.ProtoReflect.Descriptor instead. -func (*MultiHunk) Descriptor() ([]byte, []int) { - return file_transport_internet_grpc_encoding_stream_proto_rawDescGZIP(), []int{1} -} - -func (x *MultiHunk) GetData() [][]byte { - if x != nil { - return x.Data - } - return nil -} - -var File_transport_internet_grpc_encoding_stream_proto protoreflect.FileDescriptor - -var file_transport_internet_grpc_encoding_stream_proto_rawDesc = []byte{ - 0x0a, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x25, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x1a, 0x0a, 0x04, 0x48, 0x75, 0x6e, 0x6b, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x1f, 0x0a, 0x09, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x75, 0x6e, 0x6b, 0x12, - 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x32, 0xe6, 0x01, 0x0a, 0x0b, 0x47, 0x52, 0x50, 0x43, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x03, 0x54, 0x75, 0x6e, 0x12, 0x2b, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x2e, 0x48, 0x75, 0x6e, 0x6b, 0x1a, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, - 0x48, 0x75, 0x6e, 0x6b, 0x28, 0x01, 0x30, 0x01, 0x12, 0x72, 0x0a, 0x08, 0x54, 0x75, 0x6e, 0x4d, - 0x75, 0x6c, 0x74, 0x69, 0x12, 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x67, - 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x4d, 0x75, 0x6c, - 0x74, 0x69, 0x48, 0x75, 0x6e, 0x6b, 0x1a, 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x4d, - 0x75, 0x6c, 0x74, 0x69, 0x48, 0x75, 0x6e, 0x6b, 0x28, 0x01, 0x30, 0x01, 0x42, 0x3c, 0x5a, 0x3a, - 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_transport_internet_grpc_encoding_stream_proto_rawDescOnce sync.Once - file_transport_internet_grpc_encoding_stream_proto_rawDescData = file_transport_internet_grpc_encoding_stream_proto_rawDesc -) - -func file_transport_internet_grpc_encoding_stream_proto_rawDescGZIP() []byte { - file_transport_internet_grpc_encoding_stream_proto_rawDescOnce.Do(func() { - file_transport_internet_grpc_encoding_stream_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_grpc_encoding_stream_proto_rawDescData) - }) - return file_transport_internet_grpc_encoding_stream_proto_rawDescData -} - -var file_transport_internet_grpc_encoding_stream_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_grpc_encoding_stream_proto_goTypes = []interface{}{ - (*Hunk)(nil), // 0: xray.transport.internet.grpc.encoding.Hunk - (*MultiHunk)(nil), // 1: xray.transport.internet.grpc.encoding.MultiHunk -} -var file_transport_internet_grpc_encoding_stream_proto_depIdxs = []int32{ - 0, // 0: xray.transport.internet.grpc.encoding.GRPCService.Tun:input_type -> xray.transport.internet.grpc.encoding.Hunk - 1, // 1: xray.transport.internet.grpc.encoding.GRPCService.TunMulti:input_type -> xray.transport.internet.grpc.encoding.MultiHunk - 0, // 2: xray.transport.internet.grpc.encoding.GRPCService.Tun:output_type -> xray.transport.internet.grpc.encoding.Hunk - 1, // 3: xray.transport.internet.grpc.encoding.GRPCService.TunMulti:output_type -> xray.transport.internet.grpc.encoding.MultiHunk - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_grpc_encoding_stream_proto_init() } -func file_transport_internet_grpc_encoding_stream_proto_init() { - if File_transport_internet_grpc_encoding_stream_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_grpc_encoding_stream_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Hunk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_grpc_encoding_stream_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MultiHunk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_grpc_encoding_stream_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_transport_internet_grpc_encoding_stream_proto_goTypes, - DependencyIndexes: file_transport_internet_grpc_encoding_stream_proto_depIdxs, - MessageInfos: file_transport_internet_grpc_encoding_stream_proto_msgTypes, - }.Build() - File_transport_internet_grpc_encoding_stream_proto = out.File - file_transport_internet_grpc_encoding_stream_proto_rawDesc = nil - file_transport_internet_grpc_encoding_stream_proto_goTypes = nil - file_transport_internet_grpc_encoding_stream_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/grpc/encoding/stream_grpc.pb.go b/xray_api/proto/transport/internet/grpc/encoding/stream_grpc.pb.go deleted file mode 100644 index 5daf42a..0000000 --- a/xray_api/proto/transport/internet/grpc/encoding/stream_grpc.pb.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v5.27.0 -// source: transport/internet/grpc/encoding/stream.proto - -package encoding - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - GRPCService_Tun_FullMethodName = "/xray.transport.internet.grpc.encoding.GRPCService/Tun" - GRPCService_TunMulti_FullMethodName = "/xray.transport.internet.grpc.encoding.GRPCService/TunMulti" -) - -// GRPCServiceClient is the client API for GRPCService service. -// -// 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 GRPCServiceClient interface { - Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error) - TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error) -} - -type gRPCServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewGRPCServiceClient(cc grpc.ClientConnInterface) GRPCServiceClient { - return &gRPCServiceClient{cc} -} - -func (c *gRPCServiceClient) Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error) { - stream, err := c.cc.NewStream(ctx, &GRPCService_ServiceDesc.Streams[0], GRPCService_Tun_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &gRPCServiceTunClient{stream} - return x, nil -} - -type GRPCService_TunClient interface { - Send(*Hunk) error - Recv() (*Hunk, error) - grpc.ClientStream -} - -type gRPCServiceTunClient struct { - grpc.ClientStream -} - -func (x *gRPCServiceTunClient) Send(m *Hunk) error { - return x.ClientStream.SendMsg(m) -} - -func (x *gRPCServiceTunClient) Recv() (*Hunk, error) { - m := new(Hunk) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *gRPCServiceClient) TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error) { - stream, err := c.cc.NewStream(ctx, &GRPCService_ServiceDesc.Streams[1], GRPCService_TunMulti_FullMethodName, opts...) - if err != nil { - return nil, err - } - x := &gRPCServiceTunMultiClient{stream} - return x, nil -} - -type GRPCService_TunMultiClient interface { - Send(*MultiHunk) error - Recv() (*MultiHunk, error) - grpc.ClientStream -} - -type gRPCServiceTunMultiClient struct { - grpc.ClientStream -} - -func (x *gRPCServiceTunMultiClient) Send(m *MultiHunk) error { - return x.ClientStream.SendMsg(m) -} - -func (x *gRPCServiceTunMultiClient) Recv() (*MultiHunk, error) { - m := new(MultiHunk) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// GRPCServiceServer is the server API for GRPCService service. -// All implementations must embed UnimplementedGRPCServiceServer -// for forward compatibility -type GRPCServiceServer interface { - Tun(GRPCService_TunServer) error - TunMulti(GRPCService_TunMultiServer) error - mustEmbedUnimplementedGRPCServiceServer() -} - -// UnimplementedGRPCServiceServer must be embedded to have forward compatible implementations. -type UnimplementedGRPCServiceServer struct { -} - -func (UnimplementedGRPCServiceServer) Tun(GRPCService_TunServer) error { - return status.Errorf(codes.Unimplemented, "method Tun not implemented") -} -func (UnimplementedGRPCServiceServer) TunMulti(GRPCService_TunMultiServer) error { - return status.Errorf(codes.Unimplemented, "method TunMulti not implemented") -} -func (UnimplementedGRPCServiceServer) mustEmbedUnimplementedGRPCServiceServer() {} - -// UnsafeGRPCServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to GRPCServiceServer will -// result in compilation errors. -type UnsafeGRPCServiceServer interface { - mustEmbedUnimplementedGRPCServiceServer() -} - -func RegisterGRPCServiceServer(s grpc.ServiceRegistrar, srv GRPCServiceServer) { - s.RegisterService(&GRPCService_ServiceDesc, srv) -} - -func _GRPCService_Tun_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(GRPCServiceServer).Tun(&gRPCServiceTunServer{stream}) -} - -type GRPCService_TunServer interface { - Send(*Hunk) error - Recv() (*Hunk, error) - grpc.ServerStream -} - -type gRPCServiceTunServer struct { - grpc.ServerStream -} - -func (x *gRPCServiceTunServer) Send(m *Hunk) error { - return x.ServerStream.SendMsg(m) -} - -func (x *gRPCServiceTunServer) Recv() (*Hunk, error) { - m := new(Hunk) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _GRPCService_TunMulti_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(GRPCServiceServer).TunMulti(&gRPCServiceTunMultiServer{stream}) -} - -type GRPCService_TunMultiServer interface { - Send(*MultiHunk) error - Recv() (*MultiHunk, error) - grpc.ServerStream -} - -type gRPCServiceTunMultiServer struct { - grpc.ServerStream -} - -func (x *gRPCServiceTunMultiServer) Send(m *MultiHunk) error { - return x.ServerStream.SendMsg(m) -} - -func (x *gRPCServiceTunMultiServer) Recv() (*MultiHunk, error) { - m := new(MultiHunk) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// GRPCService_ServiceDesc is the grpc.ServiceDesc for GRPCService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var GRPCService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "xray.transport.internet.grpc.encoding.GRPCService", - HandlerType: (*GRPCServiceServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "Tun", - Handler: _GRPCService_Tun_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "TunMulti", - Handler: _GRPCService_TunMulti_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "transport/internet/grpc/encoding/stream.proto", -} diff --git a/xray_api/proto/transport/internet/headers/dns/config.pb.go b/xray_api/proto/transport/internet/headers/dns/config.pb.go deleted file mode 100644 index 78e5e99..0000000 --- a/xray_api/proto/transport/internet/headers/dns/config.pb.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/dns/config.proto - -package dns - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_dns_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_dns_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_dns_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -var File_transport_internet_headers_dns_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_dns_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x6e, 0x73, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x64, - 0x6e, 0x73, 0x22, 0x20, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x64, 0x6e, 0x73, - 0x50, 0x01, 0x5a, 0x38, 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, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x23, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x44, - 0x4e, 0x53, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_dns_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_dns_config_proto_rawDescData = file_transport_internet_headers_dns_config_proto_rawDesc -) - -func file_transport_internet_headers_dns_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_dns_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_dns_config_proto_rawDescData) - }) - return file_transport_internet_headers_dns_config_proto_rawDescData -} - -var file_transport_internet_headers_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_dns_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.headers.dns.Config -} -var file_transport_internet_headers_dns_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_dns_config_proto_init() } -func file_transport_internet_headers_dns_config_proto_init() { - if File_transport_internet_headers_dns_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_dns_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_dns_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_dns_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_dns_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_dns_config_proto = out.File - file_transport_internet_headers_dns_config_proto_rawDesc = nil - file_transport_internet_headers_dns_config_proto_goTypes = nil - file_transport_internet_headers_dns_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/http/config.pb.go b/xray_api/proto/transport/internet/headers/http/config.pb.go deleted file mode 100644 index 681323f..0000000 --- a/xray_api/proto/transport/internet/headers/http/config.pb.go +++ /dev/null @@ -1,649 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/http/config.proto - -package http - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Header struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // "Accept", "Cookie", etc - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Each entry must be valid in one piece. Random entry will be chosen if - // multiple entries present. - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` -} - -func (x *Header) Reset() { - *x = Header{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Header) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Header) ProtoMessage() {} - -func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Header.ProtoReflect.Descriptor instead. -func (*Header) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Header) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Header) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -// HTTP version. Default value "1.1". -type Version struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Version) Reset() { - *x = Version{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Version) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Version) ProtoMessage() {} - -func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Version.ProtoReflect.Descriptor instead. -func (*Version) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Version) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -// HTTP method. Default value "GET". -type Method struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Method) Reset() { - *x = Method{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Method) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Method) ProtoMessage() {} - -func (x *Method) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Method.ProtoReflect.Descriptor instead. -func (*Method) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{2} -} - -func (x *Method) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -type RequestConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Full HTTP version like "1.1". - Version *Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // GET, POST, CONNECT etc - Method *Method `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` - // URI like "/login.php" - Uri []string `protobuf:"bytes,3,rep,name=uri,proto3" json:"uri,omitempty"` - Header []*Header `protobuf:"bytes,4,rep,name=header,proto3" json:"header,omitempty"` -} - -func (x *RequestConfig) Reset() { - *x = RequestConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RequestConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RequestConfig) ProtoMessage() {} - -func (x *RequestConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RequestConfig.ProtoReflect.Descriptor instead. -func (*RequestConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{3} -} - -func (x *RequestConfig) GetVersion() *Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *RequestConfig) GetMethod() *Method { - if x != nil { - return x.Method - } - return nil -} - -func (x *RequestConfig) GetUri() []string { - if x != nil { - return x.Uri - } - return nil -} - -func (x *RequestConfig) GetHeader() []*Header { - if x != nil { - return x.Header - } - return nil -} - -type Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Status code. Default "200". - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - // Statue reason. Default "OK". - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` -} - -func (x *Status) Reset() { - *x = Status{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{4} -} - -func (x *Status) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *Status) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -type ResponseConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version *Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Status *Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` - Header []*Header `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"` -} - -func (x *ResponseConfig) Reset() { - *x = ResponseConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResponseConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResponseConfig) ProtoMessage() {} - -func (x *ResponseConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ResponseConfig.ProtoReflect.Descriptor instead. -func (*ResponseConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{5} -} - -func (x *ResponseConfig) GetVersion() *Version { - if x != nil { - return x.Version - } - return nil -} - -func (x *ResponseConfig) GetStatus() *Status { - if x != nil { - return x.Status - } - return nil -} - -func (x *ResponseConfig) GetHeader() []*Header { - if x != nil { - return x.Header - } - return nil -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Settings for authenticating requests. If not set, client side will not send - // authenication header, and server side will bypass authentication. - Request *RequestConfig `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // Settings for authenticating responses. If not set, client side will bypass - // authentication, and server side will not send authentication header. - Response *ResponseConfig `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_http_config_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{6} -} - -func (x *Config) GetRequest() *RequestConfig { - if x != nil { - return x.Request - } - return nil -} - -func (x *Config) GetResponse() *ResponseConfig { - if x != nil { - return x.Response - } - return nil -} - -var File_transport_internet_headers_http_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_http_config_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x68, 0x74, 0x74, 0x70, 0x22, 0x32, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1f, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x1e, 0x0a, 0x06, 0x4d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x0d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, - 0x69, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x44, 0x0a, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x22, 0x34, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, 0xe5, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x44, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, - 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x22, 0xa9, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, - 0x74, 0x74, 0x70, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x8e, 0x01, 0x0a, - 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_http_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_http_config_proto_rawDescData = file_transport_internet_headers_http_config_proto_rawDesc -) - -func file_transport_internet_headers_http_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_http_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_http_config_proto_rawDescData) - }) - return file_transport_internet_headers_http_config_proto_rawDescData -} - -var file_transport_internet_headers_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_transport_internet_headers_http_config_proto_goTypes = []interface{}{ - (*Header)(nil), // 0: xray.transport.internet.headers.http.Header - (*Version)(nil), // 1: xray.transport.internet.headers.http.Version - (*Method)(nil), // 2: xray.transport.internet.headers.http.Method - (*RequestConfig)(nil), // 3: xray.transport.internet.headers.http.RequestConfig - (*Status)(nil), // 4: xray.transport.internet.headers.http.Status - (*ResponseConfig)(nil), // 5: xray.transport.internet.headers.http.ResponseConfig - (*Config)(nil), // 6: xray.transport.internet.headers.http.Config -} -var file_transport_internet_headers_http_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.headers.http.RequestConfig.version:type_name -> xray.transport.internet.headers.http.Version - 2, // 1: xray.transport.internet.headers.http.RequestConfig.method:type_name -> xray.transport.internet.headers.http.Method - 0, // 2: xray.transport.internet.headers.http.RequestConfig.header:type_name -> xray.transport.internet.headers.http.Header - 1, // 3: xray.transport.internet.headers.http.ResponseConfig.version:type_name -> xray.transport.internet.headers.http.Version - 4, // 4: xray.transport.internet.headers.http.ResponseConfig.status:type_name -> xray.transport.internet.headers.http.Status - 0, // 5: xray.transport.internet.headers.http.ResponseConfig.header:type_name -> xray.transport.internet.headers.http.Header - 3, // 6: xray.transport.internet.headers.http.Config.request:type_name -> xray.transport.internet.headers.http.RequestConfig - 5, // 7: xray.transport.internet.headers.http.Config.response:type_name -> xray.transport.internet.headers.http.ResponseConfig - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_http_config_proto_init() } -func file_transport_internet_headers_http_config_proto_init() { - if File_transport_internet_headers_http_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Header); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Version); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Method); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResponseConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_http_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_http_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_http_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_http_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_http_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_http_config_proto = out.File - file_transport_internet_headers_http_config_proto_rawDesc = nil - file_transport_internet_headers_http_config_proto_goTypes = nil - file_transport_internet_headers_http_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/noop/config.pb.go b/xray_api/proto/transport/internet/headers/noop/config.pb.go deleted file mode 100644 index 844c3f2..0000000 --- a/xray_api/proto/transport/internet/headers/noop/config.pb.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/noop/config.proto - -package noop - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_noop_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_noop_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{0} -} - -type ConnectionConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ConnectionConfig) Reset() { - *x = ConnectionConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_noop_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConnectionConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConnectionConfig) ProtoMessage() {} - -func (x *ConnectionConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_noop_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConnectionConfig.ProtoReflect.Descriptor instead. -func (*ConnectionConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{1} -} - -var File_transport_internet_headers_noop_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_noop_config_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, - 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x6e, 0x6f, 0x6f, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x12, - 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x50, - 0x01, 0x5a, 0x39, 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, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, 0x70, 0xaa, 0x02, 0x24, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x4e, - 0x6f, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_noop_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_noop_config_proto_rawDescData = file_transport_internet_headers_noop_config_proto_rawDesc -) - -func file_transport_internet_headers_noop_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_noop_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_noop_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_noop_config_proto_rawDescData) - }) - return file_transport_internet_headers_noop_config_proto_rawDescData -} - -var file_transport_internet_headers_noop_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_headers_noop_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.headers.noop.Config - (*ConnectionConfig)(nil), // 1: xray.transport.internet.headers.noop.ConnectionConfig -} -var file_transport_internet_headers_noop_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_noop_config_proto_init() } -func file_transport_internet_headers_noop_config_proto_init() { - if File_transport_internet_headers_noop_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_noop_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_headers_noop_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConnectionConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_noop_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_noop_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_noop_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_noop_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_noop_config_proto = out.File - file_transport_internet_headers_noop_config_proto_rawDesc = nil - file_transport_internet_headers_noop_config_proto_goTypes = nil - file_transport_internet_headers_noop_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/srtp/config.pb.go b/xray_api/proto/transport/internet/headers/srtp/config.pb.go deleted file mode 100644 index f0bff8f..0000000 --- a/xray_api/proto/transport/internet/headers/srtp/config.pb.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/srtp/config.proto - -package srtp - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Padding bool `protobuf:"varint,2,opt,name=padding,proto3" json:"padding,omitempty"` - Extension bool `protobuf:"varint,3,opt,name=extension,proto3" json:"extension,omitempty"` - CsrcCount uint32 `protobuf:"varint,4,opt,name=csrc_count,json=csrcCount,proto3" json:"csrc_count,omitempty"` - Marker bool `protobuf:"varint,5,opt,name=marker,proto3" json:"marker,omitempty"` - PayloadType uint32 `protobuf:"varint,6,opt,name=payload_type,json=payloadType,proto3" json:"payload_type,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_srtp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_srtp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_srtp_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *Config) GetPadding() bool { - if x != nil { - return x.Padding - } - return false -} - -func (x *Config) GetExtension() bool { - if x != nil { - return x.Extension - } - return false -} - -func (x *Config) GetCsrcCount() uint32 { - if x != nil { - return x.CsrcCount - } - return 0 -} - -func (x *Config) GetMarker() bool { - if x != nil { - return x.Marker - } - return false -} - -func (x *Config) GetPayloadType() uint32 { - if x != nil { - return x.PayloadType - } - return 0 -} - -var File_transport_internet_headers_srtp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_srtp_config_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x73, 0x72, 0x74, - 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x24, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x73, 0x72, 0x74, 0x70, 0x22, 0xb4, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, - 0x64, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, - 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x73, 0x72, 0x63, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x73, 0x72, 0x63, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x28, - 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x73, 0x72, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x2f, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x72, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_srtp_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_srtp_config_proto_rawDescData = file_transport_internet_headers_srtp_config_proto_rawDesc -) - -func file_transport_internet_headers_srtp_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_srtp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_srtp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_srtp_config_proto_rawDescData) - }) - return file_transport_internet_headers_srtp_config_proto_rawDescData -} - -var file_transport_internet_headers_srtp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_srtp_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.headers.srtp.Config -} -var file_transport_internet_headers_srtp_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_srtp_config_proto_init() } -func file_transport_internet_headers_srtp_config_proto_init() { - if File_transport_internet_headers_srtp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_srtp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_srtp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_srtp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_srtp_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_srtp_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_srtp_config_proto = out.File - file_transport_internet_headers_srtp_config_proto_rawDesc = nil - file_transport_internet_headers_srtp_config_proto_goTypes = nil - file_transport_internet_headers_srtp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/tls/config.pb.go b/xray_api/proto/transport/internet/headers/tls/config.pb.go deleted file mode 100644 index 3c4786c..0000000 --- a/xray_api/proto/transport/internet/headers/tls/config.pb.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/tls/config.proto - -package tls - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type PacketConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *PacketConfig) Reset() { - *x = PacketConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_tls_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PacketConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PacketConfig) ProtoMessage() {} - -func (x *PacketConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_tls_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PacketConfig.ProtoReflect.Descriptor instead. -func (*PacketConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_tls_config_proto_rawDescGZIP(), []int{0} -} - -var File_transport_internet_headers_tls_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_tls_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, - 0x6c, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, 0x6c, 0x73, 0x50, 0x01, - 0x5a, 0x38, 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, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x23, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x6c, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_tls_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_tls_config_proto_rawDescData = file_transport_internet_headers_tls_config_proto_rawDesc -) - -func file_transport_internet_headers_tls_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_tls_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_tls_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_tls_config_proto_rawDescData) - }) - return file_transport_internet_headers_tls_config_proto_rawDescData -} - -var file_transport_internet_headers_tls_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_tls_config_proto_goTypes = []interface{}{ - (*PacketConfig)(nil), // 0: xray.transport.internet.headers.tls.PacketConfig -} -var file_transport_internet_headers_tls_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_tls_config_proto_init() } -func file_transport_internet_headers_tls_config_proto_init() { - if File_transport_internet_headers_tls_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_tls_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PacketConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_tls_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_tls_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_tls_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_tls_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_tls_config_proto = out.File - file_transport_internet_headers_tls_config_proto_rawDesc = nil - file_transport_internet_headers_tls_config_proto_goTypes = nil - file_transport_internet_headers_tls_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/utp/config.pb.go b/xray_api/proto/transport/internet/headers/utp/config.pb.go deleted file mode 100644 index ed04788..0000000 --- a/xray_api/proto/transport/internet/headers/utp/config.pb.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/utp/config.proto - -package utp - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_utp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_utp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_utp_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -var File_transport_internet_headers_utp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_utp_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, 0x70, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, - 0x74, 0x70, 0x22, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, - 0x74, 0x70, 0x50, 0x01, 0x5a, 0x38, 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, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, 0x70, 0xaa, 0x02, - 0x23, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x2e, 0x55, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_utp_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_utp_config_proto_rawDescData = file_transport_internet_headers_utp_config_proto_rawDesc -) - -func file_transport_internet_headers_utp_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_utp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_utp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_utp_config_proto_rawDescData) - }) - return file_transport_internet_headers_utp_config_proto_rawDescData -} - -var file_transport_internet_headers_utp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_utp_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.headers.utp.Config -} -var file_transport_internet_headers_utp_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_utp_config_proto_init() } -func file_transport_internet_headers_utp_config_proto_init() { - if File_transport_internet_headers_utp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_utp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_utp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_utp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_utp_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_utp_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_utp_config_proto = out.File - file_transport_internet_headers_utp_config_proto_rawDesc = nil - file_transport_internet_headers_utp_config_proto_goTypes = nil - file_transport_internet_headers_utp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/wechat/config.pb.go b/xray_api/proto/transport/internet/headers/wechat/config.pb.go deleted file mode 100644 index 3961181..0000000 --- a/xray_api/proto/transport/internet/headers/wechat/config.pb.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/wechat/config.proto - -package wechat - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type VideoConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *VideoConfig) Reset() { - *x = VideoConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_wechat_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *VideoConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*VideoConfig) ProtoMessage() {} - -func (x *VideoConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_wechat_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use VideoConfig.ProtoReflect.Descriptor instead. -func (*VideoConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_wechat_config_proto_rawDescGZIP(), []int{0} -} - -var File_transport_internet_headers_wechat_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_wechat_config_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x65, 0x63, - 0x68, 0x61, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x26, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x94, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x3b, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, - 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x26, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_wechat_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_wechat_config_proto_rawDescData = file_transport_internet_headers_wechat_config_proto_rawDesc -) - -func file_transport_internet_headers_wechat_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_wechat_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_wechat_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_wechat_config_proto_rawDescData) - }) - return file_transport_internet_headers_wechat_config_proto_rawDescData -} - -var file_transport_internet_headers_wechat_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_wechat_config_proto_goTypes = []interface{}{ - (*VideoConfig)(nil), // 0: xray.transport.internet.headers.wechat.VideoConfig -} -var file_transport_internet_headers_wechat_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_wechat_config_proto_init() } -func file_transport_internet_headers_wechat_config_proto_init() { - if File_transport_internet_headers_wechat_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_wechat_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VideoConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_wechat_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_wechat_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_wechat_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_wechat_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_wechat_config_proto = out.File - file_transport_internet_headers_wechat_config_proto_rawDesc = nil - file_transport_internet_headers_wechat_config_proto_goTypes = nil - file_transport_internet_headers_wechat_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/headers/wireguard/config.pb.go b/xray_api/proto/transport/internet/headers/wireguard/config.pb.go deleted file mode 100644 index 2212c69..0000000 --- a/xray_api/proto/transport/internet/headers/wireguard/config.pb.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/headers/wireguard/config.proto - -package wireguard - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type WireguardConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *WireguardConfig) Reset() { - *x = WireguardConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_headers_wireguard_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WireguardConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WireguardConfig) ProtoMessage() {} - -func (x *WireguardConfig) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_headers_wireguard_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WireguardConfig.ProtoReflect.Descriptor instead. -func (*WireguardConfig) Descriptor() ([]byte, []int) { - return file_transport_internet_headers_wireguard_config_proto_rawDescGZIP(), []int{0} -} - -var File_transport_internet_headers_wireguard_config_proto protoreflect.FileDescriptor - -var file_transport_internet_headers_wireguard_config_proto_rawDesc = []byte{ - 0x0a, 0x31, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x69, 0x72, - 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x22, 0x11, - 0x0a, 0x0f, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x42, 0x9d, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, - 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x3e, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x69, 0x72, 0x65, - 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x29, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, - 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_headers_wireguard_config_proto_rawDescOnce sync.Once - file_transport_internet_headers_wireguard_config_proto_rawDescData = file_transport_internet_headers_wireguard_config_proto_rawDesc -) - -func file_transport_internet_headers_wireguard_config_proto_rawDescGZIP() []byte { - file_transport_internet_headers_wireguard_config_proto_rawDescOnce.Do(func() { - file_transport_internet_headers_wireguard_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_headers_wireguard_config_proto_rawDescData) - }) - return file_transport_internet_headers_wireguard_config_proto_rawDescData -} - -var file_transport_internet_headers_wireguard_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_headers_wireguard_config_proto_goTypes = []interface{}{ - (*WireguardConfig)(nil), // 0: xray.transport.internet.headers.wireguard.WireguardConfig -} -var file_transport_internet_headers_wireguard_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_headers_wireguard_config_proto_init() } -func file_transport_internet_headers_wireguard_config_proto_init() { - if File_transport_internet_headers_wireguard_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_headers_wireguard_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WireguardConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_headers_wireguard_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_headers_wireguard_config_proto_goTypes, - DependencyIndexes: file_transport_internet_headers_wireguard_config_proto_depIdxs, - MessageInfos: file_transport_internet_headers_wireguard_config_proto_msgTypes, - }.Build() - File_transport_internet_headers_wireguard_config_proto = out.File - file_transport_internet_headers_wireguard_config_proto_rawDesc = nil - file_transport_internet_headers_wireguard_config_proto_goTypes = nil - file_transport_internet_headers_wireguard_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/http/config.pb.go b/xray_api/proto/transport/internet/http/config.pb.go deleted file mode 100644 index 5db5a3c..0000000 --- a/xray_api/proto/transport/internet/http/config.pb.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/http/config.proto - -package http - -import ( - http "marzban-node/xray_api/proto/transport/internet/headers/http" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Host []string `protobuf:"bytes,1,rep,name=host,proto3" json:"host,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - IdleTimeout int32 `protobuf:"varint,3,opt,name=idle_timeout,json=idleTimeout,proto3" json:"idle_timeout,omitempty"` - HealthCheckTimeout int32 `protobuf:"varint,4,opt,name=health_check_timeout,json=healthCheckTimeout,proto3" json:"health_check_timeout,omitempty"` - Method string `protobuf:"bytes,5,opt,name=method,proto3" json:"method,omitempty"` - Header []*http.Header `protobuf:"bytes,6,rep,name=header,proto3" json:"header,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_http_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_http_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_http_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetHost() []string { - if x != nil { - return x.Host - } - return nil -} - -func (x *Config) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Config) GetIdleTimeout() int32 { - if x != nil { - return x.IdleTimeout - } - return 0 -} - -func (x *Config) GetHealthCheckTimeout() int32 { - if x != nil { - return x.HealthCheckTimeout - } - return 0 -} - -func (x *Config) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *Config) GetHeader() []*http.Header { - if x != nil { - return x.Header - } - return nil -} - -var File_transport_internet_http_config_proto protoreflect.FileDescriptor - -var file_transport_internet_http_config_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x68, 0x74, 0x74, 0x70, 0x1a, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xe3, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x69, 0x64, 0x6c, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x30, 0x0a, 0x14, 0x68, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, - 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x31, - 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, 0x70, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_http_config_proto_rawDescOnce sync.Once - file_transport_internet_http_config_proto_rawDescData = file_transport_internet_http_config_proto_rawDesc -) - -func file_transport_internet_http_config_proto_rawDescGZIP() []byte { - file_transport_internet_http_config_proto_rawDescOnce.Do(func() { - file_transport_internet_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_http_config_proto_rawDescData) - }) - return file_transport_internet_http_config_proto_rawDescData -} - -var file_transport_internet_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_http_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.http.Config - (*http.Header)(nil), // 1: xray.transport.internet.headers.http.Header -} -var file_transport_internet_http_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.http.Config.header:type_name -> xray.transport.internet.headers.http.Header - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_internet_http_config_proto_init() } -func file_transport_internet_http_config_proto_init() { - if File_transport_internet_http_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_http_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_http_config_proto_goTypes, - DependencyIndexes: file_transport_internet_http_config_proto_depIdxs, - MessageInfos: file_transport_internet_http_config_proto_msgTypes, - }.Build() - File_transport_internet_http_config_proto = out.File - file_transport_internet_http_config_proto_rawDesc = nil - file_transport_internet_http_config_proto_goTypes = nil - file_transport_internet_http_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/httpupgrade/config.pb.go b/xray_api/proto/transport/internet/httpupgrade/config.pb.go deleted file mode 100644 index 9c0a4de..0000000 --- a/xray_api/proto/transport/internet/httpupgrade/config.pb.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/httpupgrade/config.proto - -package httpupgrade - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Header map[string]string `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - AcceptProxyProtocol bool `protobuf:"varint,4,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` - Ed uint32 `protobuf:"varint,5,opt,name=ed,proto3" json:"ed,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_httpupgrade_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_httpupgrade_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_httpupgrade_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *Config) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Config) GetHeader() map[string]string { - if x != nil { - return x.Header - } - return nil -} - -func (x *Config) GetAcceptProxyProtocol() bool { - if x != nil { - return x.AcceptProxyProtocol - } - return false -} - -func (x *Config) GetEd() uint32 { - if x != nil { - return x.Ed - } - return 0 -} - -var File_transport_internet_httpupgrade_config_proto protoreflect.FileDescriptor - -var file_transport_internet_httpupgrade_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x23, 0x78, - 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x75, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x22, 0x80, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x4f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x68, 0x74, 0x74, 0x70, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, - 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x65, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, - 0x65, 0x50, 0x01, 0x5a, 0x38, 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, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0xaa, 0x02, 0x23, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x55, 0x70, 0x67, 0x72, - 0x61, 0x64, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_httpupgrade_config_proto_rawDescOnce sync.Once - file_transport_internet_httpupgrade_config_proto_rawDescData = file_transport_internet_httpupgrade_config_proto_rawDesc -) - -func file_transport_internet_httpupgrade_config_proto_rawDescGZIP() []byte { - file_transport_internet_httpupgrade_config_proto_rawDescOnce.Do(func() { - file_transport_internet_httpupgrade_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_httpupgrade_config_proto_rawDescData) - }) - return file_transport_internet_httpupgrade_config_proto_rawDescData -} - -var file_transport_internet_httpupgrade_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_httpupgrade_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.httpupgrade.Config - nil, // 1: xray.transport.internet.httpupgrade.Config.HeaderEntry -} -var file_transport_internet_httpupgrade_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.httpupgrade.Config.header:type_name -> xray.transport.internet.httpupgrade.Config.HeaderEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_internet_httpupgrade_config_proto_init() } -func file_transport_internet_httpupgrade_config_proto_init() { - if File_transport_internet_httpupgrade_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_httpupgrade_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_httpupgrade_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_httpupgrade_config_proto_goTypes, - DependencyIndexes: file_transport_internet_httpupgrade_config_proto_depIdxs, - MessageInfos: file_transport_internet_httpupgrade_config_proto_msgTypes, - }.Build() - File_transport_internet_httpupgrade_config_proto = out.File - file_transport_internet_httpupgrade_config_proto_rawDesc = nil - file_transport_internet_httpupgrade_config_proto_goTypes = nil - file_transport_internet_httpupgrade_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/kcp/config.pb.go b/xray_api/proto/transport/internet/kcp/config.pb.go deleted file mode 100644 index 3a91310..0000000 --- a/xray_api/proto/transport/internet/kcp/config.pb.go +++ /dev/null @@ -1,768 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/kcp/config.proto - -package kcp - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Maximum Transmission Unit, in bytes. -type MTU struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *MTU) Reset() { - *x = MTU{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MTU) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MTU) ProtoMessage() {} - -func (x *MTU) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MTU.ProtoReflect.Descriptor instead. -func (*MTU) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{0} -} - -func (x *MTU) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -// Transmission Time Interview, in milli-sec. -type TTI struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *TTI) Reset() { - *x = TTI{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TTI) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TTI) ProtoMessage() {} - -func (x *TTI) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TTI.ProtoReflect.Descriptor instead. -func (*TTI) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{1} -} - -func (x *TTI) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -// Uplink capacity, in MB. -type UplinkCapacity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *UplinkCapacity) Reset() { - *x = UplinkCapacity{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UplinkCapacity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UplinkCapacity) ProtoMessage() {} - -func (x *UplinkCapacity) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UplinkCapacity.ProtoReflect.Descriptor instead. -func (*UplinkCapacity) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{2} -} - -func (x *UplinkCapacity) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -// Downlink capacity, in MB. -type DownlinkCapacity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Value uint32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *DownlinkCapacity) Reset() { - *x = DownlinkCapacity{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DownlinkCapacity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DownlinkCapacity) ProtoMessage() {} - -func (x *DownlinkCapacity) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DownlinkCapacity.ProtoReflect.Descriptor instead. -func (*DownlinkCapacity) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{3} -} - -func (x *DownlinkCapacity) GetValue() uint32 { - if x != nil { - return x.Value - } - return 0 -} - -type WriteBuffer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Buffer size in bytes. - Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *WriteBuffer) Reset() { - *x = WriteBuffer{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteBuffer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteBuffer) ProtoMessage() {} - -func (x *WriteBuffer) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use WriteBuffer.ProtoReflect.Descriptor instead. -func (*WriteBuffer) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{4} -} - -func (x *WriteBuffer) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -type ReadBuffer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Buffer size in bytes. - Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"` -} - -func (x *ReadBuffer) Reset() { - *x = ReadBuffer{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ReadBuffer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadBuffer) ProtoMessage() {} - -func (x *ReadBuffer) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ReadBuffer.ProtoReflect.Descriptor instead. -func (*ReadBuffer) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{5} -} - -func (x *ReadBuffer) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -type ConnectionReuse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"` -} - -func (x *ConnectionReuse) Reset() { - *x = ConnectionReuse{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConnectionReuse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConnectionReuse) ProtoMessage() {} - -func (x *ConnectionReuse) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConnectionReuse.ProtoReflect.Descriptor instead. -func (*ConnectionReuse) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{6} -} - -func (x *ConnectionReuse) GetEnable() bool { - if x != nil { - return x.Enable - } - return false -} - -// Maximum Transmission Unit, in bytes. -type EncryptionSeed struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Seed string `protobuf:"bytes,1,opt,name=seed,proto3" json:"seed,omitempty"` -} - -func (x *EncryptionSeed) Reset() { - *x = EncryptionSeed{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EncryptionSeed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EncryptionSeed) ProtoMessage() {} - -func (x *EncryptionSeed) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EncryptionSeed.ProtoReflect.Descriptor instead. -func (*EncryptionSeed) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{7} -} - -func (x *EncryptionSeed) GetSeed() string { - if x != nil { - return x.Seed - } - return "" -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Mtu *MTU `protobuf:"bytes,1,opt,name=mtu,proto3" json:"mtu,omitempty"` - Tti *TTI `protobuf:"bytes,2,opt,name=tti,proto3" json:"tti,omitempty"` - UplinkCapacity *UplinkCapacity `protobuf:"bytes,3,opt,name=uplink_capacity,json=uplinkCapacity,proto3" json:"uplink_capacity,omitempty"` - DownlinkCapacity *DownlinkCapacity `protobuf:"bytes,4,opt,name=downlink_capacity,json=downlinkCapacity,proto3" json:"downlink_capacity,omitempty"` - Congestion bool `protobuf:"varint,5,opt,name=congestion,proto3" json:"congestion,omitempty"` - WriteBuffer *WriteBuffer `protobuf:"bytes,6,opt,name=write_buffer,json=writeBuffer,proto3" json:"write_buffer,omitempty"` - ReadBuffer *ReadBuffer `protobuf:"bytes,7,opt,name=read_buffer,json=readBuffer,proto3" json:"read_buffer,omitempty"` - HeaderConfig *serial.TypedMessage `protobuf:"bytes,8,opt,name=header_config,json=headerConfig,proto3" json:"header_config,omitempty"` - Seed *EncryptionSeed `protobuf:"bytes,10,opt,name=seed,proto3" json:"seed,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_kcp_config_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_kcp_config_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{8} -} - -func (x *Config) GetMtu() *MTU { - if x != nil { - return x.Mtu - } - return nil -} - -func (x *Config) GetTti() *TTI { - if x != nil { - return x.Tti - } - return nil -} - -func (x *Config) GetUplinkCapacity() *UplinkCapacity { - if x != nil { - return x.UplinkCapacity - } - return nil -} - -func (x *Config) GetDownlinkCapacity() *DownlinkCapacity { - if x != nil { - return x.DownlinkCapacity - } - return nil -} - -func (x *Config) GetCongestion() bool { - if x != nil { - return x.Congestion - } - return false -} - -func (x *Config) GetWriteBuffer() *WriteBuffer { - if x != nil { - return x.WriteBuffer - } - return nil -} - -func (x *Config) GetReadBuffer() *ReadBuffer { - if x != nil { - return x.ReadBuffer - } - return nil -} - -func (x *Config) GetHeaderConfig() *serial.TypedMessage { - if x != nil { - return x.HeaderConfig - } - return nil -} - -func (x *Config) GetSeed() *EncryptionSeed { - if x != nil { - return x.Seed - } - return nil -} - -var File_transport_internet_kcp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_kcp_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, - 0x63, 0x70, 0x1a, 0x21, 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, 0x6f, 0x22, 0x1b, 0x0a, 0x03, 0x4d, 0x54, 0x55, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x1b, 0x0a, 0x03, 0x54, 0x54, 0x49, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0x26, 0x0a, 0x0e, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x28, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, 0x6c, - 0x69, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x21, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x22, 0x20, 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x42, 0x75, 0x66, 0x66, - 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x29, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x22, 0x24, 0x0a, 0x0e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x65, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x22, 0xe7, 0x04, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x32, 0x0a, 0x03, 0x6d, 0x74, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x4d, 0x54, - 0x55, 0x52, 0x03, 0x6d, 0x74, 0x75, 0x12, 0x32, 0x0a, 0x03, 0x74, 0x74, 0x69, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, - 0x70, 0x2e, 0x54, 0x54, 0x49, 0x52, 0x03, 0x74, 0x74, 0x69, 0x12, 0x54, 0x0a, 0x0f, 0x75, 0x70, - 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, - 0x70, 0x2e, 0x55, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, - 0x52, 0x0e, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, - 0x12, 0x5a, 0x0a, 0x11, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, - 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x69, - 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x52, 0x10, 0x64, 0x6f, 0x77, 0x6e, - 0x6c, 0x69, 0x6e, 0x6b, 0x43, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, - 0x63, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x0c, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, - 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x52, 0x0b, 0x77, 0x72, - 0x69, 0x74, 0x65, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x0b, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x52, 0x65, 0x61, - 0x64, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x42, 0x75, 0x66, - 0x66, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 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, 0x0c, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x04, 0x73, 0x65, - 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x09, 0x10, - 0x0a, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x6b, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x4b, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_kcp_config_proto_rawDescOnce sync.Once - file_transport_internet_kcp_config_proto_rawDescData = file_transport_internet_kcp_config_proto_rawDesc -) - -func file_transport_internet_kcp_config_proto_rawDescGZIP() []byte { - file_transport_internet_kcp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_kcp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_kcp_config_proto_rawDescData) - }) - return file_transport_internet_kcp_config_proto_rawDescData -} - -var file_transport_internet_kcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_transport_internet_kcp_config_proto_goTypes = []interface{}{ - (*MTU)(nil), // 0: xray.transport.internet.kcp.MTU - (*TTI)(nil), // 1: xray.transport.internet.kcp.TTI - (*UplinkCapacity)(nil), // 2: xray.transport.internet.kcp.UplinkCapacity - (*DownlinkCapacity)(nil), // 3: xray.transport.internet.kcp.DownlinkCapacity - (*WriteBuffer)(nil), // 4: xray.transport.internet.kcp.WriteBuffer - (*ReadBuffer)(nil), // 5: xray.transport.internet.kcp.ReadBuffer - (*ConnectionReuse)(nil), // 6: xray.transport.internet.kcp.ConnectionReuse - (*EncryptionSeed)(nil), // 7: xray.transport.internet.kcp.EncryptionSeed - (*Config)(nil), // 8: xray.transport.internet.kcp.Config - (*serial.TypedMessage)(nil), // 9: xray.common.serial.TypedMessage -} -var file_transport_internet_kcp_config_proto_depIdxs = []int32{ - 0, // 0: xray.transport.internet.kcp.Config.mtu:type_name -> xray.transport.internet.kcp.MTU - 1, // 1: xray.transport.internet.kcp.Config.tti:type_name -> xray.transport.internet.kcp.TTI - 2, // 2: xray.transport.internet.kcp.Config.uplink_capacity:type_name -> xray.transport.internet.kcp.UplinkCapacity - 3, // 3: xray.transport.internet.kcp.Config.downlink_capacity:type_name -> xray.transport.internet.kcp.DownlinkCapacity - 4, // 4: xray.transport.internet.kcp.Config.write_buffer:type_name -> xray.transport.internet.kcp.WriteBuffer - 5, // 5: xray.transport.internet.kcp.Config.read_buffer:type_name -> xray.transport.internet.kcp.ReadBuffer - 9, // 6: xray.transport.internet.kcp.Config.header_config:type_name -> xray.common.serial.TypedMessage - 7, // 7: xray.transport.internet.kcp.Config.seed:type_name -> xray.transport.internet.kcp.EncryptionSeed - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_transport_internet_kcp_config_proto_init() } -func file_transport_internet_kcp_config_proto_init() { - if File_transport_internet_kcp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_kcp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MTU); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TTI); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UplinkCapacity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownlinkCapacity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteBuffer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadBuffer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConnectionReuse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EncryptionSeed); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_kcp_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_kcp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_kcp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_kcp_config_proto_depIdxs, - MessageInfos: file_transport_internet_kcp_config_proto_msgTypes, - }.Build() - File_transport_internet_kcp_config_proto = out.File - file_transport_internet_kcp_config_proto_rawDesc = nil - file_transport_internet_kcp_config_proto_goTypes = nil - file_transport_internet_kcp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/quic/config.pb.go b/xray_api/proto/transport/internet/quic/config.pb.go deleted file mode 100644 index 5cc2d67..0000000 --- a/xray_api/proto/transport/internet/quic/config.pb.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/quic/config.proto - -package quic - -import ( - protocol "marzban-node/xray_api/proto/common/protocol" - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Security *protocol.SecurityConfig `protobuf:"bytes,2,opt,name=security,proto3" json:"security,omitempty"` - Header *serial.TypedMessage `protobuf:"bytes,3,opt,name=header,proto3" json:"header,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_quic_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_quic_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_quic_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Config) GetSecurity() *protocol.SecurityConfig { - if x != nil { - return x.Security - } - return nil -} - -func (x *Config) GetHeader() *serial.TypedMessage { - if x != nil { - return x.Header - } - return nil -} - -var File_transport_internet_quic_config_proto protoreflect.FileDescriptor - -var file_transport_internet_quic_config_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x71, 0x75, 0x69, 0x63, 0x1a, 0x21, 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, 0x6f, 0x1a, 0x1d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x96, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, - 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x71, - 0x75, 0x69, 0x63, 0x50, 0x01, 0x5a, 0x31, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_quic_config_proto_rawDescOnce sync.Once - file_transport_internet_quic_config_proto_rawDescData = file_transport_internet_quic_config_proto_rawDesc -) - -func file_transport_internet_quic_config_proto_rawDescGZIP() []byte { - file_transport_internet_quic_config_proto_rawDescOnce.Do(func() { - file_transport_internet_quic_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_quic_config_proto_rawDescData) - }) - return file_transport_internet_quic_config_proto_rawDescData -} - -var file_transport_internet_quic_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_quic_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.quic.Config - (*protocol.SecurityConfig)(nil), // 1: xray.common.protocol.SecurityConfig - (*serial.TypedMessage)(nil), // 2: xray.common.serial.TypedMessage -} -var file_transport_internet_quic_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.quic.Config.security:type_name -> xray.common.protocol.SecurityConfig - 2, // 1: xray.transport.internet.quic.Config.header:type_name -> xray.common.serial.TypedMessage - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_transport_internet_quic_config_proto_init() } -func file_transport_internet_quic_config_proto_init() { - if File_transport_internet_quic_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_quic_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_quic_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_quic_config_proto_goTypes, - DependencyIndexes: file_transport_internet_quic_config_proto_depIdxs, - MessageInfos: file_transport_internet_quic_config_proto_msgTypes, - }.Build() - File_transport_internet_quic_config_proto = out.File - file_transport_internet_quic_config_proto_rawDesc = nil - file_transport_internet_quic_config_proto_goTypes = nil - file_transport_internet_quic_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/reality/config.pb.go b/xray_api/proto/transport/internet/reality/config.pb.go deleted file mode 100644 index 99dec21..0000000 --- a/xray_api/proto/transport/internet/reality/config.pb.go +++ /dev/null @@ -1,310 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/reality/config.proto - -package reality - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Show bool `protobuf:"varint,1,opt,name=show,proto3" json:"show,omitempty"` - Dest string `protobuf:"bytes,2,opt,name=dest,proto3" json:"dest,omitempty"` - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - Xver uint64 `protobuf:"varint,4,opt,name=xver,proto3" json:"xver,omitempty"` - ServerNames []string `protobuf:"bytes,5,rep,name=server_names,json=serverNames,proto3" json:"server_names,omitempty"` - PrivateKey []byte `protobuf:"bytes,6,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` - MinClientVer []byte `protobuf:"bytes,7,opt,name=min_client_ver,json=minClientVer,proto3" json:"min_client_ver,omitempty"` - MaxClientVer []byte `protobuf:"bytes,8,opt,name=max_client_ver,json=maxClientVer,proto3" json:"max_client_ver,omitempty"` - MaxTimeDiff uint64 `protobuf:"varint,9,opt,name=max_time_diff,json=maxTimeDiff,proto3" json:"max_time_diff,omitempty"` - ShortIds [][]byte `protobuf:"bytes,10,rep,name=short_ids,json=shortIds,proto3" json:"short_ids,omitempty"` - Fingerprint string `protobuf:"bytes,21,opt,name=Fingerprint,proto3" json:"Fingerprint,omitempty"` - ServerName string `protobuf:"bytes,22,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"` - PublicKey []byte `protobuf:"bytes,23,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - ShortId []byte `protobuf:"bytes,24,opt,name=short_id,json=shortId,proto3" json:"short_id,omitempty"` - SpiderX string `protobuf:"bytes,25,opt,name=spider_x,json=spiderX,proto3" json:"spider_x,omitempty"` - SpiderY []int64 `protobuf:"varint,26,rep,packed,name=spider_y,json=spiderY,proto3" json:"spider_y,omitempty"` - MasterKeyLog string `protobuf:"bytes,27,opt,name=master_key_log,json=masterKeyLog,proto3" json:"master_key_log,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_reality_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_reality_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_reality_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetShow() bool { - if x != nil { - return x.Show - } - return false -} - -func (x *Config) GetDest() string { - if x != nil { - return x.Dest - } - return "" -} - -func (x *Config) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Config) GetXver() uint64 { - if x != nil { - return x.Xver - } - return 0 -} - -func (x *Config) GetServerNames() []string { - if x != nil { - return x.ServerNames - } - return nil -} - -func (x *Config) GetPrivateKey() []byte { - if x != nil { - return x.PrivateKey - } - return nil -} - -func (x *Config) GetMinClientVer() []byte { - if x != nil { - return x.MinClientVer - } - return nil -} - -func (x *Config) GetMaxClientVer() []byte { - if x != nil { - return x.MaxClientVer - } - return nil -} - -func (x *Config) GetMaxTimeDiff() uint64 { - if x != nil { - return x.MaxTimeDiff - } - return 0 -} - -func (x *Config) GetShortIds() [][]byte { - if x != nil { - return x.ShortIds - } - return nil -} - -func (x *Config) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *Config) GetServerName() string { - if x != nil { - return x.ServerName - } - return "" -} - -func (x *Config) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Config) GetShortId() []byte { - if x != nil { - return x.ShortId - } - return nil -} - -func (x *Config) GetSpiderX() string { - if x != nil { - return x.SpiderX - } - return "" -} - -func (x *Config) GetSpiderY() []int64 { - if x != nil { - return x.SpiderY - } - return nil -} - -func (x *Config) GetMasterKeyLog() string { - if x != nil { - return x.MasterKeyLog - } - return "" -} - -var File_transport_internet_reality_config_proto protoreflect.FileDescriptor - -var file_transport_internet_reality_config_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x72, 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x82, 0x04, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x04, 0x73, 0x68, 0x6f, 0x77, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x78, 0x76, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x69, 0x6e, - 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x12, - 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x65, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x56, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x5f, 0x64, 0x69, 0x66, 0x66, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6d, 0x61, - 0x78, 0x54, 0x69, 0x6d, 0x65, 0x44, 0x69, 0x66, 0x66, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x68, - 0x6f, 0x72, 0x74, 0x49, 0x64, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, - 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x46, 0x69, 0x6e, - 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x68, 0x6f, 0x72, - 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x78, 0x18, - 0x19, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x58, 0x12, 0x19, - 0x0a, 0x08, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x79, 0x18, 0x1a, 0x20, 0x03, 0x28, 0x03, - 0x52, 0x07, 0x73, 0x70, 0x69, 0x64, 0x65, 0x72, 0x59, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x73, - 0x74, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x1b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x4c, 0x6f, 0x67, 0x42, - 0x7f, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x72, - 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x01, 0x5a, 0x34, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x72, 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, 0xaa, 0x02, - 0x1f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x69, 0x74, 0x79, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_reality_config_proto_rawDescOnce sync.Once - file_transport_internet_reality_config_proto_rawDescData = file_transport_internet_reality_config_proto_rawDesc -) - -func file_transport_internet_reality_config_proto_rawDescGZIP() []byte { - file_transport_internet_reality_config_proto_rawDescOnce.Do(func() { - file_transport_internet_reality_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_reality_config_proto_rawDescData) - }) - return file_transport_internet_reality_config_proto_rawDescData -} - -var file_transport_internet_reality_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_reality_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.reality.Config -} -var file_transport_internet_reality_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_reality_config_proto_init() } -func file_transport_internet_reality_config_proto_init() { - if File_transport_internet_reality_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_reality_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_reality_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_reality_config_proto_goTypes, - DependencyIndexes: file_transport_internet_reality_config_proto_depIdxs, - MessageInfos: file_transport_internet_reality_config_proto_msgTypes, - }.Build() - File_transport_internet_reality_config_proto = out.File - file_transport_internet_reality_config_proto_rawDesc = nil - file_transport_internet_reality_config_proto_goTypes = nil - file_transport_internet_reality_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/splithttp/config.pb.go b/xray_api/proto/transport/internet/splithttp/config.pb.go deleted file mode 100644 index 3975b9f..0000000 --- a/xray_api/proto/transport/internet/splithttp/config.pb.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/splithttp/config.proto - -package splithttp - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Header map[string]string `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - MaxConcurrentUploads int32 `protobuf:"varint,4,opt,name=maxConcurrentUploads,proto3" json:"maxConcurrentUploads,omitempty"` - MaxUploadSize int32 `protobuf:"varint,5,opt,name=maxUploadSize,proto3" json:"maxUploadSize,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_splithttp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_splithttp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_splithttp_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *Config) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Config) GetHeader() map[string]string { - if x != nil { - return x.Header - } - return nil -} - -func (x *Config) GetMaxConcurrentUploads() int32 { - if x != nil { - return x.MaxConcurrentUploads - } - return 0 -} - -func (x *Config) GetMaxUploadSize() int32 { - if x != nil { - return x.MaxUploadSize - } - return 0 -} - -var File_transport_internet_splithttp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_splithttp_config_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x68, 0x74, 0x74, 0x70, 0x22, 0x94, - 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x4d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x73, 0x70, 0x6c, 0x69, - 0x74, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x32, 0x0a, 0x14, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, - 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6d, 0x61, 0x78, - 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x85, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x68, 0x74, 0x74, 0x70, 0x50, - 0x01, 0x5a, 0x36, 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, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, - 0x73, 0x70, 0x6c, 0x69, 0x74, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_splithttp_config_proto_rawDescOnce sync.Once - file_transport_internet_splithttp_config_proto_rawDescData = file_transport_internet_splithttp_config_proto_rawDesc -) - -func file_transport_internet_splithttp_config_proto_rawDescGZIP() []byte { - file_transport_internet_splithttp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_splithttp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_splithttp_config_proto_rawDescData) - }) - return file_transport_internet_splithttp_config_proto_rawDescData -} - -var file_transport_internet_splithttp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_splithttp_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.splithttp.Config - nil, // 1: xray.transport.internet.splithttp.Config.HeaderEntry -} -var file_transport_internet_splithttp_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.splithttp.Config.header:type_name -> xray.transport.internet.splithttp.Config.HeaderEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_internet_splithttp_config_proto_init() } -func file_transport_internet_splithttp_config_proto_init() { - if File_transport_internet_splithttp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_splithttp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_splithttp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_splithttp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_splithttp_config_proto_depIdxs, - MessageInfos: file_transport_internet_splithttp_config_proto_msgTypes, - }.Build() - File_transport_internet_splithttp_config_proto = out.File - file_transport_internet_splithttp_config_proto_rawDesc = nil - file_transport_internet_splithttp_config_proto_goTypes = nil - file_transport_internet_splithttp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/tcp/config.pb.go b/xray_api/proto/transport/internet/tcp/config.pb.go deleted file mode 100644 index 135ba7e..0000000 --- a/xray_api/proto/transport/internet/tcp/config.pb.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/tcp/config.proto - -package tcp - -import ( - serial "marzban-node/xray_api/proto/common/serial" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HeaderSettings *serial.TypedMessage `protobuf:"bytes,2,opt,name=header_settings,json=headerSettings,proto3" json:"header_settings,omitempty"` - AcceptProxyProtocol bool `protobuf:"varint,3,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_tcp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_tcp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_tcp_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetHeaderSettings() *serial.TypedMessage { - if x != nil { - return x.HeaderSettings - } - return nil -} - -func (x *Config) GetAcceptProxyProtocol() bool { - if x != nil { - return x.AcceptProxyProtocol - } - return false -} - -var File_transport_internet_tcp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_tcp_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, - 0x63, 0x70, 0x1a, 0x21, 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, 0x6f, 0x22, 0x8d, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x49, 0x0a, 0x0f, 0x68, 0x65, 0x61, 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, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x61, - 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, - 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_transport_internet_tcp_config_proto_rawDescOnce sync.Once - file_transport_internet_tcp_config_proto_rawDescData = file_transport_internet_tcp_config_proto_rawDesc -) - -func file_transport_internet_tcp_config_proto_rawDescGZIP() []byte { - file_transport_internet_tcp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_tcp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_tcp_config_proto_rawDescData) - }) - return file_transport_internet_tcp_config_proto_rawDescData -} - -var file_transport_internet_tcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_tcp_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.tcp.Config - (*serial.TypedMessage)(nil), // 1: xray.common.serial.TypedMessage -} -var file_transport_internet_tcp_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.tcp.Config.header_settings:type_name -> xray.common.serial.TypedMessage - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_internet_tcp_config_proto_init() } -func file_transport_internet_tcp_config_proto_init() { - if File_transport_internet_tcp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_tcp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_tcp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_tcp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_tcp_config_proto_depIdxs, - MessageInfos: file_transport_internet_tcp_config_proto_msgTypes, - }.Build() - File_transport_internet_tcp_config_proto = out.File - file_transport_internet_tcp_config_proto_rawDesc = nil - file_transport_internet_tcp_config_proto_goTypes = nil - file_transport_internet_tcp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/tls/config.pb.go b/xray_api/proto/transport/internet/tls/config.pb.go deleted file mode 100644 index 2613c3b..0000000 --- a/xray_api/proto/transport/internet/tls/config.pb.go +++ /dev/null @@ -1,521 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/tls/config.proto - -package tls - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Certificate_Usage int32 - -const ( - Certificate_ENCIPHERMENT Certificate_Usage = 0 - Certificate_AUTHORITY_VERIFY Certificate_Usage = 1 - Certificate_AUTHORITY_ISSUE Certificate_Usage = 2 -) - -// Enum value maps for Certificate_Usage. -var ( - Certificate_Usage_name = map[int32]string{ - 0: "ENCIPHERMENT", - 1: "AUTHORITY_VERIFY", - 2: "AUTHORITY_ISSUE", - } - Certificate_Usage_value = map[string]int32{ - "ENCIPHERMENT": 0, - "AUTHORITY_VERIFY": 1, - "AUTHORITY_ISSUE": 2, - } -) - -func (x Certificate_Usage) Enum() *Certificate_Usage { - p := new(Certificate_Usage) - *p = x - return p -} - -func (x Certificate_Usage) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Certificate_Usage) Descriptor() protoreflect.EnumDescriptor { - return file_transport_internet_tls_config_proto_enumTypes[0].Descriptor() -} - -func (Certificate_Usage) Type() protoreflect.EnumType { - return &file_transport_internet_tls_config_proto_enumTypes[0] -} - -func (x Certificate_Usage) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Certificate_Usage.Descriptor instead. -func (Certificate_Usage) EnumDescriptor() ([]byte, []int) { - return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{0, 0} -} - -type Certificate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // TLS certificate in x509 format. - Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"` - // TLS key in x509 format. - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Usage Certificate_Usage `protobuf:"varint,3,opt,name=usage,proto3,enum=xray.transport.internet.tls.Certificate_Usage" json:"usage,omitempty"` - OcspStapling uint64 `protobuf:"varint,4,opt,name=ocsp_stapling,json=ocspStapling,proto3" json:"ocsp_stapling,omitempty"` - // TLS certificate path - CertificatePath string `protobuf:"bytes,5,opt,name=certificate_path,json=certificatePath,proto3" json:"certificate_path,omitempty"` - // TLS Key path - KeyPath string `protobuf:"bytes,6,opt,name=key_path,json=keyPath,proto3" json:"key_path,omitempty"` - // If true, one-Time Loading - OneTimeLoading bool `protobuf:"varint,7,opt,name=One_time_loading,json=OneTimeLoading,proto3" json:"One_time_loading,omitempty"` -} - -func (x *Certificate) Reset() { - *x = Certificate{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_tls_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Certificate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Certificate) ProtoMessage() {} - -func (x *Certificate) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_tls_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Certificate.ProtoReflect.Descriptor instead. -func (*Certificate) Descriptor() ([]byte, []int) { - return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Certificate) GetCertificate() []byte { - if x != nil { - return x.Certificate - } - return nil -} - -func (x *Certificate) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *Certificate) GetUsage() Certificate_Usage { - if x != nil { - return x.Usage - } - return Certificate_ENCIPHERMENT -} - -func (x *Certificate) GetOcspStapling() uint64 { - if x != nil { - return x.OcspStapling - } - return 0 -} - -func (x *Certificate) GetCertificatePath() string { - if x != nil { - return x.CertificatePath - } - return "" -} - -func (x *Certificate) GetKeyPath() string { - if x != nil { - return x.KeyPath - } - return "" -} - -func (x *Certificate) GetOneTimeLoading() bool { - if x != nil { - return x.OneTimeLoading - } - return false -} - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Whether or not to allow self-signed certificates. - AllowInsecure bool `protobuf:"varint,1,opt,name=allow_insecure,json=allowInsecure,proto3" json:"allow_insecure,omitempty"` - // List of certificates to be served on server. - Certificate []*Certificate `protobuf:"bytes,2,rep,name=certificate,proto3" json:"certificate,omitempty"` - // Override server name. - ServerName string `protobuf:"bytes,3,opt,name=server_name,json=serverName,proto3" json:"server_name,omitempty"` - // Lists of string as ALPN values. - NextProtocol []string `protobuf:"bytes,4,rep,name=next_protocol,json=nextProtocol,proto3" json:"next_protocol,omitempty"` - // Whether or not to enable session (ticket) resumption. - EnableSessionResumption bool `protobuf:"varint,5,opt,name=enable_session_resumption,json=enableSessionResumption,proto3" json:"enable_session_resumption,omitempty"` - // If true, root certificates on the system will not be loaded for - // verification. - DisableSystemRoot bool `protobuf:"varint,6,opt,name=disable_system_root,json=disableSystemRoot,proto3" json:"disable_system_root,omitempty"` - // The minimum TLS version. - MinVersion string `protobuf:"bytes,7,opt,name=min_version,json=minVersion,proto3" json:"min_version,omitempty"` - // The maximum TLS version. - MaxVersion string `protobuf:"bytes,8,opt,name=max_version,json=maxVersion,proto3" json:"max_version,omitempty"` - // Specify cipher suites, except for TLS 1.3. - CipherSuites string `protobuf:"bytes,9,opt,name=cipher_suites,json=cipherSuites,proto3" json:"cipher_suites,omitempty"` - // Whether the server selects its most preferred ciphersuite. - // Deprecated: crypto/tls has ignored this field. - // - // Deprecated: Marked as deprecated in transport/internet/tls/config.proto. - PreferServerCipherSuites bool `protobuf:"varint,10,opt,name=prefer_server_cipher_suites,json=preferServerCipherSuites,proto3" json:"prefer_server_cipher_suites,omitempty"` - // TLS Client Hello fingerprint (uTLS). - Fingerprint string `protobuf:"bytes,11,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - RejectUnknownSni bool `protobuf:"varint,12,opt,name=reject_unknown_sni,json=rejectUnknownSni,proto3" json:"reject_unknown_sni,omitempty"` - // @Document A pinned certificate chain sha256 hash. - // @Document If the server's hash does not match this value, the connection will be aborted. - // @Document This value replace allow_insecure. - // @Critical - PinnedPeerCertificateChainSha256 [][]byte `protobuf:"bytes,13,rep,name=pinned_peer_certificate_chain_sha256,json=pinnedPeerCertificateChainSha256,proto3" json:"pinned_peer_certificate_chain_sha256,omitempty"` - // @Document A pinned certificate public key sha256 hash. - // @Document If the server's public key hash does not match this value, the connection will be aborted. - // @Document This value replace allow_insecure. - // @Critical - PinnedPeerCertificatePublicKeySha256 [][]byte `protobuf:"bytes,14,rep,name=pinned_peer_certificate_public_key_sha256,json=pinnedPeerCertificatePublicKeySha256,proto3" json:"pinned_peer_certificate_public_key_sha256,omitempty"` - MasterKeyLog string `protobuf:"bytes,15,opt,name=master_key_log,json=masterKeyLog,proto3" json:"master_key_log,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_tls_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_tls_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{1} -} - -func (x *Config) GetAllowInsecure() bool { - if x != nil { - return x.AllowInsecure - } - return false -} - -func (x *Config) GetCertificate() []*Certificate { - if x != nil { - return x.Certificate - } - return nil -} - -func (x *Config) GetServerName() string { - if x != nil { - return x.ServerName - } - return "" -} - -func (x *Config) GetNextProtocol() []string { - if x != nil { - return x.NextProtocol - } - return nil -} - -func (x *Config) GetEnableSessionResumption() bool { - if x != nil { - return x.EnableSessionResumption - } - return false -} - -func (x *Config) GetDisableSystemRoot() bool { - if x != nil { - return x.DisableSystemRoot - } - return false -} - -func (x *Config) GetMinVersion() string { - if x != nil { - return x.MinVersion - } - return "" -} - -func (x *Config) GetMaxVersion() string { - if x != nil { - return x.MaxVersion - } - return "" -} - -func (x *Config) GetCipherSuites() string { - if x != nil { - return x.CipherSuites - } - return "" -} - -// Deprecated: Marked as deprecated in transport/internet/tls/config.proto. -func (x *Config) GetPreferServerCipherSuites() bool { - if x != nil { - return x.PreferServerCipherSuites - } - return false -} - -func (x *Config) GetFingerprint() string { - if x != nil { - return x.Fingerprint - } - return "" -} - -func (x *Config) GetRejectUnknownSni() bool { - if x != nil { - return x.RejectUnknownSni - } - return false -} - -func (x *Config) GetPinnedPeerCertificateChainSha256() [][]byte { - if x != nil { - return x.PinnedPeerCertificateChainSha256 - } - return nil -} - -func (x *Config) GetPinnedPeerCertificatePublicKeySha256() [][]byte { - if x != nil { - return x.PinnedPeerCertificatePublicKeySha256 - } - return nil -} - -func (x *Config) GetMasterKeyLog() string { - if x != nil { - return x.MasterKeyLog - } - return "" -} - -var File_transport_internet_tls_config_proto protoreflect.FileDescriptor - -var file_transport_internet_tls_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, - 0x6c, 0x73, 0x22, 0xe2, 0x02, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x44, 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x74, 0x6c, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, - 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x6f, 0x63, 0x73, 0x70, 0x5f, 0x73, 0x74, 0x61, 0x70, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6f, 0x63, 0x73, 0x70, 0x53, 0x74, 0x61, 0x70, 0x6c, 0x69, 0x6e, - 0x67, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x08, - 0x6b, 0x65, 0x79, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x6b, 0x65, 0x79, 0x50, 0x61, 0x74, 0x68, 0x12, 0x28, 0x0a, 0x10, 0x4f, 0x6e, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0e, 0x4f, 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x69, 0x6e, - 0x67, 0x22, 0x44, 0x0a, 0x05, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x4e, - 0x43, 0x49, 0x50, 0x48, 0x45, 0x52, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, - 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, - 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x54, 0x59, 0x5f, - 0x49, 0x53, 0x53, 0x55, 0x45, 0x10, 0x02, 0x22, 0xf6, 0x05, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x65, - 0x63, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x49, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, - 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x6c, 0x73, 0x2e, 0x43, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x3a, 0x0a, 0x19, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, - 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x69, - 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, - 0x61, 0x78, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x69, 0x70, - 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x53, 0x75, 0x69, 0x74, 0x65, 0x73, 0x12, 0x41, - 0x0a, 0x1b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x69, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x18, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x53, 0x75, 0x69, 0x74, 0x65, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, - 0x69, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x6e, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x73, 0x6e, 0x69, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x10, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x6e, - 0x69, 0x12, 0x4e, 0x0a, 0x24, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, - 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0c, 0x52, - 0x20, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x53, 0x68, 0x61, 0x32, 0x35, - 0x36, 0x12, 0x57, 0x0a, 0x29, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x5f, 0x70, 0x65, 0x65, 0x72, - 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x18, 0x0e, - 0x20, 0x03, 0x28, 0x0c, 0x52, 0x24, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x50, 0x65, 0x65, 0x72, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x0f, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x4c, 0x6f, 0x67, - 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x74, 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x30, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2e, 0x54, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_tls_config_proto_rawDescOnce sync.Once - file_transport_internet_tls_config_proto_rawDescData = file_transport_internet_tls_config_proto_rawDesc -) - -func file_transport_internet_tls_config_proto_rawDescGZIP() []byte { - file_transport_internet_tls_config_proto_rawDescOnce.Do(func() { - file_transport_internet_tls_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_tls_config_proto_rawDescData) - }) - return file_transport_internet_tls_config_proto_rawDescData -} - -var file_transport_internet_tls_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_transport_internet_tls_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_tls_config_proto_goTypes = []interface{}{ - (Certificate_Usage)(0), // 0: xray.transport.internet.tls.Certificate.Usage - (*Certificate)(nil), // 1: xray.transport.internet.tls.Certificate - (*Config)(nil), // 2: xray.transport.internet.tls.Config -} -var file_transport_internet_tls_config_proto_depIdxs = []int32{ - 0, // 0: xray.transport.internet.tls.Certificate.usage:type_name -> xray.transport.internet.tls.Certificate.Usage - 1, // 1: xray.transport.internet.tls.Config.certificate:type_name -> xray.transport.internet.tls.Certificate - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_transport_internet_tls_config_proto_init() } -func file_transport_internet_tls_config_proto_init() { - if File_transport_internet_tls_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_tls_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Certificate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transport_internet_tls_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_tls_config_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_tls_config_proto_goTypes, - DependencyIndexes: file_transport_internet_tls_config_proto_depIdxs, - EnumInfos: file_transport_internet_tls_config_proto_enumTypes, - MessageInfos: file_transport_internet_tls_config_proto_msgTypes, - }.Build() - File_transport_internet_tls_config_proto = out.File - file_transport_internet_tls_config_proto_rawDesc = nil - file_transport_internet_tls_config_proto_goTypes = nil - file_transport_internet_tls_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/udp/config.pb.go b/xray_api/proto/transport/internet/udp/config.pb.go deleted file mode 100644 index 760e230..0000000 --- a/xray_api/proto/transport/internet/udp/config.pb.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/udp/config.proto - -package udp - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_udp_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_udp_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_udp_config_proto_rawDescGZIP(), []int{0} -} - -var File_transport_internet_udp_config_proto protoreflect.FileDescriptor - -var file_transport_internet_udp_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x75, 0x64, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, - 0x64, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x73, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, 0x64, 0x70, 0x50, - 0x01, 0x5a, 0x30, 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, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, - 0x75, 0x64, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x55, 0x64, - 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_udp_config_proto_rawDescOnce sync.Once - file_transport_internet_udp_config_proto_rawDescData = file_transport_internet_udp_config_proto_rawDesc -) - -func file_transport_internet_udp_config_proto_rawDescGZIP() []byte { - file_transport_internet_udp_config_proto_rawDescOnce.Do(func() { - file_transport_internet_udp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_udp_config_proto_rawDescData) - }) - return file_transport_internet_udp_config_proto_rawDescData -} - -var file_transport_internet_udp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_internet_udp_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.udp.Config -} -var file_transport_internet_udp_config_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_transport_internet_udp_config_proto_init() } -func file_transport_internet_udp_config_proto_init() { - if File_transport_internet_udp_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_udp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_udp_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_udp_config_proto_goTypes, - DependencyIndexes: file_transport_internet_udp_config_proto_depIdxs, - MessageInfos: file_transport_internet_udp_config_proto_msgTypes, - }.Build() - File_transport_internet_udp_config_proto = out.File - file_transport_internet_udp_config_proto_rawDesc = nil - file_transport_internet_udp_config_proto_goTypes = nil - file_transport_internet_udp_config_proto_depIdxs = nil -} diff --git a/xray_api/proto/transport/internet/websocket/config.pb.go b/xray_api/proto/transport/internet/websocket/config.pb.go deleted file mode 100644 index 9631e7e..0000000 --- a/xray_api/proto/transport/internet/websocket/config.pb.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.34.1 -// protoc v5.27.0 -// source: transport/internet/websocket/config.proto - -package websocket - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` // URL path to the WebSocket service. Empty value means root(/). - Header map[string]string `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - AcceptProxyProtocol bool `protobuf:"varint,4,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` - Ed uint32 `protobuf:"varint,5,opt,name=ed,proto3" json:"ed,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_internet_websocket_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_transport_internet_websocket_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_transport_internet_websocket_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (x *Config) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Config) GetHeader() map[string]string { - if x != nil { - return x.Header - } - return nil -} - -func (x *Config) GetAcceptProxyProtocol() bool { - if x != nil { - return x.AcceptProxyProtocol - } - return false -} - -func (x *Config) GetEd() uint32 { - if x != nil { - return x.Ed - } - return 0 -} - -var File_transport_internet_websocket_config_proto protoreflect.FileDescriptor - -var file_transport_internet_websocket_config_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x78, 0x72, 0x61, - 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x22, 0xfe, - 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x12, 0x4d, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x77, 0x65, 0x62, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x0e, 0x0a, 0x02, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x65, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x85, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x36, 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, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, - 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x57, 0x65, - 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_internet_websocket_config_proto_rawDescOnce sync.Once - file_transport_internet_websocket_config_proto_rawDescData = file_transport_internet_websocket_config_proto_rawDesc -) - -func file_transport_internet_websocket_config_proto_rawDescGZIP() []byte { - file_transport_internet_websocket_config_proto_rawDescOnce.Do(func() { - file_transport_internet_websocket_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_websocket_config_proto_rawDescData) - }) - return file_transport_internet_websocket_config_proto_rawDescData -} - -var file_transport_internet_websocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_transport_internet_websocket_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: xray.transport.internet.websocket.Config - nil, // 1: xray.transport.internet.websocket.Config.HeaderEntry -} -var file_transport_internet_websocket_config_proto_depIdxs = []int32{ - 1, // 0: xray.transport.internet.websocket.Config.header:type_name -> xray.transport.internet.websocket.Config.HeaderEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_internet_websocket_config_proto_init() } -func file_transport_internet_websocket_config_proto_init() { - if File_transport_internet_websocket_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_internet_websocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_transport_internet_websocket_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_internet_websocket_config_proto_goTypes, - DependencyIndexes: file_transport_internet_websocket_config_proto_depIdxs, - MessageInfos: file_transport_internet_websocket_config_proto_msgTypes, - }.Build() - File_transport_internet_websocket_config_proto = out.File - file_transport_internet_websocket_config_proto_rawDesc = nil - file_transport_internet_websocket_config_proto_goTypes = nil - file_transport_internet_websocket_config_proto_depIdxs = nil -} diff --git a/xray_api/stats.go b/xray_api/stats.go deleted file mode 100644 index 8bb50fa..0000000 --- a/xray_api/stats.go +++ /dev/null @@ -1,257 +0,0 @@ -package xray_api - -import ( - "context" - "fmt" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "marzban-node/xray_api/proto/app/stats/command" - "strings" -) - -type LinkType string - -const ( - Downlink LinkType = "downlink" - Uplink LinkType = "uplink" -) - -type SysStatsResponse struct { - NumGoroutine uint32 `json:"NumGoroutine,omitempty"` - NumGC uint32 `json:"NumGC,omitempty"` - Alloc uint64 `json:"Alloc,omitempty"` - TotalAlloc uint64 `json:"TotalAlloc,omitempty"` - Sys uint64 `json:"Sys,omitempty"` - Mallocs uint64 `json:"Mallocs,omitempty"` - Frees uint64 `json:"Frees,omitempty"` - LiveObjects uint64 `json:"LiveObjects,omitempty"` - PauseTotalNs uint64 `json:"PauseTotalNs,omitempty"` - Uptime uint32 `json:"Uptime,omitempty"` -} - -func (l LinkType) String() string { - return string(l) -} - -type StatResponse struct { - Name string `json:"name"` - Type string `json:"type"` - Link string `json:"link"` - Value int64 `json:"value"` -} - -type UserStatsResponse struct { - Email string `json:"email"` - Uplink int64 `json:"uplink"` - Downlink int64 `json:"downlink"` -} - -type InboundStatsResponse struct { - Tag string `json:"tag"` - Uplink int64 `json:"uplink"` - Downlink int64 `json:"downlink"` -} - -type OutboundStatsResponse struct { - Tag string `json:"tag"` - Uplink int64 `json:"uplink"` - Downlink int64 `json:"downlink"` -} - -func (x *XrayAPI) GetSysStats(ctx context.Context) (*SysStatsResponse, error) { - client := *x.StatsServiceClient - resp, err := client.GetSysStats(ctx, &command.SysStatsRequest{}) - if err != nil { - return nil, status.Errorf(codes.Unknown, "failed to get sys stats: %v", err) - } - - return &SysStatsResponse{ - NumGoroutine: resp.NumGoroutine, - NumGC: resp.NumGC, - Alloc: resp.Alloc, - TotalAlloc: resp.TotalAlloc, - Sys: resp.Sys, - Mallocs: resp.Mallocs, - Frees: resp.Frees, - LiveObjects: resp.LiveObjects, - PauseTotalNs: resp.PauseTotalNs, - Uptime: resp.Uptime, - }, nil -} - -func (x *XrayAPI) QueryStats(ctx context.Context, pattern string, reset bool) (*command.QueryStatsResponse, error) { - client := *x.StatsServiceClient - resp, err := client.QueryStats(ctx, &command.QueryStatsRequest{Pattern: pattern, Reset_: reset}) - if err != nil { - return nil, err - } - - return resp, nil -} - -func (x *XrayAPI) GetUsersStats(ctx context.Context, reset bool) ([]StatResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("user>>>"), reset) - if err != nil { - return nil, err - } - - var stats []StatResponse - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - // Extract the type from the name (e.g., "traffic") - parts := strings.Split(data, ">>>") - name := parts[1] - link := parts[2] - statType := parts[3] - - // Create a new StatResponse object and add it to the slice - stats = append(stats, StatResponse{ - Name: name, - Type: statType, - Link: link, - Value: value, - }) - } - - return stats, nil -} - -func (x *XrayAPI) GetInboundsStats(ctx context.Context, reset bool) ([]StatResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("inbound>>>"), reset) - if err != nil { - return nil, err - } - - var stats []StatResponse - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - // Extract the type from the name (e.g., "traffic") - parts := strings.Split(data, ">>>") - name := parts[1] - link := parts[2] - statType := parts[3] - - // Create a new StatResponse object and add it to the slice - stats = append(stats, StatResponse{ - Name: name, - Type: statType, - Link: link, - Value: value, - }) - } - - return stats, nil -} - -func (x *XrayAPI) GetOutboundsStats(ctx context.Context, reset bool) ([]StatResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("outbound>>>"), reset) - if err != nil { - return nil, err - } - - var stats []StatResponse - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - parts := strings.Split(data, ">>>") - name := parts[1] - statType := parts[2] - link := parts[3] - - // Create a new StatResponse object and add it to the slice - stats = append(stats, StatResponse{ - Name: name, - Type: statType, - Link: link, - Value: value, - }) - } - - return stats, nil -} - -func (x *XrayAPI) GetUserStats(ctx context.Context, email string, reset bool) (*UserStatsResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("user>>>%s>>>", email), reset) - if err != nil { - return nil, err - } - - var stats UserStatsResponse - - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - // Extract the type from the name (e.g., "traffic") - parts := strings.Split(data, ">>>") - link := parts[len(parts)] - - if link == Downlink.String() { - stats.Downlink = value - } else if link == Uplink.String() { - stats.Uplink = value - } - } - stats.Email = email - - return &stats, nil -} - -func (x *XrayAPI) GetInboundStats(ctx context.Context, tag string, reset bool) (*InboundStatsResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("inbound>>>%s>>>", tag), reset) - if err != nil { - return nil, err - } - - var stats InboundStatsResponse - - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - // Extract the type from the name (e.g., "traffic") - parts := strings.Split(data, ">>>") - link := parts[len(parts)] - - if link == Downlink.String() { - stats.Downlink = value - } else if link == Uplink.String() { - stats.Uplink = value - } - } - stats.Tag = tag - - return &stats, nil -} - -func (x *XrayAPI) GetOutboundStats(ctx context.Context, tag string, reset bool) (*OutboundStatsResponse, error) { - resp, err := x.QueryStats(ctx, fmt.Sprintf("outbound>>>%s>>>", tag), reset) - if err != nil { - return nil, err - } - - var stats OutboundStatsResponse - - for _, stat := range resp.GetStat() { - data := stat.GetName() - value := stat.GetValue() - - // Extract the type from the name (e.g., "traffic") - parts := strings.Split(data, ">>>") - link := parts[len(parts)] - - if link == Downlink.String() { - stats.Downlink = value - } else if link == Uplink.String() { - stats.Uplink = value - } - } - stats.Tag = tag - - return &stats, nil -} diff --git a/xray_api/types/account.go b/xray_api/types/account.go deleted file mode 100644 index 86dad6f..0000000 --- a/xray_api/types/account.go +++ /dev/null @@ -1,96 +0,0 @@ -package types - -import ( - "github.com/google/uuid" - "marzban-node/xray_api/proto/common/serial" - "marzban-node/xray_api/proto/proxy/shadowsocks" - "marzban-node/xray_api/proto/proxy/shadowsocks_2022" - "marzban-node/xray_api/proto/proxy/trojan" - "marzban-node/xray_api/proto/proxy/vless" - "marzban-node/xray_api/proto/proxy/vmess" -) - -type Account interface { - GetEmail() string - GetLevel() uint32 - Message() (*serial.TypedMessage, error) -} - -type BaseAccount struct { - Email string - Level uint32 -} - -func (ba *BaseAccount) GetEmail() string { - return ba.Email -} - -func (ba *BaseAccount) GetLevel() uint32 { - return ba.Level -} - -type VMessAccount struct { - BaseAccount - ID uuid.UUID -} - -func (va *VMessAccount) Message() (*serial.TypedMessage, error) { - return ToTypedMessage(&vmess.Account{Id: va.ID.String()}) -} - -type XTLSFlows string - -const ( - NONE XTLSFlows = "" - VISION XTLSFlows = "xtls-rprx-vision" -) - -type VLESSAccount struct { - BaseAccount - ID uuid.UUID - Flow XTLSFlows -} - -func (va *VLESSAccount) Message() (*serial.TypedMessage, error) { - return ToTypedMessage(&vless.Account{Id: va.ID.String(), Flow: string(va.Flow)}) -} - -type TrojanAccount struct { - BaseAccount - Password string -} - -func (ta *TrojanAccount) Message() (*serial.TypedMessage, error) { - return ToTypedMessage(&trojan.Account{Password: ta.Password}) -} - -type ShadowsocksAccount struct { - BaseAccount - Password string - Method shadowsocks.CipherType -} - -func (sa *ShadowsocksAccount) CipherType() string { - return string(sa.Method) -} - -func (sa *ShadowsocksAccount) Message() (*serial.TypedMessage, error) { - return ToTypedMessage(&shadowsocks.Account{Password: sa.Password, CipherType: sa.Method}) -} - -type Shadowsocks2022Account struct { - BaseAccount - Key string -} - -func (sa *Shadowsocks2022Account) Message() (*serial.TypedMessage, error) { - return ToTypedMessage(&shadowsocks_2022.User{Key: sa.Key, Email: sa.Email}) -} - -type ProxySettings struct { - Vmess *VMessAccount - Vless *VLESSAccount - Trojan *TrojanAccount - Shadowsocks *ShadowsocksAccount - Shadowsocks2022 *Shadowsocks2022Account -}