diff --git a/.dev/protoc/linux/protoc b/.dev/protoc/linux/protoc index 1cb992fed3..a4e3bbe0d6 100755 Binary files a/.dev/protoc/linux/protoc and b/.dev/protoc/linux/protoc differ diff --git a/.dev/protoc/macos/protoc b/.dev/protoc/macos/protoc index 178595c170..018077a4d1 100755 Binary files a/.dev/protoc/macos/protoc and b/.dev/protoc/macos/protoc differ diff --git a/.dev/protoc/windows/protoc.exe b/.dev/protoc/windows/protoc.exe index 73a388dde3..b978838fda 100755 Binary files a/.dev/protoc/windows/protoc.exe and b/.dev/protoc/windows/protoc.exe differ diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e1b98fe8f0..eca8ff32d4 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,7 +1,7 @@ -如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2ray/discussion/issues)进行讨论。 +如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/discussion/issues)进行讨论。 此 Issue 会被立即关闭。 -If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2ray/discussion/issues) first. +If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2fly/discussion/issues) first. This issue will be closed immediately. diff --git a/.github/ISSUE_TEMPLATE/bug_cn.md b/.github/ISSUE_TEMPLATE/bug_cn.md index 410920fa89..326f1d600b 100644 --- a/.github/ISSUE_TEMPLATE/bug_cn.md +++ b/.github/ISSUE_TEMPLATE/bug_cn.md @@ -1,11 +1,10 @@ --- -name: V2Ray程序问题 +name: V2Ray 程序问题 about: "提交一个 V2Ray 的程序问题报告。" --- -提交 Issue 之前请先阅读 [Issue 指引](https://github.com/v2ray/v2ray-core/blob/master/.github/SUPPORT.md),然后回答下面的问题,谢谢。 除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。 -如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2ray/discussion/issues)进行讨论。 +如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/discussion/issues)进行讨论。 1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) diff --git a/.github/ISSUE_TEMPLATE/bug_en.md b/.github/ISSUE_TEMPLATE/bug_en.md index e5b0b4bf78..1f556ac601 100644 --- a/.github/ISSUE_TEMPLATE/bug_en.md +++ b/.github/ISSUE_TEMPLATE/bug_en.md @@ -3,9 +3,8 @@ name: Bug report about: "Create a bug report to help us improve" --- -Please read the [instruction](https://github.com/v2ray/v2ray-core/blob/master/.github/SUPPORT.md) and answer the following questions before submitting your issue. Thank you. Please answer all the questions with enough information. All issues not following this template will be closed immediately. -If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2ray/discussion/issues) first. +If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2fly/discussion/issues) first. 1) What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)? diff --git a/.github/ISSUE_TEMPLATE/crash_en.md b/.github/ISSUE_TEMPLATE/crash_en.md deleted file mode 100644 index 8c2b7f9601..0000000000 --- a/.github/ISSUE_TEMPLATE/crash_en.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Crash report -about: "Create a report for panics" ---- - -Please answer all the questions with enough information. All issues not following this template will be closed immediately. -If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2ray/discussion/issues) first. - -1) What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)? - -2) What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy. - -3) Please attach full panic log. - -You may get panic log using command `journalctl -u v2ray` if your system is Linux (systemd). - -4) Please attach your configuration file (**Mask IP addresses before submit this issue**). - -```javascript - // Please attach your configuration here. -``` - -Please review your issue before submitting. diff --git a/.github/ISSUE_TEMPLATE/feature_en.md b/.github/ISSUE_TEMPLATE/feature_en.md deleted file mode 100644 index dcb635e28e..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -name: Feature Request -about: "Open a feature request to V2Ray" ---- - -Please describe the new feature you want in detail. diff --git a/.github/ISSUE_TEMPLATE/other_en.md b/.github/ISSUE_TEMPLATE/other_en.md index 9220a5fc6c..ee9653b119 100644 --- a/.github/ISSUE_TEMPLATE/other_en.md +++ b/.github/ISSUE_TEMPLATE/other_en.md @@ -1,12 +1,12 @@ --- name: Other -about: "其它问题请使用 https://github.com/v2ray/discussion/issues 进行讨论 / Please discuss other issues at https://github.com/v2ray/discussion/issues" +about: "其它问题请使用 https://github.com/v2fly/discussion/issues 进行讨论 / Please discuss other issues at https://github.com/v2fly/discussion/issues" --- -如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2ray/discussion/issues)进行讨论。 +如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用[Discussion](https://github.com/v2fly/discussion/issues)进行讨论。 此 Issue 会被立即关闭。 -If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2ray/discussion/issues) first. +If you are not sure if your question is truely a bug in V2Ray, please discuss it [here](https://github.com/v2fly/discussion/issues) first. This issue will be closed immediately. diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md deleted file mode 100644 index 36212225f8..0000000000 --- a/.github/SUPPORT.md +++ /dev/null @@ -1,63 +0,0 @@ -# V2Ray 用户支持 (User Support) - -**English reader please skip to the [English section](#way-to-get-support) below** - -## 获得帮助信息的途径 - -您可以从以下渠道获取帮助: - -1. 官方网站:[v2ray.com](https://www.v2ray.com) -1. Github:[Issues](https://github.com/v2ray/v2ray-core/issues) -1. Telegram:[主群](https://t.me/projectv2ray) - -## Github Issue 规则 - -1. 请按模板填写 issue; -1. 配置文件内容使用格式化代码段进行修饰(见下面的解释); -1. 在提交 issue 前尝试减化配置文件,比如删除不必要 inbound / outbound 模块; -1. 在提交 issue 前尝试确定问题所在,比如将 socks 代理换成 http 再次观察问题是否能重现; -1. 配置文件必须结构完整,即除了必要的隐私信息之外,配置文件可以直接拿来运行。 - -**不按模板填写的 issue 将直接被关闭** - -## 格式化代码段 - -在配置文件上下加入 Markdown 特定的修饰符,如下: - -\`\`\`javascript - -{ - // 配置文件内容 -} - -\`\`\` - -## Way to Get Support - -You may get help in the following ways: - -1. Office Site: [v2ray.com](https://www.v2ray.com) -1. Github: [Issues](https://github.com/v2ray/v2ray-core/issues) -1. Telegram: [Main Group](https://t.me/projectv2ray) - -## Github Issue Rules - -1. Please fill in the issue template. -1. Decorate config file with Markdown formatter (See below). -1. Try to simplify config file before submitting the issue, such as removing unnecessary inbound / outbound blocks. -1. Try to determine the cause of the issue, for example, replacing socks inbound with http inbound to see if the issue still exists. -1. Config file must be structurally complete. - -**Any issue not following the issue template will be closed immediately.** - -## Code formatter - -Add the following Markdown decorator to config file content: - -\`\`\`javascript - -{ - // config file -} - -\`\`\` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d921d0ffdb..d85c63734e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + version: 2 updates: -- package-ecosystem: gomod - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + open-pull-requests-limit: 10 + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml new file mode 100644 index 0000000000..9e4dcdf33f --- /dev/null +++ b/.github/linters/.golangci.yml @@ -0,0 +1,38 @@ +run: + timeout: 5m + skip-files: + - generated.* + +issues: + new: true + +linters: + enable: + - bodyclose + - depguard + - gocritic + - gofmt + - goimports + - golint + - goprintffuncname + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - noctx + - nolintlint + - rowserrcheck + - scopelint + - staticcheck + - structcheck + - stylecheck + - typecheck + - unconvert + - unparam + - varcheck + - whitespace + disable: + - deadcode + - errcheck + - unused diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..c3046cbd62 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1 @@ +Please Move to https://github.com/v2fly/v2ray-core/pulls diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..bd8d534b74 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,69 @@ +name: CodeQL + +on: + push: + branches: [master] + paths: + - "**/*.go" + pull_request: + branches: [master] + types: [opened, synchronize, reopened] + paths: + - "**/*.go" + schedule: + - cron: '0 0 * * 1' + +jobs: + analyze: + if: github.repository != 'v2ray/v2ray-core' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['go'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index b3c84f102c..35ce5168b4 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,30 +2,38 @@ name: Coverage on: push: - branches: [ master ] + branches: [master] + paths: + - "**/*.go" jobs: - - build: - name: Coverage + coverage: + if: github.repository != 'v2ray/v2ray-core' runs-on: ubuntu-latest - steps: - - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.14 - id: go + go-version: ^1.15 - - name: Check out code into the Go module directory + - name: Checkout codebase uses: actions/checkout@v2 + - name: Cache go module + uses: actions/cache@v2 + id: cache-gomodules + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Get dependencies + if: steps.cache-gomodules.outputs.cache-hit != 'true' run: | go get -v -t -d ./... - - name: Run Coverage + - name: Run coverage run: ./testing/coverage/coverall2 - name: Upload coverage to Codecov diff --git a/.github/workflows/dlc.yml b/.github/workflows/dlc.yml deleted file mode 100644 index 0727c0af43..0000000000 --- a/.github/workflows/dlc.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Update dlc - -on: - schedule: - - cron: '0 0 * * FRI' - -jobs: - - build: - name: Update - runs-on: ubuntu-latest - steps: - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Download and Write - run: | - curl -L -o release/config/geoip.dat "https://github.com/v2ray/geoip/raw/release/geoip.dat" - curl -L -o release/config/geosite.dat "https://github.com/v2ray/domain-list-community/raw/release/dlc.dat" - - - name: push - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "update geoip, geosite" -a - git push -v --progress - diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 20592df1ab..d457c2be21 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,24 +1,32 @@ -name: Lint Code Base +name: Linter on: push: - branches: [ master ] + branches: [master] + paths: + - "**/*.go" pull_request: - branches: [ master ] - types: [assigned, opened, synchronize, reopened] + branches: [master] + types: [opened, synchronize, reopened] + paths: + - "**/*.go" jobs: - build: - name: Lint Code Base + lint: + if: github.repository != 'v2ray/v2ray-core' runs-on: ubuntu-latest - steps: - - name: Checkout Code + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.15 + + - name: Checkout codebase uses: actions/checkout@v2 - - name: Lint Code Base - uses: github/super-linter@v2.2.0 - env: - VALIDATE_ALL_CODEBASE: false - VALIDATE_JSON: false - VALIDATE_ANSIBLE: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.31 + args: --config=.github/linters/.golangci.yml + only-new-issues: true diff --git a/.github/workflows/sign.yml b/.github/workflows/sign.yml index 24c32d6776..55d7eb248e 100644 --- a/.github/workflows/sign.yml +++ b/.github/workflows/sign.yml @@ -1,37 +1,25 @@ -# This is a basic workflow to help you get started with Actions - name: Sign -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: release: types: [released] -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + sign: + if: github.repository != 'v2ray/v2ray-core' runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Invoke release signing - - name: make it run - run: chmod +x $GITHUB_WORKSPACE/release/requestsign_github.sh + - name: Checkout default branch + uses: actions/checkout@v2 - # Invoke release signing - - name: make it run - run: chmod +x $GITHUB_WORKSPACE/release/requestsign.sh + - name: Grant it execution permission + run: | + chmod +x $GITHUB_WORKSPACE/release/requestsign_github.sh + chmod +x $GITHUB_WORKSPACE/release/requestsign.sh - # Invoke release signing - name: Invoke release signing env: SIGN_SERVICE_PASSWORD: ${{ secrets.SIGN_SERVICE_PASSWORD }} SIGN_SERIVCE_URL: ${{ secrets.SIGN_SERIVCE_URL }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: $GITHUB_WORKSPACE/release/requestsign_github.sh \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: $GITHUB_WORKSPACE/release/requestsign_github.sh diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 5863f3dfcb..789971e50d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,17 +2,16 @@ name: Mark stale issues and pull requests on: schedule: - - cron: "30 1 * * *" + - cron: "30 1 * * *" jobs: stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days' - days-before-stale: 120 - days-before-close: 5 + - uses: actions/stale@v3.0.13 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: "This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days" + stale-pr-message: 'It has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days' + days-before-stale: 120 + days-before-close: 5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbc4c65684..f1a3a89291 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,33 +2,41 @@ name: Test on: push: - branches: [ master ] + branches: [master] + paths: + - "**/*.go" + - "go.mod" + - "go.sum" pull_request: - branches: [ master ] + branches: [master] + types: [opened, synchronize, reopened] + paths: + - "**/*.go" + - "go.mod" + - "go.sum" jobs: - - build: - name: Test + test: + if: github.repository != 'v2ray/v2ray-core' runs-on: ${{ matrix.os }} strategy: matrix: os: [windows-latest, ubuntu-latest, macos-latest] - steps: - - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.14 - id: go + go-version: ^1.15 - - name: Check out code into the Go module directory + - name: Checkout codebase uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... + - name: Cache go module + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-go- - name: Test - run: go test -parallel 1 -timeout 6h -v ./... + run: go test -timeout 1h -v ./... diff --git a/.github/workflows/updateGeofile.yml b/.github/workflows/updateGeofile.yml new file mode 100644 index 0000000000..64d6e32c10 --- /dev/null +++ b/.github/workflows/updateGeofile.yml @@ -0,0 +1,25 @@ +name: Update Geofiles + +on: + schedule: + - cron: "0 0 * * FRI" + +jobs: + update: + if: github.repository == 'v2fly/v2ray-core' + runs-on: ubuntu-latest + steps: + - name: Checkout codebase + uses: actions/checkout@v2 + + - name: Download + run: | + curl -L -o release/config/geoip.dat "https://github.com/v2fly/geoip/raw/release/geoip.dat" + curl -L -o release/config/geosite.dat "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat" + + - name: push + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git commit -am "update geoip, geosite" + git push -v --progress diff --git a/Dockerfile b/Dockerfile index bff3dfe809..8d21eb2047 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,12 @@ # STEP 1 build executable binary ############################ FROM golang:alpine AS builder -RUN apk update && apk add --no-cache git bash wget -WORKDIR /go/src/v2ray.com/core + +RUN apk update && apk add --no-cache git bash wget curl +WORKDIR /build RUN git clone --progress https://github.com/v2fly/v2ray-core.git . && \ - bash ./release/user-package.sh nosource noconf codename=$(git describe --tags) buildname=docker-fly abpathtgz=/tmp/v2ray.tgz + bash ./release/user-package.sh nosource noconf codename=$(git describe --abbrev=0 --tags) buildname=docker-fly abpathtgz=/tmp/v2ray.tgz + ############################ # STEP 2 build a small image ############################ @@ -20,4 +22,3 @@ RUN apk update && apk add ca-certificates && \ #ENTRYPOINT ["/usr/bin/v2ray/v2ray"] ENV PATH /usr/bin/v2ray:$PATH CMD ["v2ray", "-config=/etc/v2ray/config.json"] - diff --git a/LICENSE b/LICENSE index 32acc7a47c..09c4b6e943 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2019 V2Ray +Copyright (c) 2015-2020 V2Fly Community Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 5586ae4fb3..8d3b9cffe1 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,37 @@ +# Move To https://github.com/v2fly/v2ray-core + +*** + # Project V -![](https://github.com/v2fly/v2ray-core/workflows/Test/badge.svg) -[![codecov.io][3]][4] [![GoDoc][5]][6] [![codebeat][7]][8] [![Downloads][9]][10] -[3]: https://codecov.io/gh/v2fly/v2ray-core/branch/master/graph/badge.svg?branch=master "Coverage badge" +[![GitHub Test Badge][1]][2] [![codecov.io][3]][4] [![GoDoc][5]][6] [![codebeat][7]][8] [![Downloads][9]][10] [![Downloads][11]][12] + +[1]: https://github.com/v2fly/v2ray-core/workflows/Test/badge.svg "GitHub Test Badge" +[2]: https://github.com/v2fly/v2ray-core/actions "GitHub Actions Page" +[3]: https://codecov.io/gh/v2fly/v2ray-core/branch/master/graph/badge.svg?branch=master "Coverage Badge" [4]: https://codecov.io/gh/v2fly/v2ray-core?branch=master "Codecov Status" -[5]: https://godoc.org/v2ray.com/core?status.svg "GoDoc badge" +[5]: https://godoc.org/v2ray.com/core?status.svg "GoDoc Badge" [6]: https://godoc.org/v2ray.com/core "GoDoc" -[7]: https://codebeat.co/badges/f2354ca8-3e24-463d-a2e3-159af73b2477 "Codebeat badge" -[8]: https://codebeat.co/projects/github-com-v2ray-v2ray-core-master "Codebeat" -[9]: https://img.shields.io/github/downloads/v2ray/v2ray-core/total.svg "All releases badge" -[10]: https://github.com/v2ray/v2ray-core/releases/ "All releases number" +[7]: https://goreportcard.com/badge/github.com/v2fly/v2ray-core "Goreportcard Badge" +[8]: https://goreportcard.com/report/github.com/v2fly/v2ray-core "Goreportcard Result" +[9]: https://img.shields.io/github/downloads/v2ray/v2ray-core/total.svg "v2ray/v2ray-core downloads count" +[10]: https://github.com/v2ray/v2ray-core/releases "v2ray/v2ray-core release page" +[11]: https://img.shields.io/github/downloads/v2fly/v2ray-core/total.svg "v2fly/v2ray-core downloads count" +[12]: https://github.com/v2fly/v2ray-core/releases "v2fly/v2ray-core release page" -Project V is a set of network tools that help you to build your own computer network. It secures your network connections and thus protects your privacy. See [our website](https://www.v2ray.com/) for more information. +Project V is a set of network tools that help you to build your own computer network. It secures your network connections and thus protects your privacy. See [our website](https://www.v2fly.org/) for more information. ## License -[The MIT License (MIT)](https://raw.githubusercontent.com/v2ray/v2ray-core/master/LICENSE) +[The MIT License (MIT)](https://raw.githubusercontent.com/v2fly/v2ray-core/master/LICENSE) ## Credits This repo relies on the following third-party projects: -* In production: - * [gorilla/websocket](https://github.com/gorilla/websocket) - * [gRPC](https://google.golang.org/grpc) -* For testing only: - * [miekg/dns](https://github.com/miekg/dns) - * [h12w/socks](https://github.com/h12w/socks) +- In production: + - [gorilla/websocket](https://github.com/gorilla/websocket) + - [gRPC](https://google.golang.org/grpc) +- For testing only: + - [miekg/dns](https://github.com/miekg/dns) + - [h12w/socks](https://github.com/h12w/socks) diff --git a/SECURITY.md b/SECURITY.md index 1bdfd499dd..0275c4aae2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,18 +11,19 @@ master branch, though we would still try our best to follow the compatiblity cla ## 汇报安全风险 Reporting a Vulnerability -使用邮箱 dev |at| v2fly.org 并注明安全风险。 +使用邮箱: security |at| v2fly.org。 -You can use email dev |at| v2fly.org. +Report to email: security |at| v2fly.org. GPG public key: ``` - -pub rsa4096 2020-06-02 [SC] [有效至:2020-12-29] +pub rsa4096 2020-06-02 [SC] [有效至:2022-01-02] E2E35E27914FB007C0D4B6DDB117BA3BE8B494A7 -uid V2Fly Developers -sub rsa4096 2020-06-02 [E] [有效至:2020-12-29] +uid [ 绝对 ] V2Fly Developers +sub rsa4096 2020-06-02 [E] [有效至:2022-01-02] +sub rsa4096 2020-11-08 [S] [有效至:2022-01-02] // 用于 Debian / Ubuntu 签名 + -----BEGIN PGP PUBLIC KEY BLOCK----- @@ -37,20 +38,20 @@ iQchHIdBpnu27ZbBFy09OMak+STB5zA0JmxDaC8b48mVkc0BMRXdYl7wWXJsEJf1 roAOr3RCBKiE840w0PLOTnUljfqazPYTwzs91oP+SeZjBmGOpaAh7bh5BVOpzPSE bdA61/n01GEb5bpOKpaTi9GviF3RCbfFnLKJnBq0vHvW9BqKTVFRPAKkBGuOPBdy 8MBNY+VY/2aP3ukZUoYe8Ypl9Q7dVPRjnoWaH0sEMzftoh+3s7GSSgAylQARAQAB -tCBWMkZseSBEZXZlbG9wZXJzIDxkZXZAdjJmbHkub3JnPokCVAQTAQgAPhYhBOLj -XieRT7AHwNS23bEXujvotJSnBQJe1e6UAhsDBQkBFNsABQsJCAcCBhUKCQgLAgQW -AgMBAh4BAheAAAoJELEXujvotJSnq1IP/1POoq4iwZ29T2DE6bCd+KFNdDZAfgY/ -U9KvzOycGl3AUPv5QoDGVs6GLXSelO9QYICXI2K9tsaNzIesFsx9r3LCRzr91LSI -Jx6aqPpvJVBzxYBdarwpUmOsKRPzLIDMf8udlZrXWmtq2qS3cfxqiJkrWt+fnd3H -cu8BH8fwzjZyxQYfdNRJ+Dk8d2ocgQ4mRpirB70sqi8zE95ox4YytZfd0QHD/gs+ -ihTVeXPtgFtqfCUOduTkF4gsKigQR6Jx3KUuNldLirAxF2XaVTCmygAOuymGYX9L -vI9xc0s/RoltwOHK1m26idO/0blLPCahXM6WpJR7Ds3ou5phYPKnaF6ly/AAqpIv -W+g7qFKxeKKJ0evwM/syMtDUEqJ7LS3XCd3z/E2mBCeNazc5TLM+Cx5AqvAN7qs1 -WXGG32LlbeD22Zq9zAWHC+mOI4iaHBGCzp58ugHJunq9AmiVHEB9ttuagtLWeQ3I -lu65xVq1XV/2r2viUCnb6xbSuhkPnm7pr5ssZgZW07k2IwyaeFLz33moD0rmbWeR -8dQVFbXTFMbXbj1bCMC8eav1uHme8Lr9PkJ82dt3n6d76s2V18M7ZRsfaH5yQmLF -v/RucXo6GjAslRSEs/miNim5juletdgv7VZ3z7Vjc6LJ1hukQpRCIgZX5lQK2IOz -dvDOqQyBTUPQuQINBF7V7pQBEADkQdO75smeKnmPt0/aNNlb7JDOSWW5VY0kYgx3 +tCBWMkZseSBEZXZlbG9wZXJzIDxkZXZAdjJmbHkub3JnPokCVAQTAQgAPgIbAwUL +CQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBOLjXieRT7AHwNS23bEXujvotJSnBQJf +p4leBQkC+1DKAAoJELEXujvotJSn124P/0swu9POvEQtxVlRzNh2VjAGHZ5NEDnl +pMrhfC5ryCYtlVS/kc2WwRhIRHKzr9nbamgSxUCiyLagfnIjhIvAohun49grYNzG +MZWRURiuFrCnYbD7juJTvfbzZCzJk7LPsdnqHWr8fYcOZMTOZVzQiQB2jUx2KeRm +yV8aV21Z8gMLqSGjs06a0UaRbKB0FSysTURm91/jFmiH43aG1s/LcB9/lKf5HpNl +9or6LrEOrokAwtkMSBYTqm7Dp1j+cK0iOMw2CmMqmQZkV+i6msYrQRiX/X6YufiM +wfMMSdOZOz9KG+k+C6N1swSbGeDMrJfnDUDbvrAXKhDjNgY7UBwbk69Abd7Y9aQz +/jVmrFEWt4lisBxglBot60CRUTM2boK/uQS5zBCJhemeg14F9Q/FRiUTlS8jQoeK +PWeK2lagYJS8lpJZLXkqe4xSpjCgoT0Z+lYSfTjx+T0AFF+xz5E243Lb5kDxwnR9 +Y5CZt3vV6GWBYOt9MEL3pk7AnYyNT1y1KIiMyONh/Z1koUdHr4J9exllnsmAJQUa +W/j0UtVsLsvUjFv9RTr9w5p/U0J0VLIN0YOpx4wYaBEwFIa8lsL+Ey1Vphkvvjfz +uMRAHe4v+axWb1f1hVCBjtyCVyvzf+i9RTAYsBJ3MJ0C8cvvrm10N9B7MHh0JZA5 +PcJSilailp1TuQINBF7V7pQBEADkQdO75smeKnmPt0/aNNlb7JDOSWW5VY0kYgx3 6Toh139JstIQ2xz0CLSGReizUFB6eR3DXmezLrmhkgN2Aq5A+hCtFAJwWKuKr1HS usvJ1el9h0oh7IO+tF8E/gNYwWfabjPX27FGVCHR1qG7ffN51Bghrnwi1T4YC98E R9EGU6N0Xs9DeIJL9WQPH/DF22251i/OAXkqKVGn3PNe2cBsp0yKxr9mlSyzjrha @@ -61,20 +62,54 @@ ourTZVCCLbAC60VTdxLN6eFO0f+lS2WjyJ7uZ9SGbS6uP0jMNphH/QjVF848bWXs Sg8e7/9n6+ms75/deYgnLuA6h7pkIcflm7pUMfVKXKz5Vlc8FC9ia0UtobeKBKqi jObfiO/zmNL0HQBeX0e8GkJrCyv6ikD8cUqsmVtgw7jdxGsV0SL5CddDnGKsc68O pGDmkAuRqR3QtXju/4r7a8IEVveGWc3rUvddYrtqbbCNWCN0JKX13PEvbNAm+2eD -MGQtcQARAQABiQI8BBgBCAAmFiEE4uNeJ5FPsAfA1LbdsRe6O+i0lKcFAl7V7pQC -GwwFCQEU2wAACgkQsRe6O+i0lKfK3g//a23lroIF0RZCEMox8gP5DCEZtucSg80V -4meDEAjllT3eyEIM/RcvYT2b1ViMvMYLL8lf81vQ6OvYq8F8iUYD/FpjH2gmVruE -oMBliLNxwQZHO8AuZtRFCCkjlTk6KYn0b370ypHFE/e8oJaGJxrsRHIjGbKl7DBp -a735hUl16+sT1k3V0p4BpAcd/4MOCvDSHn1TOr8gQV48tHbkm9zv1WNikzgwH9ig -rvBFidmWr1jZ+vJmtgiZCerCS5P5Tgd1qr2kBgPPQhhwEcg9bHBcIrtTw/RTyHN5 -cchrvgViCAc4ZgybqV0inawOC96HQ1K9syxXpXhjhrqL/7tJ6Ff03N5yrnQbPpw2 -KMOMQPNMibBNWnuTsUwRa3L27Mx4q6qJp+92GL9xAefytnupvvC105nvBlIym8dQ -gCiWHi3nZogmYoNMq50Eieawc0eR9ojwrJtEWihYM95i2Mt0pTCiAh955c3vHjt3 -BBYXYEBxKV3ByOxZEIKDYa119ggS7N1OZsLt+tXdCAkKN1qEcia4vSBqUjAV76// -iUFxqF5n0d8tGpHN49D7MGZT/WYaQBuhxK2Mj4ljXg8EYlVi5Sy3O7GPUEhR16dx -Y7pbP42vmaDsZaWURUdxeYkj4ha+z1MKqfhDePN6oRerh9I7fJnQK3DbRZGWAiEv -F1cKt4RANJY= -=qRzt +MGQtcQARAQABiQI8BBgBCAAmAhsMFiEE4uNeJ5FPsAfA1LbdsRe6O+i0lKcFAl+n +dwcFCQL7PnMACgkQsRe6O+i0lKeWfxAApopL5I9p4btmkcLIg2lkA1n+czFekbdr +2tjFKrBER4QWkyDCUE8QaVo/ECveTHmnxrTB/djW6xqPVS77PL8xOATIYTo6qU38 +oTCB1T7/P2L9qI72BzcRY5f9ZPyJhCtrkvjCPzjUjw+ZIPIOgQcWgKHWnE+OyUKD +0GkVEUME3QP5S4Nr3XGrgS7oxDAmD52u7pn0mSk5WmEcLW0oGwsVdc4aDXxpX+u/ +gkBZysmAuomPov7iXVosMakl+4rz30yPcrL9A81m1WAeB3PGkpaO3B++8Ql+FBCQ +OrLtPn/nnIzEuAXB1Hd8vYzxtRM2CZvhRExM7xofnhkBJOtR/ddfbJa7H5+Aruc0 +4S0JIaqMCrC6tZezjTACAzrWULmZZGmrHbLrmXBuLk0huRkeIRnDzHP+DoE2UciL +3hR9EGOHX9O/dGb3bb3y11LAf7GI28ZG7So1GeoFkEOga1IJnsBnXCqwM8vbDDWq +/7aLb3/m0gT7DUfjeXKfWPJXcnaq8r4llHzDn2i6ax4Uq/brCOLj9ovVGIctZTbt +yvsFOc1bVkSuUM+pMkCtBx80/sJSB2Nu94S6osdaUlRE+jaCcqEbPd+G68Yd0Khi +CL8zF1a3dX1dpuVFTLNpXOgrviGBzXQmzFeil7mWFs0l+1XZOPz9nhmRrMn6wV3n +i4KItRSJAXy5Ag0EX6d5hQEQAMsVyLTXdybeei2nWDb5jtzzC3AtSnPWtKG4B86C +BXncaZpU43hKI3oduW2+42eM8n8KTvO11r9xv4zKATfaHBZq2hkKZdDQjuSstovr +a3hapHHknHeNVTg3yuiakKzpr6FK23W/GE1lJfhz254v9+dRV0KazWksXvpGEdgI ++6sC4Nr5bKgJVEQibyrrL0gmzlVB/oQU/W4eGvk21zmgMlHri+edBLpVtlCmn7k/ +0t+2X9D1Pq2nkjMUurB9EJ1z24LMldmPOl6P7iJCx9kSUjcHrEg56q5VSZq50FAj +DeSjAqsdussI8cdstCMktE9nhizxVKFXpbXifqoYfJwCo23wFqQJpyPgQqHIT12s +GWRUa/MF6hRYg/5CyeadDmkmnKPTPjmQ2S2SFNXX7xs+dZKvIvXP30z4cpuVY8i8 +chZSRNb8K0L9T0Jme7CPm28F6lvDUkNDQ1WErXZruHbOKwQOfQBdXK3nedOiUpBt +401HVlGUJSInfEb3JXU01tRqnnzI/y5z7cWCGEMEa6TeaCrMbVvl8xeAA1w/nw0y +zHz6/Pnf4TITuCH22aa7+xfgpq8gRLhUUws89mbQT+9fd8tT65+Q8xcaLCyzrLAq +zND5sVZ4/PwaYc8UNZcHjeQR7aYWI1xgr/IwY1wyDWZLbWgkk0HVxpvYdMEpJryD +AyMdABEBAAGJBHIEGAEIACYWIQTi414nkU+wB8DUtt2xF7o76LSUpwUCX6d5hQIb +AgUJAim2AAJACRCxF7o76LSUp8F0IAQZAQgAHRYhBK8FZLGpNMztuW02YbJOz+X/ +ddOBBQJfp3mFAAoJELJOz+X/ddOBNKQP/0nwIC4R9gQhY53vME7VA7elIrBiSM6d +Va26a7J1nrCcpDAE7Lp0TqzrDMqyen+IL4X5QK5sKTgenYTgjppEJIQn+Wup54ix +I+YOQ8MVLfN6/3QPACWMngSPRF+UKDg4hyTCEL+/GCgTp58oXrl/YIO6Oqt5drog +w4+4ufU1/eKTb2ruGULGl9jZvFSZpLdsvJ19xJB2kC1k8GVNu7MnUL+S2pU/9kO4 +5EZ/jEa1wT45zev+HdmzX5TYW6SLaI9HKHMqbQz2EHc3tRYIDaz3FE3s4VdMjqpp +e42SvkOYaguc6cXToDbzBmU+iWGlXCTHfNhxwxoUYcKZlDEkEtvSYHJOb0k9eqbT +gvMb5GjbAgqqwOBwtN3v790j8jEG+cdXR3qHcEx0bw3F2Bd18U7j946OxHLKE5Xk +2sWEG422maVrE9o1DdeTV5oDFNNPBzqfjgGBZCCKrjkpldhDOHeoDU2aFMJ7yVqw +ZwKwJ5f8fdNS13UnQVwGsZ2BsW1cox5ZGZ/C5A7mfSF1WAgJcYIw4M2JQbDn4Yuw +yqjyg53lT3OurBONbEZ7unnsLqpT9qKwZ1qCemqGRJieXXxJwl7G4gBgZbH0rBJR +6dhbyt4c2JE8MMdC65mDWneltNM6pttC/j5jCuvIlZGACZ91UuLLediJJWAlOJ+1 +fBQ0m8TD6d8ZrakP/RFMLZrxh9WPaFB43sW/b1Fq2h933HQ29oSQFuXhsHsx1Vaq +HTRTcBB7kywAr9+zMYsOsk0/WnoZNGoMkUWu/gFkb6CdUcsdEumgyZ8S24VoBCHB +T1fD/8eOA5K82hwAFcKbPwuuTLtf9b9HB4/xsObfcczTeqIknzIPsGlgVz4w1c9a +StSo4iI4bCSLL+/mqiXZ+ArXJ/z4Vejl92fNLWVOlOrjkBV+AY6iAFCCsxJ1O5ud +5a5r1bUeBXd0BcQ1m/hpjawMC1y0SkIBTQCgxIQoPoxJ27hHNIN1R2nkqfY9vboQ +7O0uIHF8fmuz93xg68ZTW0JHwOw4Mz88lGibE2laHApjKWZAtF/i+LlhbnewtESL +EuGTT7gt7cSHgnBiDEIm5UJVEGeM0sMReztxy9V7glohH5DV8GpVK/GncKlsrh1K +BuEuz7IrqKlBzhsDy0SrNZpX7EzsiU1uvoA6teT4EPey8qXH+7WR9B2ad1Zc5yE3 +zv4BpnWkkJp8qdYu4fdCs/mrmnBR5G1YdOAIlNWhU74Wdyq+W4HfTWMgvJHmElnZ +UvQ9RDTWnw2+3n2ATeLf9ZwW1g4/Dqh55OaLtJZo5me8vU9W+vkm34xzfVfD/mus +ljogw5eiGyj8j3lUVjYWu28l/bz0zDUueWmHhV8E8z0Cn7OhrHPpUCHx2Aep +=quYd -----END PGP PUBLIC KEY BLOCK----- ``` diff --git a/app/commander/commander.go b/app/commander/commander.go index 2a8ae5011d..e0196af669 100644 --- a/app/commander/commander.go +++ b/app/commander/commander.go @@ -2,7 +2,7 @@ package commander -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/app/commander/config.pb.go b/app/commander/config.pb.go index cb67b04423..04aef5e4eb 100644 --- a/app/commander/config.pb.go +++ b/app/commander/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/commander/config.proto + package commander import ( @@ -28,14 +34,15 @@ type Config struct { // Tag of the outbound handler that handles grpc connections. Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"` - // Services that supported by this server. All services must implement Service interface. + // 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_v2ray_com_core_app_commander_config_proto_msgTypes[0] + mi := &file_app_commander_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +55,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_commander_config_proto_msgTypes[0] + mi := &file_app_commander_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -61,7 +68,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_commander_config_proto_rawDescGZIP(), []int{0} + return file_app_commander_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetTag() string { @@ -78,48 +85,47 @@ func (x *Config) GetService() []*serial.TypedMessage { return nil } -var File_v2ray_com_core_app_commander_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_commander_config_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x18, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x65, 0x72, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x5c, 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, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x42, 0x46, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x65, 0x72, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x18, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5c, 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, 0x40, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x42, 0x59, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_app_commander_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_commander_config_proto_rawDescData = file_v2ray_com_core_app_commander_config_proto_rawDesc + file_app_commander_config_proto_rawDescOnce sync.Once + file_app_commander_config_proto_rawDescData = file_app_commander_config_proto_rawDesc ) -func file_v2ray_com_core_app_commander_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_commander_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_commander_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_commander_config_proto_rawDescData) +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_v2ray_com_core_app_commander_config_proto_rawDescData + return file_app_commander_config_proto_rawDescData } -var file_v2ray_com_core_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_app_commander_config_proto_goTypes = []interface{}{ +var file_app_commander_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_app_commander_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.app.commander.Config (*serial.TypedMessage)(nil), // 1: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_app_commander_config_proto_depIdxs = []int32{ +var file_app_commander_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.app.commander.Config.service:type_name -> v2ray.core.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 @@ -128,13 +134,13 @@ var file_v2ray_com_core_app_commander_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_commander_config_proto_init() } -func file_v2ray_com_core_app_commander_config_proto_init() { - if File_v2ray_com_core_app_commander_config_proto != nil { +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_v2ray_com_core_app_commander_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_commander_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -151,18 +157,18 @@ func file_v2ray_com_core_app_commander_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_commander_config_proto_rawDesc, + RawDescriptor: file_app_commander_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_commander_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_commander_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_commander_config_proto_msgTypes, + GoTypes: file_app_commander_config_proto_goTypes, + DependencyIndexes: file_app_commander_config_proto_depIdxs, + MessageInfos: file_app_commander_config_proto_msgTypes, }.Build() - File_v2ray_com_core_app_commander_config_proto = out.File - file_v2ray_com_core_app_commander_config_proto_rawDesc = nil - file_v2ray_com_core_app_commander_config_proto_goTypes = nil - file_v2ray_com_core_app_commander_config_proto_depIdxs = nil + 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/app/commander/config.proto b/app/commander/config.proto index e6aaa7ec6b..44031f7080 100644 --- a/app/commander/config.proto +++ b/app/commander/config.proto @@ -2,16 +2,17 @@ syntax = "proto3"; package v2ray.core.app.commander; option csharp_namespace = "V2Ray.Core.App.Commander"; -option go_package = "commander"; +option go_package = "v2ray.com/core/app/commander"; option java_package = "com.v2ray.core.app.commander"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; // Config is the settings for Commander. message Config { // Tag of the outbound handler that handles grpc connections. string tag = 1; - // Services that supported by this server. All services must implement Service interface. + // Services that supported by this server. All services must implement Service + // interface. repeated v2ray.core.common.serial.TypedMessage service = 2; } diff --git a/app/dispatcher/config.pb.go b/app/dispatcher/config.pb.go index 43e2b7d72e..dea18e22fa 100644 --- a/app/dispatcher/config.pb.go +++ b/app/dispatcher/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/dispatcher/config.proto + package dispatcher import ( @@ -28,7 +34,7 @@ type SessionConfig struct { func (x *SessionConfig) Reset() { *x = SessionConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_dispatcher_config_proto_msgTypes[0] + mi := &file_app_dispatcher_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *SessionConfig) String() string { func (*SessionConfig) ProtoMessage() {} func (x *SessionConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dispatcher_config_proto_msgTypes[0] + mi := &file_app_dispatcher_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -54,7 +60,7 @@ func (x *SessionConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionConfig.ProtoReflect.Descriptor instead. func (*SessionConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dispatcher_config_proto_rawDescGZIP(), []int{0} + return file_app_dispatcher_config_proto_rawDescGZIP(), []int{0} } type Config struct { @@ -68,7 +74,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_dispatcher_config_proto_msgTypes[1] + mi := &file_app_dispatcher_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -81,7 +87,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dispatcher_config_proto_msgTypes[1] + mi := &file_app_dispatcher_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -94,7 +100,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dispatcher_config_proto_rawDescGZIP(), []int{1} + return file_app_dispatcher_config_proto_rawDescGZIP(), []int{1} } func (x *Config) GetSettings() *SessionConfig { @@ -104,46 +110,46 @@ func (x *Config) GetSettings() *SessionConfig { return nil } -var File_v2ray_com_core_app_dispatcher_config_proto protoreflect.FileDescriptor +var File_app_dispatcher_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_app_dispatcher_config_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x19, 0x76, 0x32, +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, 0x19, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x4e, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4e, - 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x49, - 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, - 0x01, 0x5a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x19, - 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, - 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 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, + 0x5c, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x50, 0x01, 0x5a, 0x1d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, + 0x72, 0xaa, 0x02, 0x19, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_app_dispatcher_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_dispatcher_config_proto_rawDescData = file_v2ray_com_core_app_dispatcher_config_proto_rawDesc + file_app_dispatcher_config_proto_rawDescOnce sync.Once + file_app_dispatcher_config_proto_rawDescData = file_app_dispatcher_config_proto_rawDesc ) -func file_v2ray_com_core_app_dispatcher_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_dispatcher_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_dispatcher_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_dispatcher_config_proto_rawDescData) +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_v2ray_com_core_app_dispatcher_config_proto_rawDescData + return file_app_dispatcher_config_proto_rawDescData } -var file_v2ray_com_core_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_app_dispatcher_config_proto_goTypes = []interface{}{ +var file_app_dispatcher_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_app_dispatcher_config_proto_goTypes = []interface{}{ (*SessionConfig)(nil), // 0: v2ray.core.app.dispatcher.SessionConfig (*Config)(nil), // 1: v2ray.core.app.dispatcher.Config } -var file_v2ray_com_core_app_dispatcher_config_proto_depIdxs = []int32{ +var file_app_dispatcher_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.app.dispatcher.Config.settings:type_name -> v2ray.core.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 @@ -152,13 +158,13 @@ var file_v2ray_com_core_app_dispatcher_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_dispatcher_config_proto_init() } -func file_v2ray_com_core_app_dispatcher_config_proto_init() { - if File_v2ray_com_core_app_dispatcher_config_proto != nil { +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_v2ray_com_core_app_dispatcher_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_dispatcher_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SessionConfig); i { case 0: return &v.state @@ -170,7 +176,7 @@ func file_v2ray_com_core_app_dispatcher_config_proto_init() { return nil } } - file_v2ray_com_core_app_dispatcher_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_dispatcher_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -187,18 +193,18 @@ func file_v2ray_com_core_app_dispatcher_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_dispatcher_config_proto_rawDesc, + RawDescriptor: file_app_dispatcher_config_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_dispatcher_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_dispatcher_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_dispatcher_config_proto_msgTypes, + GoTypes: file_app_dispatcher_config_proto_goTypes, + DependencyIndexes: file_app_dispatcher_config_proto_depIdxs, + MessageInfos: file_app_dispatcher_config_proto_msgTypes, }.Build() - File_v2ray_com_core_app_dispatcher_config_proto = out.File - file_v2ray_com_core_app_dispatcher_config_proto_rawDesc = nil - file_v2ray_com_core_app_dispatcher_config_proto_goTypes = nil - file_v2ray_com_core_app_dispatcher_config_proto_depIdxs = nil + 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/app/dispatcher/config.proto b/app/dispatcher/config.proto index dbb2d5c053..b461589c16 100644 --- a/app/dispatcher/config.proto +++ b/app/dispatcher/config.proto @@ -2,13 +2,12 @@ syntax = "proto3"; package v2ray.core.app.dispatcher; option csharp_namespace = "V2Ray.Core.App.Dispatcher"; -option go_package = "dispatcher"; +option go_package = "v2ray.com/core/app/dispatcher"; option java_package = "com.v2ray.core.app.dispatcher"; option java_multiple_files = true; message SessionConfig { reserved 1; - } message Config { diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 7c22e05a77..6823884ec4 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -2,7 +2,7 @@ package dispatcher -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -20,6 +20,7 @@ import ( "v2ray.com/core/features/outbound" "v2ray.com/core/features/policy" "v2ray.com/core/features/routing" + routing_session "v2ray.com/core/features/routing/session" "v2ray.com/core/features/stats" "v2ray.com/core/transport" "v2ray.com/core/transport/pipe" @@ -265,7 +266,8 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport. } if d.router != nil && !skipRoutePick { - if tag, err := d.router.PickRoute(ctx); err == nil { + if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil { + tag := route.GetOutboundTag() if h := d.ohm.GetHandler(tag); h != nil { newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx)) handler = h diff --git a/app/dispatcher/dispatcher.go b/app/dispatcher/dispatcher.go index ba516bd856..70c6093215 100644 --- a/app/dispatcher/dispatcher.go +++ b/app/dispatcher/dispatcher.go @@ -2,4 +2,4 @@ package dispatcher -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/app/dns/config.pb.go b/app/dns/config.pb.go index ca393d910a..a39940f2d2 100644 --- a/app/dns/config.pb.go +++ b/app/dns/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/dns/config.proto + package dns import ( @@ -57,11 +63,11 @@ func (x DomainMatchingType) String() string { } func (DomainMatchingType) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_dns_config_proto_enumTypes[0].Descriptor() + return file_app_dns_config_proto_enumTypes[0].Descriptor() } func (DomainMatchingType) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_dns_config_proto_enumTypes[0] + return &file_app_dns_config_proto_enumTypes[0] } func (x DomainMatchingType) Number() protoreflect.EnumNumber { @@ -70,7 +76,7 @@ func (x DomainMatchingType) Number() protoreflect.EnumNumber { // Deprecated: Use DomainMatchingType.Descriptor instead. func (DomainMatchingType) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dns_config_proto_rawDescGZIP(), []int{0} + return file_app_dns_config_proto_rawDescGZIP(), []int{0} } type NameServer struct { @@ -81,12 +87,13 @@ type NameServer struct { Address *net.Endpoint `protobuf:"bytes,1,opt,name=address,proto3" json:"address,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"` } func (x *NameServer) Reset() { *x = NameServer{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[0] + mi := &file_app_dns_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -99,7 +106,7 @@ func (x *NameServer) String() string { func (*NameServer) ProtoMessage() {} func (x *NameServer) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[0] + mi := &file_app_dns_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -112,7 +119,7 @@ func (x *NameServer) ProtoReflect() protoreflect.Message { // Deprecated: Use NameServer.ProtoReflect.Descriptor instead. func (*NameServer) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dns_config_proto_rawDescGZIP(), []int{0} + return file_app_dns_config_proto_rawDescGZIP(), []int{0} } func (x *NameServer) GetAddress() *net.Endpoint { @@ -136,13 +143,21 @@ func (x *NameServer) GetGeoip() []*router.GeoIP { return nil } +func (x *NameServer) GetOriginalRules() []*NameServer_OriginalRule { + if x != nil { + return x.OriginalRules + } + return nil +} + 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. + // 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: Do not use. NameServers []*net.Endpoint `protobuf:"bytes,1,rep,name=NameServers,proto3" json:"NameServers,omitempty"` @@ -153,7 +168,8 @@ type Config struct { // // Deprecated: Do not use. 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). + // 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. @@ -163,7 +179,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[1] + mi := &file_app_dns_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -176,7 +192,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[1] + mi := &file_app_dns_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -189,7 +205,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dns_config_proto_rawDescGZIP(), []int{1} + return file_app_dns_config_proto_rawDescGZIP(), []int{1} } // Deprecated: Do not use. @@ -248,7 +264,7 @@ type NameServer_PriorityDomain struct { func (x *NameServer_PriorityDomain) Reset() { *x = NameServer_PriorityDomain{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[2] + mi := &file_app_dns_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -261,7 +277,7 @@ func (x *NameServer_PriorityDomain) String() string { func (*NameServer_PriorityDomain) ProtoMessage() {} func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[2] + mi := &file_app_dns_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -274,7 +290,7 @@ func (x *NameServer_PriorityDomain) ProtoReflect() protoreflect.Message { // Deprecated: Use NameServer_PriorityDomain.ProtoReflect.Descriptor instead. func (*NameServer_PriorityDomain) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dns_config_proto_rawDescGZIP(), []int{0, 0} + return file_app_dns_config_proto_rawDescGZIP(), []int{0, 0} } func (x *NameServer_PriorityDomain) GetType() DomainMatchingType { @@ -291,6 +307,61 @@ func (x *NameServer_PriorityDomain) GetDomain() string { 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 @@ -299,15 +370,16 @@ type Config_HostMapping struct { Type DomainMatchingType `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.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. V2Ray will use this domain for IP queries. - // This field is only effective if ip is empty. + // ProxiedDomain indicates the mapped domain has the same IP address on this + // domain. V2Ray will use this domain for IP queries. This field is only + // effective if ip is empty. 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_v2ray_com_core_app_dns_config_proto_msgTypes[4] + mi := &file_app_dns_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -320,7 +392,7 @@ func (x *Config_HostMapping) String() string { func (*Config_HostMapping) ProtoMessage() {} func (x *Config_HostMapping) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_dns_config_proto_msgTypes[4] + mi := &file_app_dns_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -333,7 +405,7 @@ func (x *Config_HostMapping) ProtoReflect() protoreflect.Message { // Deprecated: Use Config_HostMapping.ProtoReflect.Descriptor instead. func (*Config_HostMapping) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_dns_config_proto_rawDescGZIP(), []int{1, 1} + return file_app_dns_config_proto_rawDescGZIP(), []int{1, 1} } func (x *Config_HostMapping) GetType() DomainMatchingType { @@ -364,41 +436,46 @@ func (x *Config_HostMapping) GetProxiedDomain() string { return "" } -var File_v2ray_com_core_app_dns_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_dns_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x2b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 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, - 0x26, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x02, 0x0a, 0x0a, 0x4e, 0x61, 0x6d, 0x65, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x5c, 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, 0x2d, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x32, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x67, 0x65, - 0x6f, 0x69, 0x70, 0x1a, 0x64, 0x0a, 0x0e, 0x50, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x22, 0xc3, 0x04, 0x0a, 0x06, 0x43, 0x6f, +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, 0x12, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0xcb, 0x03, 0x0a, 0x0a, + 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x07, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5c, 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, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x32, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, 0x0e, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x1a, 0x64, 0x0a, 0x0e, 0x50, + 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3a, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xc3, 0x04, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x45, 0x0a, 0x0b, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, @@ -439,63 +516,66 @@ var file_v2ray_com_core_app_dns_config_proto_rawDesc = []byte{ 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, 0x42, 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, + 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x47, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, - 0x50, 0x01, 0x5a, 0x03, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x12, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, - 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x01, 0x5a, 0x16, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x12, 0x56, 0x32, 0x52, + 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_app_dns_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_dns_config_proto_rawDescData = file_v2ray_com_core_app_dns_config_proto_rawDesc + file_app_dns_config_proto_rawDescOnce sync.Once + file_app_dns_config_proto_rawDescData = file_app_dns_config_proto_rawDesc ) -func file_v2ray_com_core_app_dns_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_dns_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_dns_config_proto_rawDescData) +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_v2ray_com_core_app_dns_config_proto_rawDescData + return file_app_dns_config_proto_rawDescData } -var file_v2ray_com_core_app_dns_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_app_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_v2ray_com_core_app_dns_config_proto_goTypes = []interface{}{ +var file_app_dns_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_app_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_app_dns_config_proto_goTypes = []interface{}{ (DomainMatchingType)(0), // 0: v2ray.core.app.dns.DomainMatchingType (*NameServer)(nil), // 1: v2ray.core.app.dns.NameServer (*Config)(nil), // 2: v2ray.core.app.dns.Config (*NameServer_PriorityDomain)(nil), // 3: v2ray.core.app.dns.NameServer.PriorityDomain - nil, // 4: v2ray.core.app.dns.Config.HostsEntry - (*Config_HostMapping)(nil), // 5: v2ray.core.app.dns.Config.HostMapping - (*net.Endpoint)(nil), // 6: v2ray.core.common.net.Endpoint - (*router.GeoIP)(nil), // 7: v2ray.core.app.router.GeoIP - (*net.IPOrDomain)(nil), // 8: v2ray.core.common.net.IPOrDomain -} -var file_v2ray_com_core_app_dns_config_proto_depIdxs = []int32{ - 6, // 0: v2ray.core.app.dns.NameServer.address:type_name -> v2ray.core.common.net.Endpoint + (*NameServer_OriginalRule)(nil), // 4: v2ray.core.app.dns.NameServer.OriginalRule + nil, // 5: v2ray.core.app.dns.Config.HostsEntry + (*Config_HostMapping)(nil), // 6: v2ray.core.app.dns.Config.HostMapping + (*net.Endpoint)(nil), // 7: v2ray.core.common.net.Endpoint + (*router.GeoIP)(nil), // 8: v2ray.core.app.router.GeoIP + (*net.IPOrDomain)(nil), // 9: v2ray.core.common.net.IPOrDomain +} +var file_app_dns_config_proto_depIdxs = []int32{ + 7, // 0: v2ray.core.app.dns.NameServer.address:type_name -> v2ray.core.common.net.Endpoint 3, // 1: v2ray.core.app.dns.NameServer.prioritized_domain:type_name -> v2ray.core.app.dns.NameServer.PriorityDomain - 7, // 2: v2ray.core.app.dns.NameServer.geoip:type_name -> v2ray.core.app.router.GeoIP - 6, // 3: v2ray.core.app.dns.Config.NameServers:type_name -> v2ray.core.common.net.Endpoint - 1, // 4: v2ray.core.app.dns.Config.name_server:type_name -> v2ray.core.app.dns.NameServer - 4, // 5: v2ray.core.app.dns.Config.Hosts:type_name -> v2ray.core.app.dns.Config.HostsEntry - 5, // 6: v2ray.core.app.dns.Config.static_hosts:type_name -> v2ray.core.app.dns.Config.HostMapping - 0, // 7: v2ray.core.app.dns.NameServer.PriorityDomain.type:type_name -> v2ray.core.app.dns.DomainMatchingType - 8, // 8: v2ray.core.app.dns.Config.HostsEntry.value:type_name -> v2ray.core.common.net.IPOrDomain - 0, // 9: v2ray.core.app.dns.Config.HostMapping.type:type_name -> v2ray.core.app.dns.DomainMatchingType - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_v2ray_com_core_app_dns_config_proto_init() } -func file_v2ray_com_core_app_dns_config_proto_init() { - if File_v2ray_com_core_app_dns_config_proto != nil { + 8, // 2: v2ray.core.app.dns.NameServer.geoip:type_name -> v2ray.core.app.router.GeoIP + 4, // 3: v2ray.core.app.dns.NameServer.original_rules:type_name -> v2ray.core.app.dns.NameServer.OriginalRule + 7, // 4: v2ray.core.app.dns.Config.NameServers:type_name -> v2ray.core.common.net.Endpoint + 1, // 5: v2ray.core.app.dns.Config.name_server:type_name -> v2ray.core.app.dns.NameServer + 5, // 6: v2ray.core.app.dns.Config.Hosts:type_name -> v2ray.core.app.dns.Config.HostsEntry + 6, // 7: v2ray.core.app.dns.Config.static_hosts:type_name -> v2ray.core.app.dns.Config.HostMapping + 0, // 8: v2ray.core.app.dns.NameServer.PriorityDomain.type:type_name -> v2ray.core.app.dns.DomainMatchingType + 9, // 9: v2ray.core.app.dns.Config.HostsEntry.value:type_name -> v2ray.core.common.net.IPOrDomain + 0, // 10: v2ray.core.app.dns.Config.HostMapping.type:type_name -> v2ray.core.app.dns.DomainMatchingType + 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_dns_config_proto_init() } +func file_app_dns_config_proto_init() { + if File_app_dns_config_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_app_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NameServer); i { case 0: return &v.state @@ -507,7 +587,7 @@ func file_v2ray_com_core_app_dns_config_proto_init() { return nil } } - file_v2ray_com_core_app_dns_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_dns_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -519,7 +599,7 @@ func file_v2ray_com_core_app_dns_config_proto_init() { return nil } } - file_v2ray_com_core_app_dns_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -531,7 +611,19 @@ func file_v2ray_com_core_app_dns_config_proto_init() { return nil } } - file_v2ray_com_core_app_dns_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -548,19 +640,19 @@ func file_v2ray_com_core_app_dns_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_dns_config_proto_rawDesc, + RawDescriptor: file_app_dns_config_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_dns_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_dns_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_app_dns_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_app_dns_config_proto_msgTypes, + 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_v2ray_com_core_app_dns_config_proto = out.File - file_v2ray_com_core_app_dns_config_proto_rawDesc = nil - file_v2ray_com_core_app_dns_config_proto_goTypes = nil - file_v2ray_com_core_app_dns_config_proto_depIdxs = nil + 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/app/dns/config.proto b/app/dns/config.proto index 0678b275d8..11990f23ca 100644 --- a/app/dns/config.proto +++ b/app/dns/config.proto @@ -2,13 +2,13 @@ syntax = "proto3"; package v2ray.core.app.dns; option csharp_namespace = "V2Ray.Core.App.Dns"; -option go_package = "dns"; +option go_package = "v2ray.com/core/app/dns"; option java_package = "com.v2ray.core.app.dns"; option java_multiple_files = true; -import "v2ray.com/core/common/net/address.proto"; -import "v2ray.com/core/common/net/destination.proto"; -import "v2ray.com/core/app/router/config.proto"; +import "common/net/address.proto"; +import "common/net/destination.proto"; +import "app/router/config.proto"; message NameServer { v2ray.core.common.net.Endpoint address = 1; @@ -18,8 +18,14 @@ message NameServer { string domain = 2; } + message OriginalRule { + string rule = 1; + uint32 size = 2; + } + repeated PriorityDomain prioritized_domain = 2; repeated v2ray.core.app.router.GeoIP geoip = 3; + repeated OriginalRule original_rules = 4; } enum DomainMatchingType { @@ -30,8 +36,9 @@ enum DomainMatchingType { } message Config { - // 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. + // 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. repeated v2ray.core.common.net.Endpoint NameServers = 1 [deprecated = true]; // NameServer list used by this DNS client. @@ -41,7 +48,8 @@ message Config { // Deprecated. Use static_hosts. map Hosts = 2 [deprecated = true]; - // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes (IPv6). + // Client IP for EDNS client subnet. Must be 4 bytes (IPv4) or 16 bytes + // (IPv6). bytes client_ip = 3; message HostMapping { @@ -50,8 +58,9 @@ message Config { repeated bytes ip = 3; - // ProxiedDomain indicates the mapped domain has the same IP address on this domain. V2Ray will use this domain for IP queries. - // This field is only effective if ip is empty. + // ProxiedDomain indicates the mapped domain has the same IP address on this + // domain. V2Ray will use this domain for IP queries. This field is only + // effective if ip is empty. string proxied_domain = 4; } diff --git a/app/dns/dns.go b/app/dns/dns.go index 2802423582..ac7243874f 100644 --- a/app/dns/dns.go +++ b/app/dns/dns.go @@ -1,4 +1,4 @@ // Package dns is an implementation of core.DNS feature. package dns -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/app/dns/dnscommon_test.go b/app/dns/dnscommon_test.go index d6f43c65de..7d81190aff 100644 --- a/app/dns/dnscommon_test.go +++ b/app/dns/dnscommon_test.go @@ -12,7 +12,6 @@ import ( "golang.org/x/net/dns/dnsmessage" "v2ray.com/core/common" "v2ray.com/core/common/net" - v2net "v2ray.com/core/common/net" ) func Test_parseResponse(t *testing.T) { @@ -52,7 +51,7 @@ func Test_parseResponse(t *testing.T) { wantErr bool }{ {"empty", - &IPRecord{0, []v2net.Address(nil), time.Time{}, dnsmessage.RCodeSuccess}, + &IPRecord{0, []net.Address(nil), time.Time{}, dnsmessage.RCodeSuccess}, false, }, {"error", @@ -60,12 +59,12 @@ func Test_parseResponse(t *testing.T) { true, }, {"a record", - &IPRecord{1, []v2net.Address{v2net.ParseAddress("8.8.8.8"), v2net.ParseAddress("8.8.4.4")}, + &IPRecord{1, []net.Address{net.ParseAddress("8.8.8.8"), net.ParseAddress("8.8.4.4")}, time.Time{}, dnsmessage.RCodeSuccess}, false, }, {"aaaa record", - &IPRecord{2, []v2net.Address{v2net.ParseAddress("2001::123:8888"), v2net.ParseAddress("2001::123:8844")}, time.Time{}, dnsmessage.RCodeSuccess}, + &IPRecord{2, []net.Address{net.ParseAddress("2001::123:8888"), net.ParseAddress("2001::123:8844")}, time.Time{}, dnsmessage.RCodeSuccess}, false, }, } diff --git a/app/dns/dohdns.go b/app/dns/dohdns.go index 02b0906cfb..257023ff89 100644 --- a/app/dns/dohdns.go +++ b/app/dns/dohdns.go @@ -14,8 +14,6 @@ import ( "sync/atomic" "time" - dns_feature "v2ray.com/core/features/dns" - "golang.org/x/net/dns/dnsmessage" "v2ray.com/core/common" "v2ray.com/core/common/net" @@ -23,6 +21,7 @@ import ( "v2ray.com/core/common/session" "v2ray.com/core/common/signal/pubsub" "v2ray.com/core/common/task" + dns_feature "v2ray.com/core/features/dns" "v2ray.com/core/features/routing" "v2ray.com/core/transport/internet" ) @@ -58,6 +57,7 @@ func NewDoHNameServer(url *url.URL, dispatcher routing.Dispatcher, clientIP net. MaxIdleConns: 30, IdleConnTimeout: 90 * time.Second, TLSHandshakeTimeout: 30 * time.Second, + ForceAttemptHTTP2: true, DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { dest, err := net.ParseDestination(network + ":" + addr) if err != nil { @@ -89,7 +89,8 @@ func NewDoHLocalNameServer(url *url.URL, clientIP net.IP) *DoHNameServer { url.Scheme = "https" s := baseDOHNameServer(url, "DOHL", clientIP) tr := &http.Transport{ - IdleConnTimeout: 90 * time.Second, + IdleConnTimeout: 90 * time.Second, + ForceAttemptHTTP2: true, DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { dest, err := net.ParseDestination(network + ":" + addr) if err != nil { @@ -219,13 +220,11 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO if d, ok := ctx.Deadline(); ok { deadline = d } else { - deadline = time.Now().Add(time.Second * 8) + deadline = time.Now().Add(time.Second * 5) } for _, req := range reqs { - go func(r *dnsRequest) { - // generate new context for each req, using same context // may cause reqs all aborted if any one encounter an error dnsCtx := context.Background() @@ -243,7 +242,8 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO // forced to use mux for DOH dnsCtx = session.ContextWithMuxPrefered(dnsCtx, true) - dnsCtx, cancel := context.WithDeadline(dnsCtx, deadline) + var cancel context.CancelFunc + dnsCtx, cancel = context.WithDeadline(dnsCtx, deadline) defer cancel() b, err := dns.PackMessage(r.msg) @@ -267,7 +267,6 @@ func (s *DoHNameServer) sendQuery(ctx context.Context, domain string, option IPO } func (s *DoHNameServer) dohHTTPSContext(ctx context.Context, b []byte) ([]byte, error) { - body := bytes.NewBuffer(b) req, err := http.NewRequest("POST", s.dohURL, body) if err != nil { diff --git a/app/dns/hosts.go b/app/dns/hosts.go index b4d18ff1e9..f47a32fef8 100644 --- a/app/dns/hosts.go +++ b/app/dns/hosts.go @@ -106,11 +106,14 @@ func filterIP(ips []net.Address, option IPOption) []net.Address { // LookupIP returns IP address for the given domain, if exists in this StaticHosts. func (h *StaticHosts) LookupIP(domain string, option IPOption) []net.Address { - id := h.matchers.Match(domain) - if id == 0 { + indices := h.matchers.Match(domain) + if len(indices) == 0 { return nil } - ips := h.ips[id] + ips := []net.Address{} + for _, id := range indices { + ips = append(ips, h.ips[id]...) + } if len(ips) == 1 && ips[0].Family().IsDomain() { return ips } diff --git a/app/dns/server.go b/app/dns/server.go index 6598008fbc..0693fa1e0b 100644 --- a/app/dns/server.go +++ b/app/dns/server.go @@ -2,10 +2,11 @@ package dns -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" + "fmt" "log" "net/url" "strings" @@ -28,13 +29,20 @@ import ( // Server is a DNS rely server. type Server struct { sync.Mutex - hosts *StaticHosts - clients []Client - clientIP net.IP - domainMatcher strmatcher.IndexMatcher - domainIndexMap map[uint32]uint32 - ipIndexMap map[uint32]*MultiGeoIPMatcher - tag string + hosts *StaticHosts + clientIP net.IP + clients []Client // clientIdx -> Client + ipIndexMap []*MultiGeoIPMatcher // clientIdx -> *MultiGeoIPMatcher + domainRules [][]string // clientIdx -> domainRuleIdx -> DomainRule + domainMatcher strmatcher.IndexMatcher + matcherInfos []DomainMatcherInfo // matcherIdx -> DomainMatcherInfo + tag string +} + +// DomainMatcherInfo contains information attached to index returned by Server.domainMatcher +type DomainMatcherInfo struct { + clientIdx uint16 + domainRuleIdx uint16 } // MultiGeoIPMatcher for match @@ -86,10 +94,27 @@ func New(ctx context.Context, config *Config) (*Server, error) { } server.hosts = hosts - addNameServer := func(endpoint *net.Endpoint) int { + addNameServer := func(ns *NameServer) int { + endpoint := ns.Address address := endpoint.Address.AsAddress() if address.Family().IsDomain() && address.Domain() == "localhost" { server.clients = append(server.clients, NewLocalNameServer()) + // Priotize local domains with specific TLDs or without any dot to local DNS + // References: + // https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml + // https://unix.stackexchange.com/questions/92441/whats-the-difference-between-local-home-and-lan + localTLDsAndDotlessDomains := []*NameServer_PriorityDomain{ + {Type: DomainMatchingType_Regex, Domain: "^[^.]+$"}, // This will only match domains without any dot + {Type: DomainMatchingType_Subdomain, Domain: "local"}, + {Type: DomainMatchingType_Subdomain, Domain: "localdomain"}, + {Type: DomainMatchingType_Subdomain, Domain: "localhost"}, + {Type: DomainMatchingType_Subdomain, Domain: "lan"}, + {Type: DomainMatchingType_Subdomain, Domain: "home.arpa"}, + {Type: DomainMatchingType_Subdomain, Domain: "example"}, + {Type: DomainMatchingType_Subdomain, Domain: "invalid"}, + {Type: DomainMatchingType_Subdomain, Domain: "test"}, + } + ns.PrioritizedDomain = append(ns.PrioritizedDomain, localTLDsAndDotlessDomains...) } else if address.Family().IsDomain() && strings.HasPrefix(address.Domain(), "https+local://") { // URI schemed string treated as domain // DOH Local mode @@ -98,8 +123,7 @@ func New(ctx context.Context, config *Config) (*Server, error) { log.Fatalln(newError("DNS config error").Base(err)) } server.clients = append(server.clients, NewDoHLocalNameServer(u, server.clientIP)) - } else if address.Family().IsDomain() && - strings.HasPrefix(address.Domain(), "https://") { + } else if address.Family().IsDomain() && strings.HasPrefix(address.Domain(), "https://") { // DOH Remote mode u, err := url.Parse(address.Domain()) if err != nil { @@ -131,33 +155,66 @@ func New(ctx context.Context, config *Config) (*Server, error) { })) } } + server.ipIndexMap = append(server.ipIndexMap, nil) return len(server.clients) - 1 } if len(config.NameServers) > 0 { features.PrintDeprecatedFeatureWarning("simple DNS server") for _, destPB := range config.NameServers { - addNameServer(destPB) + addNameServer(&NameServer{Address: destPB}) } } if len(config.NameServer) > 0 { + clientIndices := []int{} + domainRuleCount := 0 + for _, ns := range config.NameServer { + idx := addNameServer(ns) + clientIndices = append(clientIndices, idx) + domainRuleCount += len(ns.PrioritizedDomain) + } + + domainRules := make([][]string, len(server.clients)) domainMatcher := &strmatcher.MatcherGroup{} - domainIndexMap := make(map[uint32]uint32) - ipIndexMap := make(map[uint32]*MultiGeoIPMatcher) + matcherInfos := make([]DomainMatcherInfo, domainRuleCount+1) // matcher index starts from 1 var geoIPMatcherContainer router.GeoIPMatcherContainer + for nidx, ns := range config.NameServer { + idx := clientIndices[nidx] - for _, ns := range config.NameServer { - idx := addNameServer(ns.Address) - + // Establish domain rule matcher + rules := []string{} + ruleCurr := 0 + ruleIter := 0 for _, domain := range ns.PrioritizedDomain { matcher, err := toStrMatcher(domain.Type, domain.Domain) if err != nil { return nil, newError("failed to create prioritized domain").Base(err).AtWarning() } midx := domainMatcher.Add(matcher) - domainIndexMap[midx] = uint32(idx) + if midx >= uint32(len(matcherInfos)) { // This rarely happens according to current matcher's implementation + newError("expanding domain matcher info array to size ", midx, " when adding ", matcher).AtDebug().WriteToLog() + matcherInfos = append(matcherInfos, make([]DomainMatcherInfo, midx-uint32(len(matcherInfos))+1)...) + } + info := &matcherInfos[midx] + info.clientIdx = uint16(idx) + if ruleCurr < len(ns.OriginalRules) { + info.domainRuleIdx = uint16(ruleCurr) + rule := ns.OriginalRules[ruleCurr] + if ruleCurr >= len(rules) { + rules = append(rules, rule.Rule) + } + ruleIter++ + if ruleIter >= int(rule.Size) { + ruleIter = 0 + ruleCurr++ + } + } else { // No original rule, generate one according to current domain matcher (majorly for compatibility with tests) + info.domainRuleIdx = uint16(len(rules)) + rules = append(rules, matcher.String()) + } } + domainRules[idx] = rules // only add to ipIndexMap if GeoIP is configured if len(ns.Geoip) > 0 { @@ -170,17 +227,17 @@ func New(ctx context.Context, config *Config) (*Server, error) { matchers = append(matchers, matcher) } matcher := &MultiGeoIPMatcher{matchers: matchers} - ipIndexMap[uint32(idx)] = matcher + server.ipIndexMap[idx] = matcher } } - + server.domainRules = domainRules server.domainMatcher = domainMatcher - server.domainIndexMap = domainIndexMap - server.ipIndexMap = ipIndexMap + server.matcherInfos = matcherInfos } if len(server.clients) == 0 { server.clients = append(server.clients, NewLocalNameServer()) + server.ipIndexMap = append(server.ipIndexMap, nil) } return server, nil @@ -207,9 +264,12 @@ func (s *Server) IsOwnLink(ctx context.Context) bool { } // Match check dns ip match geoip -func (s *Server) Match(idx uint32, client Client, domain string, ips []net.IP) ([]net.IP, error) { - matcher, exist := s.ipIndexMap[idx] - if !exist { +func (s *Server) Match(idx int, client Client, domain string, ips []net.IP) ([]net.IP, error) { + var matcher *MultiGeoIPMatcher + if idx < len(s.ipIndexMap) { + matcher = s.ipIndexMap[idx] + } + if matcher == nil { return ips, nil } @@ -231,7 +291,7 @@ func (s *Server) Match(idx uint32, client Client, domain string, ips []net.IP) ( return newIps, nil } -func (s *Server) queryIPTimeout(idx uint32, client Client, domain string, option IPOption) ([]net.IP, error) { +func (s *Server) queryIPTimeout(idx int, client Client, domain string, option IPOption) ([]net.IP, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*4) if len(s.tag) > 0 { ctx = session.ContextWithInbound(ctx, &session.Inbound{ @@ -307,11 +367,6 @@ func (s *Server) lookupIPInternal(domain string, option IPOption) ([]net.IP, err domain = domain[:len(domain)-1] } - // skip domain without any dot - if !strings.Contains(domain, ".") { - return nil, newError("invalid domain name").AtWarning() - } - ips := s.lookupStatic(domain, option, 0) if ips != nil && ips[0].Family().IsIP() { newError("returning ", len(ips), " IPs for domain ", domain).WriteToLog() @@ -327,10 +382,25 @@ func (s *Server) lookupIPInternal(domain string, option IPOption) ([]net.IP, err var lastErr error var matchedClient Client if s.domainMatcher != nil { - idx := s.domainMatcher.Match(domain) - if idx > 0 { - matchedClient = s.clients[s.domainIndexMap[idx]] - ips, err := s.queryIPTimeout(s.domainIndexMap[idx], matchedClient, domain, option) + indices := s.domainMatcher.Match(domain) + domainRules := []string{} + matchingDNS := []string{} + for _, idx := range indices { + info := s.matcherInfos[idx] + rule := s.domainRules[info.clientIdx][info.domainRuleIdx] + domainRules = append(domainRules, fmt.Sprintf("%s(DNS idx:%d)", rule, info.clientIdx)) + matchingDNS = append(matchingDNS, s.clients[info.clientIdx].Name()) + } + if len(domainRules) > 0 { + newError("domain ", domain, " matches following rules: ", domainRules).AtDebug().WriteToLog() + } + if len(matchingDNS) > 0 { + newError("domain ", domain, " uses following DNS first: ", matchingDNS).AtDebug().WriteToLog() + } + for _, idx := range indices { + clientIdx := int(s.matcherInfos[idx].clientIdx) + matchedClient = s.clients[clientIdx] + ips, err := s.queryIPTimeout(clientIdx, matchedClient, domain, option) if len(ips) > 0 { return ips, nil } @@ -350,7 +420,7 @@ func (s *Server) lookupIPInternal(domain string, option IPOption) ([]net.IP, err continue } - ips, err := s.queryIPTimeout(uint32(idx), client, domain, option) + ips, err := s.queryIPTimeout(idx, client, domain, option) if len(ips) > 0 { return ips, nil } diff --git a/app/dns/server_test.go b/app/dns/server_test.go index 0561741143..de3f8caf74 100644 --- a/app/dns/server_test.go +++ b/app/dns/server_test.go @@ -50,6 +50,12 @@ func (*staticHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) { rr, _ := dns.NewRR("google.com. IN A 8.8.4.4") ans.Answer = append(ans.Answer, rr) } + } else if q.Name == "api.google.com." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("api.google.com. IN A 8.8.7.7") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "v2.api.google.com." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("v2.api.google.com. IN A 8.8.7.8") + ans.Answer = append(ans.Answer, rr) } else if q.Name == "facebook.com." && q.Qtype == dns.TypeA { rr, _ := dns.NewRR("facebook.com. IN A 9.9.9.9") ans.Answer = append(ans.Answer, rr) @@ -63,6 +69,27 @@ func (*staticHandler) ServeDNS(w dns.ResponseWriter, r *dns.Msg) { ans.Answer = append(ans.Answer, rr) } else if q.Name == "notexist.google.com." && q.Qtype == dns.TypeAAAA { ans.MsgHdr.Rcode = dns.RcodeNameError + } else if q.Name == "hostname." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("hostname. IN A 127.0.0.1") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "hostname.local." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("hostname.local. IN A 127.0.0.1") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "hostname.localdomain." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("hostname.localdomain. IN A 127.0.0.1") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "localhost." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("localhost. IN A 127.0.0.2") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "localhost-a." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("localhost-a. IN A 127.0.0.3") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "localhost-b." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("localhost-b. IN A 127.0.0.4") + ans.Answer = append(ans.Answer, rr) + } else if q.Name == "Mijia\\ Cloud." && q.Qtype == dns.TypeA { + rr, _ := dns.NewRR("Mijia\\ Cloud. IN A 127.0.0.1") + ans.Answer = append(ans.Answer, rr) } } w.WriteMsg(ans) @@ -537,3 +564,395 @@ func TestIPMatch(t *testing.T) { t.Error("DNS query doesn't finish in 2 seconds.") } } + +func TestLocalDomain(t *testing.T) { + port := udp.PickPort() + + dnsServer := dns.Server{ + Addr: "127.0.0.1:" + port.String(), + Net: "udp", + Handler: &staticHandler{}, + UDPSize: 1200, + } + + go dnsServer.ListenAndServe() + time.Sleep(time.Second) + + config := &core.Config{ + App: []*serial.TypedMessage{ + serial.ToTypedMessage(&Config{ + NameServers: []*net.Endpoint{ + { + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: 9999, /* unreachable */ + }, + }, + NameServer: []*NameServer{ + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + // Equivalent of dotless:localhost + {Type: DomainMatchingType_Regex, Domain: "^[^.]*localhost[^.]*$"}, + }, + Geoip: []*router.GeoIP{ + { // Will match localhost, localhost-a and localhost-b, + CountryCode: "local", + Cidr: []*router.CIDR{ + {Ip: []byte{127, 0, 0, 2}, Prefix: 32}, + {Ip: []byte{127, 0, 0, 3}, Prefix: 32}, + {Ip: []byte{127, 0, 0, 4}, Prefix: 32}, + }, + }, + }, + }, + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + // Equivalent of dotless: and domain:local + {Type: DomainMatchingType_Regex, Domain: "^[^.]*$"}, + {Type: DomainMatchingType_Subdomain, Domain: "local"}, + {Type: DomainMatchingType_Subdomain, Domain: "localdomain"}, + }, + }, + }, + StaticHosts: []*Config_HostMapping{ + { + Type: DomainMatchingType_Full, + Domain: "hostnamestatic", + Ip: [][]byte{{127, 0, 0, 53}}, + }, + { + Type: DomainMatchingType_Full, + Domain: "hostnamealias", + ProxiedDomain: "hostname.localdomain", + }, + }, + }), + serial.ToTypedMessage(&dispatcher.Config{}), + serial.ToTypedMessage(&proxyman.OutboundConfig{}), + serial.ToTypedMessage(&policy.Config{}), + }, + Outbound: []*core.OutboundHandlerConfig{ + { + ProxySettings: serial.ToTypedMessage(&freedom.Config{}), + }, + }, + } + + v, err := core.New(config) + common.Must(err) + + client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client) + + startTime := time.Now() + + { // Will match dotless: + ips, err := client.LookupIP("hostname") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" { + t.Fatal(r) + } + } + + { // Will match domain:local + ips, err := client.LookupIP("hostname.local") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" { + t.Fatal(r) + } + } + + { // Will match static ip + ips, err := client.LookupIP("hostnamestatic") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 53}}); r != "" { + t.Fatal(r) + } + } + + { // Will match domain replacing + ips, err := client.LookupIP("hostnamealias") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" { + t.Fatal(r) + } + } + + { // Will match dotless:localhost, but not expectIPs: 127.0.0.2, 127.0.0.3, then matches at dotless: + ips, err := client.LookupIP("localhost") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 2}}); r != "" { + t.Fatal(r) + } + } + + { // Will match dotless:localhost, and expectIPs: 127.0.0.2, 127.0.0.3 + ips, err := client.LookupIP("localhost-a") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 3}}); r != "" { + t.Fatal(r) + } + } + + { // Will match dotless:localhost, and expectIPs: 127.0.0.2, 127.0.0.3 + ips, err := client.LookupIP("localhost-b") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 4}}); r != "" { + t.Fatal(r) + } + } + + { // Will match dotless: + ips, err := client.LookupIP("Mijia Cloud") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{127, 0, 0, 1}}); r != "" { + t.Fatal(r) + } + } + + endTime := time.Now() + if startTime.After(endTime.Add(time.Second * 2)) { + t.Error("DNS query doesn't finish in 2 seconds.") + } +} + +func TestMultiMatchPrioritizedDomain(t *testing.T) { + port := udp.PickPort() + + dnsServer := dns.Server{ + Addr: "127.0.0.1:" + port.String(), + Net: "udp", + Handler: &staticHandler{}, + UDPSize: 1200, + } + + go dnsServer.ListenAndServe() + time.Sleep(time.Second) + + config := &core.Config{ + App: []*serial.TypedMessage{ + serial.ToTypedMessage(&Config{ + NameServers: []*net.Endpoint{ + { + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: 9999, /* unreachable */ + }, + }, + NameServer: []*NameServer{ + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + { + Type: DomainMatchingType_Subdomain, + Domain: "google.com", + }, + }, + Geoip: []*router.GeoIP{ + { // Will only match 8.8.8.8 and 8.8.4.4 + Cidr: []*router.CIDR{ + {Ip: []byte{8, 8, 8, 8}, Prefix: 32}, + {Ip: []byte{8, 8, 4, 4}, Prefix: 32}, + }, + }, + }, + }, + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + { + Type: DomainMatchingType_Subdomain, + Domain: "google.com", + }, + }, + Geoip: []*router.GeoIP{ + { // Will match 8.8.8.8 and 8.8.8.7, etc + Cidr: []*router.CIDR{ + {Ip: []byte{8, 8, 8, 7}, Prefix: 24}, + }, + }, + }, + }, + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + { + Type: DomainMatchingType_Subdomain, + Domain: "api.google.com", + }, + }, + Geoip: []*router.GeoIP{ + { // Will only match 8.8.7.7 (api.google.com) + Cidr: []*router.CIDR{ + {Ip: []byte{8, 8, 7, 7}, Prefix: 32}, + }, + }, + }, + }, + { + Address: &net.Endpoint{ + Network: net.Network_UDP, + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Ip{ + Ip: []byte{127, 0, 0, 1}, + }, + }, + Port: uint32(port), + }, + PrioritizedDomain: []*NameServer_PriorityDomain{ + { + Type: DomainMatchingType_Full, + Domain: "v2.api.google.com", + }, + }, + Geoip: []*router.GeoIP{ + { // Will only match 8.8.7.8 (v2.api.google.com) + Cidr: []*router.CIDR{ + {Ip: []byte{8, 8, 7, 8}, Prefix: 32}, + }, + }, + }, + }, + }, + }), + serial.ToTypedMessage(&dispatcher.Config{}), + serial.ToTypedMessage(&proxyman.OutboundConfig{}), + serial.ToTypedMessage(&policy.Config{}), + }, + Outbound: []*core.OutboundHandlerConfig{ + { + ProxySettings: serial.ToTypedMessage(&freedom.Config{}), + }, + }, + } + + v, err := core.New(config) + common.Must(err) + + client := v.GetFeature(feature_dns.ClientType()).(feature_dns.Client) + + startTime := time.Now() + + { // Will match server 1,2 and server 1 returns expected ip + ips, err := client.LookupIP("google.com") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 8}}); r != "" { + t.Fatal(r) + } + } + + { // Will match server 1,2 and server 1 returns unexpected ip, then server 2 returns expected one + clientv4 := client.(feature_dns.IPv4Lookup) + ips, err := clientv4.LookupIPv4("ipv6.google.com") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{8, 8, 8, 7}}); r != "" { + t.Fatal(r) + } + } + + { // Will match server 3,1,2 and server 3 returns expected one + ips, err := client.LookupIP("api.google.com") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{8, 8, 7, 7}}); r != "" { + t.Fatal(r) + } + } + + { // Will match server 4,3,1,2 and server 4 returns expected one + ips, err := client.LookupIP("v2.api.google.com") + if err != nil { + t.Fatal("unexpected error: ", err) + } + + if r := cmp.Diff(ips, []net.IP{{8, 8, 7, 8}}); r != "" { + t.Fatal(r) + } + } + + endTime := time.Now() + if startTime.After(endTime.Add(time.Second * 2)) { + t.Error("DNS query doesn't finish in 2 seconds.") + } +} diff --git a/app/dns/udpns.go b/app/dns/udpns.go index f1f60aca6e..a362c1dff3 100644 --- a/app/dns/udpns.go +++ b/app/dns/udpns.go @@ -134,7 +134,7 @@ func (s *ClassicNameServer) HandleResponse(ctx context.Context, packet *udp_prot } elapsed := time.Since(req.start) - newError(s.name, " got answere: ", req.domain, " ", req.reqType, " -> ", ipRec.IP, " ", elapsed).AtInfo().WriteToLog() + newError(s.name, " got answer: ", req.domain, " ", req.reqType, " -> ", ipRec.IP, " ", elapsed).AtInfo().WriteToLog() if len(req.domain) > 0 && (rec.A != nil || rec.AAAA != nil) { s.updateIP(req.domain, rec) } diff --git a/app/log/command/command.go b/app/log/command/command.go index 5d3ef6c459..a6b6b5c21e 100644 --- a/app/log/command/command.go +++ b/app/log/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -33,6 +33,8 @@ func (s *LoggerServer) RestartLogger(ctx context.Context, request *RestartLogger return &RestartLoggerResponse{}, nil } +func (s *LoggerServer) mustEmbedUnimplementedLoggerServiceServer() {} + type service struct { v *core.Instance } diff --git a/app/log/command/config.pb.go b/app/log/command/config.pb.go index 8a1bef3efc..0f1b9416df 100644 --- a/app/log/command/config.pb.go +++ b/app/log/command/config.pb.go @@ -1,11 +1,13 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/log/command/config.proto + package command import ( - context "context" proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -32,7 +34,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[0] + mi := &file_app_log_command_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +47,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[0] + 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 { @@ -58,7 +60,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_log_command_config_proto_rawDescGZIP(), []int{0} + return file_app_log_command_config_proto_rawDescGZIP(), []int{0} } type RestartLoggerRequest struct { @@ -70,7 +72,7 @@ type RestartLoggerRequest struct { func (x *RestartLoggerRequest) Reset() { *x = RestartLoggerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[1] + mi := &file_app_log_command_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -83,7 +85,7 @@ func (x *RestartLoggerRequest) String() string { func (*RestartLoggerRequest) ProtoMessage() {} func (x *RestartLoggerRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[1] + 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 { @@ -96,7 +98,7 @@ func (x *RestartLoggerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RestartLoggerRequest.ProtoReflect.Descriptor instead. func (*RestartLoggerRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_log_command_config_proto_rawDescGZIP(), []int{1} + return file_app_log_command_config_proto_rawDescGZIP(), []int{1} } type RestartLoggerResponse struct { @@ -108,7 +110,7 @@ type RestartLoggerResponse struct { func (x *RestartLoggerResponse) Reset() { *x = RestartLoggerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[2] + mi := &file_app_log_command_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -121,7 +123,7 @@ func (x *RestartLoggerResponse) String() string { func (*RestartLoggerResponse) ProtoMessage() {} func (x *RestartLoggerResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_log_command_config_proto_msgTypes[2] + 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 { @@ -134,55 +136,56 @@ func (x *RestartLoggerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RestartLoggerResponse.ProtoReflect.Descriptor instead. func (*RestartLoggerResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_log_command_config_proto_rawDescGZIP(), []int{2} + return file_app_log_command_config_proto_rawDescGZIP(), []int{2} } -var File_v2ray_com_core_app_log_command_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_log_command_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x87, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, - 0x74, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x48, - 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, - 0x50, 0x01, 0x5a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x1a, 0x56, 0x32, - 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x1a, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x87, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x12, 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x31, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x5f, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x50, 0x01, 0x5a, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, + 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_v2ray_com_core_app_log_command_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_log_command_config_proto_rawDescData = file_v2ray_com_core_app_log_command_config_proto_rawDesc + 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_v2ray_com_core_app_log_command_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_log_command_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_log_command_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_log_command_config_proto_rawDescData) +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_v2ray_com_core_app_log_command_config_proto_rawDescData + return file_app_log_command_config_proto_rawDescData } -var file_v2ray_com_core_app_log_command_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_app_log_command_config_proto_goTypes = []interface{}{ +var file_app_log_command_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_app_log_command_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.app.log.command.Config (*RestartLoggerRequest)(nil), // 1: v2ray.core.app.log.command.RestartLoggerRequest (*RestartLoggerResponse)(nil), // 2: v2ray.core.app.log.command.RestartLoggerResponse } -var file_v2ray_com_core_app_log_command_config_proto_depIdxs = []int32{ +var file_app_log_command_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.app.log.command.LoggerService.RestartLogger:input_type -> v2ray.core.app.log.command.RestartLoggerRequest 2, // 1: v2ray.core.app.log.command.LoggerService.RestartLogger:output_type -> v2ray.core.app.log.command.RestartLoggerResponse 1, // [1:2] is the sub-list for method output_type @@ -192,13 +195,13 @@ var file_v2ray_com_core_app_log_command_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_log_command_config_proto_init() } -func file_v2ray_com_core_app_log_command_config_proto_init() { - if File_v2ray_com_core_app_log_command_config_proto != nil { +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_v2ray_com_core_app_log_command_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_log_command_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -210,7 +213,7 @@ func file_v2ray_com_core_app_log_command_config_proto_init() { return nil } } - file_v2ray_com_core_app_log_command_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_log_command_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RestartLoggerRequest); i { case 0: return &v.state @@ -222,7 +225,7 @@ func file_v2ray_com_core_app_log_command_config_proto_init() { return nil } } - file_v2ray_com_core_app_log_command_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_log_command_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RestartLoggerResponse); i { case 0: return &v.state @@ -239,98 +242,18 @@ func file_v2ray_com_core_app_log_command_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_log_command_config_proto_rawDesc, + RawDescriptor: file_app_log_command_config_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_v2ray_com_core_app_log_command_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_log_command_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_log_command_config_proto_msgTypes, + 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_v2ray_com_core_app_log_command_config_proto = out.File - file_v2ray_com_core_app_log_command_config_proto_rawDesc = nil - file_v2ray_com_core_app_log_command_config_proto_goTypes = nil - file_v2ray_com_core_app_log_command_config_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// LoggerServiceClient is the client API for LoggerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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, "/v2ray.core.app.log.command.LoggerService/RestartLogger", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LoggerServiceServer is the server API for LoggerService service. -type LoggerServiceServer interface { - RestartLogger(context.Context, *RestartLoggerRequest) (*RestartLoggerResponse, error) -} - -// UnimplementedLoggerServiceServer can 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 RegisterLoggerServiceServer(s *grpc.Server, 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: "/v2ray.core.app.log.command.LoggerService/RestartLogger", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LoggerServiceServer).RestartLogger(ctx, req.(*RestartLoggerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _LoggerService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v2ray.core.app.log.command.LoggerService", - HandlerType: (*LoggerServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RestartLogger", - Handler: _LoggerService_RestartLogger_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "v2ray.com/core/app/log/command/config.proto", + 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/app/log/command/config.proto b/app/log/command/config.proto index 39e2f33f3b..369923c834 100644 --- a/app/log/command/config.proto +++ b/app/log/command/config.proto @@ -2,17 +2,16 @@ syntax = "proto3"; package v2ray.core.app.log.command; option csharp_namespace = "V2Ray.Core.App.Log.Command"; -option go_package = "command"; +option go_package = "v2ray.com/core/app/log/command"; option java_package = "com.v2ray.core.app.log.command"; option java_multiple_files = true; -message Config { -} +message Config {} message RestartLoggerRequest {} -message RestartLoggerResponse{} +message RestartLoggerResponse {} service LoggerService { rpc RestartLogger(RestartLoggerRequest) returns (RestartLoggerResponse) {} -} \ No newline at end of file +} diff --git a/app/log/command/config_grpc.pb.go b/app/log/command/config_grpc.pb.go new file mode 100644 index 0000000000..8d142add90 --- /dev/null +++ b/app/log/command/config_grpc.pb.go @@ -0,0 +1,97 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +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. +const _ = grpc.SupportPackageIsVersion7 + +// 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, "/v2ray.core.app.log.command.LoggerService/RestartLogger", 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.Server, 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: "/v2ray.core.app.log.command.LoggerService/RestartLogger", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LoggerServiceServer).RestartLogger(ctx, req.(*RestartLoggerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LoggerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v2ray.core.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/app/log/config.pb.go b/app/log/config.pb.go index 43f35a04a2..8e1c647680 100644 --- a/app/log/config.pb.go +++ b/app/log/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/log/config.proto + package log import ( @@ -56,11 +62,11 @@ func (x LogType) String() string { } func (LogType) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_log_config_proto_enumTypes[0].Descriptor() + return file_app_log_config_proto_enumTypes[0].Descriptor() } func (LogType) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_log_config_proto_enumTypes[0] + return &file_app_log_config_proto_enumTypes[0] } func (x LogType) Number() protoreflect.EnumNumber { @@ -69,7 +75,7 @@ func (x LogType) Number() protoreflect.EnumNumber { // Deprecated: Use LogType.Descriptor instead. func (LogType) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_log_config_proto_rawDescGZIP(), []int{0} + return file_app_log_config_proto_rawDescGZIP(), []int{0} } type Config struct { @@ -87,7 +93,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_log_config_proto_msgTypes[0] + mi := &file_app_log_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -100,7 +106,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_log_config_proto_msgTypes[0] + mi := &file_app_log_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -113,7 +119,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_log_config_proto_rawDescGZIP(), []int{0} + return file_app_log_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetErrorLogType() LogType { @@ -151,63 +157,63 @@ func (x *Config) GetAccessLogPath() string { return "" } -var File_v2ray_com_core_app_log_config_proto protoreflect.FileDescriptor +var File_app_log_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_app_log_config_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x1a, 0x23, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, - 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x47, 0x0a, 0x0f, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x43, 0x0a, 0x0f, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 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, - 0x34, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x03, 0x6c, 0x6f, 0x67, - 0xaa, 0x02, 0x12, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, - 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +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, 0x12, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0xa7, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a, 0x0e, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x47, + 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, + 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 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, 0x47, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x16, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x12, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_v2ray_com_core_app_log_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_log_config_proto_rawDescData = file_v2ray_com_core_app_log_config_proto_rawDesc + file_app_log_config_proto_rawDescOnce sync.Once + file_app_log_config_proto_rawDescData = file_app_log_config_proto_rawDesc ) -func file_v2ray_com_core_app_log_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_log_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_log_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_log_config_proto_rawDescData) +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_v2ray_com_core_app_log_config_proto_rawDescData + return file_app_log_config_proto_rawDescData } -var file_v2ray_com_core_app_log_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_app_log_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_app_log_config_proto_goTypes = []interface{}{ +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: v2ray.core.app.log.LogType (*Config)(nil), // 1: v2ray.core.app.log.Config (log.Severity)(0), // 2: v2ray.core.common.log.Severity } -var file_v2ray_com_core_app_log_config_proto_depIdxs = []int32{ +var file_app_log_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.app.log.Config.error_log_type:type_name -> v2ray.core.app.log.LogType 2, // 1: v2ray.core.app.log.Config.error_log_level:type_name -> v2ray.core.common.log.Severity 0, // 2: v2ray.core.app.log.Config.access_log_type:type_name -> v2ray.core.app.log.LogType @@ -218,13 +224,13 @@ var file_v2ray_com_core_app_log_config_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_log_config_proto_init() } -func file_v2ray_com_core_app_log_config_proto_init() { - if File_v2ray_com_core_app_log_config_proto != nil { +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_v2ray_com_core_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_log_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -241,19 +247,19 @@ func file_v2ray_com_core_app_log_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_log_config_proto_rawDesc, + RawDescriptor: file_app_log_config_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_log_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_log_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_app_log_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_app_log_config_proto_msgTypes, + 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_v2ray_com_core_app_log_config_proto = out.File - file_v2ray_com_core_app_log_config_proto_rawDesc = nil - file_v2ray_com_core_app_log_config_proto_goTypes = nil - file_v2ray_com_core_app_log_config_proto_depIdxs = nil + 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/app/log/config.proto b/app/log/config.proto index 16bb0c93ed..2931b713f2 100644 --- a/app/log/config.proto +++ b/app/log/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.app.log; option csharp_namespace = "V2Ray.Core.App.Log"; -option go_package = "log"; +option go_package = "v2ray.com/core/app/log"; option java_package = "com.v2ray.core.app.log"; option java_multiple_files = true; -import "v2ray.com/core/common/log/log.proto"; +import "common/log/log.proto"; enum LogType { None = 0; @@ -22,4 +22,4 @@ message Config { LogType access_log_type = 4; string access_log_path = 5; -} \ No newline at end of file +} diff --git a/app/log/log.go b/app/log/log.go index 1b47cb567e..bf95a4ce6f 100644 --- a/app/log/log.go +++ b/app/log/log.go @@ -2,7 +2,7 @@ package log -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/app/policy/config.go b/app/policy/config.go index 4856e94db7..adf09448a1 100644 --- a/app/policy/config.go +++ b/app/policy/config.go @@ -50,8 +50,8 @@ func (p *Policy) overrideWith(another *Policy) { p.Timeout.overrideWith(another.Timeout) } if another.Stats != nil && p.Stats == nil { - p.Stats = new(Policy_Stats) - *p.Stats = *another.Stats + p.Stats = &Policy_Stats{} + p.Stats = another.Stats } if another.Buffer != nil { p.Buffer = &Policy_Buffer{ diff --git a/app/policy/config.pb.go b/app/policy/config.pb.go index 3a2ea555fe..bfb5693c54 100644 --- a/app/policy/config.pb.go +++ b/app/policy/config.pb.go @@ -1,8 +1,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.24.0 -// protoc (unknown) -// source: config.proto +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/policy/config.proto package policy @@ -36,7 +36,7 @@ type Second struct { func (x *Second) Reset() { *x = Second{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[0] + mi := &file_app_policy_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +49,7 @@ func (x *Second) String() string { func (*Second) ProtoMessage() {} func (x *Second) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[0] + mi := &file_app_policy_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +62,7 @@ func (x *Second) ProtoReflect() protoreflect.Message { // Deprecated: Use Second.ProtoReflect.Descriptor instead. func (*Second) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{0} + return file_app_policy_config_proto_rawDescGZIP(), []int{0} } func (x *Second) GetValue() uint32 { @@ -85,7 +85,7 @@ type Policy struct { func (x *Policy) Reset() { *x = Policy{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[1] + mi := &file_app_policy_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -98,7 +98,7 @@ func (x *Policy) String() string { func (*Policy) ProtoMessage() {} func (x *Policy) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[1] + mi := &file_app_policy_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -111,7 +111,7 @@ func (x *Policy) ProtoReflect() protoreflect.Message { // Deprecated: Use Policy.ProtoReflect.Descriptor instead. func (*Policy) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{1} + return file_app_policy_config_proto_rawDescGZIP(), []int{1} } func (x *Policy) GetTimeout() *Policy_Timeout { @@ -146,7 +146,7 @@ type SystemPolicy struct { func (x *SystemPolicy) Reset() { *x = SystemPolicy{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[2] + mi := &file_app_policy_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -159,7 +159,7 @@ func (x *SystemPolicy) String() string { func (*SystemPolicy) ProtoMessage() {} func (x *SystemPolicy) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[2] + mi := &file_app_policy_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -172,7 +172,7 @@ func (x *SystemPolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use SystemPolicy.ProtoReflect.Descriptor instead. func (*SystemPolicy) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{2} + return file_app_policy_config_proto_rawDescGZIP(), []int{2} } func (x *SystemPolicy) GetStats() *SystemPolicy_Stats { @@ -194,7 +194,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[3] + mi := &file_app_policy_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -207,7 +207,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[3] + mi := &file_app_policy_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -220,7 +220,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{3} + return file_app_policy_config_proto_rawDescGZIP(), []int{3} } func (x *Config) GetLevel() map[uint32]*Policy { @@ -252,7 +252,7 @@ type Policy_Timeout struct { func (x *Policy_Timeout) Reset() { *x = Policy_Timeout{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[4] + mi := &file_app_policy_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -265,7 +265,7 @@ func (x *Policy_Timeout) String() string { func (*Policy_Timeout) ProtoMessage() {} func (x *Policy_Timeout) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[4] + mi := &file_app_policy_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -278,7 +278,7 @@ func (x *Policy_Timeout) ProtoReflect() protoreflect.Message { // Deprecated: Use Policy_Timeout.ProtoReflect.Descriptor instead. func (*Policy_Timeout) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{1, 0} + return file_app_policy_config_proto_rawDescGZIP(), []int{1, 0} } func (x *Policy_Timeout) GetHandshake() *Second { @@ -321,7 +321,7 @@ type Policy_Stats struct { func (x *Policy_Stats) Reset() { *x = Policy_Stats{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[5] + mi := &file_app_policy_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -334,7 +334,7 @@ func (x *Policy_Stats) String() string { func (*Policy_Stats) ProtoMessage() {} func (x *Policy_Stats) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[5] + mi := &file_app_policy_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -347,7 +347,7 @@ func (x *Policy_Stats) ProtoReflect() protoreflect.Message { // Deprecated: Use Policy_Stats.ProtoReflect.Descriptor instead. func (*Policy_Stats) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{1, 1} + return file_app_policy_config_proto_rawDescGZIP(), []int{1, 1} } func (x *Policy_Stats) GetUserUplink() bool { @@ -376,7 +376,7 @@ type Policy_Buffer struct { func (x *Policy_Buffer) Reset() { *x = Policy_Buffer{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[6] + mi := &file_app_policy_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -389,7 +389,7 @@ func (x *Policy_Buffer) String() string { func (*Policy_Buffer) ProtoMessage() {} func (x *Policy_Buffer) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[6] + mi := &file_app_policy_config_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -402,7 +402,7 @@ func (x *Policy_Buffer) ProtoReflect() protoreflect.Message { // Deprecated: Use Policy_Buffer.ProtoReflect.Descriptor instead. func (*Policy_Buffer) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{1, 2} + return file_app_policy_config_proto_rawDescGZIP(), []int{1, 2} } func (x *Policy_Buffer) GetConnection() int32 { @@ -426,7 +426,7 @@ type SystemPolicy_Stats struct { func (x *SystemPolicy_Stats) Reset() { *x = SystemPolicy_Stats{} if protoimpl.UnsafeEnabled { - mi := &file_config_proto_msgTypes[7] + mi := &file_app_policy_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -439,7 +439,7 @@ func (x *SystemPolicy_Stats) String() string { func (*SystemPolicy_Stats) ProtoMessage() {} func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message { - mi := &file_config_proto_msgTypes[7] + mi := &file_app_policy_config_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -452,7 +452,7 @@ func (x *SystemPolicy_Stats) ProtoReflect() protoreflect.Message { // Deprecated: Use SystemPolicy_Stats.ProtoReflect.Descriptor instead. func (*SystemPolicy_Stats) Descriptor() ([]byte, []int) { - return file_config_proto_rawDescGZIP(), []int{2, 0} + return file_app_policy_config_proto_rawDescGZIP(), []int{2, 0} } func (x *SystemPolicy_Stats) GetInboundUplink() bool { @@ -483,102 +483,104 @@ func (x *SystemPolicy_Stats) GetOutboundDownlink() bool { return false } -var File_config_proto protoreflect.FileDescriptor +var File_app_policy_config_proto protoreflect.FileDescriptor -var file_config_proto_rawDesc = []byte{ - 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xd0, 0x04, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x12, 0x3f, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x39, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, 0x0a, 0x06, - 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x92, 0x02, 0x0a, 0x07, 0x54, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, - 0x61, 0x6b, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x46, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x0b, 0x75, - 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x42, 0x0a, 0x0d, 0x64, - 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x81, 0x02, 0x0a, 0x0c, 0x53, 0x79, 0x73, - 0x74, 0x65, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3f, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, +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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xde, 0x01, 0x0a, - 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x3b, 0x0a, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 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, 0xd0, 0x04, 0x0a, 0x06, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3f, 0x0a, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x39, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, 0x0a, 0x06, 0x62, 0x75, 0x66, 0x66, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x57, 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, 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x3d, 0x0a, - 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x06, 0x70, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x52, 0x06, 0x62, + 0x75, 0x66, 0x66, 0x65, 0x72, 0x1a, 0x92, 0x02, 0x0a, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x68, 0x61, 0x6e, 0x64, 0x73, 0x68, 0x61, 0x6b, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x46, + 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x6c, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x0b, 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, + 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x42, 0x0a, 0x0d, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, + 0x6e, 0x6b, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x81, 0x02, 0x0a, 0x0c, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3f, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0xde, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x3e, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3b, 0x0a, 0x06, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x57, 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, + 0x33, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_config_proto_rawDescOnce sync.Once - file_config_proto_rawDescData = file_config_proto_rawDesc + file_app_policy_config_proto_rawDescOnce sync.Once + file_app_policy_config_proto_rawDescData = file_app_policy_config_proto_rawDesc ) -func file_config_proto_rawDescGZIP() []byte { - file_config_proto_rawDescOnce.Do(func() { - file_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_proto_rawDescData) +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_config_proto_rawDescData + return file_app_policy_config_proto_rawDescData } -var file_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_config_proto_goTypes = []interface{}{ +var file_app_policy_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_app_policy_config_proto_goTypes = []interface{}{ (*Second)(nil), // 0: v2ray.core.app.policy.Second (*Policy)(nil), // 1: v2ray.core.app.policy.Policy (*SystemPolicy)(nil), // 2: v2ray.core.app.policy.SystemPolicy @@ -589,7 +591,7 @@ var file_config_proto_goTypes = []interface{}{ (*SystemPolicy_Stats)(nil), // 7: v2ray.core.app.policy.SystemPolicy.Stats nil, // 8: v2ray.core.app.policy.Config.LevelEntry } -var file_config_proto_depIdxs = []int32{ +var file_app_policy_config_proto_depIdxs = []int32{ 4, // 0: v2ray.core.app.policy.Policy.timeout:type_name -> v2ray.core.app.policy.Policy.Timeout 5, // 1: v2ray.core.app.policy.Policy.stats:type_name -> v2ray.core.app.policy.Policy.Stats 6, // 2: v2ray.core.app.policy.Policy.buffer:type_name -> v2ray.core.app.policy.Policy.Buffer @@ -608,13 +610,13 @@ var file_config_proto_depIdxs = []int32{ 0, // [0:11] is the sub-list for field type_name } -func init() { file_config_proto_init() } -func file_config_proto_init() { - if File_config_proto != nil { +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_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_policy_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Second); i { case 0: return &v.state @@ -626,7 +628,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_policy_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Policy); i { case 0: return &v.state @@ -638,7 +640,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_policy_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SystemPolicy); i { case 0: return &v.state @@ -650,7 +652,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_policy_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -662,7 +664,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -674,7 +676,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -686,7 +688,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -698,7 +700,7 @@ func file_config_proto_init() { return nil } } - file_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -715,18 +717,18 @@ func file_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_config_proto_rawDesc, + RawDescriptor: file_app_policy_config_proto_rawDesc, NumEnums: 0, NumMessages: 9, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_config_proto_goTypes, - DependencyIndexes: file_config_proto_depIdxs, - MessageInfos: file_config_proto_msgTypes, + GoTypes: file_app_policy_config_proto_goTypes, + DependencyIndexes: file_app_policy_config_proto_depIdxs, + MessageInfos: file_app_policy_config_proto_msgTypes, }.Build() - File_config_proto = out.File - file_config_proto_rawDesc = nil - file_config_proto_goTypes = nil - file_config_proto_depIdxs = nil + 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/app/policy/config.proto b/app/policy/config.proto index 30cd2be5ae..cc07fa3f86 100644 --- a/app/policy/config.proto +++ b/app/policy/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.app.policy; option csharp_namespace = "V2Ray.Core.App.Policy"; -option go_package = "policy"; +option go_package = "v2ray.com/core/app/policy"; option java_package = "com.v2ray.core.app.policy"; option java_multiple_files = true; diff --git a/app/policy/policy.go b/app/policy/policy.go index bb3ac3b3b2..4ae0b02852 100644 --- a/app/policy/policy.go +++ b/app/policy/policy.go @@ -1,4 +1,4 @@ // Package policy is an implementation of policy.Manager feature. package policy -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go index 64b4a2e691..6586bf0c12 100644 --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -125,6 +125,8 @@ func (s *handlerServer) AlterOutbound(ctx context.Context, request *AlterOutboun return &AlterOutboundResponse{}, operation.ApplyOutbound(ctx, handler) } +func (s *handlerServer) mustEmbedUnimplementedHandlerServiceServer() {} + type service struct { v *core.Instance } diff --git a/app/proxyman/command/command.pb.go b/app/proxyman/command/command.pb.go index a23ae4b98d..d6170718be 100644 --- a/app/proxyman/command/command.pb.go +++ b/app/proxyman/command/command.pb.go @@ -1,11 +1,13 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/proxyman/command/command.proto + package command import ( - context "context" proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -37,7 +39,7 @@ type AddUserOperation struct { func (x *AddUserOperation) Reset() { *x = AddUserOperation{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[0] + mi := &file_app_proxyman_command_command_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +52,7 @@ func (x *AddUserOperation) String() string { func (*AddUserOperation) ProtoMessage() {} func (x *AddUserOperation) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[0] + 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 { @@ -63,7 +65,7 @@ func (x *AddUserOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use AddUserOperation.ProtoReflect.Descriptor instead. func (*AddUserOperation) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{0} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{0} } func (x *AddUserOperation) GetUser() *protocol.User { @@ -84,7 +86,7 @@ type RemoveUserOperation struct { func (x *RemoveUserOperation) Reset() { *x = RemoveUserOperation{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[1] + mi := &file_app_proxyman_command_command_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -97,7 +99,7 @@ func (x *RemoveUserOperation) String() string { func (*RemoveUserOperation) ProtoMessage() {} func (x *RemoveUserOperation) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[1] + 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 { @@ -110,7 +112,7 @@ func (x *RemoveUserOperation) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveUserOperation.ProtoReflect.Descriptor instead. func (*RemoveUserOperation) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{1} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{1} } func (x *RemoveUserOperation) GetEmail() string { @@ -131,7 +133,7 @@ type AddInboundRequest struct { func (x *AddInboundRequest) Reset() { *x = AddInboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[2] + mi := &file_app_proxyman_command_command_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -144,7 +146,7 @@ func (x *AddInboundRequest) String() string { func (*AddInboundRequest) ProtoMessage() {} func (x *AddInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[2] + 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 { @@ -157,7 +159,7 @@ func (x *AddInboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddInboundRequest.ProtoReflect.Descriptor instead. func (*AddInboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{2} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{2} } func (x *AddInboundRequest) GetInbound() *core.InboundHandlerConfig { @@ -176,7 +178,7 @@ type AddInboundResponse struct { func (x *AddInboundResponse) Reset() { *x = AddInboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[3] + mi := &file_app_proxyman_command_command_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -189,7 +191,7 @@ func (x *AddInboundResponse) String() string { func (*AddInboundResponse) ProtoMessage() {} func (x *AddInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[3] + 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 { @@ -202,7 +204,7 @@ func (x *AddInboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddInboundResponse.ProtoReflect.Descriptor instead. func (*AddInboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{3} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{3} } type RemoveInboundRequest struct { @@ -216,7 +218,7 @@ type RemoveInboundRequest struct { func (x *RemoveInboundRequest) Reset() { *x = RemoveInboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[4] + mi := &file_app_proxyman_command_command_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -229,7 +231,7 @@ func (x *RemoveInboundRequest) String() string { func (*RemoveInboundRequest) ProtoMessage() {} func (x *RemoveInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[4] + 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 { @@ -242,7 +244,7 @@ func (x *RemoveInboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveInboundRequest.ProtoReflect.Descriptor instead. func (*RemoveInboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{4} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{4} } func (x *RemoveInboundRequest) GetTag() string { @@ -261,7 +263,7 @@ type RemoveInboundResponse struct { func (x *RemoveInboundResponse) Reset() { *x = RemoveInboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[5] + mi := &file_app_proxyman_command_command_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -274,7 +276,7 @@ func (x *RemoveInboundResponse) String() string { func (*RemoveInboundResponse) ProtoMessage() {} func (x *RemoveInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[5] + 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 { @@ -287,7 +289,7 @@ func (x *RemoveInboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveInboundResponse.ProtoReflect.Descriptor instead. func (*RemoveInboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{5} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{5} } type AlterInboundRequest struct { @@ -302,7 +304,7 @@ type AlterInboundRequest struct { func (x *AlterInboundRequest) Reset() { *x = AlterInboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[6] + mi := &file_app_proxyman_command_command_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -315,7 +317,7 @@ func (x *AlterInboundRequest) String() string { func (*AlterInboundRequest) ProtoMessage() {} func (x *AlterInboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[6] + 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 { @@ -328,7 +330,7 @@ func (x *AlterInboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AlterInboundRequest.ProtoReflect.Descriptor instead. func (*AlterInboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{6} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{6} } func (x *AlterInboundRequest) GetTag() string { @@ -354,7 +356,7 @@ type AlterInboundResponse struct { func (x *AlterInboundResponse) Reset() { *x = AlterInboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[7] + mi := &file_app_proxyman_command_command_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -367,7 +369,7 @@ func (x *AlterInboundResponse) String() string { func (*AlterInboundResponse) ProtoMessage() {} func (x *AlterInboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[7] + 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 { @@ -380,7 +382,7 @@ func (x *AlterInboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AlterInboundResponse.ProtoReflect.Descriptor instead. func (*AlterInboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{7} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{7} } type AddOutboundRequest struct { @@ -394,7 +396,7 @@ type AddOutboundRequest struct { func (x *AddOutboundRequest) Reset() { *x = AddOutboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[8] + mi := &file_app_proxyman_command_command_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -407,7 +409,7 @@ func (x *AddOutboundRequest) String() string { func (*AddOutboundRequest) ProtoMessage() {} func (x *AddOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[8] + 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 { @@ -420,7 +422,7 @@ func (x *AddOutboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddOutboundRequest.ProtoReflect.Descriptor instead. func (*AddOutboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{8} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{8} } func (x *AddOutboundRequest) GetOutbound() *core.OutboundHandlerConfig { @@ -439,7 +441,7 @@ type AddOutboundResponse struct { func (x *AddOutboundResponse) Reset() { *x = AddOutboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[9] + mi := &file_app_proxyman_command_command_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +454,7 @@ func (x *AddOutboundResponse) String() string { func (*AddOutboundResponse) ProtoMessage() {} func (x *AddOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[9] + 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 { @@ -465,7 +467,7 @@ func (x *AddOutboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddOutboundResponse.ProtoReflect.Descriptor instead. func (*AddOutboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{9} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{9} } type RemoveOutboundRequest struct { @@ -479,7 +481,7 @@ type RemoveOutboundRequest struct { func (x *RemoveOutboundRequest) Reset() { *x = RemoveOutboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[10] + mi := &file_app_proxyman_command_command_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -492,7 +494,7 @@ func (x *RemoveOutboundRequest) String() string { func (*RemoveOutboundRequest) ProtoMessage() {} func (x *RemoveOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[10] + 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 { @@ -505,7 +507,7 @@ func (x *RemoveOutboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveOutboundRequest.ProtoReflect.Descriptor instead. func (*RemoveOutboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{10} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{10} } func (x *RemoveOutboundRequest) GetTag() string { @@ -524,7 +526,7 @@ type RemoveOutboundResponse struct { func (x *RemoveOutboundResponse) Reset() { *x = RemoveOutboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[11] + mi := &file_app_proxyman_command_command_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -537,7 +539,7 @@ func (x *RemoveOutboundResponse) String() string { func (*RemoveOutboundResponse) ProtoMessage() {} func (x *RemoveOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[11] + 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 { @@ -550,7 +552,7 @@ func (x *RemoveOutboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveOutboundResponse.ProtoReflect.Descriptor instead. func (*RemoveOutboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{11} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{11} } type AlterOutboundRequest struct { @@ -565,7 +567,7 @@ type AlterOutboundRequest struct { func (x *AlterOutboundRequest) Reset() { *x = AlterOutboundRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[12] + mi := &file_app_proxyman_command_command_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -578,7 +580,7 @@ func (x *AlterOutboundRequest) String() string { func (*AlterOutboundRequest) ProtoMessage() {} func (x *AlterOutboundRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[12] + 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 { @@ -591,7 +593,7 @@ func (x *AlterOutboundRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AlterOutboundRequest.ProtoReflect.Descriptor instead. func (*AlterOutboundRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{12} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{12} } func (x *AlterOutboundRequest) GetTag() string { @@ -617,7 +619,7 @@ type AlterOutboundResponse struct { func (x *AlterOutboundResponse) Reset() { *x = AlterOutboundResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[13] + mi := &file_app_proxyman_command_command_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -630,7 +632,7 @@ func (x *AlterOutboundResponse) String() string { func (*AlterOutboundResponse) ProtoMessage() {} func (x *AlterOutboundResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[13] + 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 { @@ -643,7 +645,7 @@ func (x *AlterOutboundResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AlterOutboundResponse.ProtoReflect.Descriptor instead. func (*AlterOutboundResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{13} + return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{13} } type Config struct { @@ -655,7 +657,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[14] + mi := &file_app_proxyman_command_command_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -668,7 +670,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[14] + 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 { @@ -681,143 +683,141 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP(), []int{14} -} - -var File_v2ray_com_core_app_proxyman_command_command_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_proxyman_command_command_proto_rawDesc = []byte{ - 0x0a, 0x31, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x1f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, - 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 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, 0x1b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x48, - 0x0a, 0x10, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4f, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x07, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, - 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, - 0x6d, 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, 0x44, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x4f, 0x75, 0x74, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x08, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x62, + 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, 0x1f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x4f, 0x0a, 0x11, 0x41, 0x64, 0x64, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, + 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x20, 0x2e, 0x76, 0x32, 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, 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, 0x6e, 0x0a, 0x14, 0x41, 0x6c, 0x74, 0x65, 0x72, + 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, 0x6d, 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, 0x44, 0x0a, 0x09, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 0x0a, 0x12, 0x41, 0x64, + 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x3d, 0x0a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 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, 0x12, 0x44, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x90, 0x06, 0x0a, 0x0e, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x77, 0x0a, - 0x0a, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x32, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x80, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x7d, 0x0a, 0x0c, 0x41, 0x6c, 0x74, - 0x65, 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x34, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x7a, 0x0a, 0x0b, 0x41, 0x64, 0x64, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x34, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x83, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, - 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, - 0x37, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, + 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, 0x6e, 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, 0x44, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x90, + 0x06, 0x0a, 0x0e, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x77, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, + 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x80, 0x01, 0x0a, 0x0d, 0x41, - 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x35, 0x2e, 0x76, + 0x64, 0x2e, 0x41, 0x64, 0x64, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x80, 0x01, 0x0a, 0x0d, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 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, 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, - 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, + 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, 0x7d, 0x0a, + 0x0c, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x34, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x7a, 0x0a, 0x0b, + 0x41, 0x64, 0x64, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x33, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x34, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x83, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x36, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x37, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x80, + 0x01, 0x0a, 0x0d, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x12, 0x35, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x6e, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x23, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x1f, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_app_proxyman_command_command_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_proxyman_command_command_proto_rawDescData = file_v2ray_com_core_app_proxyman_command_command_proto_rawDesc + 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_v2ray_com_core_app_proxyman_command_command_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_proxyman_command_command_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_proxyman_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_proxyman_command_command_proto_rawDescData) +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_v2ray_com_core_app_proxyman_command_command_proto_rawDescData + return file_app_proxyman_command_command_proto_rawDescData } -var file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_v2ray_com_core_app_proxyman_command_command_proto_goTypes = []interface{}{ +var file_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_app_proxyman_command_command_proto_goTypes = []interface{}{ (*AddUserOperation)(nil), // 0: v2ray.core.app.proxyman.command.AddUserOperation (*RemoveUserOperation)(nil), // 1: v2ray.core.app.proxyman.command.RemoveUserOperation (*AddInboundRequest)(nil), // 2: v2ray.core.app.proxyman.command.AddInboundRequest @@ -838,7 +838,7 @@ var file_v2ray_com_core_app_proxyman_command_command_proto_goTypes = []interface (*serial.TypedMessage)(nil), // 17: v2ray.core.common.serial.TypedMessage (*core.OutboundHandlerConfig)(nil), // 18: v2ray.core.OutboundHandlerConfig } -var file_v2ray_com_core_app_proxyman_command_command_proto_depIdxs = []int32{ +var file_app_proxyman_command_command_proto_depIdxs = []int32{ 15, // 0: v2ray.core.app.proxyman.command.AddUserOperation.user:type_name -> v2ray.core.common.protocol.User 16, // 1: v2ray.core.app.proxyman.command.AddInboundRequest.inbound:type_name -> v2ray.core.InboundHandlerConfig 17, // 2: v2ray.core.app.proxyman.command.AlterInboundRequest.operation:type_name -> v2ray.core.common.serial.TypedMessage @@ -863,13 +863,13 @@ var file_v2ray_com_core_app_proxyman_command_command_proto_depIdxs = []int32{ 0, // [0:5] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_proxyman_command_command_proto_init() } -func file_v2ray_com_core_app_proxyman_command_command_proto_init() { - if File_v2ray_com_core_app_proxyman_command_command_proto != nil { +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_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddUserOperation); i { case 0: return &v.state @@ -881,7 +881,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveUserOperation); i { case 0: return &v.state @@ -893,7 +893,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddInboundRequest); i { case 0: return &v.state @@ -905,7 +905,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddInboundResponse); i { case 0: return &v.state @@ -917,7 +917,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveInboundRequest); i { case 0: return &v.state @@ -929,7 +929,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveInboundResponse); i { case 0: return &v.state @@ -941,7 +941,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AlterInboundRequest); i { case 0: return &v.state @@ -953,7 +953,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AlterInboundResponse); i { case 0: return &v.state @@ -965,7 +965,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddOutboundRequest); i { case 0: return &v.state @@ -977,7 +977,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddOutboundResponse); i { case 0: return &v.state @@ -989,7 +989,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveOutboundRequest); i { case 0: return &v.state @@ -1001,7 +1001,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveOutboundResponse); i { case 0: return &v.state @@ -1013,7 +1013,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AlterOutboundRequest); i { case 0: return &v.state @@ -1025,7 +1025,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AlterOutboundResponse); i { case 0: return &v.state @@ -1037,7 +1037,7 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_command_command_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -1054,278 +1054,18 @@ func file_v2ray_com_core_app_proxyman_command_command_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_proxyman_command_command_proto_rawDesc, + RawDescriptor: file_app_proxyman_command_command_proto_rawDesc, NumEnums: 0, NumMessages: 15, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_v2ray_com_core_app_proxyman_command_command_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_proxyman_command_command_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_proxyman_command_command_proto_msgTypes, + 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_v2ray_com_core_app_proxyman_command_command_proto = out.File - file_v2ray_com_core_app_proxyman_command_command_proto_rawDesc = nil - file_v2ray_com_core_app_proxyman_command_command_proto_goTypes = nil - file_v2ray_com_core_app_proxyman_command_command_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// HandlerServiceClient is the client API for HandlerService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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, "/v2ray.core.app.proxyman.command.HandlerService/AddInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// HandlerServiceServer is the server API for HandlerService service. -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) -} - -// UnimplementedHandlerServiceServer can 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 RegisterHandlerServiceServer(s *grpc.Server, 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: "/v2ray.core.app.proxyman.command.HandlerService/AddInbound", - } - 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: "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound", - } - 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: "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound", - } - 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: "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound", - } - 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: "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound", - } - 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: "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HandlerServiceServer).AlterOutbound(ctx, req.(*AlterOutboundRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _HandlerService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v2ray.core.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: "v2ray.com/core/app/proxyman/command/command.proto", + 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/app/proxyman/command/command.proto b/app/proxyman/command/command.proto index c40c8ec254..71004ad5fe 100644 --- a/app/proxyman/command/command.proto +++ b/app/proxyman/command/command.proto @@ -2,13 +2,13 @@ syntax = "proto3"; package v2ray.core.app.proxyman.command; option csharp_namespace = "V2Ray.Core.App.Proxyman.Command"; -option go_package = "command"; +option go_package = "v2ray.com/core/app/proxyman/command"; option java_package = "com.v2ray.core.app.proxyman.command"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/user.proto"; -import "v2ray.com/core/common/serial/typed_message.proto"; -import "v2ray.com/core/config.proto"; +import "common/protocol/user.proto"; +import "common/serial/typed_message.proto"; +import "config.proto"; message AddUserOperation { v2ray.core.common.protocol.User user = 1; @@ -22,9 +22,7 @@ message AddInboundRequest { core.InboundHandlerConfig inbound = 1; } -message AddInboundResponse{ - -} +message AddInboundResponse {} message RemoveInboundRequest { string tag = 1; @@ -37,31 +35,26 @@ message AlterInboundRequest { v2ray.core.common.serial.TypedMessage operation = 2; } -message AlterInboundResponse { -} +message AlterInboundResponse {} message AddOutboundRequest { core.OutboundHandlerConfig outbound = 1; } -message AddOutboundResponse { - -} +message AddOutboundResponse {} message RemoveOutboundRequest { string tag = 1; } -message RemoveOutboundResponse { -} +message RemoveOutboundResponse {} message AlterOutboundRequest { string tag = 1; v2ray.core.common.serial.TypedMessage operation = 2; } -message AlterOutboundResponse { -} +message AlterOutboundResponse {} service HandlerService { rpc AddInbound(AddInboundRequest) returns (AddInboundResponse) {} @@ -77,4 +70,4 @@ service HandlerService { rpc AlterOutbound(AlterOutboundRequest) returns (AlterOutboundResponse) {} } -message Config {} \ No newline at end of file +message Config {} diff --git a/app/proxyman/command/command_grpc.pb.go b/app/proxyman/command/command_grpc.pb.go new file mode 100644 index 0000000000..2b97a31e2f --- /dev/null +++ b/app/proxyman/command/command_grpc.pb.go @@ -0,0 +1,277 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +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. +const _ = grpc.SupportPackageIsVersion7 + +// 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, "/v2ray.core.app.proxyman.command.HandlerService/AddInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound", 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, "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound", 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.Server, 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: "/v2ray.core.app.proxyman.command.HandlerService/AddInbound", + } + 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: "/v2ray.core.app.proxyman.command.HandlerService/RemoveInbound", + } + 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: "/v2ray.core.app.proxyman.command.HandlerService/AlterInbound", + } + 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: "/v2ray.core.app.proxyman.command.HandlerService/AddOutbound", + } + 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: "/v2ray.core.app.proxyman.command.HandlerService/RemoveOutbound", + } + 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: "/v2ray.core.app.proxyman.command.HandlerService/AlterOutbound", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HandlerServiceServer).AlterOutbound(ctx, req.(*AlterOutboundRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _HandlerService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v2ray.core.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/app/proxyman/command/doc.go b/app/proxyman/command/doc.go index a9d2624e94..d09e0a9a39 100644 --- a/app/proxyman/command/doc.go +++ b/app/proxyman/command/doc.go @@ -1,3 +1,3 @@ package command -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/app/proxyman/config.pb.go b/app/proxyman/config.pb.go index 3ce9f4ad86..ce670a283d 100644 --- a/app/proxyman/config.pb.go +++ b/app/proxyman/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/proxyman/config.proto + package proxyman import ( @@ -52,11 +58,11 @@ func (x KnownProtocols) String() string { } func (KnownProtocols) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_proxyman_config_proto_enumTypes[0].Descriptor() + return file_app_proxyman_config_proto_enumTypes[0].Descriptor() } func (KnownProtocols) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_proxyman_config_proto_enumTypes[0] + return &file_app_proxyman_config_proto_enumTypes[0] } func (x KnownProtocols) Number() protoreflect.EnumNumber { @@ -65,7 +71,7 @@ func (x KnownProtocols) Number() protoreflect.EnumNumber { // Deprecated: Use KnownProtocols.Descriptor instead. func (KnownProtocols) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{0} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{0} } type AllocationStrategy_Type int32 @@ -104,11 +110,11 @@ func (x AllocationStrategy_Type) String() string { } func (AllocationStrategy_Type) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_proxyman_config_proto_enumTypes[1].Descriptor() + return file_app_proxyman_config_proto_enumTypes[1].Descriptor() } func (AllocationStrategy_Type) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_proxyman_config_proto_enumTypes[1] + return &file_app_proxyman_config_proto_enumTypes[1] } func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber { @@ -117,7 +123,7 @@ func (x AllocationStrategy_Type) Number() protoreflect.EnumNumber { // Deprecated: Use AllocationStrategy_Type.Descriptor instead. func (AllocationStrategy_Type) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} } type InboundConfig struct { @@ -129,7 +135,7 @@ type InboundConfig struct { func (x *InboundConfig) Reset() { *x = InboundConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[0] + mi := &file_app_proxyman_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -142,7 +148,7 @@ func (x *InboundConfig) String() string { func (*InboundConfig) ProtoMessage() {} func (x *InboundConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[0] + mi := &file_app_proxyman_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -155,7 +161,7 @@ func (x *InboundConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use InboundConfig.ProtoReflect.Descriptor instead. func (*InboundConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{0} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{0} } type AllocationStrategy struct { @@ -175,7 +181,7 @@ type AllocationStrategy struct { func (x *AllocationStrategy) Reset() { *x = AllocationStrategy{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[1] + mi := &file_app_proxyman_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -188,7 +194,7 @@ func (x *AllocationStrategy) String() string { func (*AllocationStrategy) ProtoMessage() {} func (x *AllocationStrategy) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[1] + mi := &file_app_proxyman_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -201,7 +207,7 @@ func (x *AllocationStrategy) ProtoReflect() protoreflect.Message { // Deprecated: Use AllocationStrategy.ProtoReflect.Descriptor instead. func (*AllocationStrategy) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{1} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{1} } func (x *AllocationStrategy) GetType() AllocationStrategy_Type { @@ -240,7 +246,7 @@ type SniffingConfig struct { func (x *SniffingConfig) Reset() { *x = SniffingConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[2] + mi := &file_app_proxyman_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -253,7 +259,7 @@ func (x *SniffingConfig) String() string { func (*SniffingConfig) ProtoMessage() {} func (x *SniffingConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[2] + mi := &file_app_proxyman_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -266,7 +272,7 @@ func (x *SniffingConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SniffingConfig.ProtoReflect.Descriptor instead. func (*SniffingConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{2} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{2} } func (x *SniffingConfig) GetEnabled() bool { @@ -306,7 +312,7 @@ type ReceiverConfig struct { func (x *ReceiverConfig) Reset() { *x = ReceiverConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[3] + mi := &file_app_proxyman_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -319,7 +325,7 @@ func (x *ReceiverConfig) String() string { func (*ReceiverConfig) ProtoMessage() {} func (x *ReceiverConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[3] + mi := &file_app_proxyman_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -332,7 +338,7 @@ func (x *ReceiverConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ReceiverConfig.ProtoReflect.Descriptor instead. func (*ReceiverConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{3} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{3} } func (x *ReceiverConfig) GetPortRange() *net.PortRange { @@ -398,7 +404,7 @@ type InboundHandlerConfig struct { func (x *InboundHandlerConfig) Reset() { *x = InboundHandlerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[4] + mi := &file_app_proxyman_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -411,7 +417,7 @@ func (x *InboundHandlerConfig) String() string { func (*InboundHandlerConfig) ProtoMessage() {} func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[4] + mi := &file_app_proxyman_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -424,7 +430,7 @@ func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use InboundHandlerConfig.ProtoReflect.Descriptor instead. func (*InboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{4} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{4} } func (x *InboundHandlerConfig) GetTag() string { @@ -457,7 +463,7 @@ type OutboundConfig struct { func (x *OutboundConfig) Reset() { *x = OutboundConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[5] + mi := &file_app_proxyman_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -470,7 +476,7 @@ func (x *OutboundConfig) String() string { func (*OutboundConfig) ProtoMessage() {} func (x *OutboundConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[5] + mi := &file_app_proxyman_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -483,7 +489,7 @@ func (x *OutboundConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use OutboundConfig.ProtoReflect.Descriptor instead. func (*OutboundConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{5} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{5} } type SenderConfig struct { @@ -501,7 +507,7 @@ type SenderConfig struct { func (x *SenderConfig) Reset() { *x = SenderConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[6] + mi := &file_app_proxyman_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -514,7 +520,7 @@ func (x *SenderConfig) String() string { func (*SenderConfig) ProtoMessage() {} func (x *SenderConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[6] + mi := &file_app_proxyman_config_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -527,7 +533,7 @@ func (x *SenderConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SenderConfig.ProtoReflect.Descriptor instead. func (*SenderConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{6} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{6} } func (x *SenderConfig) GetVia() *net.IPOrDomain { @@ -572,7 +578,7 @@ type MultiplexingConfig struct { func (x *MultiplexingConfig) Reset() { *x = MultiplexingConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[7] + mi := &file_app_proxyman_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -585,7 +591,7 @@ func (x *MultiplexingConfig) String() string { func (*MultiplexingConfig) ProtoMessage() {} func (x *MultiplexingConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[7] + mi := &file_app_proxyman_config_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -598,7 +604,7 @@ func (x *MultiplexingConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use MultiplexingConfig.ProtoReflect.Descriptor instead. func (*MultiplexingConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{7} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{7} } func (x *MultiplexingConfig) GetEnabled() bool { @@ -626,7 +632,7 @@ type AllocationStrategy_AllocationStrategyConcurrency struct { func (x *AllocationStrategy_AllocationStrategyConcurrency) Reset() { *x = AllocationStrategy_AllocationStrategyConcurrency{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[8] + mi := &file_app_proxyman_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -639,7 +645,7 @@ func (x *AllocationStrategy_AllocationStrategyConcurrency) String() string { func (*AllocationStrategy_AllocationStrategyConcurrency) ProtoMessage() {} func (x *AllocationStrategy_AllocationStrategyConcurrency) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[8] + mi := &file_app_proxyman_config_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -652,7 +658,7 @@ func (x *AllocationStrategy_AllocationStrategyConcurrency) ProtoReflect() protor // Deprecated: Use AllocationStrategy_AllocationStrategyConcurrency.ProtoReflect.Descriptor instead. func (*AllocationStrategy_AllocationStrategyConcurrency) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 0} } func (x *AllocationStrategy_AllocationStrategyConcurrency) GetValue() uint32 { @@ -673,7 +679,7 @@ type AllocationStrategy_AllocationStrategyRefresh struct { func (x *AllocationStrategy_AllocationStrategyRefresh) Reset() { *x = AllocationStrategy_AllocationStrategyRefresh{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[9] + mi := &file_app_proxyman_config_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -686,7 +692,7 @@ func (x *AllocationStrategy_AllocationStrategyRefresh) String() string { func (*AllocationStrategy_AllocationStrategyRefresh) ProtoMessage() {} func (x *AllocationStrategy_AllocationStrategyRefresh) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_proxyman_config_proto_msgTypes[9] + mi := &file_app_proxyman_config_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -699,7 +705,7 @@ func (x *AllocationStrategy_AllocationStrategyRefresh) ProtoReflect() protorefle // Deprecated: Use AllocationStrategy_AllocationStrategyRefresh.ProtoReflect.Descriptor instead. func (*AllocationStrategy_AllocationStrategyRefresh) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP(), []int{1, 1} + return file_app_proxyman_config_proto_rawDescGZIP(), []int{1, 1} } func (x *AllocationStrategy_AllocationStrategyRefresh) GetValue() uint32 { @@ -709,159 +715,156 @@ func (x *AllocationStrategy_AllocationStrategyRefresh) GetValue() uint32 { return 0 } -var File_v2ray_com_core_app_proxyman_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_proxyman_config_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x17, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x6d, 0x61, 0x6e, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 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, 0x24, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 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, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 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, 0xc0, 0x03, 0x0a, 0x12, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x44, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x76, 0x32, 0x72, +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, 0x17, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xc0, 0x03, 0x0a, 0x12, 0x41, + 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, + 0x79, 0x12, 0x44, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6b, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5f, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x5d, 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, 0x22, 0xb4, 0x04, 0x0a, + 0x0e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x3f, 0x0a, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x39, 0x0a, 0x06, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5c, 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, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x54, 0x0a, 0x0f, 0x73, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x54, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6b, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x49, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, - 0x5f, 0x0a, 0x07, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x45, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5d, 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, 0x22, 0xb4, 0x04, 0x0a, 0x0e, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3f, 0x0a, 0x0a, 0x70, 0x6f, - 0x72, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x09, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x6c, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, + 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, 0x54, 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, 0x27, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xcc, 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, 0x53, + 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4d, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5c, 0x0a, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x03, 0x20, + 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, 0xc8, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x33, 0x0a, 0x03, 0x76, 0x69, 0x61, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x54, 0x0a, 0x0f, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x54, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x54, 0x0a, 0x0f, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x54, 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, 0x27, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xcc, - 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, 0x53, 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x4d, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, - 0xc8, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x33, 0x0a, 0x03, 0x76, 0x69, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x54, 0x0a, 0x0f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x51, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5a, - 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, 0x2b, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x22, 0x50, 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, 0x0d, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 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, 0x43, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, - 0x50, 0x01, 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x17, 0x56, - 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x51, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5a, 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, + 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x22, + 0x50, 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, 0x0d, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, + 0x79, 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, 0x56, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x1b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x17, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, + 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_app_proxyman_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_proxyman_config_proto_rawDescData = file_v2ray_com_core_app_proxyman_config_proto_rawDesc + file_app_proxyman_config_proto_rawDescOnce sync.Once + file_app_proxyman_config_proto_rawDescData = file_app_proxyman_config_proto_rawDesc ) -func file_v2ray_com_core_app_proxyman_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_proxyman_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_proxyman_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_proxyman_config_proto_rawDescData) +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_v2ray_com_core_app_proxyman_config_proto_rawDescData + return file_app_proxyman_config_proto_rawDescData } -var file_v2ray_com_core_app_proxyman_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v2ray_com_core_app_proxyman_config_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_v2ray_com_core_app_proxyman_config_proto_goTypes = []interface{}{ +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: v2ray.core.app.proxyman.KnownProtocols (AllocationStrategy_Type)(0), // 1: v2ray.core.app.proxyman.AllocationStrategy.Type (*InboundConfig)(nil), // 2: v2ray.core.app.proxyman.InboundConfig @@ -880,7 +883,7 @@ var file_v2ray_com_core_app_proxyman_config_proto_goTypes = []interface{}{ (*serial.TypedMessage)(nil), // 15: v2ray.core.common.serial.TypedMessage (*internet.ProxyConfig)(nil), // 16: v2ray.core.transport.internet.ProxyConfig } -var file_v2ray_com_core_app_proxyman_config_proto_depIdxs = []int32{ +var file_app_proxyman_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.app.proxyman.AllocationStrategy.type:type_name -> v2ray.core.app.proxyman.AllocationStrategy.Type 10, // 1: v2ray.core.app.proxyman.AllocationStrategy.concurrency:type_name -> v2ray.core.app.proxyman.AllocationStrategy.AllocationStrategyConcurrency 11, // 2: v2ray.core.app.proxyman.AllocationStrategy.refresh:type_name -> v2ray.core.app.proxyman.AllocationStrategy.AllocationStrategyRefresh @@ -903,13 +906,13 @@ var file_v2ray_com_core_app_proxyman_config_proto_depIdxs = []int32{ 0, // [0:15] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_proxyman_config_proto_init() } -func file_v2ray_com_core_app_proxyman_config_proto_init() { - if File_v2ray_com_core_app_proxyman_config_proto != nil { +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_v2ray_com_core_app_proxyman_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundConfig); i { case 0: return &v.state @@ -921,7 +924,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AllocationStrategy); i { case 0: return &v.state @@ -933,7 +936,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SniffingConfig); i { case 0: return &v.state @@ -945,7 +948,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReceiverConfig); i { case 0: return &v.state @@ -957,7 +960,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundHandlerConfig); i { case 0: return &v.state @@ -969,7 +972,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundConfig); i { case 0: return &v.state @@ -981,7 +984,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SenderConfig); i { case 0: return &v.state @@ -993,7 +996,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_app_proxyman_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MultiplexingConfig); i { case 0: return &v.state @@ -1005,7 +1008,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -1017,7 +1020,7 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { return nil } } - file_v2ray_com_core_app_proxyman_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -1034,19 +1037,19 @@ func file_v2ray_com_core_app_proxyman_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_proxyman_config_proto_rawDesc, + RawDescriptor: file_app_proxyman_config_proto_rawDesc, NumEnums: 2, NumMessages: 10, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_proxyman_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_proxyman_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_app_proxyman_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_app_proxyman_config_proto_msgTypes, + 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_v2ray_com_core_app_proxyman_config_proto = out.File - file_v2ray_com_core_app_proxyman_config_proto_rawDesc = nil - file_v2ray_com_core_app_proxyman_config_proto_goTypes = nil - file_v2ray_com_core_app_proxyman_config_proto_depIdxs = nil + 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/app/proxyman/config.proto b/app/proxyman/config.proto index ed5e0151a2..7f4b7b8d28 100644 --- a/app/proxyman/config.proto +++ b/app/proxyman/config.proto @@ -2,17 +2,16 @@ syntax = "proto3"; package v2ray.core.app.proxyman; option csharp_namespace = "V2Ray.Core.App.Proxyman"; -option go_package = "proxyman"; +option go_package = "v2ray.com/core/app/proxyman"; option java_package = "com.v2ray.core.app.proxyman"; option java_multiple_files = true; -import "v2ray.com/core/common/net/address.proto"; -import "v2ray.com/core/common/net/port.proto"; -import "v2ray.com/core/transport/internet/config.proto"; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/net/address.proto"; +import "common/net/port.proto"; +import "transport/internet/config.proto"; +import "common/serial/typed_message.proto"; -message InboundConfig { -} +message InboundConfig {} message AllocationStrategy { enum Type { @@ -36,7 +35,6 @@ message AllocationStrategy { // Default value is 3 if unset. AllocationStrategyConcurrency concurrency = 2; - message AllocationStrategyRefresh { uint32 value = 1; } @@ -81,9 +79,7 @@ message InboundHandlerConfig { v2ray.core.common.serial.TypedMessage proxy_settings = 3; } -message OutboundConfig { - -} +message OutboundConfig {} message SenderConfig { // Send traffic through the given IP. Only IP is allowed. diff --git a/app/proxyman/inbound/inbound.go b/app/proxyman/inbound/inbound.go index 528356942d..947205e863 100644 --- a/app/proxyman/inbound/inbound.go +++ b/app/proxyman/inbound/inbound.go @@ -1,6 +1,6 @@ package inbound -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -150,6 +150,13 @@ func NewHandler(ctx context.Context, config *core.InboundHandlerConfig) (inbound return nil, newError("not a ReceiverConfig").AtError() } + streamSettings := receiverSettings.StreamSettings + if streamSettings != nil && streamSettings.SocketSettings != nil { + ctx = session.ContextWithSockopt(ctx, &session.Sockopt{ + Mark: streamSettings.SocketSettings.Mark, + }) + } + allocStrategy := receiverSettings.AllocationStrategy if allocStrategy == nil || allocStrategy.Type == proxyman.AllocationStrategy_Always { return NewAlwaysOnInboundHandler(ctx, tag, receiverSettings, proxySettings) diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index 3ffe9ae2d6..f899e6b8de 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -200,7 +200,7 @@ func (h *Handler) Dial(ctx context.Context, dest net.Destination) (internet.Conn return h.getStatCouterConnection(conn), err } -func (h *Handler) getStatCouterConnection(conn internet.Connection) (internet.Connection) { +func (h *Handler) getStatCouterConnection(conn internet.Connection) internet.Connection { if h.uplinkCounter != nil || h.downlinkCounter != nil { return &internet.StatCouterConnection{ Connection: conn, diff --git a/app/proxyman/outbound/handler_test.go b/app/proxyman/outbound/handler_test.go index c05183784c..b3b6e0545a 100644 --- a/app/proxyman/outbound/handler_test.go +++ b/app/proxyman/outbound/handler_test.go @@ -57,7 +57,7 @@ func TestOutboundWithStatCounter(t *testing.T) { serial.ToTypedMessage(&policy.Config{ System: &policy.SystemPolicy{ Stats: &policy.SystemPolicy_Stats{ - OutboundUplink: true, + OutboundUplink: true, OutboundDownlink: true, }, }, diff --git a/app/proxyman/outbound/outbound.go b/app/proxyman/outbound/outbound.go index af286116d7..e01c7bb08e 100644 --- a/app/proxyman/outbound/outbound.go +++ b/app/proxyman/outbound/outbound.go @@ -1,6 +1,6 @@ package outbound -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/app/reverse/config.pb.go b/app/reverse/config.pb.go index 3ad4a6ec04..558417a6ef 100644 --- a/app/reverse/config.pb.go +++ b/app/reverse/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/reverse/config.proto + package reverse import ( @@ -49,11 +55,11 @@ func (x Control_State) String() string { } func (Control_State) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_reverse_config_proto_enumTypes[0].Descriptor() + return file_app_reverse_config_proto_enumTypes[0].Descriptor() } func (Control_State) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_reverse_config_proto_enumTypes[0] + return &file_app_reverse_config_proto_enumTypes[0] } func (x Control_State) Number() protoreflect.EnumNumber { @@ -62,7 +68,7 @@ func (x Control_State) Number() protoreflect.EnumNumber { // Deprecated: Use Control_State.Descriptor instead. func (Control_State) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP(), []int{0, 0} + return file_app_reverse_config_proto_rawDescGZIP(), []int{0, 0} } type Control struct { @@ -77,7 +83,7 @@ type Control struct { func (x *Control) Reset() { *x = Control{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[0] + mi := &file_app_reverse_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -90,7 +96,7 @@ func (x *Control) String() string { func (*Control) ProtoMessage() {} func (x *Control) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[0] + mi := &file_app_reverse_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -103,7 +109,7 @@ func (x *Control) ProtoReflect() protoreflect.Message { // Deprecated: Use Control.ProtoReflect.Descriptor instead. func (*Control) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP(), []int{0} + return file_app_reverse_config_proto_rawDescGZIP(), []int{0} } func (x *Control) GetState() Control_State { @@ -132,7 +138,7 @@ type BridgeConfig struct { func (x *BridgeConfig) Reset() { *x = BridgeConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[1] + mi := &file_app_reverse_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -145,7 +151,7 @@ func (x *BridgeConfig) String() string { func (*BridgeConfig) ProtoMessage() {} func (x *BridgeConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[1] + mi := &file_app_reverse_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -158,7 +164,7 @@ func (x *BridgeConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use BridgeConfig.ProtoReflect.Descriptor instead. func (*BridgeConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP(), []int{1} + return file_app_reverse_config_proto_rawDescGZIP(), []int{1} } func (x *BridgeConfig) GetTag() string { @@ -187,7 +193,7 @@ type PortalConfig struct { func (x *PortalConfig) Reset() { *x = PortalConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[2] + mi := &file_app_reverse_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -200,7 +206,7 @@ func (x *PortalConfig) String() string { func (*PortalConfig) ProtoMessage() {} func (x *PortalConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[2] + mi := &file_app_reverse_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -213,7 +219,7 @@ func (x *PortalConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use PortalConfig.ProtoReflect.Descriptor instead. func (*PortalConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP(), []int{2} + return file_app_reverse_config_proto_rawDescGZIP(), []int{2} } func (x *PortalConfig) GetTag() string { @@ -242,7 +248,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[3] + mi := &file_app_reverse_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -255,7 +261,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_reverse_config_proto_msgTypes[3] + mi := &file_app_reverse_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -268,7 +274,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP(), []int{3} + return file_app_reverse_config_proto_rawDescGZIP(), []int{3} } func (x *Config) GetBridgeConfig() []*BridgeConfig { @@ -285,68 +291,68 @@ func (x *Config) GetPortalConfig() []*PortalConfig { return nil } -var File_v2ray_com_core_app_reverse_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_reverse_config_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x16, 0x76, 0x32, 0x72, 0x61, 0x79, +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, 0x16, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, + 0x73, 0x65, 0x22, 0x7e, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3b, 0x0a, + 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x9e, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x49, 0x0a, 0x0d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, - 0x65, 0x22, 0x7e, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3b, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x9e, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x49, 0x0a, 0x0d, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x49, 0x0a, 0x0d, 0x70, - 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x44, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, - 0x65, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 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, 0x49, 0x0a, 0x0d, + 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x57, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, + 0x76, 0x65, 0x72, 0x73, 0x65, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_app_reverse_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_reverse_config_proto_rawDescData = file_v2ray_com_core_app_reverse_config_proto_rawDesc + file_app_reverse_config_proto_rawDescOnce sync.Once + file_app_reverse_config_proto_rawDescData = file_app_reverse_config_proto_rawDesc ) -func file_v2ray_com_core_app_reverse_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_reverse_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_reverse_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_reverse_config_proto_rawDescData) +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_v2ray_com_core_app_reverse_config_proto_rawDescData + return file_app_reverse_config_proto_rawDescData } -var file_v2ray_com_core_app_reverse_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_app_reverse_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_v2ray_com_core_app_reverse_config_proto_goTypes = []interface{}{ +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: v2ray.core.app.reverse.Control.State (*Control)(nil), // 1: v2ray.core.app.reverse.Control (*BridgeConfig)(nil), // 2: v2ray.core.app.reverse.BridgeConfig (*PortalConfig)(nil), // 3: v2ray.core.app.reverse.PortalConfig (*Config)(nil), // 4: v2ray.core.app.reverse.Config } -var file_v2ray_com_core_app_reverse_config_proto_depIdxs = []int32{ +var file_app_reverse_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.app.reverse.Control.state:type_name -> v2ray.core.app.reverse.Control.State 2, // 1: v2ray.core.app.reverse.Config.bridge_config:type_name -> v2ray.core.app.reverse.BridgeConfig 3, // 2: v2ray.core.app.reverse.Config.portal_config:type_name -> v2ray.core.app.reverse.PortalConfig @@ -357,13 +363,13 @@ var file_v2ray_com_core_app_reverse_config_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_reverse_config_proto_init() } -func file_v2ray_com_core_app_reverse_config_proto_init() { - if File_v2ray_com_core_app_reverse_config_proto != nil { +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_v2ray_com_core_app_reverse_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_reverse_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Control); i { case 0: return &v.state @@ -375,7 +381,7 @@ func file_v2ray_com_core_app_reverse_config_proto_init() { return nil } } - file_v2ray_com_core_app_reverse_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_reverse_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BridgeConfig); i { case 0: return &v.state @@ -387,7 +393,7 @@ func file_v2ray_com_core_app_reverse_config_proto_init() { return nil } } - file_v2ray_com_core_app_reverse_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_reverse_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortalConfig); i { case 0: return &v.state @@ -399,7 +405,7 @@ func file_v2ray_com_core_app_reverse_config_proto_init() { return nil } } - file_v2ray_com_core_app_reverse_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_reverse_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -416,19 +422,19 @@ func file_v2ray_com_core_app_reverse_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_reverse_config_proto_rawDesc, + RawDescriptor: file_app_reverse_config_proto_rawDesc, NumEnums: 1, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_reverse_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_reverse_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_app_reverse_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_app_reverse_config_proto_msgTypes, + 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_v2ray_com_core_app_reverse_config_proto = out.File - file_v2ray_com_core_app_reverse_config_proto_rawDesc = nil - file_v2ray_com_core_app_reverse_config_proto_goTypes = nil - file_v2ray_com_core_app_reverse_config_proto_depIdxs = nil + 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/app/reverse/config.proto b/app/reverse/config.proto index 9cf649d896..53c81fbc48 100644 --- a/app/reverse/config.proto +++ b/app/reverse/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.app.reverse; option csharp_namespace = "V2Ray.Core.Proxy.Reverse"; -option go_package = "reverse"; +option go_package = "v2ray.com/core/app/reverse"; option java_package = "com.v2ray.core.proxy.reverse"; option java_multiple_files = true; @@ -19,7 +19,6 @@ message Control { message BridgeConfig { string tag = 1; string domain = 2; - } message PortalConfig { diff --git a/app/reverse/reverse.go b/app/reverse/reverse.go index 898a1850ed..a1d2628630 100644 --- a/app/reverse/reverse.go +++ b/app/reverse/reverse.go @@ -2,7 +2,7 @@ package reverse -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/app/router/command/command.go b/app/router/command/command.go new file mode 100644 index 0000000000..f1720f8713 --- /dev/null +++ b/app/router/command/command.go @@ -0,0 +1,95 @@ +// +build !confonly + +package command + +//go:generate go run v2ray.com/core/common/errors/errorgen + +import ( + "context" + "time" + + "google.golang.org/grpc" + + "v2ray.com/core" + "v2ray.com/core/common" + "v2ray.com/core/features/routing" + "v2ray.com/core/features/stats" +) + +// routingServer is an implementation of RoutingService. +type routingServer struct { + router routing.Router + routingStats stats.Channel +} + +// NewRoutingServer creates a statistics service with statistics manager. +func NewRoutingServer(router routing.Router, routingStats stats.Channel) RoutingServiceServer { + return &routingServer{ + router: router, + routingStats: routingStats, + } +} + +func (s *routingServer) TestRoute(ctx context.Context, request *TestRouteRequest) (*RoutingContext, error) { + if request.RoutingContext == nil { + return nil, newError("Invalid routing request.") + } + route, err := s.router.PickRoute(AsRoutingContext(request.RoutingContext)) + if err != nil { + return nil, err + } + if request.PublishResult && s.routingStats != nil { + ctx, _ := context.WithTimeout(context.Background(), 4*time.Second) // nolint: govet + s.routingStats.Publish(ctx, route) + } + return AsProtobufMessage(request.FieldSelectors)(route), nil +} + +func (s *routingServer) SubscribeRoutingStats(request *SubscribeRoutingStatsRequest, stream RoutingService_SubscribeRoutingStatsServer) error { + if s.routingStats == nil { + return newError("Routing statistics not enabled.") + } + genMessage := AsProtobufMessage(request.FieldSelectors) + subscriber, err := stats.SubscribeRunnableChannel(s.routingStats) + if err != nil { + return err + } + defer stats.UnsubscribeClosableChannel(s.routingStats, subscriber) // nolint: errcheck + for { + select { + case value, ok := <-subscriber: + if !ok { + return newError("Upstream closed the subscriber channel.") + } + route, ok := value.(routing.Route) + if !ok { + return newError("Upstream sent malformed statistics.") + } + err := stream.Send(genMessage(route)) + if err != nil { + return err + } + case <-stream.Context().Done(): + return stream.Context().Err() + } + } +} + +func (s *routingServer) mustEmbedUnimplementedRoutingServiceServer() {} + +type service struct { + v *core.Instance +} + +func (s *service) Register(server *grpc.Server) { + common.Must(s.v.RequireFeatures(func(router routing.Router, stats stats.Manager) { + RegisterRoutingServiceServer(server, NewRoutingServer(router, nil)) + })) +} + +func init() { + common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) { + s := core.MustFromContext(ctx) + return &service{v: s}, nil + })) +} diff --git a/app/router/command/command.pb.go b/app/router/command/command.pb.go new file mode 100644 index 0000000000..9ea07bfa9d --- /dev/null +++ b/app/router/command/command.pb.go @@ -0,0 +1,534 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/router/command/command.proto + +package command + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + net "v2ray.com/core/common/net" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// RoutingContext is the context with information relative to routing process. +// It conforms to the structure of v2ray.core.features.routing.Context and +// v2ray.core.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=v2ray.core.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_Unknown +} + +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 v2ray-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 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[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_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 Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_app_router_command_command_proto_rawDescGZIP(), []int{3} +} + +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, 0x1d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x22, 0xa8, 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, 0x38, + 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5d, 0x0a, 0x0a, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xb7, + 0x01, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x55, 0x0a, 0x0e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x32, 0x89, 0x02, 0x0a, 0x0e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x15, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x62, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x3b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x6d, 0x0a, 0x09, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x42, 0x68, + 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 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, 0x1d, 0x56, 0x32, 0x52, 0x61, 0x79, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, 5) +var file_app_router_command_command_proto_goTypes = []interface{}{ + (*RoutingContext)(nil), // 0: v2ray.core.app.router.command.RoutingContext + (*SubscribeRoutingStatsRequest)(nil), // 1: v2ray.core.app.router.command.SubscribeRoutingStatsRequest + (*TestRouteRequest)(nil), // 2: v2ray.core.app.router.command.TestRouteRequest + (*Config)(nil), // 3: v2ray.core.app.router.command.Config + nil, // 4: v2ray.core.app.router.command.RoutingContext.AttributesEntry + (net.Network)(0), // 5: v2ray.core.common.net.Network +} +var file_app_router_command_command_proto_depIdxs = []int32{ + 5, // 0: v2ray.core.app.router.command.RoutingContext.Network:type_name -> v2ray.core.common.net.Network + 4, // 1: v2ray.core.app.router.command.RoutingContext.Attributes:type_name -> v2ray.core.app.router.command.RoutingContext.AttributesEntry + 0, // 2: v2ray.core.app.router.command.TestRouteRequest.RoutingContext:type_name -> v2ray.core.app.router.command.RoutingContext + 1, // 3: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:input_type -> v2ray.core.app.router.command.SubscribeRoutingStatsRequest + 2, // 4: v2ray.core.app.router.command.RoutingService.TestRoute:input_type -> v2ray.core.app.router.command.TestRouteRequest + 0, // 5: v2ray.core.app.router.command.RoutingService.SubscribeRoutingStats:output_type -> v2ray.core.app.router.command.RoutingContext + 0, // 6: v2ray.core.app.router.command.RoutingService.TestRoute:output_type -> v2ray.core.app.router.command.RoutingContext + 5, // [5:7] is the sub-list for method output_type + 3, // [3:5] 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_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.(*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: 5, + 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/app/router/command/command.proto b/app/router/command/command.proto new file mode 100644 index 0000000000..65e732542e --- /dev/null +++ b/app/router/command/command.proto @@ -0,0 +1,69 @@ +syntax = "proto3"; + +package v2ray.core.app.router.command; +option csharp_namespace = "V2Ray.Core.App.Router.Command"; +option go_package = "v2ray.com/core/app/router/command"; +option java_package = "com.v2ray.core.app.router.command"; +option java_multiple_files = true; + +import "common/net/network.proto"; + +// RoutingContext is the context with information relative to routing process. +// It conforms to the structure of v2ray.core.features.routing.Context and +// v2ray.core.features.routing.Route. +message RoutingContext { + string InboundTag = 1; + v2ray.core.common.net.Network Network = 2; + repeated bytes SourceIPs = 3; + repeated bytes TargetIPs = 4; + uint32 SourcePort = 5; + uint32 TargetPort = 6; + string TargetDomain = 7; + string Protocol = 8; + string User = 9; + map Attributes = 10; + repeated string OutboundGroupTags = 11; + string OutboundTag = 12; +} + +// SubscribeRoutingStatsRequest subscribes to routing statistics channel if +// opened by v2ray-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. +message SubscribeRoutingStatsRequest { + repeated string FieldSelectors = 1; +} + +// 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. +message TestRouteRequest { + RoutingContext RoutingContext = 1; + repeated string FieldSelectors = 2; + bool PublishResult = 3; +} + +service RoutingService { + rpc SubscribeRoutingStats(SubscribeRoutingStatsRequest) + returns (stream RoutingContext) {} + rpc TestRoute(TestRouteRequest) returns (RoutingContext) {} +} + +message Config {} diff --git a/app/router/command/command_grpc.pb.go b/app/router/command/command_grpc.pb.go new file mode 100644 index 0000000000..3763bd0123 --- /dev/null +++ b/app/router/command/command_grpc.pb.go @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +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. +const _ = grpc.SupportPackageIsVersion7 + +// 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) +} + +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], "/v2ray.core.app.router.command.RoutingService/SubscribeRoutingStats", 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, "/v2ray.core.app.router.command.RoutingService/TestRoute", 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) + 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) 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.Server, 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: "/v2ray.core.app.router.command.RoutingService/TestRoute", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoutingServiceServer).TestRoute(ctx, req.(*TestRouteRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _RoutingService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.router.command.RoutingService", + HandlerType: (*RoutingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TestRoute", + Handler: _RoutingService_TestRoute_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeRoutingStats", + Handler: _RoutingService_SubscribeRoutingStats_Handler, + ServerStreams: true, + }, + }, + Metadata: "app/router/command/command.proto", +} diff --git a/app/router/command/command_test.go b/app/router/command/command_test.go new file mode 100644 index 0000000000..258ff1a09f --- /dev/null +++ b/app/router/command/command_test.go @@ -0,0 +1,361 @@ +package command_test + +import ( + "context" + "testing" + "time" + + "github.com/golang/mock/gomock" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "google.golang.org/grpc" + "google.golang.org/grpc/test/bufconn" + "v2ray.com/core/app/router" + . "v2ray.com/core/app/router/command" + "v2ray.com/core/app/stats" + "v2ray.com/core/common" + "v2ray.com/core/common/net" + "v2ray.com/core/features/routing" + "v2ray.com/core/testing/mocks" +) + +func TestServiceSubscribeRoutingStats(t *testing.T) { + c := stats.NewChannel(&stats.ChannelConfig{ + SubscriberLimit: 1, + BufferSize: 0, + Blocking: true, + }) + common.Must(c.Start()) + defer c.Close() + + lis := bufconn.Listen(1024 * 1024) + bufDialer := func(context.Context, string) (net.Conn, error) { + return lis.Dial() + } + + testCases := []*RoutingContext{ + {InboundTag: "in", OutboundTag: "out"}, + {TargetIPs: [][]byte{{1, 2, 3, 4}}, TargetPort: 8080, OutboundTag: "out"}, + {TargetDomain: "example.com", TargetPort: 443, OutboundTag: "out"}, + {SourcePort: 9999, TargetPort: 9999, OutboundTag: "out"}, + {Network: net.Network_UDP, OutboundGroupTags: []string{"outergroup", "innergroup"}, OutboundTag: "out"}, + {Protocol: "bittorrent", OutboundTag: "blocked"}, + {User: "example@v2fly.org", OutboundTag: "out"}, + {SourceIPs: [][]byte{{127, 0, 0, 1}}, Attributes: map[string]string{"attr": "value"}, OutboundTag: "out"}, + } + errCh := make(chan error) + nextPub := make(chan struct{}) + + // Server goroutine + go func() { + server := grpc.NewServer() + RegisterRoutingServiceServer(server, NewRoutingServer(nil, c)) + errCh <- server.Serve(lis) + }() + + // Publisher goroutine + go func() { + publishTestCases := func() error { + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + for { // Wait until there's one subscriber in routing stats channel + if len(c.Subscribers()) > 0 { + break + } + if ctx.Err() != nil { + return ctx.Err() + } + } + for _, tc := range testCases { + c.Publish(context.Background(), AsRoutingRoute(tc)) + time.Sleep(time.Millisecond) + } + return nil + } + + if err := publishTestCases(); err != nil { + errCh <- err + } + + // Wait for next round of publishing + <-nextPub + + if err := publishTestCases(); err != nil { + errCh <- err + } + }() + + // Client goroutine + go func() { + defer lis.Close() + conn, err := grpc.DialContext(context.Background(), "bufnet", grpc.WithContextDialer(bufDialer), grpc.WithInsecure()) + if err != nil { + errCh <- err + return + } + defer conn.Close() + client := NewRoutingServiceClient(conn) + + // Test retrieving all fields + testRetrievingAllFields := func() error { + streamCtx, streamClose := context.WithCancel(context.Background()) + + // Test the unsubscription of stream works well + defer func() { + streamClose() + timeOutCtx, timeout := context.WithTimeout(context.Background(), time.Second) + defer timeout() + for { // Wait until there's no subscriber in routing stats channel + if len(c.Subscribers()) == 0 { + break + } + if timeOutCtx.Err() != nil { + t.Error("unexpected subscribers not decreased in channel", timeOutCtx.Err()) + } + } + }() + + stream, err := client.SubscribeRoutingStats(streamCtx, &SubscribeRoutingStatsRequest{}) + if err != nil { + return err + } + + for _, tc := range testCases { + msg, err := stream.Recv() + if err != nil { + return err + } + if r := cmp.Diff(msg, tc, cmpopts.IgnoreUnexported(RoutingContext{})); r != "" { + t.Error(r) + } + } + + // Test that double subscription will fail + errStream, err := client.SubscribeRoutingStats(context.Background(), &SubscribeRoutingStatsRequest{ + FieldSelectors: []string{"ip", "port", "domain", "outbound"}, + }) + if err != nil { + return err + } + if _, err := errStream.Recv(); err == nil { + t.Error("unexpected successful subscription") + } + + return nil + } + + // Test retrieving only a subset of fields + testRetrievingSubsetOfFields := func() error { + streamCtx, streamClose := context.WithCancel(context.Background()) + defer streamClose() + stream, err := client.SubscribeRoutingStats(streamCtx, &SubscribeRoutingStatsRequest{ + FieldSelectors: []string{"ip", "port", "domain", "outbound"}, + }) + if err != nil { + return err + } + + // Send nextPub signal to start next round of publishing + close(nextPub) + + for _, tc := range testCases { + msg, err := stream.Recv() + if err != nil { + return err + } + stat := &RoutingContext{ // Only a subset of stats is retrieved + SourceIPs: tc.SourceIPs, + TargetIPs: tc.TargetIPs, + SourcePort: tc.SourcePort, + TargetPort: tc.TargetPort, + TargetDomain: tc.TargetDomain, + OutboundGroupTags: tc.OutboundGroupTags, + OutboundTag: tc.OutboundTag, + } + if r := cmp.Diff(msg, stat, cmpopts.IgnoreUnexported(RoutingContext{})); r != "" { + t.Error(r) + } + } + + return nil + } + + if err := testRetrievingAllFields(); err != nil { + errCh <- err + } + if err := testRetrievingSubsetOfFields(); err != nil { + errCh <- err + } + errCh <- nil // Client passed all tests successfully + }() + + // Wait for goroutines to complete + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case err := <-errCh: + if err != nil { + t.Fatal(err) + } + } +} + +func TestSerivceTestRoute(t *testing.T) { + c := stats.NewChannel(&stats.ChannelConfig{ + SubscriberLimit: 1, + BufferSize: 16, + Blocking: true, + }) + common.Must(c.Start()) + defer c.Close() + + r := new(router.Router) + mockCtl := gomock.NewController(t) + defer mockCtl.Finish() + common.Must(r.Init(&router.Config{ + Rule: []*router.RoutingRule{ + { + InboundTag: []string{"in"}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + Protocol: []string{"bittorrent"}, + TargetTag: &router.RoutingRule_Tag{Tag: "blocked"}, + }, + { + PortList: &net.PortList{Range: []*net.PortRange{{From: 8080, To: 8080}}}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + SourcePortList: &net.PortList{Range: []*net.PortRange{{From: 9999, To: 9999}}}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + Domain: []*router.Domain{{Type: router.Domain_Domain, Value: "com"}}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + SourceGeoip: []*router.GeoIP{{CountryCode: "private", Cidr: []*router.CIDR{{Ip: []byte{127, 0, 0, 0}, Prefix: 8}}}}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + UserEmail: []string{"example@v2fly.org"}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + { + Networks: []net.Network{net.Network_UDP, net.Network_TCP}, + TargetTag: &router.RoutingRule_Tag{Tag: "out"}, + }, + }, + }, mocks.NewDNSClient(mockCtl), mocks.NewOutboundManager(mockCtl))) + + lis := bufconn.Listen(1024 * 1024) + bufDialer := func(context.Context, string) (net.Conn, error) { + return lis.Dial() + } + + errCh := make(chan error) + + // Server goroutine + go func() { + server := grpc.NewServer() + RegisterRoutingServiceServer(server, NewRoutingServer(r, c)) + errCh <- server.Serve(lis) + }() + + // Client goroutine + go func() { + defer lis.Close() + conn, err := grpc.DialContext(context.Background(), "bufnet", grpc.WithContextDialer(bufDialer), grpc.WithInsecure()) + if err != nil { + errCh <- err + } + defer conn.Close() + client := NewRoutingServiceClient(conn) + + testCases := []*RoutingContext{ + {InboundTag: "in", OutboundTag: "out"}, + {TargetIPs: [][]byte{{1, 2, 3, 4}}, TargetPort: 8080, OutboundTag: "out"}, + {TargetDomain: "example.com", TargetPort: 443, OutboundTag: "out"}, + {SourcePort: 9999, TargetPort: 9999, OutboundTag: "out"}, + {Network: net.Network_UDP, Protocol: "bittorrent", OutboundTag: "blocked"}, + {User: "example@v2fly.org", OutboundTag: "out"}, + {SourceIPs: [][]byte{{127, 0, 0, 1}}, Attributes: map[string]string{"attr": "value"}, OutboundTag: "out"}, + } + + // Test simple TestRoute + testSimple := func() error { + for _, tc := range testCases { + route, err := client.TestRoute(context.Background(), &TestRouteRequest{RoutingContext: tc}) + if err != nil { + return err + } + if r := cmp.Diff(route, tc, cmpopts.IgnoreUnexported(RoutingContext{})); r != "" { + t.Error(r) + } + } + return nil + } + + // Test TestRoute with special options + testOptions := func() error { + sub, err := c.Subscribe() + if err != nil { + return err + } + for _, tc := range testCases { + route, err := client.TestRoute(context.Background(), &TestRouteRequest{ + RoutingContext: tc, + FieldSelectors: []string{"ip", "port", "domain", "outbound"}, + PublishResult: true, + }) + if err != nil { + return err + } + stat := &RoutingContext{ // Only a subset of stats is retrieved + SourceIPs: tc.SourceIPs, + TargetIPs: tc.TargetIPs, + SourcePort: tc.SourcePort, + TargetPort: tc.TargetPort, + TargetDomain: tc.TargetDomain, + OutboundGroupTags: tc.OutboundGroupTags, + OutboundTag: tc.OutboundTag, + } + if r := cmp.Diff(route, stat, cmpopts.IgnoreUnexported(RoutingContext{})); r != "" { + t.Error(r) + } + select { // Check that routing result has been published to statistics channel + case msg, received := <-sub: + if route, ok := msg.(routing.Route); received && ok { + if r := cmp.Diff(AsProtobufMessage(nil)(route), tc, cmpopts.IgnoreUnexported(RoutingContext{})); r != "" { + t.Error(r) + } + } else { + t.Error("unexpected failure in receiving published routing result for testcase", tc) + } + case <-time.After(100 * time.Millisecond): + t.Error("unexpected failure in receiving published routing result", tc) + } + } + return nil + } + + if err := testSimple(); err != nil { + errCh <- err + } + if err := testOptions(); err != nil { + errCh <- err + } + errCh <- nil // Client passed all tests successfully + }() + + // Wait for goroutines to complete + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case err := <-errCh: + if err != nil { + t.Fatal(err) + } + } +} diff --git a/app/router/command/config.go b/app/router/command/config.go new file mode 100644 index 0000000000..1385f296f8 --- /dev/null +++ b/app/router/command/config.go @@ -0,0 +1,94 @@ +package command + +import ( + "strings" + + "v2ray.com/core/common/net" + "v2ray.com/core/features/routing" +) + +// routingContext is an wrapper of protobuf RoutingContext as implementation of routing.Context and routing.Route. +type routingContext struct { + *RoutingContext +} + +func (c routingContext) GetSourceIPs() []net.IP { + return mapBytesToIPs(c.RoutingContext.GetSourceIPs()) +} + +func (c routingContext) GetSourcePort() net.Port { + return net.Port(c.RoutingContext.GetSourcePort()) +} + +func (c routingContext) GetTargetIPs() []net.IP { + return mapBytesToIPs(c.RoutingContext.GetTargetIPs()) +} + +func (c routingContext) GetTargetPort() net.Port { + return net.Port(c.RoutingContext.GetTargetPort()) +} + +// AsRoutingContext converts a protobuf RoutingContext into an implementation of routing.Context. +func AsRoutingContext(r *RoutingContext) routing.Context { + return routingContext{r} +} + +// AsRoutingRoute converts a protobuf RoutingContext into an implementation of routing.Route. +func AsRoutingRoute(r *RoutingContext) routing.Route { + return routingContext{r} +} + +var fieldMap = map[string]func(*RoutingContext, routing.Route){ + "inbound": func(s *RoutingContext, r routing.Route) { s.InboundTag = r.GetInboundTag() }, + "network": func(s *RoutingContext, r routing.Route) { s.Network = r.GetNetwork() }, + "ip_source": func(s *RoutingContext, r routing.Route) { s.SourceIPs = mapIPsToBytes(r.GetSourceIPs()) }, + "ip_target": func(s *RoutingContext, r routing.Route) { s.TargetIPs = mapIPsToBytes(r.GetTargetIPs()) }, + "port_source": func(s *RoutingContext, r routing.Route) { s.SourcePort = uint32(r.GetSourcePort()) }, + "port_target": func(s *RoutingContext, r routing.Route) { s.TargetPort = uint32(r.GetTargetPort()) }, + "domain": func(s *RoutingContext, r routing.Route) { s.TargetDomain = r.GetTargetDomain() }, + "protocol": func(s *RoutingContext, r routing.Route) { s.Protocol = r.GetProtocol() }, + "user": func(s *RoutingContext, r routing.Route) { s.User = r.GetUser() }, + "attributes": func(s *RoutingContext, r routing.Route) { s.Attributes = r.GetAttributes() }, + "outbound_group": func(s *RoutingContext, r routing.Route) { s.OutboundGroupTags = r.GetOutboundGroupTags() }, + "outbound": func(s *RoutingContext, r routing.Route) { s.OutboundTag = r.GetOutboundTag() }, +} + +// AsProtobufMessage takes selectors of fields and returns a function to convert routing.Route to protobuf RoutingContext. +func AsProtobufMessage(fieldSelectors []string) func(routing.Route) *RoutingContext { + initializers := []func(*RoutingContext, routing.Route){} + for field, init := range fieldMap { + if len(fieldSelectors) == 0 { // If selectors not set, retrieve all fields + initializers = append(initializers, init) + continue + } + for _, selector := range fieldSelectors { + if strings.HasPrefix(field, selector) { + initializers = append(initializers, init) + break + } + } + } + return func(ctx routing.Route) *RoutingContext { + message := new(RoutingContext) + for _, init := range initializers { + init(message, ctx) + } + return message + } +} + +func mapBytesToIPs(bytes [][]byte) []net.IP { + var ips []net.IP + for _, rawIP := range bytes { + ips = append(ips, net.IP(rawIP)) + } + return ips +} + +func mapIPsToBytes(ips []net.IP) [][]byte { + var bytes [][]byte + for _, ip := range ips { + bytes = append(bytes, []byte(ip)) + } + return bytes +} diff --git a/app/router/command/errors.generated.go b/app/router/command/errors.generated.go new file mode 100644 index 0000000000..66f7805101 --- /dev/null +++ b/app/router/command/errors.generated.go @@ -0,0 +1,9 @@ +package command + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/app/router/condition.go b/app/router/condition.go index 209a60a3eb..c77fc657e3 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -10,10 +10,11 @@ import ( "v2ray.com/core/common/net" "v2ray.com/core/common/strmatcher" + "v2ray.com/core/features/routing" ) type Condition interface { - Apply(ctx *Context) bool + Apply(ctx routing.Context) bool } type ConditionChan []Condition @@ -28,7 +29,8 @@ func (v *ConditionChan) Add(cond Condition) *ConditionChan { return v } -func (v *ConditionChan) Apply(ctx *Context) bool { +// Apply applies all conditions registered in this chan. +func (v *ConditionChan) Apply(ctx routing.Context) bool { for _, cond := range *v { if !cond.Apply(ctx) { return false @@ -82,39 +84,21 @@ func NewDomainMatcher(domains []*Domain) (*DomainMatcher, error) { } func (m *DomainMatcher) ApplyDomain(domain string) bool { - return m.matchers.Match(domain) > 0 + return len(m.matchers.Match(domain)) > 0 } -func (m *DomainMatcher) Apply(ctx *Context) bool { - if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { +// Apply implements Condition. +func (m *DomainMatcher) Apply(ctx routing.Context) bool { + domain := ctx.GetTargetDomain() + if len(domain) == 0 { return false } - dest := ctx.Outbound.Target - if !dest.Address.Family().IsDomain() { - return false - } - return m.ApplyDomain(dest.Address.Domain()) -} - -func getIPsFromSource(ctx *Context) []net.IP { - if ctx.Inbound == nil || !ctx.Inbound.Source.IsValid() { - return nil - } - dest := ctx.Inbound.Source - if dest.Address.Family().IsDomain() { - return nil - } - - return []net.IP{dest.Address.IP()} -} - -func getIPsFromTarget(ctx *Context) []net.IP { - return ctx.GetTargetIPs() + return m.ApplyDomain(domain) } type MultiGeoIPMatcher struct { matchers []*GeoIPMatcher - ipFunc func(*Context) []net.IP + onSource bool } func NewMultiGeoIPMatcher(geoips []*GeoIP, onSource bool) (*MultiGeoIPMatcher, error) { @@ -129,20 +113,20 @@ func NewMultiGeoIPMatcher(geoips []*GeoIP, onSource bool) (*MultiGeoIPMatcher, e matcher := &MultiGeoIPMatcher{ matchers: matchers, - } - - if onSource { - matcher.ipFunc = getIPsFromSource - } else { - matcher.ipFunc = getIPsFromTarget + onSource: onSource, } return matcher, nil } -func (m *MultiGeoIPMatcher) Apply(ctx *Context) bool { - ips := m.ipFunc(ctx) - +// Apply implements Condition. +func (m *MultiGeoIPMatcher) Apply(ctx routing.Context) bool { + var ips []net.IP + if m.onSource { + ips = ctx.GetSourceIPs() + } else { + ips = ctx.GetTargetIPs() + } for _, ip := range ips { for _, matcher := range m.matchers { if matcher.Match(ip) { @@ -154,20 +138,25 @@ func (m *MultiGeoIPMatcher) Apply(ctx *Context) bool { } type PortMatcher struct { - port net.MemoryPortList + port net.MemoryPortList + onSource bool } -func NewPortMatcher(list *net.PortList) *PortMatcher { +// NewPortMatcher create a new port matcher that can match source or destination port +func NewPortMatcher(list *net.PortList, onSource bool) *PortMatcher { return &PortMatcher{ - port: net.PortListFromProto(list), + port: net.PortListFromProto(list), + onSource: onSource, } } -func (v *PortMatcher) Apply(ctx *Context) bool { - if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { - return false +// Apply implements Condition. +func (v *PortMatcher) Apply(ctx routing.Context) bool { + if v.onSource { + return v.port.Contains(ctx.GetSourcePort()) + } else { + return v.port.Contains(ctx.GetTargetPort()) } - return v.port.Contains(ctx.Outbound.Target.Port) } type NetworkMatcher struct { @@ -182,11 +171,9 @@ func NewNetworkMatcher(network []net.Network) NetworkMatcher { return matcher } -func (v NetworkMatcher) Apply(ctx *Context) bool { - if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { - return false - } - return v.list[int(ctx.Outbound.Target.Network)] +// Apply implements Condition. +func (v NetworkMatcher) Apply(ctx routing.Context) bool { + return v.list[int(ctx.GetNetwork())] } type UserMatcher struct { @@ -205,17 +192,14 @@ func NewUserMatcher(users []string) *UserMatcher { } } -func (v *UserMatcher) Apply(ctx *Context) bool { - if ctx.Inbound == nil { - return false - } - - user := ctx.Inbound.User - if user == nil { +// Apply implements Condition. +func (v *UserMatcher) Apply(ctx routing.Context) bool { + user := ctx.GetUser() + if len(user) == 0 { return false } for _, u := range v.user { - if u == user.Email { + if u == user { return true } } @@ -238,11 +222,12 @@ func NewInboundTagMatcher(tags []string) *InboundTagMatcher { } } -func (v *InboundTagMatcher) Apply(ctx *Context) bool { - if ctx.Inbound == nil || len(ctx.Inbound.Tag) == 0 { +// Apply implements Condition. +func (v *InboundTagMatcher) Apply(ctx routing.Context) bool { + tag := ctx.GetInboundTag() + if len(tag) == 0 { return false } - tag := ctx.Inbound.Tag for _, t := range v.tags { if t == tag { return true @@ -269,18 +254,17 @@ func NewProtocolMatcher(protocols []string) *ProtocolMatcher { } } -func (m *ProtocolMatcher) Apply(ctx *Context) bool { - if ctx.Content == nil { +// Apply implements Condition. +func (m *ProtocolMatcher) Apply(ctx routing.Context) bool { + protocol := ctx.GetProtocol() + if len(protocol) == 0 { return false } - - protocol := ctx.Content.Protocol for _, p := range m.protocols { if strings.HasPrefix(protocol, p) { return true } } - return false } @@ -304,17 +288,11 @@ func NewAttributeMatcher(code string) (*AttributeMatcher, error) { }, nil } -func (m *AttributeMatcher) Match(attrs map[string]interface{}) bool { +// Match implements attributes matching. +func (m *AttributeMatcher) Match(attrs map[string]string) bool { attrsDict := new(starlark.Dict) for key, value := range attrs { - var starValue starlark.Value - switch value := value.(type) { - case string: - starValue = starlark.String(value) - } - if starValue != nil { - attrsDict.SetKey(starlark.String(key), starValue) - } + attrsDict.SetKey(starlark.String(key), starlark.String(value)) } predefined := make(starlark.StringDict) @@ -331,9 +309,11 @@ func (m *AttributeMatcher) Match(attrs map[string]interface{}) bool { return satisfied != nil && bool(satisfied.Truth()) } -func (m *AttributeMatcher) Apply(ctx *Context) bool { - if ctx.Content == nil { +// Apply implements Condition. +func (m *AttributeMatcher) Apply(ctx routing.Context) bool { + attributes := ctx.GetAttributes() + if attributes == nil { return false } - return m.Match(ctx.Content.Attributes) + return m.Match(attributes) } diff --git a/app/router/condition_geoip_test.go b/app/router/condition_geoip_test.go index 38e053736a..c92d990b3c 100644 --- a/app/router/condition_geoip_test.go +++ b/app/router/condition_geoip_test.go @@ -17,8 +17,12 @@ func init() { wd, err := os.Getwd() common.Must(err) - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "release", "config", "geosite.dat"))) + if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) { + common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) + } + if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && os.IsNotExist(err) { + common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "release", "config", "geosite.dat"))) + } } func TestGeoIPMatcherContainer(t *testing.T) { diff --git a/app/router/condition_test.go b/app/router/condition_test.go index 5655d74324..af055bb4ed 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -17,27 +17,41 @@ import ( "v2ray.com/core/common/protocol" "v2ray.com/core/common/protocol/http" "v2ray.com/core/common/session" + "v2ray.com/core/features/routing" + routing_session "v2ray.com/core/features/routing/session" ) func init() { wd, err := os.Getwd() common.Must(err) - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "release", "config", "geosite.dat"))) + if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) { + common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) + } + if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && os.IsNotExist(err) { + common.Must(filesystem.CopyFile(platform.GetAssetLocation("geosite.dat"), filepath.Join(wd, "..", "..", "release", "config", "geosite.dat"))) + } +} + +func withBackground() routing.Context { + return &routing_session.Context{} } -func withOutbound(outbound *session.Outbound) *Context { - return &Context{Outbound: outbound} +func withOutbound(outbound *session.Outbound) routing.Context { + return &routing_session.Context{Outbound: outbound} } -func withInbound(inbound *session.Inbound) *Context { - return &Context{Inbound: inbound} +func withInbound(inbound *session.Inbound) routing.Context { + return &routing_session.Context{Inbound: inbound} +} + +func withContent(content *session.Content) routing.Context { + return &routing_session.Context{Content: content} } func TestRoutingRule(t *testing.T) { type ruleTest struct { - input *Context + input routing.Context output bool } @@ -88,7 +102,7 @@ func TestRoutingRule(t *testing.T) { output: false, }, { - input: &Context{}, + input: withBackground(), output: false, }, }, @@ -124,7 +138,7 @@ func TestRoutingRule(t *testing.T) { output: true, }, { - input: &Context{}, + input: withBackground(), output: false, }, }, @@ -164,7 +178,7 @@ func TestRoutingRule(t *testing.T) { output: true, }, { - input: &Context{}, + input: withBackground(), output: false, }, }, @@ -205,7 +219,7 @@ func TestRoutingRule(t *testing.T) { output: false, }, { - input: &Context{}, + input: withBackground(), output: false, }, }, @@ -216,7 +230,7 @@ func TestRoutingRule(t *testing.T) { }, test: []ruleTest{ { - input: &Context{Content: &session.Content{Protocol: (&http.SniffHeader{}).Protocol()}}, + input: withContent(&session.Content{Protocol: (&http.SniffHeader{}).Protocol()}), output: true, }, }, @@ -264,6 +278,34 @@ func TestRoutingRule(t *testing.T) { }, }, }, + { + rule: &RoutingRule{ + SourcePortList: &net.PortList{ + Range: []*net.PortRange{ + {From: 123, To: 123}, + {From: 9993, To: 9999}, + }, + }, + }, + test: []ruleTest{ + { + input: withInbound(&session.Inbound{Source: net.UDPDestination(net.LocalHostIP, 123)}), + output: true, + }, + { + input: withInbound(&session.Inbound{Source: net.UDPDestination(net.LocalHostIP, 9999)}), + output: true, + }, + { + input: withInbound(&session.Inbound{Source: net.UDPDestination(net.LocalHostIP, 9994)}), + output: true, + }, + { + input: withInbound(&session.Inbound{Source: net.UDPDestination(net.LocalHostIP, 53)}), + output: false, + }, + }, + }, { rule: &RoutingRule{ Protocol: []string{"http"}, @@ -271,7 +313,7 @@ func TestRoutingRule(t *testing.T) { }, test: []ruleTest{ { - input: &Context{Content: &session.Content{Protocol: "http/1.1", Attributes: map[string]interface{}{":path": "/test/1"}}}, + input: withContent(&session.Content{Protocol: "http/1.1", Attributes: map[string]string{":path": "/test/1"}}), output: true, }, }, diff --git a/app/router/config.go b/app/router/config.go index 585bd16051..8eb9d5aa12 100644 --- a/app/router/config.go +++ b/app/router/config.go @@ -5,6 +5,7 @@ package router import ( "v2ray.com/core/common/net" "v2ray.com/core/features/outbound" + "v2ray.com/core/features/routing" ) // CIDRList is an alias of []*CIDR to provide sort.Interface. @@ -59,7 +60,8 @@ func (r *Rule) GetTag() (string, error) { return r.Tag, nil } -func (r *Rule) Apply(ctx *Context) bool { +// Apply checks rule matching of current routing context. +func (r *Rule) Apply(ctx routing.Context) bool { return r.Condition.Apply(ctx) } @@ -83,9 +85,13 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) { } if rr.PortList != nil { - conds.Add(NewPortMatcher(rr.PortList)) + conds.Add(NewPortMatcher(rr.PortList, false)) } else if rr.PortRange != nil { - conds.Add(NewPortMatcher(&net.PortList{Range: []*net.PortRange{rr.PortRange}})) + conds.Add(NewPortMatcher(&net.PortList{Range: []*net.PortRange{rr.PortRange}}, false)) + } + + if rr.SourcePortList != nil { + conds.Add(NewPortMatcher(rr.SourcePortList, true)) } if len(rr.Networks) > 0 { diff --git a/app/router/config.pb.go b/app/router/config.pb.go index 83561bff5b..c052f7b493 100644 --- a/app/router/config.pb.go +++ b/app/router/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/router/config.proto + package router import ( @@ -61,11 +67,11 @@ func (x Domain_Type) String() string { } func (Domain_Type) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_router_config_proto_enumTypes[0].Descriptor() + return file_app_router_config_proto_enumTypes[0].Descriptor() } func (Domain_Type) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_router_config_proto_enumTypes[0] + return &file_app_router_config_proto_enumTypes[0] } func (x Domain_Type) Number() protoreflect.EnumNumber { @@ -74,7 +80,7 @@ func (x Domain_Type) Number() protoreflect.EnumNumber { // Deprecated: Use Domain_Type.Descriptor instead. func (Domain_Type) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{0, 0} + return file_app_router_config_proto_rawDescGZIP(), []int{0, 0} } type Config_DomainStrategy int32 @@ -117,11 +123,11 @@ func (x Config_DomainStrategy) String() string { } func (Config_DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_app_router_config_proto_enumTypes[1].Descriptor() + return file_app_router_config_proto_enumTypes[1].Descriptor() } func (Config_DomainStrategy) Type() protoreflect.EnumType { - return &file_v2ray_com_core_app_router_config_proto_enumTypes[1] + return &file_app_router_config_proto_enumTypes[1] } func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { @@ -130,7 +136,7 @@ func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { // Deprecated: Use Config_DomainStrategy.Descriptor instead. func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{8, 0} + return file_app_router_config_proto_rawDescGZIP(), []int{8, 0} } // Domain for routing decision. @@ -150,7 +156,7 @@ type Domain struct { func (x *Domain) Reset() { *x = Domain{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[0] + mi := &file_app_router_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +169,7 @@ func (x *Domain) String() string { func (*Domain) ProtoMessage() {} func (x *Domain) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[0] + mi := &file_app_router_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +182,7 @@ func (x *Domain) ProtoReflect() protoreflect.Message { // Deprecated: Use Domain.ProtoReflect.Descriptor instead. func (*Domain) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{0} + return file_app_router_config_proto_rawDescGZIP(), []int{0} } func (x *Domain) GetType() Domain_Type { @@ -215,7 +221,7 @@ type CIDR struct { func (x *CIDR) Reset() { *x = CIDR{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[1] + mi := &file_app_router_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -228,7 +234,7 @@ func (x *CIDR) String() string { func (*CIDR) ProtoMessage() {} func (x *CIDR) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[1] + mi := &file_app_router_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -241,7 +247,7 @@ func (x *CIDR) ProtoReflect() protoreflect.Message { // Deprecated: Use CIDR.ProtoReflect.Descriptor instead. func (*CIDR) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{1} + return file_app_router_config_proto_rawDescGZIP(), []int{1} } func (x *CIDR) GetIp() []byte { @@ -270,7 +276,7 @@ type GeoIP struct { func (x *GeoIP) Reset() { *x = GeoIP{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[2] + mi := &file_app_router_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -283,7 +289,7 @@ func (x *GeoIP) String() string { func (*GeoIP) ProtoMessage() {} func (x *GeoIP) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[2] + mi := &file_app_router_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -296,7 +302,7 @@ func (x *GeoIP) ProtoReflect() protoreflect.Message { // Deprecated: Use GeoIP.ProtoReflect.Descriptor instead. func (*GeoIP) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{2} + return file_app_router_config_proto_rawDescGZIP(), []int{2} } func (x *GeoIP) GetCountryCode() string { @@ -324,7 +330,7 @@ type GeoIPList struct { func (x *GeoIPList) Reset() { *x = GeoIPList{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[3] + mi := &file_app_router_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -337,7 +343,7 @@ func (x *GeoIPList) String() string { func (*GeoIPList) ProtoMessage() {} func (x *GeoIPList) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[3] + mi := &file_app_router_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -350,7 +356,7 @@ func (x *GeoIPList) ProtoReflect() protoreflect.Message { // Deprecated: Use GeoIPList.ProtoReflect.Descriptor instead. func (*GeoIPList) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{3} + return file_app_router_config_proto_rawDescGZIP(), []int{3} } func (x *GeoIPList) GetEntry() []*GeoIP { @@ -372,7 +378,7 @@ type GeoSite struct { func (x *GeoSite) Reset() { *x = GeoSite{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[4] + mi := &file_app_router_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -385,7 +391,7 @@ func (x *GeoSite) String() string { func (*GeoSite) ProtoMessage() {} func (x *GeoSite) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[4] + mi := &file_app_router_config_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -398,7 +404,7 @@ func (x *GeoSite) ProtoReflect() protoreflect.Message { // Deprecated: Use GeoSite.ProtoReflect.Descriptor instead. func (*GeoSite) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{4} + return file_app_router_config_proto_rawDescGZIP(), []int{4} } func (x *GeoSite) GetCountryCode() string { @@ -426,7 +432,7 @@ type GeoSiteList struct { func (x *GeoSiteList) Reset() { *x = GeoSiteList{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[5] + mi := &file_app_router_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -439,7 +445,7 @@ func (x *GeoSiteList) String() string { func (*GeoSiteList) ProtoMessage() {} func (x *GeoSiteList) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[5] + mi := &file_app_router_config_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -452,7 +458,7 @@ func (x *GeoSiteList) ProtoReflect() protoreflect.Message { // Deprecated: Use GeoSiteList.ProtoReflect.Descriptor instead. func (*GeoSiteList) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{5} + return file_app_router_config_proto_rawDescGZIP(), []int{5} } func (x *GeoSiteList) GetEntry() []*GeoSite { @@ -478,12 +484,13 @@ type RoutingRule struct { // // Deprecated: Do not use. 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. + // 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. + // A range of port [from, to]. If the destination port is in this range, this + // rule takes effect. Deprecated. Use port_list. // // Deprecated: Do not use. PortRange *net.PortRange `protobuf:"bytes,4,opt,name=port_range,json=portRange,proto3" json:"port_range,omitempty"` @@ -499,18 +506,21 @@ type RoutingRule struct { // // Deprecated: Do not use. 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. + // 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"` - 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 string `protobuf:"bytes,15,opt,name=attributes,proto3" json:"attributes,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 string `protobuf:"bytes,15,opt,name=attributes,proto3" json:"attributes,omitempty"` } func (x *RoutingRule) Reset() { *x = RoutingRule{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[6] + mi := &file_app_router_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -523,7 +533,7 @@ func (x *RoutingRule) String() string { func (*RoutingRule) ProtoMessage() {} func (x *RoutingRule) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[6] + mi := &file_app_router_config_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -536,7 +546,7 @@ func (x *RoutingRule) ProtoReflect() protoreflect.Message { // Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead. func (*RoutingRule) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{6} + return file_app_router_config_proto_rawDescGZIP(), []int{6} } func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag { @@ -627,6 +637,13 @@ func (x *RoutingRule) GetSourceGeoip() []*GeoIP { 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 @@ -685,7 +702,7 @@ type BalancingRule struct { func (x *BalancingRule) Reset() { *x = BalancingRule{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[7] + mi := &file_app_router_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -698,7 +715,7 @@ func (x *BalancingRule) String() string { func (*BalancingRule) ProtoMessage() {} func (x *BalancingRule) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[7] + mi := &file_app_router_config_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +728,7 @@ func (x *BalancingRule) ProtoReflect() protoreflect.Message { // Deprecated: Use BalancingRule.ProtoReflect.Descriptor instead. func (*BalancingRule) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{7} + return file_app_router_config_proto_rawDescGZIP(), []int{7} } func (x *BalancingRule) GetTag() string { @@ -741,7 +758,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[8] + mi := &file_app_router_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -754,7 +771,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[8] + mi := &file_app_router_config_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -767,7 +784,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{8} + return file_app_router_config_proto_rawDescGZIP(), []int{8} } func (x *Config) GetDomainStrategy() Config_DomainStrategy { @@ -806,7 +823,7 @@ type Domain_Attribute struct { func (x *Domain_Attribute) Reset() { *x = Domain_Attribute{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[9] + mi := &file_app_router_config_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -819,7 +836,7 @@ func (x *Domain_Attribute) String() string { func (*Domain_Attribute) ProtoMessage() {} func (x *Domain_Attribute) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_router_config_proto_msgTypes[9] + mi := &file_app_router_config_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -832,7 +849,7 @@ func (x *Domain_Attribute) ProtoReflect() protoreflect.Message { // Deprecated: Use Domain_Attribute.ProtoReflect.Descriptor instead. func (*Domain_Attribute) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_router_config_proto_rawDescGZIP(), []int{0, 0} + return file_app_router_config_proto_rawDescGZIP(), []int{0, 0} } func (x *Domain_Attribute) GetKey() string { @@ -879,156 +896,159 @@ func (*Domain_Attribute_BoolValue) isDomain_Attribute_TypedValue() {} func (*Domain_Attribute_IntValue) isDomain_Attribute_TypedValue() {} -var File_v2ray_com_core_app_router_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_router_config_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x1a, - 0x24, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0xbf, - 0x02, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x45, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5b, 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, 0x2f, 0x0a, 0x04, - 0x63, 0x69, 0x64, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, +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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, + 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, 0xbf, 0x02, 0x0a, 0x06, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x72, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, 0x22, 0x3f, 0x0a, - 0x09, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x65, 0x6e, - 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x63, - 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, 0x35, 0x0a, 0x06, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, + 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, 0x45, 0x0a, 0x09, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5b, 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, + 0x2f, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, + 0x22, 0x3f, 0x0a, 0x09, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, + 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, 0x65, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xff, 0x05, 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, 0x35, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x33, 0x0a, 0x04, 0x63, 0x69, - 0x64, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x75, 0x74, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, + 0x79, 0x22, 0x63, 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, + 0x35, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x6f, 0x53, 0x69, 0x74, + 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0xca, 0x06, 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, 0x35, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x33, 0x0a, + 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x32, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, 0x0a, 0x09, 0x70, + 0x6f, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x49, 0x0a, 0x0c, 0x6e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x40, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x3f, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6f, + 0x69, 0x70, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x32, 0x0a, 0x05, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x0a, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, 0x0a, 0x09, 0x70, 0x6f, 0x72, 0x74, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x49, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x0d, 0x20, - 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x40, 0x0a, - 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x3f, 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6f, 0x69, 0x70, 0x18, - 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 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, 0x1e, 0x0a, 0x0a, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x0c, 0x0a, 0x0a, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x22, 0x4e, 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, 0x22, 0xad, 0x02, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x36, 0x0a, 0x04, - 0x72, 0x75, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4b, 0x0a, 0x0e, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, - 0x67, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, + 0x2e, 0x47, 0x65, 0x6f, 0x49, 0x50, 0x52, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, + 0x6f, 0x69, 0x70, 0x12, 0x49, 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, 0x1f, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x1e, 0x0a, 0x0a, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x22, 0x4e, 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, 0x22, 0xad, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3d, 0x0a, 0x19, 0x63, 0x6f, - 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x06, 0x72, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 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, 0x36, 0x0a, 0x04, 0x72, 0x75, + 0x6c, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4b, 0x0a, 0x0e, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x69, 0x6e, 0x67, 0x5f, + 0x72, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, + 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, + 0x65, 0x72, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, + 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_v2ray_com_core_app_router_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_router_config_proto_rawDescData = file_v2ray_com_core_app_router_config_proto_rawDesc + file_app_router_config_proto_rawDescOnce sync.Once + file_app_router_config_proto_rawDescData = file_app_router_config_proto_rawDesc ) -func file_v2ray_com_core_app_router_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_router_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_router_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_router_config_proto_rawDescData) +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_v2ray_com_core_app_router_config_proto_rawDescData + return file_app_router_config_proto_rawDescData } -var file_v2ray_com_core_app_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v2ray_com_core_app_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_v2ray_com_core_app_router_config_proto_goTypes = []interface{}{ +var file_app_router_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_app_router_config_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_app_router_config_proto_goTypes = []interface{}{ (Domain_Type)(0), // 0: v2ray.core.app.router.Domain.Type (Config_DomainStrategy)(0), // 1: v2ray.core.app.router.Config.DomainStrategy (*Domain)(nil), // 2: v2ray.core.app.router.Domain @@ -1046,7 +1066,7 @@ var file_v2ray_com_core_app_router_config_proto_goTypes = []interface{}{ (*net.NetworkList)(nil), // 14: v2ray.core.common.net.NetworkList (net.Network)(0), // 15: v2ray.core.common.net.Network } -var file_v2ray_com_core_app_router_config_proto_depIdxs = []int32{ +var file_app_router_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.app.router.Domain.type:type_name -> v2ray.core.app.router.Domain.Type 11, // 1: v2ray.core.app.router.Domain.attribute:type_name -> v2ray.core.app.router.Domain.Attribute 3, // 2: v2ray.core.app.router.GeoIP.cidr:type_name -> v2ray.core.app.router.CIDR @@ -1062,23 +1082,24 @@ var file_v2ray_com_core_app_router_config_proto_depIdxs = []int32{ 15, // 12: v2ray.core.app.router.RoutingRule.networks:type_name -> v2ray.core.common.net.Network 3, // 13: v2ray.core.app.router.RoutingRule.source_cidr:type_name -> v2ray.core.app.router.CIDR 4, // 14: v2ray.core.app.router.RoutingRule.source_geoip:type_name -> v2ray.core.app.router.GeoIP - 1, // 15: v2ray.core.app.router.Config.domain_strategy:type_name -> v2ray.core.app.router.Config.DomainStrategy - 8, // 16: v2ray.core.app.router.Config.rule:type_name -> v2ray.core.app.router.RoutingRule - 9, // 17: v2ray.core.app.router.Config.balancing_rule:type_name -> v2ray.core.app.router.BalancingRule - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name -} - -func init() { file_v2ray_com_core_app_router_config_proto_init() } -func file_v2ray_com_core_app_router_config_proto_init() { - if File_v2ray_com_core_app_router_config_proto != nil { + 13, // 15: v2ray.core.app.router.RoutingRule.source_port_list:type_name -> v2ray.core.common.net.PortList + 1, // 16: v2ray.core.app.router.Config.domain_strategy:type_name -> v2ray.core.app.router.Config.DomainStrategy + 8, // 17: v2ray.core.app.router.Config.rule:type_name -> v2ray.core.app.router.RoutingRule + 9, // 18: v2ray.core.app.router.Config.balancing_rule:type_name -> v2ray.core.app.router.BalancingRule + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] 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_v2ray_com_core_app_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Domain); i { case 0: return &v.state @@ -1090,7 +1111,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CIDR); i { case 0: return &v.state @@ -1102,7 +1123,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeoIP); i { case 0: return &v.state @@ -1114,7 +1135,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeoIPList); i { case 0: return &v.state @@ -1126,7 +1147,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeoSite); i { case 0: return &v.state @@ -1138,7 +1159,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeoSiteList); i { case 0: return &v.state @@ -1150,7 +1171,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RoutingRule); i { case 0: return &v.state @@ -1162,7 +1183,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BalancingRule); i { case 0: return &v.state @@ -1174,7 +1195,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -1186,7 +1207,7 @@ func file_v2ray_com_core_app_router_config_proto_init() { return nil } } - file_v2ray_com_core_app_router_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_app_router_config_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Domain_Attribute); i { case 0: return &v.state @@ -1199,11 +1220,11 @@ func file_v2ray_com_core_app_router_config_proto_init() { } } } - file_v2ray_com_core_app_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_app_router_config_proto_msgTypes[6].OneofWrappers = []interface{}{ (*RoutingRule_Tag)(nil), (*RoutingRule_BalancingTag)(nil), } - file_v2ray_com_core_app_router_config_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_app_router_config_proto_msgTypes[9].OneofWrappers = []interface{}{ (*Domain_Attribute_BoolValue)(nil), (*Domain_Attribute_IntValue)(nil), } @@ -1211,19 +1232,19 @@ func file_v2ray_com_core_app_router_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_router_config_proto_rawDesc, + RawDescriptor: file_app_router_config_proto_rawDesc, NumEnums: 2, NumMessages: 10, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_router_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_router_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_app_router_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_app_router_config_proto_msgTypes, + 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_v2ray_com_core_app_router_config_proto = out.File - file_v2ray_com_core_app_router_config_proto_rawDesc = nil - file_v2ray_com_core_app_router_config_proto_goTypes = nil - file_v2ray_com_core_app_router_config_proto_depIdxs = nil + 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/app/router/config.proto b/app/router/config.proto index f0d778aec5..66f7594705 100644 --- a/app/router/config.proto +++ b/app/router/config.proto @@ -2,14 +2,14 @@ syntax = "proto3"; package v2ray.core.app.router; option csharp_namespace = "V2Ray.Core.App.Router"; -option go_package = "router"; +option go_package = "v2ray.com/core/app/router"; option java_package = "com.v2ray.core.app.router"; option java_multiple_files = true; -import "v2ray.com/core/common/net/port.proto"; -import "v2ray.com/core/common/net/network.proto"; +import "common/net/port.proto"; +import "common/net/network.proto"; -// Domain for routing decision. +// Domain for routing decision. message Domain { // Type of domain value. enum Type { @@ -65,7 +65,7 @@ message GeoSite { repeated Domain domain = 2; } -message GeoSiteList{ +message GeoSiteList { repeated GeoSite entry = 1; } @@ -77,7 +77,6 @@ message RoutingRule { // Tag of routing balancer. string balancing_tag = 12; } - // List of domains for target domain matching. repeated Domain domain = 2; @@ -85,14 +84,15 @@ message RoutingRule { // List of CIDRs for target IP address matching. // Deprecated. Use geoip below. repeated CIDR cidr = 3 [deprecated = true]; - - // 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. + + // 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. repeated GeoIP geoip = 10; - // A range of port [from, to]. If the destination port is in this range, this rule takes effect. - // Deprecated. Use port_list. + // A range of port [from, to]. If the destination port is in this range, this + // rule takes effect. Deprecated. Use port_list. v2ray.core.common.net.PortRange port_range = 4 [deprecated = true]; // List of ports. @@ -107,9 +107,13 @@ message RoutingRule { // List of CIDRs for source IP address matching. repeated CIDR source_cidr = 6 [deprecated = true]; - // List of GeoIPs for source IP address matching. If this entry exists, the source_cidr above will have no effect. + // List of GeoIPs for source IP address matching. If this entry exists, the + // source_cidr above will have no effect. repeated GeoIP source_geoip = 11; + // List of ports for source port matching. + v2ray.core.common.net.PortList source_port_list = 16; + repeated string user_email = 7; repeated string inbound_tag = 8; repeated string protocol = 9; diff --git a/app/router/router.go b/app/router/router.go index 542ff3d7be..30cfe6592d 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -2,32 +2,19 @@ package router -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" "v2ray.com/core" "v2ray.com/core/common" - "v2ray.com/core/common/net" - "v2ray.com/core/common/session" "v2ray.com/core/features/dns" "v2ray.com/core/features/outbound" "v2ray.com/core/features/routing" + routing_dns "v2ray.com/core/features/routing/dns" ) -func init() { - common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { - r := new(Router) - if err := core.RequireFeatures(ctx, func(d dns.Client, ohm outbound.Manager) error { - return r.Init(config.(*Config), d, ohm) - }); err != nil { - return nil, err - } - return r, nil - })) -} - // Router is an implementation of routing.Router. type Router struct { domainStrategy Config_DomainStrategy @@ -36,6 +23,13 @@ type Router struct { dns dns.Client } +// Route is an implementation of routing.Route. +type Route struct { + routing.Context + outboundGroupTags []string + outboundTag string +} + // Init initializes the Router. func (r *Router) Init(config *Config, d dns.Client, ohm outbound.Manager) error { r.domainStrategy = config.DomainStrategy @@ -74,50 +68,44 @@ func (r *Router) Init(config *Config, d dns.Client, ohm outbound.Manager) error return nil } -func (r *Router) PickRoute(ctx context.Context) (string, error) { - rule, err := r.pickRouteInternal(ctx) +// PickRoute implements routing.Router. +func (r *Router) PickRoute(ctx routing.Context) (routing.Route, error) { + rule, ctx, err := r.pickRouteInternal(ctx) if err != nil { - return "", err + return nil, err } - return rule.GetTag() -} - -func isDomainOutbound(outbound *session.Outbound) bool { - return outbound != nil && outbound.Target.IsValid() && outbound.Target.Address.Family().IsDomain() -} - -// PickRoute implements routing.Router. -func (r *Router) pickRouteInternal(ctx context.Context) (*Rule, error) { - sessionContext := &Context{ - Inbound: session.InboundFromContext(ctx), - Outbound: session.OutboundFromContext(ctx), - Content: session.ContentFromContext(ctx), + tag, err := rule.GetTag() + if err != nil { + return nil, err } + return &Route{Context: ctx, outboundTag: tag}, nil +} +func (r *Router) pickRouteInternal(ctx routing.Context) (*Rule, routing.Context, error) { if r.domainStrategy == Config_IpOnDemand { - sessionContext.dnsClient = r.dns + ctx = routing_dns.ContextWithDNSClient(ctx, r.dns) } for _, rule := range r.rules { - if rule.Apply(sessionContext) { - return rule, nil + if rule.Apply(ctx) { + return rule, ctx, nil } } - if r.domainStrategy != Config_IpIfNonMatch || !isDomainOutbound(sessionContext.Outbound) { - return nil, common.ErrNoClue + if r.domainStrategy != Config_IpIfNonMatch || len(ctx.GetTargetDomain()) == 0 { + return nil, ctx, common.ErrNoClue } - sessionContext.dnsClient = r.dns + ctx = routing_dns.ContextWithDNSClient(ctx, r.dns) // Try applying rules again if we have IPs. for _, rule := range r.rules { - if rule.Apply(sessionContext) { - return rule, nil + if rule.Apply(ctx) { + return rule, ctx, nil } } - return nil, common.ErrNoClue + return nil, ctx, common.ErrNoClue } // Start implements common.Runnable. @@ -135,36 +123,24 @@ func (*Router) Type() interface{} { return routing.RouterType() } -type Context struct { - Inbound *session.Inbound - Outbound *session.Outbound - Content *session.Content - - dnsClient dns.Client +// GetOutboundGroupTags implements routing.Route. +func (r *Route) GetOutboundGroupTags() []string { + return r.outboundGroupTags } -func (c *Context) GetTargetIPs() []net.IP { - if c.Outbound == nil || !c.Outbound.Target.IsValid() { - return nil - } - - if c.Outbound.Target.Address.Family().IsIP() { - return []net.IP{c.Outbound.Target.Address.IP()} - } - - if len(c.Outbound.ResolvedIPs) > 0 { - return c.Outbound.ResolvedIPs - } +// GetOutboundTag implements routing.Route. +func (r *Route) GetOutboundTag() string { + return r.outboundTag +} - if c.dnsClient != nil { - domain := c.Outbound.Target.Address.Domain() - ips, err := c.dnsClient.LookupIP(domain) - if err == nil { - c.Outbound.ResolvedIPs = ips - return ips +func init() { + common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { + r := new(Router) + if err := core.RequireFeatures(ctx, func(d dns.Client, ohm outbound.Manager) error { + return r.Init(config.(*Config), d, ohm) + }); err != nil { + return nil, err } - newError("resolve ip for ", domain).Base(err).WriteToLog() - } - - return nil + return r, nil + })) } diff --git a/app/router/router_test.go b/app/router/router_test.go index 0992e1c9ab..8c1aec0aaa 100644 --- a/app/router/router_test.go +++ b/app/router/router_test.go @@ -10,6 +10,7 @@ import ( "v2ray.com/core/common/net" "v2ray.com/core/common/session" "v2ray.com/core/features/outbound" + routing_session "v2ray.com/core/features/routing/session" "v2ray.com/core/testing/mocks" ) @@ -44,9 +45,9 @@ func TestSimpleRouter(t *testing.T) { })) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) - tag, err := r.PickRoute(ctx) + route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) common.Must(err) - if tag != "test" { + if tag := route.GetOutboundTag(); tag != "test" { t.Error("expect tag 'test', bug actually ", tag) } } @@ -85,9 +86,9 @@ func TestSimpleBalancer(t *testing.T) { })) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) - tag, err := r.PickRoute(ctx) + route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) common.Must(err) - if tag != "test" { + if tag := route.GetOutboundTag(); tag != "test" { t.Error("expect tag 'test', bug actually ", tag) } } @@ -120,9 +121,9 @@ func TestIPOnDemand(t *testing.T) { common.Must(r.Init(config, mockDns, nil)) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) - tag, err := r.PickRoute(ctx) + route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) common.Must(err) - if tag != "test" { + if tag := route.GetOutboundTag(); tag != "test" { t.Error("expect tag 'test', bug actually ", tag) } } @@ -155,9 +156,9 @@ func TestIPIfNonMatchDomain(t *testing.T) { common.Must(r.Init(config, mockDns, nil)) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) - tag, err := r.PickRoute(ctx) + route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) common.Must(err) - if tag != "test" { + if tag := route.GetOutboundTag(); tag != "test" { t.Error("expect tag 'test', bug actually ", tag) } } @@ -189,9 +190,9 @@ func TestIPIfNonMatchIP(t *testing.T) { common.Must(r.Init(config, mockDns, nil)) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.LocalHostIP, 80)}) - tag, err := r.PickRoute(ctx) + route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) common.Must(err) - if tag != "test" { + if tag := route.GetOutboundTag(); tag != "test" { t.Error("expect tag 'test', bug actually ", tag) } } diff --git a/app/stats/channel.go b/app/stats/channel.go new file mode 100644 index 0000000000..2fd54468c9 --- /dev/null +++ b/app/stats/channel.go @@ -0,0 +1,174 @@ +// +build !confonly + +package stats + +import ( + "context" + "sync" + + "v2ray.com/core/common" +) + +// Channel is an implementation of stats.Channel. +type Channel struct { + channel chan channelMessage + subscribers []chan interface{} + + // Synchronization components + access sync.RWMutex + closed chan struct{} + + // Channel options + blocking bool // Set blocking state if channel buffer reaches limit + bufferSize int // Set to 0 as no buffering + subsLimit int // Set to 0 as no subscriber limit +} + +// NewChannel creates an instance of Statistics Channel. +func NewChannel(config *ChannelConfig) *Channel { + return &Channel{ + channel: make(chan channelMessage, config.BufferSize), + subsLimit: int(config.SubscriberLimit), + bufferSize: int(config.BufferSize), + blocking: config.Blocking, + } +} + +// Subscribers implements stats.Channel. +func (c *Channel) Subscribers() []chan interface{} { + c.access.RLock() + defer c.access.RUnlock() + return c.subscribers +} + +// Subscribe implements stats.Channel. +func (c *Channel) Subscribe() (chan interface{}, error) { + c.access.Lock() + defer c.access.Unlock() + if c.subsLimit > 0 && len(c.subscribers) >= c.subsLimit { + return nil, newError("Number of subscribers has reached limit") + } + subscriber := make(chan interface{}, c.bufferSize) + c.subscribers = append(c.subscribers, subscriber) + return subscriber, nil +} + +// Unsubscribe implements stats.Channel. +func (c *Channel) Unsubscribe(subscriber chan interface{}) error { + c.access.Lock() + defer c.access.Unlock() + for i, s := range c.subscribers { + if s == subscriber { + // Copy to new memory block to prevent modifying original data + subscribers := make([]chan interface{}, len(c.subscribers)-1) + copy(subscribers[:i], c.subscribers[:i]) + copy(subscribers[i:], c.subscribers[i+1:]) + c.subscribers = subscribers + } + } + return nil +} + +// Publish implements stats.Channel. +func (c *Channel) Publish(ctx context.Context, msg interface{}) { + select { // Early exit if channel closed + case <-c.closed: + return + default: + pub := channelMessage{context: ctx, message: msg} + if c.blocking { + pub.publish(c.channel) + } else { + pub.publishNonBlocking(c.channel) + } + } +} + +// Running returns whether the channel is running. +func (c *Channel) Running() bool { + select { + case <-c.closed: // Channel closed + default: // Channel running or not initialized + if c.closed != nil { // Channel initialized + return true + } + } + return false +} + +// Start implements common.Runnable. +func (c *Channel) Start() error { + c.access.Lock() + defer c.access.Unlock() + if !c.Running() { + c.closed = make(chan struct{}) // Reset close signal + go func() { + for { + select { + case pub := <-c.channel: // Published message received + for _, sub := range c.Subscribers() { // Concurrency-safe subscribers retrievement + if c.blocking { + pub.broadcast(sub) + } else { + pub.broadcastNonBlocking(sub) + } + } + case <-c.closed: // Channel closed + for _, sub := range c.Subscribers() { // Remove all subscribers + common.Must(c.Unsubscribe(sub)) + close(sub) + } + return + } + } + }() + } + return nil +} + +// Close implements common.Closable. +func (c *Channel) Close() error { + c.access.Lock() + defer c.access.Unlock() + if c.Running() { + close(c.closed) // Send closed signal + } + return nil +} + +// channelMessage is the published message with guaranteed delivery. +// message is discarded only when the context is early cancelled. +type channelMessage struct { + context context.Context + message interface{} +} + +func (c channelMessage) publish(publisher chan channelMessage) { + select { + case publisher <- c: + case <-c.context.Done(): + } +} + +func (c channelMessage) publishNonBlocking(publisher chan channelMessage) { + select { + case publisher <- c: + default: // Create another goroutine to keep sending message + go c.publish(publisher) + } +} + +func (c channelMessage) broadcast(subscriber chan interface{}) { + select { + case subscriber <- c.message: + case <-c.context.Done(): + } +} + +func (c channelMessage) broadcastNonBlocking(subscriber chan interface{}) { + select { + case subscriber <- c.message: + default: // Create another goroutine to keep sending message + go c.broadcast(subscriber) + } +} diff --git a/app/stats/channel_test.go b/app/stats/channel_test.go new file mode 100644 index 0000000000..b2a1c174cf --- /dev/null +++ b/app/stats/channel_test.go @@ -0,0 +1,405 @@ +package stats_test + +import ( + "context" + "fmt" + "testing" + "time" + + . "v2ray.com/core/app/stats" + "v2ray.com/core/common" + "v2ray.com/core/features/stats" +) + +func TestStatsChannel(t *testing.T) { + // At most 2 subscribers could be registered + c := NewChannel(&ChannelConfig{SubscriberLimit: 2, Blocking: true}) + + a, err := stats.SubscribeRunnableChannel(c) + common.Must(err) + if !c.Running() { + t.Fatal("unexpected failure in running channel after first subscription") + } + + b, err := c.Subscribe() + common.Must(err) + + // Test that third subscriber is forbidden + _, err = c.Subscribe() + if err == nil { + t.Fatal("unexpected successful subscription") + } + t.Log("expected error: ", err) + + stopCh := make(chan struct{}) + errCh := make(chan string) + + go func() { + c.Publish(context.Background(), 1) + c.Publish(context.Background(), 2) + c.Publish(context.Background(), "3") + c.Publish(context.Background(), []int{4}) + stopCh <- struct{}{} + }() + + go func() { + if v, ok := (<-a).(int); !ok || v != 1 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 1) + } + if v, ok := (<-a).(int); !ok || v != 2 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 2) + } + if v, ok := (<-a).(string); !ok || v != "3" { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", "3") + } + if v, ok := (<-a).([]int); !ok || v[0] != 4 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", []int{4}) + } + stopCh <- struct{}{} + }() + + go func() { + if v, ok := (<-b).(int); !ok || v != 1 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 1) + } + if v, ok := (<-b).(int); !ok || v != 2 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 2) + } + if v, ok := (<-b).(string); !ok || v != "3" { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", "3") + } + if v, ok := (<-b).([]int); !ok || v[0] != 4 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", []int{4}) + } + stopCh <- struct{}{} + }() + + timeout := time.After(2 * time.Second) + for i := 0; i < 3; i++ { + select { + case <-timeout: + t.Fatal("Test timeout after 2s") + case e := <-errCh: + t.Fatal(e) + case <-stopCh: + } + } + + // Test the unsubscription of channel + common.Must(c.Unsubscribe(b)) + + // Test the last subscriber will close channel with `UnsubscribeClosableChannel` + common.Must(stats.UnsubscribeClosableChannel(c, a)) + if c.Running() { + t.Fatal("unexpected running channel after unsubscribing the last subscriber") + } +} + +func TestStatsChannelUnsubcribe(t *testing.T) { + c := NewChannel(&ChannelConfig{Blocking: true}) + common.Must(c.Start()) + defer c.Close() + + a, err := c.Subscribe() + common.Must(err) + defer c.Unsubscribe(a) + + b, err := c.Subscribe() + common.Must(err) + + pauseCh := make(chan struct{}) + stopCh := make(chan struct{}) + errCh := make(chan string) + + { + var aSet, bSet bool + for _, s := range c.Subscribers() { + if s == a { + aSet = true + } + if s == b { + bSet = true + } + } + if !(aSet && bSet) { + t.Fatal("unexpected subscribers: ", c.Subscribers()) + } + } + + go func() { // Blocking publish + c.Publish(context.Background(), 1) + <-pauseCh // Wait for `b` goroutine to resume sending message + c.Publish(context.Background(), 2) + }() + + go func() { + if v, ok := (<-a).(int); !ok || v != 1 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 1) + } + if v, ok := (<-a).(int); !ok || v != 2 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 2) + } + }() + + go func() { + if v, ok := (<-b).(int); !ok || v != 1 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 1) + } + // Unsubscribe `b` while publishing is paused + c.Unsubscribe(b) + { // Test `b` is not in subscribers + var aSet, bSet bool + for _, s := range c.Subscribers() { + if s == a { + aSet = true + } + if s == b { + bSet = true + } + } + if !(aSet && !bSet) { + errCh <- fmt.Sprint("unexpected subscribers: ", c.Subscribers()) + } + } + // Resume publishing progress + close(pauseCh) + // Test `b` is neither closed nor able to receive any data + select { + case v, ok := <-b: + if ok { + errCh <- fmt.Sprint("unexpected data received: ", v) + } else { + errCh <- fmt.Sprint("unexpected closed channel: ", b) + } + default: + } + close(stopCh) + }() + + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case e := <-errCh: + t.Fatal(e) + case <-stopCh: + } +} + +func TestStatsChannelBlocking(t *testing.T) { + // Do not use buffer so as to create blocking scenario + c := NewChannel(&ChannelConfig{BufferSize: 0, Blocking: true}) + common.Must(c.Start()) + defer c.Close() + + a, err := c.Subscribe() + common.Must(err) + defer c.Unsubscribe(a) + + pauseCh := make(chan struct{}) + stopCh := make(chan struct{}) + errCh := make(chan string) + + ctx, cancel := context.WithCancel(context.Background()) + + // Test blocking channel publishing + go func() { + // Dummy messsage with no subscriber receiving, will block broadcasting goroutine + c.Publish(context.Background(), nil) + + <-pauseCh + + // Publishing should be blocked here, for last message was not cleared and buffer was full + c.Publish(context.Background(), nil) + + pauseCh <- struct{}{} + + // Publishing should still be blocked here + c.Publish(ctx, nil) + + // Check publishing is done because context is canceled + select { + case <-ctx.Done(): + if ctx.Err() != context.Canceled { + errCh <- fmt.Sprint("unexpected error: ", ctx.Err()) + } + default: + errCh <- "unexpected non-blocked publishing" + } + close(stopCh) + }() + + go func() { + pauseCh <- struct{}{} + + select { + case <-pauseCh: + errCh <- "unexpected non-blocked publishing" + case <-time.After(100 * time.Millisecond): + } + + // Receive first published message + <-a + + select { + case <-pauseCh: + case <-time.After(100 * time.Millisecond): + errCh <- "unexpected blocking publishing" + } + + // Manually cancel the context to end publishing + cancel() + }() + + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case e := <-errCh: + t.Fatal(e) + case <-stopCh: + } +} + +func TestStatsChannelNonBlocking(t *testing.T) { + // Do not use buffer so as to create blocking scenario + c := NewChannel(&ChannelConfig{BufferSize: 0, Blocking: false}) + common.Must(c.Start()) + defer c.Close() + + a, err := c.Subscribe() + common.Must(err) + defer c.Unsubscribe(a) + + pauseCh := make(chan struct{}) + stopCh := make(chan struct{}) + errCh := make(chan string) + + ctx, cancel := context.WithCancel(context.Background()) + + // Test blocking channel publishing + go func() { + c.Publish(context.Background(), nil) + c.Publish(context.Background(), nil) + pauseCh <- struct{}{} + <-pauseCh + c.Publish(ctx, nil) + c.Publish(ctx, nil) + // Check publishing is done because context is canceled + select { + case <-ctx.Done(): + if ctx.Err() != context.Canceled { + errCh <- fmt.Sprint("unexpected error: ", ctx.Err()) + } + case <-time.After(100 * time.Millisecond): + errCh <- "unexpected non-cancelled publishing" + } + }() + + go func() { + // Check publishing won't block even if there is no subscriber receiving message + select { + case <-pauseCh: + case <-time.After(100 * time.Millisecond): + errCh <- "unexpected blocking publishing" + } + + // Receive first and second published message + <-a + <-a + + pauseCh <- struct{}{} + + // Manually cancel the context to end publishing + cancel() + + // Check third and forth published message is cancelled and cannot receive + <-time.After(100 * time.Millisecond) + select { + case <-a: + errCh <- "unexpected non-cancelled publishing" + default: + } + select { + case <-a: + errCh <- "unexpected non-cancelled publishing" + default: + } + close(stopCh) + }() + + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case e := <-errCh: + t.Fatal(e) + case <-stopCh: + } +} + +func TestStatsChannelConcurrency(t *testing.T) { + // Do not use buffer so as to create blocking scenario + c := NewChannel(&ChannelConfig{BufferSize: 0, Blocking: true}) + common.Must(c.Start()) + defer c.Close() + + a, err := c.Subscribe() + common.Must(err) + defer c.Unsubscribe(a) + + b, err := c.Subscribe() + common.Must(err) + defer c.Unsubscribe(b) + + stopCh := make(chan struct{}) + errCh := make(chan string) + + go func() { // Blocking publish + c.Publish(context.Background(), 1) + c.Publish(context.Background(), 2) + }() + + go func() { + if v, ok := (<-a).(int); !ok || v != 1 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 1) + } + if v, ok := (<-a).(int); !ok || v != 2 { + errCh <- fmt.Sprint("unexpected receiving: ", v, ", wanted ", 2) + } + }() + + go func() { + // Block `b` for a time so as to ensure source channel is trying to send message to `b`. + <-time.After(25 * time.Millisecond) + // This causes concurrency scenario: unsubscribe `b` while trying to send message to it + c.Unsubscribe(b) + // Test `b` is not closed and can still receive data 1: + // Because unsubscribe won't affect the ongoing process of sending message. + select { + case v, ok := <-b: + if v1, ok1 := v.(int); !(ok && ok1 && v1 == 1) { + errCh <- fmt.Sprint("unexpected failure in receiving data: ", 1) + } + default: + errCh <- fmt.Sprint("unexpected block from receiving data: ", 1) + } + // Test `b` is not closed but cannot receive data 2: + // Because in a new round of messaging, `b` has been unsubscribed. + select { + case v, ok := <-b: + if ok { + errCh <- fmt.Sprint("unexpected receiving: ", v) + } else { + errCh <- fmt.Sprint("unexpected closing of channel") + } + default: + } + close(stopCh) + }() + + select { + case <-time.After(2 * time.Second): + t.Fatal("Test timeout after 2s") + case e := <-errCh: + t.Fatal(e) + case <-stopCh: + } +} diff --git a/app/stats/command/command.go b/app/stats/command/command.go index 68bc8e462b..434af86b32 100644 --- a/app/stats/command/command.go +++ b/app/stats/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -63,7 +63,7 @@ func (s *statsServer) QueryStats(ctx context.Context, request *QueryStatsRequest return nil, newError("QueryStats only works its own stats.Manager.") } - manager.Visit(func(name string, c feature_stats.Counter) bool { + manager.VisitCounters(func(name string, c feature_stats.Counter) bool { if matcher.Match(name) { var value int64 if request.Reset_ { @@ -104,6 +104,8 @@ func (s *statsServer) GetSysStats(ctx context.Context, request *SysStatsRequest) return response, nil } +func (s *statsServer) mustEmbedUnimplementedStatsServiceServer() {} + type service struct { statsManager feature_stats.Manager } diff --git a/app/stats/command/command.pb.go b/app/stats/command/command.pb.go index cfd66f62ea..7124df06c1 100644 --- a/app/stats/command/command.pb.go +++ b/app/stats/command/command.pb.go @@ -1,11 +1,13 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/stats/command/command.proto + package command import ( - context "context" proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -37,7 +39,7 @@ type GetStatsRequest struct { func (x *GetStatsRequest) Reset() { *x = GetStatsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[0] + mi := &file_app_stats_command_command_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -50,7 +52,7 @@ func (x *GetStatsRequest) String() string { func (*GetStatsRequest) ProtoMessage() {} func (x *GetStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[0] + 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 { @@ -63,7 +65,7 @@ func (x *GetStatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStatsRequest.ProtoReflect.Descriptor instead. func (*GetStatsRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{0} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{0} } func (x *GetStatsRequest) GetName() string { @@ -92,7 +94,7 @@ type Stat struct { func (x *Stat) Reset() { *x = Stat{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[1] + mi := &file_app_stats_command_command_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -105,7 +107,7 @@ func (x *Stat) String() string { func (*Stat) ProtoMessage() {} func (x *Stat) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[1] + 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 { @@ -118,7 +120,7 @@ func (x *Stat) ProtoReflect() protoreflect.Message { // Deprecated: Use Stat.ProtoReflect.Descriptor instead. func (*Stat) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{1} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{1} } func (x *Stat) GetName() string { @@ -146,7 +148,7 @@ type GetStatsResponse struct { func (x *GetStatsResponse) Reset() { *x = GetStatsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[2] + mi := &file_app_stats_command_command_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -159,7 +161,7 @@ func (x *GetStatsResponse) String() string { func (*GetStatsResponse) ProtoMessage() {} func (x *GetStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[2] + 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 { @@ -172,7 +174,7 @@ func (x *GetStatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStatsResponse.ProtoReflect.Descriptor instead. func (*GetStatsResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{2} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{2} } func (x *GetStatsResponse) GetStat() *Stat { @@ -194,7 +196,7 @@ type QueryStatsRequest struct { func (x *QueryStatsRequest) Reset() { *x = QueryStatsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[3] + mi := &file_app_stats_command_command_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -207,7 +209,7 @@ func (x *QueryStatsRequest) String() string { func (*QueryStatsRequest) ProtoMessage() {} func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[3] + 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 { @@ -220,7 +222,7 @@ func (x *QueryStatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryStatsRequest.ProtoReflect.Descriptor instead. func (*QueryStatsRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{3} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{3} } func (x *QueryStatsRequest) GetPattern() string { @@ -248,7 +250,7 @@ type QueryStatsResponse struct { func (x *QueryStatsResponse) Reset() { *x = QueryStatsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[4] + mi := &file_app_stats_command_command_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -261,7 +263,7 @@ func (x *QueryStatsResponse) String() string { func (*QueryStatsResponse) ProtoMessage() {} func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[4] + 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 { @@ -274,7 +276,7 @@ func (x *QueryStatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryStatsResponse.ProtoReflect.Descriptor instead. func (*QueryStatsResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{4} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{4} } func (x *QueryStatsResponse) GetStat() []*Stat { @@ -293,7 +295,7 @@ type SysStatsRequest struct { func (x *SysStatsRequest) Reset() { *x = SysStatsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[5] + mi := &file_app_stats_command_command_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -306,7 +308,7 @@ func (x *SysStatsRequest) String() string { func (*SysStatsRequest) ProtoMessage() {} func (x *SysStatsRequest) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[5] + 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 { @@ -319,7 +321,7 @@ func (x *SysStatsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SysStatsRequest.ProtoReflect.Descriptor instead. func (*SysStatsRequest) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{5} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{5} } type SysStatsResponse struct { @@ -342,7 +344,7 @@ type SysStatsResponse struct { func (x *SysStatsResponse) Reset() { *x = SysStatsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[6] + mi := &file_app_stats_command_command_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -355,7 +357,7 @@ func (x *SysStatsResponse) String() string { func (*SysStatsResponse) ProtoMessage() {} func (x *SysStatsResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[6] + 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 { @@ -368,7 +370,7 @@ func (x *SysStatsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SysStatsResponse.ProtoReflect.Descriptor instead. func (*SysStatsResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{6} + return file_app_stats_command_command_proto_rawDescGZIP(), []int{6} } func (x *SysStatsResponse) GetNumGoroutine() uint32 { @@ -450,7 +452,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[7] + mi := &file_app_stats_command_command_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -463,7 +465,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_command_command_proto_msgTypes[7] + 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 { @@ -476,102 +478,102 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP(), []int{7} -} - -var File_v2ray_com_core_app_stats_command_command_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_app_stats_command_command_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4c, - 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xde, - 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x6b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x76, 0x32, + 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, 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x4c, 0x0a, 0x12, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, + 0xde, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x6b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x71, 0x0a, 0x0a, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x30, 0x2e, 0x76, 0x32, + 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x71, 0x0a, + 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2d, + 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6e, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, + 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x4c, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, - 0x1c, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x65, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x20, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x1c, 0x56, 0x32, 0x52, 0x61, 0x79, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_app_stats_command_command_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_stats_command_command_proto_rawDescData = file_v2ray_com_core_app_stats_command_command_proto_rawDesc + 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_v2ray_com_core_app_stats_command_command_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_stats_command_command_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_stats_command_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_stats_command_command_proto_rawDescData) +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_v2ray_com_core_app_stats_command_command_proto_rawDescData + return file_app_stats_command_command_proto_rawDescData } -var file_v2ray_com_core_app_stats_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_v2ray_com_core_app_stats_command_command_proto_goTypes = []interface{}{ +var file_app_stats_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_app_stats_command_command_proto_goTypes = []interface{}{ (*GetStatsRequest)(nil), // 0: v2ray.core.app.stats.command.GetStatsRequest (*Stat)(nil), // 1: v2ray.core.app.stats.command.Stat (*GetStatsResponse)(nil), // 2: v2ray.core.app.stats.command.GetStatsResponse @@ -581,7 +583,7 @@ var file_v2ray_com_core_app_stats_command_command_proto_goTypes = []interface{}{ (*SysStatsResponse)(nil), // 6: v2ray.core.app.stats.command.SysStatsResponse (*Config)(nil), // 7: v2ray.core.app.stats.command.Config } -var file_v2ray_com_core_app_stats_command_command_proto_depIdxs = []int32{ +var file_app_stats_command_command_proto_depIdxs = []int32{ 1, // 0: v2ray.core.app.stats.command.GetStatsResponse.stat:type_name -> v2ray.core.app.stats.command.Stat 1, // 1: v2ray.core.app.stats.command.QueryStatsResponse.stat:type_name -> v2ray.core.app.stats.command.Stat 0, // 2: v2ray.core.app.stats.command.StatsService.GetStats:input_type -> v2ray.core.app.stats.command.GetStatsRequest @@ -597,13 +599,13 @@ var file_v2ray_com_core_app_stats_command_command_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_stats_command_command_proto_init() } -func file_v2ray_com_core_app_stats_command_command_proto_init() { - if File_v2ray_com_core_app_stats_command_command_proto != nil { +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_v2ray_com_core_app_stats_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStatsRequest); i { case 0: return &v.state @@ -615,7 +617,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Stat); i { case 0: return &v.state @@ -627,7 +629,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStatsResponse); i { case 0: return &v.state @@ -639,7 +641,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryStatsRequest); i { case 0: return &v.state @@ -651,7 +653,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryStatsResponse); i { case 0: return &v.state @@ -663,7 +665,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SysStatsRequest); i { case 0: return &v.state @@ -675,7 +677,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SysStatsResponse); i { case 0: return &v.state @@ -687,7 +689,7 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { return nil } } - file_v2ray_com_core_app_stats_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_command_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -704,170 +706,18 @@ func file_v2ray_com_core_app_stats_command_command_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_app_stats_command_command_proto_rawDesc, + RawDescriptor: file_app_stats_command_command_proto_rawDesc, NumEnums: 0, NumMessages: 8, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_v2ray_com_core_app_stats_command_command_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_stats_command_command_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_stats_command_command_proto_msgTypes, + 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_v2ray_com_core_app_stats_command_command_proto = out.File - file_v2ray_com_core_app_stats_command_command_proto_rawDesc = nil - file_v2ray_com_core_app_stats_command_command_proto_goTypes = nil - file_v2ray_com_core_app_stats_command_command_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 - -// StatsServiceClient is the client API for StatsService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#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, "/v2ray.core.app.stats.command.StatsService/GetStats", 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, "/v2ray.core.app.stats.command.StatsService/QueryStats", 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, "/v2ray.core.app.stats.command.StatsService/GetSysStats", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// StatsServiceServer is the server API for StatsService service. -type StatsServiceServer interface { - GetStats(context.Context, *GetStatsRequest) (*GetStatsResponse, error) - QueryStats(context.Context, *QueryStatsRequest) (*QueryStatsResponse, error) - GetSysStats(context.Context, *SysStatsRequest) (*SysStatsResponse, error) -} - -// UnimplementedStatsServiceServer can 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 RegisterStatsServiceServer(s *grpc.Server, 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: "/v2ray.core.app.stats.command.StatsService/GetStats", - } - 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: "/v2ray.core.app.stats.command.StatsService/QueryStats", - } - 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: "/v2ray.core.app.stats.command.StatsService/GetSysStats", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StatsServiceServer).GetSysStats(ctx, req.(*SysStatsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _StatsService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "v2ray.core.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: "v2ray.com/core/app/stats/command/command.proto", + 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/app/stats/command/command.proto b/app/stats/command/command.proto index 2bd9cdecac..11c4d245e8 100644 --- a/app/stats/command/command.proto +++ b/app/stats/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.app.stats.command; option csharp_namespace = "V2Ray.Core.App.Stats.Command"; -option go_package = "command"; +option go_package = "v2ray.com/core/app/stats/command"; option java_package = "com.v2ray.core.app.stats.command"; option java_multiple_files = true; @@ -31,8 +31,7 @@ message QueryStatsResponse { repeated Stat stat = 1; } -message SysStatsRequest { -} +message SysStatsRequest {} message SysStatsResponse { uint32 NumGoroutine = 1; diff --git a/app/stats/command/command_grpc.pb.go b/app/stats/command/command_grpc.pb.go new file mode 100644 index 0000000000..dfa936707f --- /dev/null +++ b/app/stats/command/command_grpc.pb.go @@ -0,0 +1,169 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +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. +const _ = grpc.SupportPackageIsVersion7 + +// 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, "/v2ray.core.app.stats.command.StatsService/GetStats", 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, "/v2ray.core.app.stats.command.StatsService/QueryStats", 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, "/v2ray.core.app.stats.command.StatsService/GetSysStats", 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.Server, 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: "/v2ray.core.app.stats.command.StatsService/GetStats", + } + 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: "/v2ray.core.app.stats.command.StatsService/QueryStats", + } + 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: "/v2ray.core.app.stats.command.StatsService/GetSysStats", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatsServiceServer).GetSysStats(ctx, req.(*SysStatsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _StatsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "v2ray.core.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/app/stats/config.go b/app/stats/config.go deleted file mode 100644 index e124b17a60..0000000000 --- a/app/stats/config.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build !confonly - -package stats - -import ( - "context" - - "v2ray.com/core/common" -) - -func init() { - common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { - return NewManager(ctx, config.(*Config)) - })) -} diff --git a/app/stats/config.pb.go b/app/stats/config.pb.go index 628de21bc1..6fd8f1b50a 100644 --- a/app/stats/config.pb.go +++ b/app/stats/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: app/stats/config.proto + package stats import ( @@ -28,7 +34,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_app_stats_config_proto_msgTypes[0] + mi := &file_app_stats_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_app_stats_config_proto_msgTypes[0] + mi := &file_app_stats_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -54,40 +60,112 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_app_stats_config_proto_rawDescGZIP(), []int{0} + 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_v2ray_com_core_app_stats_config_proto protoreflect.FileDescriptor +var File_app_stats_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_app_stats_config_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x22, 0x08, 0x0a, - 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x3a, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x50, 0x01, 0x5a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x14, 0x56, - 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +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, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, + 0x4d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x50, 0x01, 0x5a, 0x18, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_app_stats_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_app_stats_config_proto_rawDescData = file_v2ray_com_core_app_stats_config_proto_rawDesc + file_app_stats_config_proto_rawDescOnce sync.Once + file_app_stats_config_proto_rawDescData = file_app_stats_config_proto_rawDesc ) -func file_v2ray_com_core_app_stats_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_app_stats_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_app_stats_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_app_stats_config_proto_rawDescData) +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_v2ray_com_core_app_stats_config_proto_rawDescData + return file_app_stats_config_proto_rawDescData } -var file_v2ray_com_core_app_stats_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_app_stats_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: v2ray.core.app.stats.Config +var file_app_stats_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_app_stats_config_proto_goTypes = []interface{}{ + (*Config)(nil), // 0: v2ray.core.app.stats.Config + (*ChannelConfig)(nil), // 1: v2ray.core.app.stats.ChannelConfig } -var file_v2ray_com_core_app_stats_config_proto_depIdxs = []int32{ +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 @@ -95,13 +173,13 @@ var file_v2ray_com_core_app_stats_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_app_stats_config_proto_init() } -func file_v2ray_com_core_app_stats_config_proto_init() { - if File_v2ray_com_core_app_stats_config_proto != nil { +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_v2ray_com_core_app_stats_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_app_stats_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -113,23 +191,35 @@ func file_v2ray_com_core_app_stats_config_proto_init() { 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_v2ray_com_core_app_stats_config_proto_rawDesc, + RawDescriptor: file_app_stats_config_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_app_stats_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_app_stats_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_app_stats_config_proto_msgTypes, + GoTypes: file_app_stats_config_proto_goTypes, + DependencyIndexes: file_app_stats_config_proto_depIdxs, + MessageInfos: file_app_stats_config_proto_msgTypes, }.Build() - File_v2ray_com_core_app_stats_config_proto = out.File - file_v2ray_com_core_app_stats_config_proto_rawDesc = nil - file_v2ray_com_core_app_stats_config_proto_goTypes = nil - file_v2ray_com_core_app_stats_config_proto_depIdxs = nil + 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/app/stats/config.proto b/app/stats/config.proto index 9407fd391b..db63e9a363 100644 --- a/app/stats/config.proto +++ b/app/stats/config.proto @@ -2,10 +2,14 @@ syntax = "proto3"; package v2ray.core.app.stats; option csharp_namespace = "V2Ray.Core.App.Stats"; -option go_package = "stats"; +option go_package = "v2ray.com/core/app/stats"; option java_package = "com.v2ray.core.app.stats"; option java_multiple_files = true; -message Config { - +message Config {} + +message ChannelConfig { + bool Blocking = 1; + int32 SubscriberLimit = 2; + int32 BufferSize = 3; } diff --git a/app/stats/counter.go b/app/stats/counter.go new file mode 100644 index 0000000000..c4e1201339 --- /dev/null +++ b/app/stats/counter.go @@ -0,0 +1,25 @@ +// +build !confonly + +package stats + +import "sync/atomic" + +// Counter is an implementation of stats.Counter. +type Counter struct { + value int64 +} + +// Value implements stats.Counter. +func (c *Counter) Value() int64 { + return atomic.LoadInt64(&c.value) +} + +// Set implements stats.Counter. +func (c *Counter) Set(newValue int64) int64 { + return atomic.SwapInt64(&c.value, newValue) +} + +// Add implements stats.Counter. +func (c *Counter) Add(delta int64) int64 { + return atomic.AddInt64(&c.value, delta) +} diff --git a/app/stats/counter_test.go b/app/stats/counter_test.go new file mode 100644 index 0000000000..f2594e1ee6 --- /dev/null +++ b/app/stats/counter_test.go @@ -0,0 +1,31 @@ +package stats_test + +import ( + "context" + "testing" + + . "v2ray.com/core/app/stats" + "v2ray.com/core/common" + "v2ray.com/core/features/stats" +) + +func TestStatsCounter(t *testing.T) { + raw, err := common.CreateObject(context.Background(), &Config{}) + common.Must(err) + + m := raw.(stats.Manager) + c, err := m.RegisterCounter("test.counter") + common.Must(err) + + if v := c.Add(1); v != 1 { + t.Fatal("unpexcted Add(1) return: ", v, ", wanted ", 1) + } + + if v := c.Set(0); v != 1 { + t.Fatal("unexpected Set(0) return: ", v, ", wanted ", 1) + } + + if v := c.Value(); v != 0 { + t.Fatal("unexpected Value() return: ", v, ", wanted ", 0) + } +} diff --git a/app/stats/stats.go b/app/stats/stats.go index c7f5883157..55574d161a 100644 --- a/app/stats/stats.go +++ b/app/stats/stats.go @@ -2,54 +2,41 @@ package stats -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" "sync" - "sync/atomic" + "v2ray.com/core/common" + "v2ray.com/core/common/errors" "v2ray.com/core/features/stats" ) -// Counter is an implementation of stats.Counter. -type Counter struct { - value int64 -} - -// Value implements stats.Counter. -func (c *Counter) Value() int64 { - return atomic.LoadInt64(&c.value) -} - -// Set implements stats.Counter. -func (c *Counter) Set(newValue int64) int64 { - return atomic.SwapInt64(&c.value, newValue) -} - -// Add implements stats.Counter. -func (c *Counter) Add(delta int64) int64 { - return atomic.AddInt64(&c.value, delta) -} - // Manager is an implementation of stats.Manager. type Manager struct { access sync.RWMutex counters map[string]*Counter + channels map[string]*Channel + running bool } +// NewManager creates an instance of Statistics Manager. func NewManager(ctx context.Context, config *Config) (*Manager, error) { m := &Manager{ counters: make(map[string]*Counter), + channels: make(map[string]*Channel), } return m, nil } +// Type implements common.HasType. func (*Manager) Type() interface{} { return stats.ManagerType() } +// RegisterCounter implements stats.Manager. func (m *Manager) RegisterCounter(name string) (stats.Counter, error) { m.access.Lock() defer m.access.Unlock() @@ -63,18 +50,19 @@ func (m *Manager) RegisterCounter(name string) (stats.Counter, error) { return c, nil } +// UnregisterCounter implements stats.Manager. func (m *Manager) UnregisterCounter(name string) error { m.access.Lock() defer m.access.Unlock() - if _, found := m.counters[name]; !found { - return newError("Counter ", name, " was not found.") + if _, found := m.counters[name]; found { + newError("remove counter ", name).AtDebug().WriteToLog() + delete(m.counters, name) } - newError("remove counter ", name).AtDebug().WriteToLog() - delete(m.counters, name) return nil } +// GetCounter implements stats.Manager. func (m *Manager) GetCounter(name string) stats.Counter { m.access.RLock() defer m.access.RUnlock() @@ -85,7 +73,8 @@ func (m *Manager) GetCounter(name string) stats.Counter { return nil } -func (m *Manager) Visit(visitor func(string, stats.Counter) bool) { +// VisitCounters calls visitor function on all managed counters. +func (m *Manager) VisitCounters(visitor func(string, stats.Counter) bool) { m.access.RLock() defer m.access.RUnlock() @@ -96,12 +85,85 @@ func (m *Manager) Visit(visitor func(string, stats.Counter) bool) { } } +// RegisterChannel implements stats.Manager. +func (m *Manager) RegisterChannel(name string) (stats.Channel, error) { + m.access.Lock() + defer m.access.Unlock() + + if _, found := m.channels[name]; found { + return nil, newError("Channel ", name, " already registered.") + } + newError("create new channel ", name).AtDebug().WriteToLog() + c := NewChannel(&ChannelConfig{BufferSize: 64, Blocking: false}) + m.channels[name] = c + if m.running { + return c, c.Start() + } + return c, nil +} + +// UnregisterChannel implements stats.Manager. +func (m *Manager) UnregisterChannel(name string) error { + m.access.Lock() + defer m.access.Unlock() + + if c, found := m.channels[name]; found { + newError("remove channel ", name).AtDebug().WriteToLog() + delete(m.channels, name) + return c.Close() + } + return nil +} + +// GetChannel implements stats.Manager. +func (m *Manager) GetChannel(name string) stats.Channel { + m.access.RLock() + defer m.access.RUnlock() + + if c, found := m.channels[name]; found { + return c + } + return nil +} + // Start implements common.Runnable. func (m *Manager) Start() error { + m.access.Lock() + defer m.access.Unlock() + m.running = true + errs := []error{} + for _, channel := range m.channels { + if err := channel.Start(); err != nil { + errs = append(errs, err) + } + } + if len(errs) != 0 { + return errors.Combine(errs...) + } return nil } // Close implement common.Closable. func (m *Manager) Close() error { + m.access.Lock() + defer m.access.Unlock() + m.running = false + errs := []error{} + for name, channel := range m.channels { + newError("remove channel ", name).AtDebug().WriteToLog() + delete(m.channels, name) + if err := channel.Close(); err != nil { + errs = append(errs, err) + } + } + if len(errs) != 0 { + return errors.Combine(errs...) + } return nil } + +func init() { + common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { + return NewManager(ctx, config.(*Config)) + })) +} \ No newline at end of file diff --git a/app/stats/stats_test.go b/app/stats/stats_test.go index 2a0d9b91ae..1641021dcf 100644 --- a/app/stats/stats_test.go +++ b/app/stats/stats_test.go @@ -3,33 +3,84 @@ package stats_test import ( "context" "testing" + "time" . "v2ray.com/core/app/stats" "v2ray.com/core/common" "v2ray.com/core/features/stats" ) -func TestInternface(t *testing.T) { +func TestInterface(t *testing.T) { _ = (stats.Manager)(new(Manager)) } -func TestStatsCounter(t *testing.T) { +func TestStatsChannelRunnable(t *testing.T) { raw, err := common.CreateObject(context.Background(), &Config{}) common.Must(err) m := raw.(stats.Manager) - c, err := m.RegisterCounter("test.counter") + + ch1, err := m.RegisterChannel("test.channel.1") + c1 := ch1.(*Channel) + common.Must(err) + + if c1.Running() { + t.Fatalf("unexpected running channel: test.channel.%d", 1) + } + + common.Must(m.Start()) + + if !c1.Running() { + t.Fatalf("unexpected non-running channel: test.channel.%d", 1) + } + + ch2, err := m.RegisterChannel("test.channel.2") + c2 := ch2.(*Channel) + common.Must(err) + + if !c2.Running() { + t.Fatalf("unexpected non-running channel: test.channel.%d", 2) + } + + s1, err := c1.Subscribe() common.Must(err) + common.Must(c1.Close()) + + if c1.Running() { + t.Fatalf("unexpected running channel: test.channel.%d", 1) + } - if v := c.Add(1); v != 1 { - t.Fatal("unpexcted Add(1) return: ", v, ", wanted ", 1) + select { // Check all subscribers in closed channel are closed + case _, ok := <-s1: + if ok { + t.Fatalf("unexpected non-closed subscriber in channel: test.channel.%d", 1) + } + case <-time.After(500 * time.Millisecond): + t.Fatalf("unexpected non-closed subscriber in channel: test.channel.%d", 1) } - if v := c.Set(0); v != 1 { - t.Fatal("unexpected Set(0) return: ", v, ", wanted ", 1) + if len(c1.Subscribers()) != 0 { // Check subscribers in closed channel are emptied + t.Fatalf("unexpected non-empty subscribers in channel: test.channel.%d", 1) + } + + common.Must(m.Close()) + + if c2.Running() { + t.Fatalf("unexpected running channel: test.channel.%d", 2) } - if v := c.Value(); v != 0 { - t.Fatal("unexpected Value() return: ", v, ", wanted ", 0) + ch3, err := m.RegisterChannel("test.channel.3") + c3 := ch3.(*Channel) + common.Must(err) + + if c3.Running() { + t.Fatalf("unexpected running channel: test.channel.%d", 3) + } + + common.Must(c3.Start()) + common.Must(m.UnregisterChannel("test.channel.3")) + + if c3.Running() { // Test that unregistering will close the channel. + t.Fatalf("unexpected running channel: test.channel.%d", 3) } } diff --git a/azure-pipelines.template.yml b/azure-pipelines.template.yml deleted file mode 100644 index a982efbe91..0000000000 --- a/azure-pipelines.template.yml +++ /dev/null @@ -1,22 +0,0 @@ -jobs: -- job: ${{ parameters.name }} - timeoutInMinutes: 30 - - pool: - vmImage: ${{ parameters.vmImage }} - - steps: - - checkout: self - - task: GoTool@0 - inputs: - version: '1.14' - - script: | - go test -p 1 -v -timeout 30m ./... - workingDirectory: '$(Build.SourcesDirectory)' - displayName: 'Test' - - - script: | - go build ./common/buf - condition: always() - workingDirectory: '$(Build.SourcesDirectory)' - displayName: 'Test Buf error' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1ccf6ad1a..7d374bce13 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,120 +2,37 @@ trigger: batch: true branches: include: - - master - - dev* - - refs/tags/* + - master + - dev* + - refs/tags/* -pr: - - master - - dev* +pool: + vmImage: "ubuntu-latest" -jobs: -- template: azure-pipelines.template.yml - parameters: - name: linux - vmImage: 'ubuntu-latest' +variables: + - group: GithubToken -- template: azure-pipelines.template.yml - parameters: - name: windows - vmImage: 'windows-latest' - -- template: azure-pipelines.template.yml - parameters: - name: macos - vmImage: 'macOS-latest' - -- job: linux_coverage - dependsOn: linux - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - timeoutInMinutes: 30 - - pool: - vmImage: 'ubuntu-latest' - -#variables: -# CODECOV_TOKEN: '$(coverage.token)' - - - steps: +steps: - checkout: self - task: GoTool@0 inputs: - version: '1.14.4' - - script: | - bash ./testing/coverage/coverall - workingDirectory: '$(Build.SourcesDirectory)' - displayName: 'Coverage' - -- job: make_release - dependsOn: linux - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - timeoutInMinutes: 60 - - pool: - vmImage: 'ubuntu-latest' - variables: - - group: GithubToken - - name: GOPATH - value: '$(system.defaultWorkingDirectory)/gopath' - - name: BAZEL_VER - value: '0.23.0' - - steps: - - checkout: self - - task: GoTool@0 - inputs: - version: '1.14.4' - - script: | - mkdir triggersrc - ls -I "triggersrc" | xargs cp -rf -t triggersrc - mkdir gopath - displayName: Prepare Environment - workingDirectory: '$(system.defaultWorkingDirectory)' - - script: | - sudo apt-get -y update - sudo apt-get -y install jq git file pkg-config zip g++ zlib1g-dev unzip python openssl tree - displayName: Apt Install + version: "1.15.2" - script: | go version - unset GOPATH - mkdir ./src - mkdir ./src/v2ray.com - ln -s $(pwd)/../triggersrc ./src/v2ray.com/core - go get -v -t -d ./src/v2ray.com/core/... - tree - workingDirectory: '$(GOPATH)' - displayName: 'Fetch sources' + go mod download + workingDirectory: $(system.defaultWorkingDirectory) + displayName: "Fetch sources" - script: | - mkdir release - cd src - zip -9 -r ../release/src_all.zip * -x '*.git*' - workingDirectory: '$(GOPATH)' - displayName: 'Dump sources' + bazel build --action_env=PATH=$PATH --action_env=GOPATH=$(go env GOPATH) --action_env=GOCACHE=$(go env GOCACHE) --action_env=SPWD=$(pwd) --spawn_strategy local //release:all + workingDirectory: $(system.defaultWorkingDirectory) + displayName: "Build Binaries" - script: | - curl -L -o bazel-installer.sh https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VER}/bazel-${BAZEL_VER}-installer-linux-x86_64.sh - chmod +x bazel-installer.sh - ./bazel-installer.sh --user - workingDirectory: '$(GOPATH)' - displayName: 'Install Bazel' - - script: | - cd ./src/v2ray.com/core - ./release/updatedat.sh - $HOME/bin/bazel build --action_env=GOPATH=$GOPATH --action_env=PATH=$PATH --action_env=GPG_PASS=${SIGN_KEY_PASS} --action_env=SPWD=$PWD --action_env=GOCACHE=$(go env GOCACHE) --spawn_strategy local //release:all - workingDirectory: '$(GOPATH)' - displayName: 'Build Binaries' - - script: | - cp ./src/v2ray.com/core/bazel-bin/release/*.zip ./release/ - workingDirectory: '$(GOPATH)' - displayName: 'Dump Binaries' - - script: | - cd ./src/v2ray.com/core echo $RELEASE_TAG ./release/bleedingrelease.sh - workingDirectory: '$(GOPATH)' - displayName: 'Generate Bleeding Edge Release' + workingDirectory: $(system.defaultWorkingDirectory) + displayName: "Generate Bleeding Edge Release" env: + WORKDIR: $(system.defaultWorkingDirectory) GITHUB_TOKEN: $(GITHUB_TOKEN) PRERELEASE: true RELEASE_TAG: unstable-$(Build.SourceVersion) @@ -124,13 +41,14 @@ jobs: GITHUB_REPO_OWNER: v2fly GITHUB_REPO_NAME: v2ray-core - script: | - cd ./src/v2ray.com/core echo $RELEASE_TAG ./release/tagrelease.sh - workingDirectory: '$(GOPATH)' - displayName: 'Generate Tag Release' + workingDirectory: $(system.defaultWorkingDirectory) + displayName: "Generate Tag Release" env: + WORKDIR: $(system.defaultWorkingDirectory) GITHUB_TOKEN: $(GITHUB_TOKEN) PRERELEASE: true RELEASE_TAG: unstable-$(Build.SourceVersion) + RELEASE_SHA: $(Build.SourceVersion) TRIGGER_REASON: $(Build.SourceBranch) diff --git a/common/buf/buf.go b/common/buf/buf.go index 3933547999..8579694c38 100644 --- a/common/buf/buf.go +++ b/common/buf/buf.go @@ -1,4 +1,4 @@ // Package buf provides a light-weight memory allocation mechanism. package buf // import "v2ray.com/core/common/buf" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/common/buf/buffer_test.go b/common/buf/buffer_test.go index 6231e449ff..34961c8f6b 100644 --- a/common/buf/buffer_test.go +++ b/common/buf/buffer_test.go @@ -22,7 +22,7 @@ func TestBufferClear(t *testing.T) { buffer.Clear() if buffer.Len() != 0 { - t.Error("expect 0 lenght, but got ", buffer.Len()) + t.Error("expect 0 length, but got ", buffer.Len()) } } diff --git a/common/common.go b/common/common.go index b67f187095..2d0a929baf 100644 --- a/common/common.go +++ b/common/common.go @@ -2,9 +2,18 @@ // See each sub-package for detail. package common -import "v2ray.com/core/common/errors" +import ( + "fmt" + "go/build" + "io/ioutil" + "os" + "path/filepath" + "strings" -//go:generate errorgen + "v2ray.com/core/common/errors" +) + +//go:generate go run v2ray.com/core/common/errors/errorgen var ( // ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route. @@ -28,3 +37,122 @@ func Must2(v interface{}, err error) interface{} { func Error2(v interface{}, err error) error { return err } + +// envFile returns the name of the Go environment configuration file. +// Copy from https://github.com/golang/go/blob/c4f2a9788a7be04daf931ac54382fbe2cb754938/src/cmd/go/internal/cfg/cfg.go#L150-L166 +func envFile() (string, error) { + if file := os.Getenv("GOENV"); file != "" { + if file == "off" { + return "", fmt.Errorf("GOENV=off") + } + return file, nil + } + dir, err := os.UserConfigDir() + if err != nil { + return "", err + } + if dir == "" { + return "", fmt.Errorf("missing user-config dir") + } + return filepath.Join(dir, "go", "env"), nil +} + +// GetRuntimeEnv returns the value of runtime environment variable, +// that is set by running following command: `go env -w key=value`. +func GetRuntimeEnv(key string) (string, error) { + file, err := envFile() + if err != nil { + return "", err + } + if file == "" { + return "", fmt.Errorf("missing runtime env file") + } + var data []byte + var runtimeEnv string + data, readErr := ioutil.ReadFile(file) + if readErr != nil { + return "", readErr + } + envStrings := strings.Split(string(data), "\n") + for _, envItem := range envStrings { + envItem = strings.TrimSuffix(envItem, "\r") + envKeyValue := strings.Split(envItem, "=") + if strings.EqualFold(strings.TrimSpace(envKeyValue[0]), key) { + runtimeEnv = strings.TrimSpace(envKeyValue[1]) + } + } + return runtimeEnv, nil +} + +// GetGOBIN returns GOBIN environment variable as a string. It will NOT be empty. +func GetGOBIN() string { + // The one set by user explicitly by `export GOBIN=/path` or `env GOBIN=/path command` + GOBIN := os.Getenv("GOBIN") + if GOBIN == "" { + var err error + // The one set by user by running `go env -w GOBIN=/path` + GOBIN, err = GetRuntimeEnv("GOBIN") + if err != nil { + // The default one that Golang uses + return filepath.Join(build.Default.GOPATH, "bin") + } + if GOBIN == "" { + return filepath.Join(build.Default.GOPATH, "bin") + } + return GOBIN + } + return GOBIN +} + +// GetGOPATH returns GOPATH environment variable as a string. It will NOT be empty. +func GetGOPATH() string { + // The one set by user explicitly by `export GOPATH=/path` or `env GOPATH=/path command` + GOPATH := os.Getenv("GOPATH") + if GOPATH == "" { + var err error + // The one set by user by running `go env -w GOPATH=/path` + GOPATH, err = GetRuntimeEnv("GOPATH") + if err != nil { + // The default one that Golang uses + return build.Default.GOPATH + } + if GOPATH == "" { + return build.Default.GOPATH + } + return GOPATH + } + return GOPATH +} + +// GetModuleName returns the value of module in `go.mod` file. +func GetModuleName(pathToProjectRoot string) (string, error) { + var moduleName string + loopPath := pathToProjectRoot + for { + if idx := strings.LastIndex(loopPath, string(filepath.Separator)); idx >= 0 { + gomodPath := filepath.Join(loopPath, "go.mod") + gomodBytes, err := ioutil.ReadFile(gomodPath) + if err != nil { + loopPath = loopPath[:idx] + continue + } + + gomodContent := string(gomodBytes) + moduleIdx := strings.Index(gomodContent, "module ") + newLineIdx := strings.Index(gomodContent, "\n") + + if moduleIdx >= 0 { + if newLineIdx >= 0 { + moduleName = strings.TrimSpace(gomodContent[moduleIdx+6 : newLineIdx]) + moduleName = strings.TrimSuffix(moduleName, "\r") + } else { + moduleName = strings.TrimSpace(gomodContent[moduleIdx+6:]) + } + return moduleName, nil + } + return "", fmt.Errorf("can not get module path in `%s`", gomodPath) + } + break + } + return moduleName, fmt.Errorf("no `go.mod` file in every parent directory of `%s`", pathToProjectRoot) +} diff --git a/common/crypto/auth.go b/common/crypto/auth.go index d1f1187d00..2e64c8110e 100644 --- a/common/crypto/auth.go +++ b/common/crypto/auth.go @@ -248,13 +248,14 @@ func (w *AuthenticationWriter) seal(b []byte) (*buf.Buffer, error) { paddingSize = int32(w.padding.NextPaddingLen()) } - totalSize := encryptedSize + paddingSize + sizeBytes := w.sizeParser.SizeBytes() + totalSize := sizeBytes + encryptedSize + paddingSize if totalSize > buf.Size { return nil, newError("size too large: ", totalSize) } eb := buf.New() - w.sizeParser.Encode(uint16(encryptedSize+paddingSize), eb.Extend(w.sizeParser.SizeBytes())) + w.sizeParser.Encode(uint16(encryptedSize+paddingSize), eb.Extend(sizeBytes)) if _, err := w.auth.Seal(eb.Extend(encryptedSize)[:0], b); err != nil { eb.Release() return nil, err diff --git a/common/crypto/crypto.go b/common/crypto/crypto.go index d98e8dfe2b..0adb1a2a91 100644 --- a/common/crypto/crypto.go +++ b/common/crypto/crypto.go @@ -1,4 +1,4 @@ // Package crypto provides common crypto libraries for V2Ray. package crypto // import "v2ray.com/core/common/crypto" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/common/errors/errorgen/main.go b/common/errors/errorgen/main.go index 85dfeb6147..f7bbefe47e 100644 --- a/common/errors/errorgen/main.go +++ b/common/errors/errorgen/main.go @@ -5,35 +5,41 @@ import ( "log" "os" "path/filepath" + + "v2ray.com/core/common" ) -func getCurrentPkg() (string, error) { - path, err := os.Getwd() +func main() { + pwd, err := os.Getwd() if err != nil { - return "", err + fmt.Println("can not get current working directory") + os.Exit(1) + } + pkg := filepath.Base(pwd) + if pkg == "v2ray-core" { + pkg = "core" } - return filepath.Base(path), nil -} -func main() { - pkg, err := getCurrentPkg() - if err != nil { - log.Fatal("Failed to get current package: ", err.Error()) - return + moduleName, gmnErr := common.GetModuleName(pwd) + if gmnErr != nil { + fmt.Println("can not get module path", gmnErr) + os.Exit(1) } file, err := os.OpenFile("errors.generated.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644) if err != nil { log.Fatalf("Failed to generate errors.generated.go: %v", err) - return + os.Exit(1) } + defer file.Close() fmt.Fprintln(file, "package", pkg) fmt.Fprintln(file, "") - fmt.Fprintln(file, "import \"v2ray.com/core/common/errors\"") + fmt.Fprintln(file, "import \""+moduleName+"/common/errors\"") fmt.Fprintln(file, "") - fmt.Fprintln(file, "type errPathObjHolder struct {}") - fmt.Fprintln(file, "func newError(values ...interface{}) *errors.Error { return errors.New(values...).WithPathObj(errPathObjHolder{}) }") - - file.Close() + fmt.Fprintln(file, "type errPathObjHolder struct{}") + fmt.Fprintln(file, "") + fmt.Fprintln(file, "func newError(values ...interface{}) *errors.Error {") + fmt.Fprintln(file, " return errors.New(values...).WithPathObj(errPathObjHolder{})") + fmt.Fprintln(file, "}") } diff --git a/common/log/log.pb.go b/common/log/log.pb.go index 0d6daa1b95..553aece12a 100644 --- a/common/log/log.pb.go +++ b/common/log/log.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/log/log.proto + package log import ( @@ -58,11 +64,11 @@ func (x Severity) String() string { } func (Severity) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_common_log_log_proto_enumTypes[0].Descriptor() + return file_common_log_log_proto_enumTypes[0].Descriptor() } func (Severity) Type() protoreflect.EnumType { - return &file_v2ray_com_core_common_log_log_proto_enumTypes[0] + return &file_common_log_log_proto_enumTypes[0] } func (x Severity) Number() protoreflect.EnumNumber { @@ -71,44 +77,44 @@ func (x Severity) Number() protoreflect.EnumNumber { // Deprecated: Use Severity.Descriptor instead. func (Severity) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_common_log_log_proto_rawDescGZIP(), []int{0} + return file_common_log_log_proto_rawDescGZIP(), []int{0} } -var File_v2ray_com_core_common_log_log_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_log_log_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x6c, 0x6f, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f, 0x67, 0x50, - 0x01, 0x5a, 0x03, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, - 0x6f, 0x72, 0x65, 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 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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6c, 0x6f, 0x67, + 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x15, + 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_log_log_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_log_log_proto_rawDescData = file_v2ray_com_core_common_log_log_proto_rawDesc + file_common_log_log_proto_rawDescOnce sync.Once + file_common_log_log_proto_rawDescData = file_common_log_log_proto_rawDesc ) -func file_v2ray_com_core_common_log_log_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_log_log_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_log_log_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_log_log_proto_rawDescData) +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_v2ray_com_core_common_log_log_proto_rawDescData + return file_common_log_log_proto_rawDescData } -var file_v2ray_com_core_common_log_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_common_log_log_proto_goTypes = []interface{}{ +var file_common_log_log_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_log_log_proto_goTypes = []interface{}{ (Severity)(0), // 0: v2ray.core.common.log.Severity } -var file_v2ray_com_core_common_log_log_proto_depIdxs = []int32{ +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 @@ -116,27 +122,27 @@ var file_v2ray_com_core_common_log_log_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_log_log_proto_init() } -func file_v2ray_com_core_common_log_log_proto_init() { - if File_v2ray_com_core_common_log_log_proto != nil { +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_v2ray_com_core_common_log_log_proto_rawDesc, + RawDescriptor: file_common_log_log_proto_rawDesc, NumEnums: 1, NumMessages: 0, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_log_log_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_log_log_proto_depIdxs, - EnumInfos: file_v2ray_com_core_common_log_log_proto_enumTypes, + GoTypes: file_common_log_log_proto_goTypes, + DependencyIndexes: file_common_log_log_proto_depIdxs, + EnumInfos: file_common_log_log_proto_enumTypes, }.Build() - File_v2ray_com_core_common_log_log_proto = out.File - file_v2ray_com_core_common_log_log_proto_rawDesc = nil - file_v2ray_com_core_common_log_log_proto_goTypes = nil - file_v2ray_com_core_common_log_log_proto_depIdxs = nil + 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/common/log/log.proto b/common/log/log.proto index 7e1d4de599..59c893447e 100644 --- a/common/log/log.proto +++ b/common/log/log.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.common.log; option csharp_namespace = "V2Ray.Core.Common.Log"; -option go_package = "log"; +option go_package = "v2ray.com/core/common/log"; option java_package = "com.v2ray.core.common.log"; option java_multiple_files = true; @@ -13,4 +13,3 @@ enum Severity { Info = 3; Debug = 4; } - diff --git a/common/mux/client.go b/common/mux/client.go index ae9fe1b56d..9e651bbe5f 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -83,7 +83,7 @@ func (p *IncrementalWorkerPicker) findAvailable() int { return -1 } -func (p *IncrementalWorkerPicker) pickInternal() (*ClientWorker, error, bool) { +func (p *IncrementalWorkerPicker) pickInternal() (*ClientWorker, bool, error) { p.access.Lock() defer p.access.Unlock() @@ -93,14 +93,14 @@ func (p *IncrementalWorkerPicker) pickInternal() (*ClientWorker, error, bool) { if n > 1 && idx != n-1 { p.workers[n-1], p.workers[idx] = p.workers[idx], p.workers[n-1] } - return p.workers[idx], nil, false + return p.workers[idx], false, nil } p.cleanup() worker, err := p.Factory.Create() if err != nil { - return nil, err, false + return nil, false, err } p.workers = append(p.workers, worker) @@ -111,11 +111,11 @@ func (p *IncrementalWorkerPicker) pickInternal() (*ClientWorker, error, bool) { } } - return worker, nil, true + return worker, true, nil } func (p *IncrementalWorkerPicker) PickAvailable() (*ClientWorker, error) { - worker, err, start := p.pickInternal() + worker, start, err := p.pickInternal() if start { common.Must(p.cleanupTask.Start()) } diff --git a/common/mux/mux.go b/common/mux/mux.go index 306827718a..35b05a76af 100644 --- a/common/mux/mux.go +++ b/common/mux/mux.go @@ -1,3 +1,3 @@ package mux -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/common/mux/server.go b/common/mux/server.go index 48c4a23a0a..8985bdd73a 100644 --- a/common/mux/server.go +++ b/common/mux/server.go @@ -35,7 +35,7 @@ func (s *Server) Type() interface{} { return s.dispatcher.Type() } -// Dispatch impliments routing.Dispatcher +// Dispatch implements routing.Dispatcher func (s *Server) Dispatch(ctx context.Context, dest net.Destination) (*transport.Link, error) { if dest.Address != muxCoolAddress { return s.dispatcher.Dispatch(ctx, dest) diff --git a/common/net/address.pb.go b/common/net/address.pb.go index e15433c3c2..b5dc27c420 100644 --- a/common/net/address.pb.go +++ b/common/net/address.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/net/address.proto + package net import ( @@ -19,7 +25,8 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -// Address of a network host. It may be either an IP address or a domain address. +// 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 @@ -34,7 +41,7 @@ type IPOrDomain struct { func (x *IPOrDomain) Reset() { *x = IPOrDomain{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_net_address_proto_msgTypes[0] + mi := &file_common_net_address_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +54,7 @@ func (x *IPOrDomain) String() string { func (*IPOrDomain) ProtoMessage() {} func (x *IPOrDomain) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_net_address_proto_msgTypes[0] + mi := &file_common_net_address_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +67,7 @@ func (x *IPOrDomain) ProtoReflect() protoreflect.Message { // Deprecated: Use IPOrDomain.ProtoReflect.Descriptor instead. func (*IPOrDomain) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_address_proto_rawDescGZIP(), []int{0} + return file_common_net_address_proto_rawDescGZIP(), []int{0} } func (m *IPOrDomain) GetAddress() isIPOrDomain_Address { @@ -102,41 +109,41 @@ func (*IPOrDomain_Ip) isIPOrDomain_Address() {} func (*IPOrDomain_Domain) isIPOrDomain_Address() {} -var File_v2ray_com_core_common_net_address_proto protoreflect.FileDescriptor +var File_common_net_address_proto protoreflect.FileDescriptor -var file_v2ray_com_core_common_net_address_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, - 0x65, 0x74, 0x50, 0x01, 0x5a, 0x03, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, - 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_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, 0x15, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, + 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_net_address_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_net_address_proto_rawDescData = file_v2ray_com_core_common_net_address_proto_rawDesc + file_common_net_address_proto_rawDescOnce sync.Once + file_common_net_address_proto_rawDescData = file_common_net_address_proto_rawDesc ) -func file_v2ray_com_core_common_net_address_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_net_address_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_net_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_net_address_proto_rawDescData) +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_v2ray_com_core_common_net_address_proto_rawDescData + return file_common_net_address_proto_rawDescData } -var file_v2ray_com_core_common_net_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_net_address_proto_goTypes = []interface{}{ +var file_common_net_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_net_address_proto_goTypes = []interface{}{ (*IPOrDomain)(nil), // 0: v2ray.core.common.net.IPOrDomain } -var file_v2ray_com_core_common_net_address_proto_depIdxs = []int32{ +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 @@ -144,13 +151,13 @@ var file_v2ray_com_core_common_net_address_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_net_address_proto_init() } -func file_v2ray_com_core_common_net_address_proto_init() { - if File_v2ray_com_core_common_net_address_proto != nil { +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_v2ray_com_core_common_net_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_net_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IPOrDomain); i { case 0: return &v.state @@ -163,7 +170,7 @@ func file_v2ray_com_core_common_net_address_proto_init() { } } } - file_v2ray_com_core_common_net_address_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_common_net_address_proto_msgTypes[0].OneofWrappers = []interface{}{ (*IPOrDomain_Ip)(nil), (*IPOrDomain_Domain)(nil), } @@ -171,18 +178,18 @@ func file_v2ray_com_core_common_net_address_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_net_address_proto_rawDesc, + RawDescriptor: file_common_net_address_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_net_address_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_net_address_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_net_address_proto_msgTypes, + GoTypes: file_common_net_address_proto_goTypes, + DependencyIndexes: file_common_net_address_proto_depIdxs, + MessageInfos: file_common_net_address_proto_msgTypes, }.Build() - File_v2ray_com_core_common_net_address_proto = out.File - file_v2ray_com_core_common_net_address_proto_rawDesc = nil - file_v2ray_com_core_common_net_address_proto_goTypes = nil - file_v2ray_com_core_common_net_address_proto_depIdxs = nil + 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/common/net/address.proto b/common/net/address.proto index 07f106d0aa..2149030f78 100644 --- a/common/net/address.proto +++ b/common/net/address.proto @@ -2,11 +2,12 @@ syntax = "proto3"; package v2ray.core.common.net; option csharp_namespace = "V2Ray.Core.Common.Net"; -option go_package = "net"; +option go_package = "v2ray.com/core/common/net"; option java_package = "com.v2ray.core.common.net"; option java_multiple_files = true; -// Address of a network host. It may be either an IP address or a domain address. +// Address of a network host. It may be either an IP address or a domain +// address. message IPOrDomain { oneof address { // IP address. Must by either 4 or 16 bytes. diff --git a/common/net/destination.pb.go b/common/net/destination.pb.go index 5d6435cd90..c648bf0b18 100644 --- a/common/net/destination.pb.go +++ b/common/net/destination.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/net/destination.proto + package net import ( @@ -33,7 +39,7 @@ type Endpoint struct { func (x *Endpoint) Reset() { *x = Endpoint{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_net_destination_proto_msgTypes[0] + mi := &file_common_net_destination_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +52,7 @@ func (x *Endpoint) String() string { func (*Endpoint) ProtoMessage() {} func (x *Endpoint) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_net_destination_proto_msgTypes[0] + mi := &file_common_net_destination_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +65,7 @@ func (x *Endpoint) ProtoReflect() protoreflect.Message { // Deprecated: Use Endpoint.ProtoReflect.Descriptor instead. func (*Endpoint) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_destination_proto_rawDescGZIP(), []int{0} + return file_common_net_destination_proto_rawDescGZIP(), []int{0} } func (x *Endpoint) GetNetwork() Network { @@ -83,54 +89,52 @@ func (x *Endpoint) GetPort() uint32 { return 0 } -var File_v2ray_com_core_common_net_destination_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_net_destination_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x15, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6e, 0x65, 0x74, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x27, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x95, 0x01, 0x0a, 0x08, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x3b, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, - 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x03, 0x6e, - 0x65, 0x74, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x15, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x95, 0x01, 0x0a, 0x08, 0x45, 0x6e, + 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, + 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x15, 0x56, 0x32, + 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_net_destination_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_net_destination_proto_rawDescData = file_v2ray_com_core_common_net_destination_proto_rawDesc + file_common_net_destination_proto_rawDescOnce sync.Once + file_common_net_destination_proto_rawDescData = file_common_net_destination_proto_rawDesc ) -func file_v2ray_com_core_common_net_destination_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_net_destination_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_net_destination_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_net_destination_proto_rawDescData) +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_v2ray_com_core_common_net_destination_proto_rawDescData + return file_common_net_destination_proto_rawDescData } -var file_v2ray_com_core_common_net_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_net_destination_proto_goTypes = []interface{}{ +var file_common_net_destination_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_net_destination_proto_goTypes = []interface{}{ (*Endpoint)(nil), // 0: v2ray.core.common.net.Endpoint (Network)(0), // 1: v2ray.core.common.net.Network (*IPOrDomain)(nil), // 2: v2ray.core.common.net.IPOrDomain } -var file_v2ray_com_core_common_net_destination_proto_depIdxs = []int32{ +var file_common_net_destination_proto_depIdxs = []int32{ 1, // 0: v2ray.core.common.net.Endpoint.network:type_name -> v2ray.core.common.net.Network 2, // 1: v2ray.core.common.net.Endpoint.address:type_name -> v2ray.core.common.net.IPOrDomain 2, // [2:2] is the sub-list for method output_type @@ -140,15 +144,15 @@ var file_v2ray_com_core_common_net_destination_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_net_destination_proto_init() } -func file_v2ray_com_core_common_net_destination_proto_init() { - if File_v2ray_com_core_common_net_destination_proto != nil { +func init() { file_common_net_destination_proto_init() } +func file_common_net_destination_proto_init() { + if File_common_net_destination_proto != nil { return } - file_v2ray_com_core_common_net_network_proto_init() - file_v2ray_com_core_common_net_address_proto_init() + file_common_net_network_proto_init() + file_common_net_address_proto_init() if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_common_net_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_net_destination_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Endpoint); i { case 0: return &v.state @@ -165,18 +169,18 @@ func file_v2ray_com_core_common_net_destination_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_net_destination_proto_rawDesc, + RawDescriptor: file_common_net_destination_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_net_destination_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_net_destination_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_net_destination_proto_msgTypes, + GoTypes: file_common_net_destination_proto_goTypes, + DependencyIndexes: file_common_net_destination_proto_depIdxs, + MessageInfos: file_common_net_destination_proto_msgTypes, }.Build() - File_v2ray_com_core_common_net_destination_proto = out.File - file_v2ray_com_core_common_net_destination_proto_rawDesc = nil - file_v2ray_com_core_common_net_destination_proto_goTypes = nil - file_v2ray_com_core_common_net_destination_proto_depIdxs = nil + 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/common/net/destination.proto b/common/net/destination.proto index c9a0b2afd7..11f66960c0 100644 --- a/common/net/destination.proto +++ b/common/net/destination.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.common.net; option csharp_namespace = "V2Ray.Core.Common.Net"; -option go_package = "net"; +option go_package = "v2ray.com/core/common/net"; option java_package = "com.v2ray.core.common.net"; option java_multiple_files = true; -import "v2ray.com/core/common/net/network.proto"; -import "v2ray.com/core/common/net/address.proto"; +import "common/net/network.proto"; +import "common/net/address.proto"; // Endpoint of a network connection. message Endpoint { diff --git a/common/net/net.go b/common/net/net.go index da929836c7..172e516db1 100644 --- a/common/net/net.go +++ b/common/net/net.go @@ -1,4 +1,4 @@ // Package net is a drop-in replacement to Golang's net package, with some more functionalities. package net // import "v2ray.com/core/common/net" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/common/net/network.pb.go b/common/net/network.pb.go index a3d0fb498e..28ab9ba667 100644 --- a/common/net/network.pb.go +++ b/common/net/network.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/net/network.proto + package net import ( @@ -56,11 +62,11 @@ func (x Network) String() string { } func (Network) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_common_net_network_proto_enumTypes[0].Descriptor() + return file_common_net_network_proto_enumTypes[0].Descriptor() } func (Network) Type() protoreflect.EnumType { - return &file_v2ray_com_core_common_net_network_proto_enumTypes[0] + return &file_common_net_network_proto_enumTypes[0] } func (x Network) Number() protoreflect.EnumNumber { @@ -69,7 +75,7 @@ func (x Network) Number() protoreflect.EnumNumber { // Deprecated: Use Network.Descriptor instead. func (Network) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_network_proto_rawDescGZIP(), []int{0} + return file_common_net_network_proto_rawDescGZIP(), []int{0} } // NetworkList is a list of Networks. @@ -84,7 +90,7 @@ type NetworkList struct { func (x *NetworkList) Reset() { *x = NetworkList{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_net_network_proto_msgTypes[0] + mi := &file_common_net_network_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -97,7 +103,7 @@ func (x *NetworkList) String() string { func (*NetworkList) ProtoMessage() {} func (x *NetworkList) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_net_network_proto_msgTypes[0] + mi := &file_common_net_network_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -110,7 +116,7 @@ func (x *NetworkList) ProtoReflect() protoreflect.Message { // Deprecated: Use NetworkList.ProtoReflect.Descriptor instead. func (*NetworkList) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_network_proto_rawDescGZIP(), []int{0} + return file_common_net_network_proto_rawDescGZIP(), []int{0} } func (x *NetworkList) GetNetwork() []Network { @@ -120,47 +126,47 @@ func (x *NetworkList) GetNetwork() []Network { return nil } -var File_v2ray_com_core_common_net_network_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_net_network_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, - 0x22, 0x47, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, - 0x38, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x38, 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, 0x42, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, - 0x50, 0x01, 0x5a, 0x03, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, - 0x43, 0x6f, 0x72, 0x65, 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 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, 0x15, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, + 0x74, 0x22, 0x47, 0x0a, 0x0b, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x38, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x38, 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, 0x42, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, + 0x74, 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, + 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_net_network_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_net_network_proto_rawDescData = file_v2ray_com_core_common_net_network_proto_rawDesc + file_common_net_network_proto_rawDescOnce sync.Once + file_common_net_network_proto_rawDescData = file_common_net_network_proto_rawDesc ) -func file_v2ray_com_core_common_net_network_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_net_network_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_net_network_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_net_network_proto_rawDescData) +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_v2ray_com_core_common_net_network_proto_rawDescData + return file_common_net_network_proto_rawDescData } -var file_v2ray_com_core_common_net_network_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_common_net_network_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_net_network_proto_goTypes = []interface{}{ +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: v2ray.core.common.net.Network (*NetworkList)(nil), // 1: v2ray.core.common.net.NetworkList } -var file_v2ray_com_core_common_net_network_proto_depIdxs = []int32{ +var file_common_net_network_proto_depIdxs = []int32{ 0, // 0: v2ray.core.common.net.NetworkList.network:type_name -> v2ray.core.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 @@ -169,13 +175,13 @@ var file_v2ray_com_core_common_net_network_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_net_network_proto_init() } -func file_v2ray_com_core_common_net_network_proto_init() { - if File_v2ray_com_core_common_net_network_proto != nil { +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_v2ray_com_core_common_net_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_net_network_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NetworkList); i { case 0: return &v.state @@ -192,19 +198,19 @@ func file_v2ray_com_core_common_net_network_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_net_network_proto_rawDesc, + RawDescriptor: file_common_net_network_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_net_network_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_net_network_proto_depIdxs, - EnumInfos: file_v2ray_com_core_common_net_network_proto_enumTypes, - MessageInfos: file_v2ray_com_core_common_net_network_proto_msgTypes, + 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_v2ray_com_core_common_net_network_proto = out.File - file_v2ray_com_core_common_net_network_proto_rawDesc = nil - file_v2ray_com_core_common_net_network_proto_goTypes = nil - file_v2ray_com_core_common_net_network_proto_depIdxs = nil + 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/common/net/network.proto b/common/net/network.proto index 3915091c0d..adaca5fb19 100644 --- a/common/net/network.proto +++ b/common/net/network.proto @@ -2,14 +2,14 @@ syntax = "proto3"; package v2ray.core.common.net; option csharp_namespace = "V2Ray.Core.Common.Net"; -option go_package = "net"; +option go_package = "v2ray.com/core/common/net"; option java_package = "com.v2ray.core.common.net"; option java_multiple_files = true; enum Network { Unknown = 0; - RawTCP = 1 [deprecated=true]; + RawTCP = 1 [deprecated = true]; TCP = 2; UDP = 3; } diff --git a/common/net/port.go b/common/net/port.go index e5f5cd349f..2a0bf63705 100644 --- a/common/net/port.go +++ b/common/net/port.go @@ -44,17 +44,17 @@ func (p Port) String() string { } // FromPort returns the beginning port of this PortRange. -func (p PortRange) FromPort() Port { +func (p *PortRange) FromPort() Port { return Port(p.From) } // ToPort returns the end port of this PortRange. -func (p PortRange) ToPort() Port { +func (p *PortRange) ToPort() Port { return Port(p.To) } // Contains returns true if the given port is within the range of a PortRange. -func (p PortRange) Contains(port Port) bool { +func (p *PortRange) Contains(port Port) bool { return p.FromPort() <= port && port <= p.ToPort() } diff --git a/common/net/port.pb.go b/common/net/port.pb.go index 92eecb7367..61f933aed9 100644 --- a/common/net/port.pb.go +++ b/common/net/port.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/net/port.proto + package net import ( @@ -34,7 +40,7 @@ type PortRange struct { func (x *PortRange) Reset() { *x = PortRange{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_net_port_proto_msgTypes[0] + mi := &file_common_net_port_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +53,7 @@ func (x *PortRange) String() string { func (*PortRange) ProtoMessage() {} func (x *PortRange) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_net_port_proto_msgTypes[0] + mi := &file_common_net_port_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -60,7 +66,7 @@ func (x *PortRange) ProtoReflect() protoreflect.Message { // Deprecated: Use PortRange.ProtoReflect.Descriptor instead. func (*PortRange) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_port_proto_rawDescGZIP(), []int{0} + return file_common_net_port_proto_rawDescGZIP(), []int{0} } func (x *PortRange) GetFrom() uint32 { @@ -89,7 +95,7 @@ type PortList struct { func (x *PortList) Reset() { *x = PortList{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_net_port_proto_msgTypes[1] + mi := &file_common_net_port_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +108,7 @@ func (x *PortList) String() string { func (*PortList) ProtoMessage() {} func (x *PortList) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_net_port_proto_msgTypes[1] + mi := &file_common_net_port_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +121,7 @@ func (x *PortList) ProtoReflect() protoreflect.Message { // Deprecated: Use PortList.ProtoReflect.Descriptor instead. func (*PortList) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_net_port_proto_rawDescGZIP(), []int{1} + return file_common_net_port_proto_rawDescGZIP(), []int{1} } func (x *PortList) GetRange() []*PortRange { @@ -125,45 +131,45 @@ func (x *PortList) GetRange() []*PortRange { return nil } -var File_v2ray_com_core_common_net_port_proto protoreflect.FileDescriptor +var File_common_net_port_proto protoreflect.FileDescriptor -var file_v2ray_com_core_common_net_port_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0x2f, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x42, - 0x0a, 0x08, 0x50, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, 0x61, - 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, - 0x01, 0x5a, 0x03, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, - 0x6f, 0x72, 0x65, 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_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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, + 0x42, 0x0a, 0x08, 0x50, 0x6f, 0x72, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x05, 0x72, + 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, + 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x15, + 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_net_port_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_net_port_proto_rawDescData = file_v2ray_com_core_common_net_port_proto_rawDesc + file_common_net_port_proto_rawDescOnce sync.Once + file_common_net_port_proto_rawDescData = file_common_net_port_proto_rawDesc ) -func file_v2ray_com_core_common_net_port_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_net_port_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_net_port_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_net_port_proto_rawDescData) +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_v2ray_com_core_common_net_port_proto_rawDescData + return file_common_net_port_proto_rawDescData } -var file_v2ray_com_core_common_net_port_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_common_net_port_proto_goTypes = []interface{}{ +var file_common_net_port_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_common_net_port_proto_goTypes = []interface{}{ (*PortRange)(nil), // 0: v2ray.core.common.net.PortRange (*PortList)(nil), // 1: v2ray.core.common.net.PortList } -var file_v2ray_com_core_common_net_port_proto_depIdxs = []int32{ +var file_common_net_port_proto_depIdxs = []int32{ 0, // 0: v2ray.core.common.net.PortList.range:type_name -> v2ray.core.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 @@ -172,13 +178,13 @@ var file_v2ray_com_core_common_net_port_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_net_port_proto_init() } -func file_v2ray_com_core_common_net_port_proto_init() { - if File_v2ray_com_core_common_net_port_proto != nil { +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_v2ray_com_core_common_net_port_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_net_port_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortRange); i { case 0: return &v.state @@ -190,7 +196,7 @@ func file_v2ray_com_core_common_net_port_proto_init() { return nil } } - file_v2ray_com_core_common_net_port_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_common_net_port_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PortList); i { case 0: return &v.state @@ -207,18 +213,18 @@ func file_v2ray_com_core_common_net_port_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_net_port_proto_rawDesc, + RawDescriptor: file_common_net_port_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_net_port_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_net_port_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_net_port_proto_msgTypes, + GoTypes: file_common_net_port_proto_goTypes, + DependencyIndexes: file_common_net_port_proto_depIdxs, + MessageInfos: file_common_net_port_proto_msgTypes, }.Build() - File_v2ray_com_core_common_net_port_proto = out.File - file_v2ray_com_core_common_net_port_proto_rawDesc = nil - file_v2ray_com_core_common_net_port_proto_goTypes = nil - file_v2ray_com_core_common_net_port_proto_depIdxs = nil + 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/common/net/port.proto b/common/net/port.proto index eeffa02e3e..bed263eb8d 100644 --- a/common/net/port.proto +++ b/common/net/port.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.common.net; option csharp_namespace = "V2Ray.Core.Common.Net"; -option go_package = "net"; +option go_package = "v2ray.com/core/common/net"; option java_package = "com.v2ray.core.common.net"; option java_multiple_files = true; diff --git a/common/platform/ctlcmd/ctlcmd.go b/common/platform/ctlcmd/ctlcmd.go index 1fad1e74e6..3ee617bde9 100644 --- a/common/platform/ctlcmd/ctlcmd.go +++ b/common/platform/ctlcmd/ctlcmd.go @@ -10,7 +10,7 @@ import ( "v2ray.com/core/common/platform" ) -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen func Run(args []string, input io.Reader) (buf.MultiBuffer, error) { v2ctl := platform.GetToolLocation("v2ctl") diff --git a/common/platform/others.go b/common/platform/others.go index e93f5af6b9..e526f498d0 100644 --- a/common/platform/others.go +++ b/common/platform/others.go @@ -20,3 +20,25 @@ func GetToolLocation(file string) string { toolPath := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecutableDir) return filepath.Join(toolPath, file) } + +// GetAssetLocation search for `file` in certain locations +func GetAssetLocation(file string) string { + const name = "v2ray.location.asset" + assetPath := NewEnvFlag(name).GetValue(getExecutableDir) + defPath := filepath.Join(assetPath, file) + for _, p := range []string{ + defPath, + filepath.Join("/usr/local/share/v2ray/", file), + filepath.Join("/usr/share/v2ray/", file), + } { + if _, err := os.Stat(p); os.IsNotExist(err) { + continue + } + + // asset found + return p + } + + // asset not found, let the caller throw out the error + return defPath +} diff --git a/common/platform/platform.go b/common/platform/platform.go index b57a98fd7f..c0bf8c20b6 100644 --- a/common/platform/platform.go +++ b/common/platform/platform.go @@ -66,12 +66,6 @@ func getExecutableSubDir(dir string) func() string { } } -func GetAssetLocation(file string) string { - const name = "v2ray.location.asset" - assetPath := NewEnvFlag(name).GetValue(getExecutableDir) - return filepath.Join(assetPath, file) -} - func GetPluginDirectory() string { const name = "v2ray.location.plugin" pluginDir := NewEnvFlag(name).GetValue(getExecutableSubDir("plugins")) diff --git a/common/platform/windows.go b/common/platform/windows.go index c311ef5c0b..454a24063f 100644 --- a/common/platform/windows.go +++ b/common/platform/windows.go @@ -18,3 +18,10 @@ func GetToolLocation(file string) string { toolPath := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecutableDir) return filepath.Join(toolPath, file+".exe") } + +// GetAssetLocation search for `file` in the excutable dir +func GetAssetLocation(file string) string { + const name = "v2ray.location.asset" + assetPath := NewEnvFlag(name).GetValue(getExecutableDir) + return filepath.Join(assetPath, file) +} diff --git a/common/protocol/headers.pb.go b/common/protocol/headers.pb.go index cabdb0bcc1..88ab46a425 100644 --- a/common/protocol/headers.pb.go +++ b/common/protocol/headers.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/protocol/headers.proto + package protocol import ( @@ -61,11 +67,11 @@ func (x SecurityType) String() string { } func (SecurityType) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_common_protocol_headers_proto_enumTypes[0].Descriptor() + return file_common_protocol_headers_proto_enumTypes[0].Descriptor() } func (SecurityType) Type() protoreflect.EnumType { - return &file_v2ray_com_core_common_protocol_headers_proto_enumTypes[0] + return &file_common_protocol_headers_proto_enumTypes[0] } func (x SecurityType) Number() protoreflect.EnumNumber { @@ -74,7 +80,7 @@ func (x SecurityType) Number() protoreflect.EnumNumber { // Deprecated: Use SecurityType.Descriptor instead. func (SecurityType) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_common_protocol_headers_proto_rawDescGZIP(), []int{0} + return file_common_protocol_headers_proto_rawDescGZIP(), []int{0} } type SecurityConfig struct { @@ -88,7 +94,7 @@ type SecurityConfig struct { func (x *SecurityConfig) Reset() { *x = SecurityConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_protocol_headers_proto_msgTypes[0] + mi := &file_common_protocol_headers_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -101,7 +107,7 @@ func (x *SecurityConfig) String() string { func (*SecurityConfig) ProtoMessage() {} func (x *SecurityConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_protocol_headers_proto_msgTypes[0] + mi := &file_common_protocol_headers_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -114,7 +120,7 @@ func (x *SecurityConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SecurityConfig.ProtoReflect.Descriptor instead. func (*SecurityConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_protocol_headers_proto_rawDescGZIP(), []int{0} + return file_common_protocol_headers_proto_rawDescGZIP(), []int{0} } func (x *SecurityConfig) GetType() SecurityType { @@ -124,52 +130,52 @@ func (x *SecurityConfig) GetType() SecurityType { return SecurityType_UNKNOWN } -var File_v2ray_com_core_common_protocol_headers_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_protocol_headers_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1a, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x4e, 0x0a, 0x0e, 0x53, 0x65, - 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x62, 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, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x47, 0x41, 0x43, - 0x59, 0x10, 0x01, 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, 0x42, 0x49, - 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x50, 0x01, 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, - 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, + 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x22, 0x4e, 0x0a, 0x0e, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3c, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x62, 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, 0x0a, 0x0a, 0x06, 0x4c, 0x45, 0x47, 0x41, + 0x43, 0x59, 0x10, 0x01, 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, 0x42, + 0x5f, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, + 0x6c, 0x50, 0x01, 0x5a, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, + 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_v2ray_com_core_common_protocol_headers_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_protocol_headers_proto_rawDescData = file_v2ray_com_core_common_protocol_headers_proto_rawDesc + file_common_protocol_headers_proto_rawDescOnce sync.Once + file_common_protocol_headers_proto_rawDescData = file_common_protocol_headers_proto_rawDesc ) -func file_v2ray_com_core_common_protocol_headers_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_protocol_headers_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_protocol_headers_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_protocol_headers_proto_rawDescData) +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_v2ray_com_core_common_protocol_headers_proto_rawDescData + return file_common_protocol_headers_proto_rawDescData } -var file_v2ray_com_core_common_protocol_headers_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_common_protocol_headers_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_protocol_headers_proto_goTypes = []interface{}{ +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: v2ray.core.common.protocol.SecurityType (*SecurityConfig)(nil), // 1: v2ray.core.common.protocol.SecurityConfig } -var file_v2ray_com_core_common_protocol_headers_proto_depIdxs = []int32{ +var file_common_protocol_headers_proto_depIdxs = []int32{ 0, // 0: v2ray.core.common.protocol.SecurityConfig.type:type_name -> v2ray.core.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 @@ -178,13 +184,13 @@ var file_v2ray_com_core_common_protocol_headers_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_protocol_headers_proto_init() } -func file_v2ray_com_core_common_protocol_headers_proto_init() { - if File_v2ray_com_core_common_protocol_headers_proto != nil { +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_v2ray_com_core_common_protocol_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_protocol_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecurityConfig); i { case 0: return &v.state @@ -201,19 +207,19 @@ func file_v2ray_com_core_common_protocol_headers_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_protocol_headers_proto_rawDesc, + RawDescriptor: file_common_protocol_headers_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_protocol_headers_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_protocol_headers_proto_depIdxs, - EnumInfos: file_v2ray_com_core_common_protocol_headers_proto_enumTypes, - MessageInfos: file_v2ray_com_core_common_protocol_headers_proto_msgTypes, + 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_v2ray_com_core_common_protocol_headers_proto = out.File - file_v2ray_com_core_common_protocol_headers_proto_rawDesc = nil - file_v2ray_com_core_common_protocol_headers_proto_goTypes = nil - file_v2ray_com_core_common_protocol_headers_proto_depIdxs = nil + 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/common/protocol/headers.proto b/common/protocol/headers.proto index ea37d48c4e..907947d3f7 100644 --- a/common/protocol/headers.proto +++ b/common/protocol/headers.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.common.protocol; option csharp_namespace = "V2Ray.Core.Common.Protocol"; -option go_package = "protocol"; +option go_package = "v2ray.com/core/common/protocol"; option java_package = "com.v2ray.core.common.protocol"; option java_multiple_files = true; diff --git a/common/protocol/protocol.go b/common/protocol/protocol.go index 8a7851b208..41d99d0a83 100644 --- a/common/protocol/protocol.go +++ b/common/protocol/protocol.go @@ -1,3 +1,3 @@ package protocol // import "v2ray.com/core/common/protocol" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/common/protocol/server_spec.go b/common/protocol/server_spec.go index bcf05d6913..d462b4406e 100644 --- a/common/protocol/server_spec.go +++ b/common/protocol/server_spec.go @@ -58,7 +58,7 @@ func NewServerSpec(dest net.Destination, valid ValidationStrategy, users ...*Mem } } -func NewServerSpecFromPB(spec ServerEndpoint) (*ServerSpec, error) { +func NewServerSpecFromPB(spec *ServerEndpoint) (*ServerSpec, error) { dest := net.TCPDestination(spec.Address.AsAddress(), net.Port(spec.Port)) mUsers := make([]*MemoryUser, len(spec.User)) for idx, u := range spec.User { diff --git a/common/protocol/server_spec.pb.go b/common/protocol/server_spec.pb.go index 9d00d4d2e4..c7c24ab773 100644 --- a/common/protocol/server_spec.pb.go +++ b/common/protocol/server_spec.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/protocol/server_spec.proto + package protocol import ( @@ -33,7 +39,7 @@ type ServerEndpoint struct { func (x *ServerEndpoint) Reset() { *x = ServerEndpoint{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_protocol_server_spec_proto_msgTypes[0] + mi := &file_common_protocol_server_spec_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +52,7 @@ func (x *ServerEndpoint) String() string { func (*ServerEndpoint) ProtoMessage() {} func (x *ServerEndpoint) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_protocol_server_spec_proto_msgTypes[0] + 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 { @@ -59,7 +65,7 @@ func (x *ServerEndpoint) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerEndpoint.ProtoReflect.Descriptor instead. func (*ServerEndpoint) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_protocol_server_spec_proto_rawDescGZIP(), []int{0} + return file_common_protocol_server_spec_proto_rawDescGZIP(), []int{0} } func (x *ServerEndpoint) GetAddress() *net.IPOrDomain { @@ -83,55 +89,54 @@ func (x *ServerEndpoint) GetUser() []*User { return nil } -var File_v2ray_com_core_common_protocol_server_spec_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_protocol_server_spec_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0x27, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x97, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, - 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, +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, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x97, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, + 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, + 0x5f, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x49, 0x0a, 0x1e, - 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, - 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x50, 0x01, 0x5a, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, + 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_v2ray_com_core_common_protocol_server_spec_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_protocol_server_spec_proto_rawDescData = file_v2ray_com_core_common_protocol_server_spec_proto_rawDesc + 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_v2ray_com_core_common_protocol_server_spec_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_protocol_server_spec_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_protocol_server_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_protocol_server_spec_proto_rawDescData) +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_v2ray_com_core_common_protocol_server_spec_proto_rawDescData + return file_common_protocol_server_spec_proto_rawDescData } -var file_v2ray_com_core_common_protocol_server_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_protocol_server_spec_proto_goTypes = []interface{}{ +var file_common_protocol_server_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_protocol_server_spec_proto_goTypes = []interface{}{ (*ServerEndpoint)(nil), // 0: v2ray.core.common.protocol.ServerEndpoint (*net.IPOrDomain)(nil), // 1: v2ray.core.common.net.IPOrDomain (*User)(nil), // 2: v2ray.core.common.protocol.User } -var file_v2ray_com_core_common_protocol_server_spec_proto_depIdxs = []int32{ +var file_common_protocol_server_spec_proto_depIdxs = []int32{ 1, // 0: v2ray.core.common.protocol.ServerEndpoint.address:type_name -> v2ray.core.common.net.IPOrDomain 2, // 1: v2ray.core.common.protocol.ServerEndpoint.user:type_name -> v2ray.core.common.protocol.User 2, // [2:2] is the sub-list for method output_type @@ -141,14 +146,14 @@ var file_v2ray_com_core_common_protocol_server_spec_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_protocol_server_spec_proto_init() } -func file_v2ray_com_core_common_protocol_server_spec_proto_init() { - if File_v2ray_com_core_common_protocol_server_spec_proto != nil { +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_v2ray_com_core_common_protocol_user_proto_init() + file_common_protocol_user_proto_init() if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_common_protocol_server_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_protocol_server_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerEndpoint); i { case 0: return &v.state @@ -165,18 +170,18 @@ func file_v2ray_com_core_common_protocol_server_spec_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_protocol_server_spec_proto_rawDesc, + RawDescriptor: file_common_protocol_server_spec_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_protocol_server_spec_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_protocol_server_spec_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_protocol_server_spec_proto_msgTypes, + 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_v2ray_com_core_common_protocol_server_spec_proto = out.File - file_v2ray_com_core_common_protocol_server_spec_proto_rawDesc = nil - file_v2ray_com_core_common_protocol_server_spec_proto_goTypes = nil - file_v2ray_com_core_common_protocol_server_spec_proto_depIdxs = nil + 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/common/protocol/server_spec.proto b/common/protocol/server_spec.proto index 9361401056..7cd6cb7839 100644 --- a/common/protocol/server_spec.proto +++ b/common/protocol/server_spec.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.common.protocol; option csharp_namespace = "V2Ray.Core.Common.Protocol"; -option go_package = "protocol"; +option go_package = "v2ray.com/core/common/protocol"; option java_package = "com.v2ray.core.common.protocol"; option java_multiple_files = true; -import "v2ray.com/core/common/net/address.proto"; -import "v2ray.com/core/common/protocol/user.proto"; +import "common/net/address.proto"; +import "common/protocol/user.proto"; message ServerEndpoint { v2ray.core.common.net.IPOrDomain address = 1; diff --git a/common/protocol/tls/cert/cert.go b/common/protocol/tls/cert/cert.go index 6c2b8bc3b8..8f96db00e1 100644 --- a/common/protocol/tls/cert/cert.go +++ b/common/protocol/tls/cert/cert.go @@ -15,7 +15,7 @@ import ( "v2ray.com/core/common" ) -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen type Certificate struct { // Cerificate in ASN.1 DER format diff --git a/common/protocol/user.pb.go b/common/protocol/user.pb.go index e9c12bad0f..9e9bf17065 100644 --- a/common/protocol/user.pb.go +++ b/common/protocol/user.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/protocol/user.proto + package protocol import ( @@ -28,14 +34,15 @@ type User struct { 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. + // 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_v2ray_com_core_common_protocol_user_proto_msgTypes[0] + mi := &file_common_protocol_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +55,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_protocol_user_proto_msgTypes[0] + mi := &file_common_protocol_user_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -61,7 +68,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_protocol_user_proto_rawDescGZIP(), []int{0} + return file_common_protocol_user_proto_rawDescGZIP(), []int{0} } func (x *User) GetLevel() uint32 { @@ -85,50 +92,49 @@ func (x *User) GetAccount() *serial.TypedMessage { return nil } -var File_v2ray_com_core_common_protocol_user_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_protocol_user_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1a, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x74, 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, 0x40, 0x0a, - 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x49, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x50, 0x01, 0x5a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, - 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x1a, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x74, 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, + 0x40, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5f, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x72, 0x65, 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_v2ray_com_core_common_protocol_user_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_protocol_user_proto_rawDescData = file_v2ray_com_core_common_protocol_user_proto_rawDesc + file_common_protocol_user_proto_rawDescOnce sync.Once + file_common_protocol_user_proto_rawDescData = file_common_protocol_user_proto_rawDesc ) -func file_v2ray_com_core_common_protocol_user_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_protocol_user_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_protocol_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_protocol_user_proto_rawDescData) +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_v2ray_com_core_common_protocol_user_proto_rawDescData + return file_common_protocol_user_proto_rawDescData } -var file_v2ray_com_core_common_protocol_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_protocol_user_proto_goTypes = []interface{}{ +var file_common_protocol_user_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_protocol_user_proto_goTypes = []interface{}{ (*User)(nil), // 0: v2ray.core.common.protocol.User (*serial.TypedMessage)(nil), // 1: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_common_protocol_user_proto_depIdxs = []int32{ +var file_common_protocol_user_proto_depIdxs = []int32{ 1, // 0: v2ray.core.common.protocol.User.account:type_name -> v2ray.core.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 @@ -137,13 +143,13 @@ var file_v2ray_com_core_common_protocol_user_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_protocol_user_proto_init() } -func file_v2ray_com_core_common_protocol_user_proto_init() { - if File_v2ray_com_core_common_protocol_user_proto != nil { +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_v2ray_com_core_common_protocol_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_protocol_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -160,18 +166,18 @@ func file_v2ray_com_core_common_protocol_user_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_protocol_user_proto_rawDesc, + RawDescriptor: file_common_protocol_user_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_protocol_user_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_protocol_user_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_protocol_user_proto_msgTypes, + GoTypes: file_common_protocol_user_proto_goTypes, + DependencyIndexes: file_common_protocol_user_proto_depIdxs, + MessageInfos: file_common_protocol_user_proto_msgTypes, }.Build() - File_v2ray_com_core_common_protocol_user_proto = out.File - file_v2ray_com_core_common_protocol_user_proto_rawDesc = nil - file_v2ray_com_core_common_protocol_user_proto_goTypes = nil - file_v2ray_com_core_common_protocol_user_proto_depIdxs = nil + 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/common/protocol/user.proto b/common/protocol/user.proto index 56e5d0249c..41d1b34ec8 100644 --- a/common/protocol/user.proto +++ b/common/protocol/user.proto @@ -2,17 +2,18 @@ syntax = "proto3"; package v2ray.core.common.protocol; option csharp_namespace = "V2Ray.Core.Common.Protocol"; -option go_package = "protocol"; +option go_package = "v2ray.com/core/common/protocol"; option java_package = "com.v2ray.core.common.protocol"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; // User is a generic user for all procotols. message User { uint32 level = 1; string email = 2; - // Protocol specific account information. Must be the account proto in one of the proxies. + // Protocol specific account information. Must be the account proto in one of + // the proxies. v2ray.core.common.serial.TypedMessage account = 3; -} \ No newline at end of file +} diff --git a/common/retry/retry.go b/common/retry/retry.go index c719e26745..30aed1f1ee 100644 --- a/common/retry/retry.go +++ b/common/retry/retry.go @@ -1,6 +1,6 @@ package retry // import "v2ray.com/core/common/retry" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "time" diff --git a/common/serial/typed_message.pb.go b/common/serial/typed_message.pb.go index 0a1fe69182..b16ae77fd4 100644 --- a/common/serial/typed_message.pb.go +++ b/common/serial/typed_message.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: common/serial/typed_message.proto + package serial import ( @@ -34,7 +40,7 @@ type TypedMessage struct { func (x *TypedMessage) Reset() { *x = TypedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_common_serial_typed_message_proto_msgTypes[0] + mi := &file_common_serial_typed_message_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +53,7 @@ func (x *TypedMessage) String() string { func (*TypedMessage) ProtoMessage() {} func (x *TypedMessage) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_common_serial_typed_message_proto_msgTypes[0] + 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 { @@ -60,7 +66,7 @@ func (x *TypedMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use TypedMessage.ProtoReflect.Descriptor instead. func (*TypedMessage) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_common_serial_typed_message_proto_rawDescGZIP(), []int{0} + return file_common_serial_typed_message_proto_rawDescGZIP(), []int{0} } func (x *TypedMessage) GetType() string { @@ -77,42 +83,42 @@ func (x *TypedMessage) GetValue() []byte { return nil } -var File_v2ray_com_core_common_serial_typed_message_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_common_serial_typed_message_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x18, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x06, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, - 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x18, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x59, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_common_serial_typed_message_proto_rawDescOnce sync.Once - file_v2ray_com_core_common_serial_typed_message_proto_rawDescData = file_v2ray_com_core_common_serial_typed_message_proto_rawDesc + 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_v2ray_com_core_common_serial_typed_message_proto_rawDescGZIP() []byte { - file_v2ray_com_core_common_serial_typed_message_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_common_serial_typed_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_common_serial_typed_message_proto_rawDescData) +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_v2ray_com_core_common_serial_typed_message_proto_rawDescData + return file_common_serial_typed_message_proto_rawDescData } -var file_v2ray_com_core_common_serial_typed_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_common_serial_typed_message_proto_goTypes = []interface{}{ +var file_common_serial_typed_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_common_serial_typed_message_proto_goTypes = []interface{}{ (*TypedMessage)(nil), // 0: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_common_serial_typed_message_proto_depIdxs = []int32{ +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 @@ -120,13 +126,13 @@ var file_v2ray_com_core_common_serial_typed_message_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_common_serial_typed_message_proto_init() } -func file_v2ray_com_core_common_serial_typed_message_proto_init() { - if File_v2ray_com_core_common_serial_typed_message_proto != nil { +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_v2ray_com_core_common_serial_typed_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_common_serial_typed_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TypedMessage); i { case 0: return &v.state @@ -143,18 +149,18 @@ func file_v2ray_com_core_common_serial_typed_message_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_common_serial_typed_message_proto_rawDesc, + RawDescriptor: file_common_serial_typed_message_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_common_serial_typed_message_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_common_serial_typed_message_proto_depIdxs, - MessageInfos: file_v2ray_com_core_common_serial_typed_message_proto_msgTypes, + 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_v2ray_com_core_common_serial_typed_message_proto = out.File - file_v2ray_com_core_common_serial_typed_message_proto_rawDesc = nil - file_v2ray_com_core_common_serial_typed_message_proto_goTypes = nil - file_v2ray_com_core_common_serial_typed_message_proto_depIdxs = nil + 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/common/serial/typed_message.proto b/common/serial/typed_message.proto index 41ee5a3dfd..d32250ed19 100644 --- a/common/serial/typed_message.proto +++ b/common/serial/typed_message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.common.serial; option csharp_namespace = "V2Ray.Core.Common.Serial"; -option go_package = "serial"; +option go_package = "v2ray.com/core/common/serial"; option java_package = "com.v2ray.core.common.serial"; option java_multiple_files = true; @@ -10,6 +10,6 @@ option java_multiple_files = true; message TypedMessage { // The name of the message type, retrieved from protobuf API. string type = 1; - // Serialized proto message. + // Serialized proto message. bytes value = 2; } diff --git a/common/session/context.go b/common/session/context.go index a836bc6b2c..7f1d7df9b8 100644 --- a/common/session/context.go +++ b/common/session/context.go @@ -10,6 +10,7 @@ const ( outboundSessionKey contentSessionKey muxPreferedSessionKey + sockoptSessionKey ) // ContextWithID returns a new context with the given ID. @@ -70,3 +71,16 @@ func MuxPreferedFromContext(ctx context.Context) bool { } return false } + +// ContextWithSockopt returns a new context with Socket configs included +func ContextWithSockopt(ctx context.Context, s *Sockopt) context.Context { + return context.WithValue(ctx, sockoptSessionKey, s) +} + +// SockoptFromContext returns Socket configs in this context, or nil if not contained. +func SockoptFromContext(ctx context.Context) *Sockopt { + if sockopt, ok := ctx.Value(sockoptSessionKey).(*Sockopt); ok { + return sockopt + } + return nil +} diff --git a/common/session/session.go b/common/session/session.go index 5225264814..17b461d56e 100644 --- a/common/session/session.go +++ b/common/session/session.go @@ -51,10 +51,9 @@ type Outbound struct { Target net.Destination // Gateway address Gateway net.Address - // ResolvedIPs is the resolved IP addresses, if the Targe is a domain address. - ResolvedIPs []net.IP } +// SniffingRequest controls the behavior of content sniffing. type SniffingRequest struct { OverrideDestinationForProtocol []string Enabled bool @@ -67,21 +66,29 @@ type Content struct { SniffingRequest SniffingRequest - Attributes map[string]interface{} + Attributes map[string]string SkipRoutePick bool } -func (c *Content) SetAttribute(name string, value interface{}) { +// Sockopt is the settings for socket connection. +type Sockopt struct { + // Mark of the socket connection. + Mark int32 +} + +// SetAttribute attachs additional string attributes to content. +func (c *Content) SetAttribute(name string, value string) { if c.Attributes == nil { - c.Attributes = make(map[string]interface{}) + c.Attributes = make(map[string]string) } c.Attributes[name] = value } -func (c *Content) Attribute(name string) interface{} { +// Attribute retrieves additional string attributes from content. +func (c *Content) Attribute(name string) string { if c.Attributes == nil { - return nil + return "" } return c.Attributes[name] } diff --git a/common/stack/bytes.go b/common/stack/bytes.go index 0ea5631b42..1e4719eee4 100644 --- a/common/stack/bytes.go +++ b/common/stack/bytes.go @@ -1,6 +1,6 @@ package stack -// TwoBytes is a [8]byte which is always allocated on stack. +// TwoBytes is a [2]byte which is always allocated on stack. // //go:notinheap type TwoBytes [2]byte diff --git a/common/strmatcher/domain_matcher.go b/common/strmatcher/domain_matcher.go index aabbf43eb6..ae8e65bc21 100644 --- a/common/strmatcher/domain_matcher.go +++ b/common/strmatcher/domain_matcher.go @@ -7,8 +7,8 @@ func breakDomain(domain string) []string { } type node struct { - value uint32 - sub map[string]*node + values []uint32 + sub map[string]*node } // DomainMatcherGroup is a IndexMatcher for a large set of Domain matchers. @@ -25,11 +25,6 @@ func (g *DomainMatcherGroup) Add(domain string, value uint32) { current := g.root parts := breakDomain(domain) for i := len(parts) - 1; i >= 0; i-- { - if current.value > 0 { - // if current node is already a match, it is not necessary to match further. - return - } - part := parts[i] if current.sub == nil { current.sub = make(map[string]*node) @@ -42,22 +37,21 @@ func (g *DomainMatcherGroup) Add(domain string, value uint32) { current = next } - current.value = value - current.sub = nil // shortcut sub nodes as current node is a match. + current.values = append(current.values, value) } func (g *DomainMatcherGroup) addMatcher(m domainMatcher, value uint32) { g.Add(string(m), value) } -func (g *DomainMatcherGroup) Match(domain string) uint32 { +func (g *DomainMatcherGroup) Match(domain string) []uint32 { if domain == "" { - return 0 + return nil } current := g.root if current == nil { - return 0 + return nil } nextPart := func(idx int) int { @@ -69,6 +63,7 @@ func (g *DomainMatcherGroup) Match(domain string) uint32 { return -1 } + matches := [][]uint32{} idx := len(domain) for { if idx == -1 || current.sub == nil { @@ -83,6 +78,21 @@ func (g *DomainMatcherGroup) Match(domain string) uint32 { } current = next idx = nidx + if len(current.values) > 0 { + matches = append(matches, current.values) + } + } + switch len(matches) { + case 0: + return nil + case 1: + return matches[0] + default: + result := []uint32{} + for idx := range matches { + // Insert reversely, the subdomain that matches further ranks higher + result = append(result, matches[len(matches)-1-idx]...) + } + return result } - return current.value } diff --git a/common/strmatcher/domain_matcher_test.go b/common/strmatcher/domain_matcher_test.go index a6319740bc..660594a9f2 100644 --- a/common/strmatcher/domain_matcher_test.go +++ b/common/strmatcher/domain_matcher_test.go @@ -1,6 +1,7 @@ package strmatcher_test import ( + "reflect" "testing" . "v2ray.com/core/common/strmatcher" @@ -13,48 +14,54 @@ func TestDomainMatcherGroup(t *testing.T) { g.Add("x.a.com", 3) g.Add("a.b.com", 4) g.Add("c.a.b.com", 5) + g.Add("x.y.com", 4) + g.Add("x.y.com", 6) testCases := []struct { Domain string - Result uint32 + Result []uint32 }{ { Domain: "x.v2ray.com", - Result: 1, + Result: []uint32{1}, }, { Domain: "y.com", - Result: 0, + Result: nil, }, { Domain: "a.b.com", - Result: 4, + Result: []uint32{4}, }, - { + { // Matches [c.a.b.com, a.b.com] Domain: "c.a.b.com", - Result: 4, + Result: []uint32{5, 4}, }, { Domain: "c.a..b.com", - Result: 0, + Result: nil, }, { Domain: ".com", - Result: 0, + Result: nil, }, { Domain: "com", - Result: 0, + Result: nil, }, { Domain: "", - Result: 0, + Result: nil, + }, + { + Domain: "x.y.com", + Result: []uint32{4, 6}, }, } for _, testCase := range testCases { r := g.Match(testCase.Domain) - if r != testCase.Result { + if !reflect.DeepEqual(r, testCase.Result) { t.Error("Failed to match domain: ", testCase.Domain, ", expect ", testCase.Result, ", but got ", r) } } @@ -63,7 +70,7 @@ func TestDomainMatcherGroup(t *testing.T) { func TestEmptyDomainMatcherGroup(t *testing.T) { g := new(DomainMatcherGroup) r := g.Match("v2ray.com") - if r != 0 { - t.Error("Expect 0, but ", r) + if len(r) != 0 { + t.Error("Expect [], but ", r) } } diff --git a/common/strmatcher/full_matcher.go b/common/strmatcher/full_matcher.go index fc7e0c335f..e00d02aa9c 100644 --- a/common/strmatcher/full_matcher.go +++ b/common/strmatcher/full_matcher.go @@ -1,24 +1,24 @@ package strmatcher type FullMatcherGroup struct { - matchers map[string]uint32 + matchers map[string][]uint32 } func (g *FullMatcherGroup) Add(domain string, value uint32) { if g.matchers == nil { - g.matchers = make(map[string]uint32) + g.matchers = make(map[string][]uint32) } - g.matchers[domain] = value + g.matchers[domain] = append(g.matchers[domain], value) } func (g *FullMatcherGroup) addMatcher(m fullMatcher, value uint32) { g.Add(string(m), value) } -func (g *FullMatcherGroup) Match(str string) uint32 { +func (g *FullMatcherGroup) Match(str string) []uint32 { if g.matchers == nil { - return 0 + return nil } return g.matchers[str] diff --git a/common/strmatcher/full_matcher_test.go b/common/strmatcher/full_matcher_test.go index a19a60c776..2fe6ee34e0 100644 --- a/common/strmatcher/full_matcher_test.go +++ b/common/strmatcher/full_matcher_test.go @@ -1,6 +1,7 @@ package strmatcher_test import ( + "reflect" "testing" . "v2ray.com/core/common/strmatcher" @@ -11,24 +12,30 @@ func TestFullMatcherGroup(t *testing.T) { g.Add("v2ray.com", 1) g.Add("google.com", 2) g.Add("x.a.com", 3) + g.Add("x.y.com", 4) + g.Add("x.y.com", 6) testCases := []struct { Domain string - Result uint32 + Result []uint32 }{ { Domain: "v2ray.com", - Result: 1, + Result: []uint32{1}, }, { Domain: "y.com", - Result: 0, + Result: nil, + }, + { + Domain: "x.y.com", + Result: []uint32{4, 6}, }, } for _, testCase := range testCases { r := g.Match(testCase.Domain) - if r != testCase.Result { + if !reflect.DeepEqual(r, testCase.Result) { t.Error("Failed to match domain: ", testCase.Domain, ", expect ", testCase.Result, ", but got ", r) } } @@ -37,7 +44,7 @@ func TestFullMatcherGroup(t *testing.T) { func TestEmptyFullMatcherGroup(t *testing.T) { g := new(FullMatcherGroup) r := g.Match("v2ray.com") - if r != 0 { - t.Error("Expect 0, but ", r) + if len(r) != 0 { + t.Error("Expect [], but ", r) } } diff --git a/common/strmatcher/matchers.go b/common/strmatcher/matchers.go index 73d9e7b833..b5ab09c4cb 100644 --- a/common/strmatcher/matchers.go +++ b/common/strmatcher/matchers.go @@ -11,12 +11,20 @@ func (m fullMatcher) Match(s string) bool { return string(m) == s } +func (m fullMatcher) String() string { + return "full:" + string(m) +} + type substrMatcher string func (m substrMatcher) Match(s string) bool { return strings.Contains(s, string(m)) } +func (m substrMatcher) String() string { + return "keyword:" + string(m) +} + type domainMatcher string func (m domainMatcher) Match(s string) bool { @@ -27,6 +35,10 @@ func (m domainMatcher) Match(s string) bool { return len(s) == len(pattern) || s[len(s)-len(pattern)-1] == '.' } +func (m domainMatcher) String() string { + return "domain:" + string(m) +} + type regexMatcher struct { pattern *regexp.Regexp } @@ -34,3 +46,7 @@ type regexMatcher struct { func (m *regexMatcher) Match(s string) bool { return m.pattern.MatchString(s) } + +func (m *regexMatcher) String() string { + return "regexp:" + m.pattern.String() +} diff --git a/common/strmatcher/strmatcher.go b/common/strmatcher/strmatcher.go index fb63eda568..9728047d56 100644 --- a/common/strmatcher/strmatcher.go +++ b/common/strmatcher/strmatcher.go @@ -8,6 +8,7 @@ import ( type Matcher interface { // Match returns true if the given string matches a predefined pattern. Match(string) bool + String() string } // Type is the type of the matcher. @@ -48,8 +49,8 @@ func (t Type) New(pattern string) (Matcher, error) { // IndexMatcher is the interface for matching with a group of matchers. type IndexMatcher interface { - // Match returns the the index of a matcher that matches the input. It returns 0 if no such matcher exists. - Match(input string) uint32 + // Match returns the index of a matcher that matches the input. It returns empty array if no such matcher exists. + Match(input string) []uint32 } type matcherEntry struct { @@ -87,22 +88,16 @@ func (g *MatcherGroup) Add(m Matcher) uint32 { } // Match implements IndexMatcher.Match. -func (g *MatcherGroup) Match(pattern string) uint32 { - if c := g.fullMatcher.Match(pattern); c > 0 { - return c - } - - if c := g.domainMatcher.Match(pattern); c > 0 { - return c - } - +func (g *MatcherGroup) Match(pattern string) []uint32 { + result := []uint32{} + result = append(result, g.fullMatcher.Match(pattern)...) + result = append(result, g.domainMatcher.Match(pattern)...) for _, e := range g.otherMatchers { if e.m.Match(pattern) { - return e.id + result = append(result, e.id) } } - - return 0 + return result } // Size returns the number of matchers in the MatcherGroup. diff --git a/common/strmatcher/strmatcher_test.go b/common/strmatcher/strmatcher_test.go new file mode 100644 index 0000000000..f9cf2e73c6 --- /dev/null +++ b/common/strmatcher/strmatcher_test.go @@ -0,0 +1,94 @@ +package strmatcher_test + +import ( + "reflect" + "testing" + + "v2ray.com/core/common" + . "v2ray.com/core/common/strmatcher" +) + +// See https://github.com/v2fly/v2ray-core/issues/92#issuecomment-673238489 +func TestMatcherGroup(t *testing.T) { + rules := []struct { + Type Type + Domain string + }{ + { + Type: Regex, + Domain: "apis\\.us$", + }, + { + Type: Substr, + Domain: "apis", + }, + { + Type: Domain, + Domain: "googleapis.com", + }, + { + Type: Domain, + Domain: "com", + }, + { + Type: Full, + Domain: "www.baidu.com", + }, + { + Type: Substr, + Domain: "apis", + }, + { + Type: Domain, + Domain: "googleapis.com", + }, + { + Type: Full, + Domain: "fonts.googleapis.com", + }, + { + Type: Full, + Domain: "www.baidu.com", + }, + { + Type: Domain, + Domain: "example.com", + }, + } + cases := []struct { + Input string + Output []uint32 + }{ + { + Input: "www.baidu.com", + Output: []uint32{5, 9, 4}, + }, + { + Input: "fonts.googleapis.com", + Output: []uint32{8, 3, 7, 4, 2, 6}, + }, + { + Input: "example.googleapis.com", + Output: []uint32{3, 7, 4, 2, 6}, + }, + { + Input: "testapis.us", + Output: []uint32{1, 2, 6}, + }, + { + Input: "example.com", + Output: []uint32{10, 4}, + }, + } + matcherGroup := &MatcherGroup{} + for _, rule := range rules { + matcher, err := rule.Type.New(rule.Domain) + common.Must(err) + matcherGroup.Add(matcher) + } + for _, test := range cases { + if m := matcherGroup.Match(test.Input); !reflect.DeepEqual(m, test.Output) { + t.Error("unexpected output: ", m, " for test case ", test) + } + } +} diff --git a/config.pb.go b/config.pb.go index 15e30e6fff..9a4056a29d 100644 --- a/config.pb.go +++ b/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: config.proto + package core import ( @@ -21,7 +27,8 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -// Config is the master config of V2Ray. V2Ray takes this config as input and functions accordingly. +// Config is the master config of V2Ray. V2Ray takes this config as input and +// functions accordingly. type Config struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -29,25 +36,29 @@ type Config struct { // 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 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 V2Ray. A feature must implement the Feature interface, and its config type must be registered through common.RegisterConfig. + // App is for configurations of all features in V2Ray. 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. Each inbound and outbound should choose their own transport + // config. Date to remove: 2020-01-13 // // Deprecated: Do not use. Transport *transport.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 V2Ray. - // V2Ray will ignore such config during initialization. + // Configuration for extensions. The config may not work if corresponding + // extension is not loaded into V2Ray. V2Ray 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_v2ray_com_core_config_proto_msgTypes[0] + mi := &file_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -60,7 +71,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_config_proto_msgTypes[0] + mi := &file_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -73,7 +84,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_config_proto_rawDescGZIP(), []int{0} + return file_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetInbound() []*InboundHandlerConfig { @@ -118,7 +129,8 @@ type InboundHandlerConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Tag of the inbound handler. The tag must be unique among all inbound handlers + // 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"` @@ -129,7 +141,7 @@ type InboundHandlerConfig struct { func (x *InboundHandlerConfig) Reset() { *x = InboundHandlerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_config_proto_msgTypes[1] + mi := &file_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -142,7 +154,7 @@ func (x *InboundHandlerConfig) String() string { func (*InboundHandlerConfig) ProtoMessage() {} func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_config_proto_msgTypes[1] + mi := &file_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -155,7 +167,7 @@ func (x *InboundHandlerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use InboundHandlerConfig.ProtoReflect.Descriptor instead. func (*InboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_config_proto_rawDescGZIP(), []int{1} + return file_config_proto_rawDescGZIP(), []int{1} } func (x *InboundHandlerConfig) GetTag() string { @@ -200,7 +212,7 @@ type OutboundHandlerConfig struct { func (x *OutboundHandlerConfig) Reset() { *x = OutboundHandlerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_config_proto_msgTypes[2] + mi := &file_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -213,7 +225,7 @@ func (x *OutboundHandlerConfig) String() string { func (*OutboundHandlerConfig) ProtoMessage() {} func (x *OutboundHandlerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_config_proto_msgTypes[2] + mi := &file_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -226,7 +238,7 @@ func (x *OutboundHandlerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use OutboundHandlerConfig.ProtoReflect.Descriptor instead. func (*OutboundHandlerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_config_proto_rawDescGZIP(), []int{2} + return file_config_proto_rawDescGZIP(), []int{2} } func (x *OutboundHandlerConfig) GetTag() string { @@ -264,93 +276,91 @@ func (x *OutboundHandlerConfig) GetComment() string { return "" } -var File_v2ray_com_core_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_config_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x25, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, - 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, - 0x2e, 0x76, 0x32, 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, 0x3d, 0x0a, 0x08, 0x6f, 0x75, 0x74, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, - 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, 0x38, 0x0a, 0x03, 0x61, 0x70, 0x70, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, +var File_config_proto protoreflect.FileDescriptor + +var file_config_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, + 0x76, 0x32, 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, 0x16, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x3a, 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 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, 0x3d, 0x0a, 0x08, + 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x76, 0x32, 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, 0x38, 0x0a, 0x03, 0x61, + 0x70, 0x70, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x44, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xcc, 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, 0x53, 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x4d, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xfb, 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, 0x4f, 0x0a, 0x0f, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x44, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 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, 0x4d, 0x0a, + 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xcc, - 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, 0x53, 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x4d, - 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0xfb, 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, 0x4f, 0x0a, 0x0f, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4d, 0x0a, 0x0e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x25, 0x0a, 0x0e, 0x63, - 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, - 0x04, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x0a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0x2f, + 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 0x50, 0x01, 0x5a, 0x0e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0xaa, 0x02, 0x0a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_config_proto_rawDescData = file_v2ray_com_core_config_proto_rawDesc + file_config_proto_rawDescOnce sync.Once + file_config_proto_rawDescData = file_config_proto_rawDesc ) -func file_v2ray_com_core_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_config_proto_rawDescData) +func file_config_proto_rawDescGZIP() []byte { + file_config_proto_rawDescOnce.Do(func() { + file_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_config_proto_rawDescData) }) - return file_v2ray_com_core_config_proto_rawDescData + return file_config_proto_rawDescData } -var file_v2ray_com_core_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_config_proto_goTypes = []interface{}{ +var file_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.Config (*InboundHandlerConfig)(nil), // 1: v2ray.core.InboundHandlerConfig (*OutboundHandlerConfig)(nil), // 2: v2ray.core.OutboundHandlerConfig (*serial.TypedMessage)(nil), // 3: v2ray.core.common.serial.TypedMessage (*transport.Config)(nil), // 4: v2ray.core.transport.Config } -var file_v2ray_com_core_config_proto_depIdxs = []int32{ +var file_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.Config.inbound:type_name -> v2ray.core.InboundHandlerConfig 2, // 1: v2ray.core.Config.outbound:type_name -> v2ray.core.OutboundHandlerConfig 3, // 2: v2ray.core.Config.app:type_name -> v2ray.core.common.serial.TypedMessage @@ -367,13 +377,13 @@ var file_v2ray_com_core_config_proto_depIdxs = []int32{ 0, // [0:9] is the sub-list for field type_name } -func init() { file_v2ray_com_core_config_proto_init() } -func file_v2ray_com_core_config_proto_init() { - if File_v2ray_com_core_config_proto != nil { +func init() { file_config_proto_init() } +func file_config_proto_init() { + if File_config_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -385,7 +395,7 @@ func file_v2ray_com_core_config_proto_init() { return nil } } - file_v2ray_com_core_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InboundHandlerConfig); i { case 0: return &v.state @@ -397,7 +407,7 @@ func file_v2ray_com_core_config_proto_init() { return nil } } - file_v2ray_com_core_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OutboundHandlerConfig); i { case 0: return &v.state @@ -414,18 +424,18 @@ func file_v2ray_com_core_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_config_proto_rawDesc, + RawDescriptor: file_config_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_config_proto_msgTypes, + GoTypes: file_config_proto_goTypes, + DependencyIndexes: file_config_proto_depIdxs, + MessageInfos: file_config_proto_msgTypes, }.Build() - File_v2ray_com_core_config_proto = out.File - file_v2ray_com_core_config_proto_rawDesc = nil - file_v2ray_com_core_config_proto_goTypes = nil - file_v2ray_com_core_config_proto_depIdxs = nil + File_config_proto = out.File + file_config_proto_rawDesc = nil + file_config_proto_goTypes = nil + file_config_proto_depIdxs = nil } diff --git a/config.proto b/config.proto index e2302158a9..4f97f73592 100644 --- a/config.proto +++ b/config.proto @@ -2,39 +2,45 @@ syntax = "proto3"; package v2ray.core; option csharp_namespace = "V2Ray.Core"; -option go_package = "core"; +option go_package = "v2ray.com/core"; option java_package = "com.v2ray.core"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; -import "v2ray.com/core/transport/config.proto"; +import "common/serial/typed_message.proto"; +import "transport/config.proto"; -// Config is the master config of V2Ray. V2Ray takes this config as input and functions accordingly. +// Config is the master config of V2Ray. V2Ray takes this config as input and +// functions accordingly. message Config { // Inbound handler configurations. Must have at least one item. repeated InboundHandlerConfig inbound = 1; - // Outbound handler configurations. Must have at least one item. The first item is used as default for routing. + // Outbound handler configurations. Must have at least one item. The first + // item is used as default for routing. repeated OutboundHandlerConfig outbound = 2; reserved 3; - // App is for configurations of all features in V2Ray. A feature must implement the Feature interface, and its config type must be registered through common.RegisterConfig. + // App is for configurations of all features in V2Ray. A feature must + // implement the Feature interface, and its config type must be registered + // through common.RegisterConfig. repeated v2ray.core.common.serial.TypedMessage app = 4; // Transport settings. - // Deprecated. Each inbound and outbound should choose their own transport config. - // Date to remove: 2020-01-13 + // Deprecated. Each inbound and outbound should choose their own transport + // config. Date to remove: 2020-01-13 v2ray.core.transport.Config transport = 5 [deprecated = true]; - // Configuration for extensions. The config may not work if corresponding extension is not loaded into V2Ray. - // V2Ray will ignore such config during initialization. + // Configuration for extensions. The config may not work if corresponding + // extension is not loaded into V2Ray. V2Ray will ignore such config during + // initialization. repeated v2ray.core.common.serial.TypedMessage extension = 6; } // InboundHandlerConfig is the configuration for inbound handler. message InboundHandlerConfig { - // Tag of the inbound handler. The tag must be unique among all inbound handlers + // Tag of the inbound handler. The tag must be unique among all inbound + // handlers string tag = 1; // Settings for how this inbound proxy is handled. v2ray.core.common.serial.TypedMessage receiver_settings = 2; diff --git a/core.go b/core.go index 2844a27036..f8dcccc56d 100644 --- a/core.go +++ b/core.go @@ -9,8 +9,7 @@ // connections. package core -//go:generate go install "v2ray.com/core/common/errors/errorgen" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "runtime" @@ -19,7 +18,7 @@ import ( ) var ( - version = "4.26.0" + version = "4.31.0" build = "Custom" codename = "V2Fly, a community-driven edition of V2Ray." intro = "A unified platform for anti-censorship." diff --git a/external/README.md b/external/README.md deleted file mode 100644 index 1934162947..0000000000 --- a/external/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Note - -The `external` dir in the project exists for historical reasons. We will migrate to use go mod to maintain 3rd party libraries. - -Fow now, all modules under external are used by "quic-go" to support quic protocol, and can't migrate without a breaking change. - -The plan is that we will remove the whole `external` dir when `quic-go` is tested to be matured enough in production. \ No newline at end of file diff --git a/external/github.com/cheekybits/genny/LICENSE b/external/github.com/cheekybits/genny/LICENSE deleted file mode 100644 index 519d7f2272..0000000000 --- a/external/github.com/cheekybits/genny/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 cheekybits - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/external/github.com/cheekybits/genny/generic/doc.go b/external/github.com/cheekybits/genny/generic/doc.go deleted file mode 100644 index 3bd6c869c0..0000000000 --- a/external/github.com/cheekybits/genny/generic/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package generic contains the generic marker types. -package generic diff --git a/external/github.com/cheekybits/genny/generic/generic.go b/external/github.com/cheekybits/genny/generic/generic.go deleted file mode 100644 index 04a2306cbf..0000000000 --- a/external/github.com/cheekybits/genny/generic/generic.go +++ /dev/null @@ -1,13 +0,0 @@ -package generic - -// Type is the placeholder type that indicates a generic value. -// When genny is executed, variables of this type will be replaced with -// references to the specific types. -// var GenericType generic.Type -type Type interface{} - -// Number is the placehoder type that indiccates a generic numerical value. -// When genny is executed, variables of this type will be replaced with -// references to the specific types. -// var GenericType generic.Number -type Number float64 diff --git a/external/github.com/cloudflare/sidh/LICENSE b/external/github.com/cloudflare/sidh/LICENSE deleted file mode 100644 index ea60699d75..0000000000 --- a/external/github.com/cloudflare/sidh/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2017 Cloudflare. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Cloudflare nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -======================================================================== - -The x64 field arithmetic implementation was derived from the Microsoft Research -SIDH implementation, , available -under the following license: - -======================================================================== - -MIT License - -Copyright (c) Microsoft Corporation. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE diff --git a/external/github.com/cloudflare/sidh/internal/arith/generic.go b/external/github.com/cloudflare/sidh/internal/arith/generic.go deleted file mode 100644 index 223777081f..0000000000 --- a/external/github.com/cloudflare/sidh/internal/arith/generic.go +++ /dev/null @@ -1,66 +0,0 @@ -// +build noasm !amd64 - -package internal - -// helper used for Uint128 representation -type Uint128 struct { - H, L uint64 -} - -// Adds 2 64bit digits in constant time. -// Returns result and carry (1 or 0) -func Addc64(cin, a, b uint64) (ret, cout uint64) { - t := a + cin - ret = b + t - cout = ((a & b) | ((a | b) & (^ret))) >> 63 - return -} - -// Substracts 2 64bit digits in constant time. -// Returns result and borrow (1 or 0) -func Subc64(bIn, a, b uint64) (ret, bOut uint64) { - var tmp1 = a - b - // Set bOut if bIn!=0 and tmp1==0 in constant time - bOut = bIn & (1 ^ ((tmp1 | uint64(0-tmp1)) >> 63)) - // Constant time check if x> 63 - ret = tmp1 - bIn - return -} - -// Multiplies 2 64bit digits in constant time -func Mul64(a, b uint64) (res Uint128) { - var al, bl, ah, bh, albl, albh, ahbl, ahbh uint64 - var res1, res2, res3 uint64 - var carry, maskL, maskH, temp uint64 - - maskL = (^maskL) >> 32 - maskH = ^maskL - - al = a & maskL - ah = a >> 32 - bl = b & maskL - bh = b >> 32 - - albl = al * bl - albh = al * bh - ahbl = ah * bl - ahbh = ah * bh - res.L = albl & maskL - - res1 = albl >> 32 - res2 = ahbl & maskL - res3 = albh & maskL - temp = res1 + res2 + res3 - carry = temp >> 32 - res.L ^= temp << 32 - - res1 = ahbl >> 32 - res2 = albh >> 32 - res3 = ahbh & maskL - temp = res1 + res2 + res3 + carry - res.H = temp & maskL - carry = temp & maskH - res.H ^= (ahbh & maskH) + carry - return -} diff --git a/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go b/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go deleted file mode 100644 index ce1ce9a530..0000000000 --- a/external/github.com/cloudflare/sidh/internal/isogeny/curve_ops.go +++ /dev/null @@ -1,440 +0,0 @@ -package internal - -type CurveOperations struct { - Params *SidhParams -} - -// Computes j-invariant for a curve y2=x3+A/Cx+x with A,C in F_(p^2). Result -// is returned in jBytes buffer, encoded in little-endian format. Caller -// provided jBytes buffer has to be big enough to j-invariant value. In case -// of SIDH, buffer size must be at least size of shared secret. -// Implementation corresponds to Algorithm 9 from SIKE. -func (c *CurveOperations) Jinvariant(cparams *ProjectiveCurveParameters, jBytes []byte) { - var j, t0, t1 Fp2Element - - op := c.Params.Op - op.Square(&j, &cparams.A) // j = A^2 - op.Square(&t1, &cparams.C) // t1 = C^2 - op.Add(&t0, &t1, &t1) // t0 = t1 + t1 - op.Sub(&t0, &j, &t0) // t0 = j - t0 - op.Sub(&t0, &t0, &t1) // t0 = t0 - t1 - op.Sub(&j, &t0, &t1) // t0 = t0 - t1 - op.Square(&t1, &t1) // t1 = t1^2 - op.Mul(&j, &j, &t1) // j = j * t1 - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Square(&t1, &t0) // t1 = t0^2 - op.Mul(&t0, &t0, &t1) // t0 = t0 * t1 - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Inv(&j, &j) // j = 1/j - op.Mul(&j, &t0, &j) // j = t0 * j - - c.Fp2ToBytes(jBytes, &j) -} - -// Given affine points x(P), x(Q) and x(Q-P) in a extension field F_{p^2}, function -// recorvers projective coordinate A of a curve. This is Algorithm 10 from SIKE. -func (c *CurveOperations) RecoverCoordinateA(curve *ProjectiveCurveParameters, xp, xq, xr *Fp2Element) { - var t0, t1 Fp2Element - - op := c.Params.Op - op.Add(&t1, xp, xq) // t1 = Xp + Xq - op.Mul(&t0, xp, xq) // t0 = Xp * Xq - op.Mul(&curve.A, xr, &t1) // A = X(q-p) * t1 - op.Add(&curve.A, &curve.A, &t0) // A = A + t0 - op.Mul(&t0, &t0, xr) // t0 = t0 * X(q-p) - op.Sub(&curve.A, &curve.A, &c.Params.OneFp2) // A = A - 1 - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Add(&t1, &t1, xr) // t1 = t1 + X(q-p) - op.Add(&t0, &t0, &t0) // t0 = t0 + t0 - op.Square(&curve.A, &curve.A) // A = A^2 - op.Inv(&t0, &t0) // t0 = 1/t0 - op.Mul(&curve.A, &curve.A, &t0) // A = A * t0 - op.Sub(&curve.A, &curve.A, &t1) // A = A - t1 -} - -// Computes equivalence (A:C) ~ (A+2C : A-2C) -func (c *CurveOperations) CalcCurveParamsEquiv3(cparams *ProjectiveCurveParameters) CurveCoefficientsEquiv { - var coef CurveCoefficientsEquiv - var c2 Fp2Element - var op = c.Params.Op - - op.Add(&c2, &cparams.C, &cparams.C) - // A24p = A+2*C - op.Add(&coef.A, &cparams.A, &c2) - // A24m = A-2*C - op.Sub(&coef.C, &cparams.A, &c2) - return coef -} - -// Computes equivalence (A:C) ~ (A+2C : 4C) -func (c *CurveOperations) CalcCurveParamsEquiv4(cparams *ProjectiveCurveParameters) CurveCoefficientsEquiv { - var coefEq CurveCoefficientsEquiv - var op = c.Params.Op - - op.Add(&coefEq.C, &cparams.C, &cparams.C) - // A24p = A+2C - op.Add(&coefEq.A, &cparams.A, &coefEq.C) - // C24 = 4*C - op.Add(&coefEq.C, &coefEq.C, &coefEq.C) - return coefEq -} - -// Helper function for RightToLeftLadder(). Returns A+2C / 4. -func (c *CurveOperations) CalcAplus2Over4(cparams *ProjectiveCurveParameters) (ret Fp2Element) { - var tmp Fp2Element - var op = c.Params.Op - - // 2C - op.Add(&tmp, &cparams.C, &cparams.C) - // A+2C - op.Add(&ret, &cparams.A, &tmp) - // 1/4C - op.Add(&tmp, &tmp, &tmp) - op.Inv(&tmp, &tmp) - // A+2C/4C - op.Mul(&ret, &ret, &tmp) - return -} - -// Recovers (A:C) curve parameters from projectively equivalent (A+2C:A-2C). -func (c *CurveOperations) RecoverCurveCoefficients3(cparams *ProjectiveCurveParameters, coefEq *CurveCoefficientsEquiv) { - var op = c.Params.Op - - op.Add(&cparams.A, &coefEq.A, &coefEq.C) - // cparams.A = 2*(A+2C+A-2C) = 4A - op.Add(&cparams.A, &cparams.A, &cparams.A) - // cparams.C = (A+2C-A+2C) = 4C - op.Sub(&cparams.C, &coefEq.A, &coefEq.C) - return -} - -// Recovers (A:C) curve parameters from projectively equivalent (A+2C:4C). -func (c *CurveOperations) RecoverCurveCoefficients4(cparams *ProjectiveCurveParameters, coefEq *CurveCoefficientsEquiv) { - var op = c.Params.Op - // cparams.C = (4C)*1/2=2C - op.Mul(&cparams.C, &coefEq.C, &c.Params.HalfFp2) - // cparams.A = A+2C - 2C = A - op.Sub(&cparams.A, &coefEq.A, &cparams.C) - // cparams.C = 2C * 1/2 = C - op.Mul(&cparams.C, &cparams.C, &c.Params.HalfFp2) - return -} - -// Combined coordinate doubling and differential addition. Takes projective points -// P,Q,Q-P and (A+2C)/4C curve E coefficient. Returns 2*P and P+Q calculated on E. -// Function is used only by RightToLeftLadder. Corresponds to Algorithm 5 of SIKE -func (c *CurveOperations) xDblAdd(P, Q, QmP *ProjectivePoint, a24 *Fp2Element) (dblP, PaQ ProjectivePoint) { - var t0, t1, t2 Fp2Element - var op = c.Params.Op - - xQmP, zQmP := &QmP.X, &QmP.Z - xPaQ, zPaQ := &PaQ.X, &PaQ.Z - x2P, z2P := &dblP.X, &dblP.Z - xP, zP := &P.X, &P.Z - xQ, zQ := &Q.X, &Q.Z - - op.Add(&t0, xP, zP) // t0 = Xp+Zp - op.Sub(&t1, xP, zP) // t1 = Xp-Zp - op.Square(x2P, &t0) // 2P.X = t0^2 - op.Sub(&t2, xQ, zQ) // t2 = Xq-Zq - op.Add(xPaQ, xQ, zQ) // Xp+q = Xq+Zq - op.Mul(&t0, &t0, &t2) // t0 = t0 * t2 - op.Mul(z2P, &t1, &t1) // 2P.Z = t1 * t1 - op.Mul(&t1, &t1, xPaQ) // t1 = t1 * Xp+q - op.Sub(&t2, x2P, z2P) // t2 = 2P.X - 2P.Z - op.Mul(x2P, x2P, z2P) // 2P.X = 2P.X * 2P.Z - op.Mul(xPaQ, a24, &t2) // Xp+q = A24 * t2 - op.Sub(zPaQ, &t0, &t1) // Zp+q = t0 - t1 - op.Add(z2P, xPaQ, z2P) // 2P.Z = Xp+q + 2P.Z - op.Add(xPaQ, &t0, &t1) // Xp+q = t0 + t1 - op.Mul(z2P, z2P, &t2) // 2P.Z = 2P.Z * t2 - op.Square(zPaQ, zPaQ) // Zp+q = Zp+q ^ 2 - op.Square(xPaQ, xPaQ) // Xp+q = Xp+q ^ 2 - op.Mul(zPaQ, xQmP, zPaQ) // Zp+q = Xq-p * Zp+q - op.Mul(xPaQ, zQmP, xPaQ) // Xp+q = Zq-p * Xp+q - return -} - -// Given the curve parameters, xP = x(P), computes xP = x([2^k]P) -// Safe to overlap xP, x2P. -func (c *CurveOperations) Pow2k(xP *ProjectivePoint, params *CurveCoefficientsEquiv, k uint32) { - var t0, t1 Fp2Element - var op = c.Params.Op - - x, z := &xP.X, &xP.Z - for i := uint32(0); i < k; i++ { - op.Sub(&t0, x, z) // t0 = Xp - Zp - op.Add(&t1, x, z) // t1 = Xp + Zp - op.Square(&t0, &t0) // t0 = t0 ^ 2 - op.Square(&t1, &t1) // t1 = t1 ^ 2 - op.Mul(z, ¶ms.C, &t0) // Z2p = C24 * t0 - op.Mul(x, z, &t1) // X2p = Z2p * t1 - op.Sub(&t1, &t1, &t0) // t1 = t1 - t0 - op.Mul(&t0, ¶ms.A, &t1) // t0 = A24+ * t1 - op.Add(z, z, &t0) // Z2p = Z2p + t0 - op.Mul(z, z, &t1) // Zp = Z2p * t1 - } -} - -// Given the curve parameters, xP = x(P), and k >= 0, compute xP = x([3^k]P). -// -// Safe to overlap xP, xR. -func (c *CurveOperations) Pow3k(xP *ProjectivePoint, params *CurveCoefficientsEquiv, k uint32) { - var t0, t1, t2, t3, t4, t5, t6 Fp2Element - var op = c.Params.Op - - x, z := &xP.X, &xP.Z - for i := uint32(0); i < k; i++ { - op.Sub(&t0, x, z) // t0 = Xp - Zp - op.Square(&t2, &t0) // t2 = t0^2 - op.Add(&t1, x, z) // t1 = Xp + Zp - op.Square(&t3, &t1) // t3 = t1^2 - op.Add(&t4, &t1, &t0) // t4 = t1 + t0 - op.Sub(&t0, &t1, &t0) // t0 = t1 - t0 - op.Square(&t1, &t4) // t1 = t4^2 - op.Sub(&t1, &t1, &t3) // t1 = t1 - t3 - op.Sub(&t1, &t1, &t2) // t1 = t1 - t2 - op.Mul(&t5, &t3, ¶ms.A) // t5 = t3 * A24+ - op.Mul(&t3, &t3, &t5) // t3 = t5 * t3 - op.Mul(&t6, &t2, ¶ms.C) // t6 = t2 * A24- - op.Mul(&t2, &t2, &t6) // t2 = t2 * t6 - op.Sub(&t3, &t2, &t3) // t3 = t2 - t3 - op.Sub(&t2, &t5, &t6) // t2 = t5 - t6 - op.Mul(&t1, &t2, &t1) // t1 = t2 * t1 - op.Add(&t2, &t3, &t1) // t2 = t3 + t1 - op.Square(&t2, &t2) // t2 = t2^2 - op.Mul(x, &t2, &t4) // X3p = t2 * t4 - op.Sub(&t1, &t3, &t1) // t1 = t3 - t1 - op.Square(&t1, &t1) // t1 = t1^2 - op.Mul(z, &t1, &t0) // Z3p = t1 * t0 - } -} - -// Set (y1, y2, y3) = (1/x1, 1/x2, 1/x3). -// -// All xi, yi must be distinct. -func (c *CurveOperations) Fp2Batch3Inv(x1, x2, x3, y1, y2, y3 *Fp2Element) { - var x1x2, t Fp2Element - var op = c.Params.Op - - op.Mul(&x1x2, x1, x2) // x1*x2 - op.Mul(&t, &x1x2, x3) // 1/(x1*x2*x3) - op.Inv(&t, &t) - op.Mul(y1, &t, x2) // 1/x1 - op.Mul(y1, y1, x3) - op.Mul(y2, &t, x1) // 1/x2 - op.Mul(y2, y2, x3) - op.Mul(y3, &t, &x1x2) // 1/x3 -} - -// ScalarMul3Pt is a right-to-left point multiplication that given the -// x-coordinate of P, Q and P-Q calculates the x-coordinate of R=Q+[scalar]P. -// nbits must be smaller or equal to len(scalar). -func (c *CurveOperations) ScalarMul3Pt(cparams *ProjectiveCurveParameters, P, Q, PmQ *ProjectivePoint, nbits uint, scalar []uint8) ProjectivePoint { - var R0, R2, R1 ProjectivePoint - var op = c.Params.Op - aPlus2Over4 := c.CalcAplus2Over4(cparams) - R1 = *P - R2 = *PmQ - R0 = *Q - - // Iterate over the bits of the scalar, bottom to top - prevBit := uint8(0) - for i := uint(0); i < nbits; i++ { - bit := (scalar[i>>3] >> (i & 7) & 1) - swap := prevBit ^ bit - prevBit = bit - op.CondSwap(&R1.X, &R1.Z, &R2.X, &R2.Z, swap) - R0, R2 = c.xDblAdd(&R0, &R2, &R1, &aPlus2Over4) - } - op.CondSwap(&R1.X, &R1.Z, &R2.X, &R2.Z, prevBit) - return R1 -} - -// Convert the input to wire format. -// -// The output byte slice must be at least 2*bytelen(p) bytes long. -func (c *CurveOperations) Fp2ToBytes(output []byte, fp2 *Fp2Element) { - if len(output) < 2*c.Params.Bytelen { - panic("output byte slice too short") - } - var a Fp2Element - c.Params.Op.FromMontgomery(fp2, &a) - - // convert to bytes in little endian form - for i := 0; i < c.Params.Bytelen; i++ { - // set i = j*8 + k - fp2 := i / 8 - k := uint64(i % 8) - output[i] = byte(a.A[fp2] >> (8 * k)) - output[i+c.Params.Bytelen] = byte(a.B[fp2] >> (8 * k)) - } -} - -// Read 2*bytelen(p) bytes into the given ExtensionFieldElement. -// -// It is an error to call this function if the input byte slice is less than 2*bytelen(p) bytes long. -func (c *CurveOperations) Fp2FromBytes(fp2 *Fp2Element, input []byte) { - if len(input) < 2*c.Params.Bytelen { - panic("input byte slice too short") - } - - for i := 0; i < c.Params.Bytelen; i++ { - j := i / 8 - k := uint64(i % 8) - fp2.A[j] |= uint64(input[i]) << (8 * k) - fp2.B[j] |= uint64(input[i+c.Params.Bytelen]) << (8 * k) - } - c.Params.Op.ToMontgomery(fp2) -} - -/* ------------------------------------------------------------------------- - Mechnisms used for isogeny calculations - -------------------------------------------------------------------------*/ - -// Constructs isogeny3 objects -func Newisogeny3(op FieldOps) Isogeny { - return &isogeny3{Field: op} -} - -// Constructs isogeny4 objects -func Newisogeny4(op FieldOps) Isogeny { - return &isogeny4{isogeny3: isogeny3{Field: op}} -} - -// Given a three-torsion point p = x(PB) on the curve E_(A:C), construct the -// three-isogeny phi : E_(A:C) -> E_(A:C)/ = E_(A':C'). -// -// Input: (XP_3: ZP_3), where P_3 has exact order 3 on E_A/C -// Output: * Curve coordinates (A' + 2C', A' - 2C') corresponding to E_A'/C' = A_E/C/ -// * Isogeny phi with constants in F_p^2 -func (phi *isogeny3) GenerateCurve(p *ProjectivePoint) CurveCoefficientsEquiv { - var t0, t1, t2, t3, t4 Fp2Element - var coefEq CurveCoefficientsEquiv - var K1, K2 = &phi.K1, &phi.K2 - - op := phi.Field - op.Sub(K1, &p.X, &p.Z) // K1 = XP3 - ZP3 - op.Square(&t0, K1) // t0 = K1^2 - op.Add(K2, &p.X, &p.Z) // K2 = XP3 + ZP3 - op.Square(&t1, K2) // t1 = K2^2 - op.Add(&t2, &t0, &t1) // t2 = t0 + t1 - op.Add(&t3, K1, K2) // t3 = K1 + K2 - op.Square(&t3, &t3) // t3 = t3^2 - op.Sub(&t3, &t3, &t2) // t3 = t3 - t2 - op.Add(&t2, &t1, &t3) // t2 = t1 + t3 - op.Add(&t3, &t3, &t0) // t3 = t3 + t0 - op.Add(&t4, &t3, &t0) // t4 = t3 + t0 - op.Add(&t4, &t4, &t4) // t4 = t4 + t4 - op.Add(&t4, &t1, &t4) // t4 = t1 + t4 - op.Mul(&coefEq.C, &t2, &t4) // A24m = t2 * t4 - op.Add(&t4, &t1, &t2) // t4 = t1 + t2 - op.Add(&t4, &t4, &t4) // t4 = t4 + t4 - op.Add(&t4, &t0, &t4) // t4 = t0 + t4 - op.Mul(&t4, &t3, &t4) // t4 = t3 * t4 - op.Sub(&t0, &t4, &coefEq.C) // t0 = t4 - A24m - op.Add(&coefEq.A, &coefEq.C, &t0) // A24p = A24m + t0 - return coefEq -} - -// Given a 3-isogeny phi and a point pB = x(PB), compute x(QB), the x-coordinate -// of the image QB = phi(PB) of PB under phi : E_(A:C) -> E_(A':C'). -// -// The output xQ = x(Q) is then a point on the curve E_(A':C'); the curve -// parameters are returned by the GenerateCurve function used to construct phi. -func (phi *isogeny3) EvaluatePoint(p *ProjectivePoint) ProjectivePoint { - var t0, t1, t2 Fp2Element - var q ProjectivePoint - var K1, K2 = &phi.K1, &phi.K2 - var px, pz = &p.X, &p.Z - - op := phi.Field - op.Add(&t0, px, pz) // t0 = XQ + ZQ - op.Sub(&t1, px, pz) // t1 = XQ - ZQ - op.Mul(&t0, K1, &t0) // t2 = K1 * t0 - op.Mul(&t1, K2, &t1) // t1 = K2 * t1 - op.Add(&t2, &t0, &t1) // t2 = t0 + t1 - op.Sub(&t0, &t1, &t0) // t0 = t1 - t0 - op.Square(&t2, &t2) // t2 = t2 ^ 2 - op.Square(&t0, &t0) // t0 = t0 ^ 2 - op.Mul(&q.X, px, &t2) // XQ'= XQ * t2 - op.Mul(&q.Z, pz, &t0) // ZQ'= ZQ * t0 - return q -} - -// Given a four-torsion point p = x(PB) on the curve E_(A:C), construct the -// four-isogeny phi : E_(A:C) -> E_(A:C)/ = E_(A':C'). -// -// Input: (XP_4: ZP_4), where P_4 has exact order 4 on E_A/C -// Output: * Curve coordinates (A' + 2C', 4C') corresponding to E_A'/C' = A_E/C/ -// * Isogeny phi with constants in F_p^2 -func (phi *isogeny4) GenerateCurve(p *ProjectivePoint) CurveCoefficientsEquiv { - var coefEq CurveCoefficientsEquiv - var xp4, zp4 = &p.X, &p.Z - var K1, K2, K3 = &phi.K1, &phi.K2, &phi.K3 - - op := phi.Field - op.Sub(K2, xp4, zp4) - op.Add(K3, xp4, zp4) - op.Square(K1, zp4) - op.Add(K1, K1, K1) - op.Square(&coefEq.C, K1) - op.Add(K1, K1, K1) - op.Square(&coefEq.A, xp4) - op.Add(&coefEq.A, &coefEq.A, &coefEq.A) - op.Square(&coefEq.A, &coefEq.A) - return coefEq -} - -// Given a 4-isogeny phi and a point xP = x(P), compute x(Q), the x-coordinate -// of the image Q = phi(P) of P under phi : E_(A:C) -> E_(A':C'). -// -// Input: Isogeny returned by GenerateCurve and point q=(Qx,Qz) from E0_A/C -// Output: Corresponding point q from E1_A'/C', where E1 is 4-isogenous to E0 -func (phi *isogeny4) EvaluatePoint(p *ProjectivePoint) ProjectivePoint { - var t0, t1 Fp2Element - var q = *p - var xq, zq = &q.X, &q.Z - var K1, K2, K3 = &phi.K1, &phi.K2, &phi.K3 - - op := phi.Field - op.Add(&t0, xq, zq) - op.Sub(&t1, xq, zq) - op.Mul(xq, &t0, K2) - op.Mul(zq, &t1, K3) - op.Mul(&t0, &t0, &t1) - op.Mul(&t0, &t0, K1) - op.Add(&t1, xq, zq) - op.Sub(zq, xq, zq) - op.Square(&t1, &t1) - op.Square(zq, zq) - op.Add(xq, &t0, &t1) - op.Sub(&t0, zq, &t0) - op.Mul(xq, xq, &t1) - op.Mul(zq, zq, &t0) - return q -} - -/* ------------------------------------------------------------------------- - Utils - -------------------------------------------------------------------------*/ -func (point *ProjectivePoint) ToAffine(c *CurveOperations) *Fp2Element { - var affine_x Fp2Element - c.Params.Op.Inv(&affine_x, &point.Z) - c.Params.Op.Mul(&affine_x, &affine_x, &point.X) - return &affine_x -} - -// Cleans data in fp -func (fp *Fp2Element) Zeroize() { - // Zeroizing in 2 seperated loops tells compiler to - // use fast runtime.memclr() - for i := range fp.A { - fp.A[i] = 0 - } - for i := range fp.B { - fp.B[i] = 0 - } -} diff --git a/external/github.com/cloudflare/sidh/internal/isogeny/types.go b/external/github.com/cloudflare/sidh/internal/isogeny/types.go deleted file mode 100644 index ecf0129e49..0000000000 --- a/external/github.com/cloudflare/sidh/internal/isogeny/types.go +++ /dev/null @@ -1,140 +0,0 @@ -package internal - -const ( - FP_MAX_WORDS = 12 // Currently p751.NumWords -) - -// Representation of an element of the base field F_p. -// -// No particular meaning is assigned to the representation -- it could represent -// an element in Montgomery form, or not. Tracking the meaning of the field -// element is left to higher types. -type FpElement [FP_MAX_WORDS]uint64 - -// Represents an intermediate product of two elements of the base field F_p. -type FpElementX2 [2 * FP_MAX_WORDS]uint64 - -// Represents an element of the extended field Fp^2 = Fp(x+i) -type Fp2Element struct { - A FpElement - B FpElement -} - -type DomainParams struct { - // P, Q and R=P-Q base points - Affine_P, Affine_Q, Affine_R Fp2Element - // Size of a compuatation strategy for x-torsion group - IsogenyStrategy []uint32 - // Max size of secret key for x-torsion group - SecretBitLen uint - // Max size of secret key for x-torsion group - SecretByteLen uint -} - -type SidhParams struct { - Id uint8 - // Bytelen of P - Bytelen int - // The public key size, in bytes. - PublicKeySize int - // The shared secret size, in bytes. - SharedSecretSize uint - // 2- and 3-torsion group parameter definitions - A, B DomainParams - // Precomputed identity element in the Fp2 in Montgomery domain - OneFp2 Fp2Element - // Precomputed 1/2 in the Fp2 in Montgomery domain - HalfFp2 Fp2Element - // Length of SIKE secret message. Must be one of {24,32,40}, - // depending on size of prime field used (see [SIKE], 1.4 and 5.1) - MsgLen uint - // Length of SIKE ephemeral KEM key (see [SIKE], 1.4 and 5.1) - KemSize uint - // Access to field arithmetic - Op FieldOps -} - -// Interface for working with isogenies. -type Isogeny interface { - // Given a torsion point on a curve computes isogenous curve. - // Returns curve coefficients (A:C), so that E_(A/C) = E_(A/C)/

, - // where P is a provided projective point. Sets also isogeny constants - // that are needed for isogeny evaluation. - GenerateCurve(*ProjectivePoint) CurveCoefficientsEquiv - // Evaluates isogeny at caller provided point. Requires isogeny curve constants - // to be earlier computed by GenerateCurve. - EvaluatePoint(*ProjectivePoint) ProjectivePoint -} - -// Stores curve projective parameters equivalent to A/C. Meaning of the -// values depends on the context. When working with isogenies over -// subgroup that are powers of: -// * three then (A:C) ~ (A+2C:A-2C) -// * four then (A:C) ~ (A+2C: 4C) -// See Appendix A of SIKE for more details -type CurveCoefficientsEquiv struct { - A Fp2Element - C Fp2Element -} - -// A point on the projective line P^1(F_{p^2}). -// -// This represents a point on the Kummer line of a Montgomery curve. The -// curve is specified by a ProjectiveCurveParameters struct. -type ProjectivePoint struct { - X Fp2Element - Z Fp2Element -} - -// A point on the projective line P^1(F_{p^2}). -// -// This is used to work projectively with the curve coefficients. -type ProjectiveCurveParameters struct { - A Fp2Element - C Fp2Element -} - -// Stores Isogeny 3 curve constants -type isogeny3 struct { - Field FieldOps - K1 Fp2Element - K2 Fp2Element -} - -// Stores Isogeny 4 curve constants -type isogeny4 struct { - isogeny3 - K3 Fp2Element -} - -type FieldOps interface { - // Set res = lhs + rhs. - // - // Allowed to overlap lhs or rhs with res. - Add(res, lhs, rhs *Fp2Element) - - // Set res = lhs - rhs. - // - // Allowed to overlap lhs or rhs with res. - Sub(res, lhs, rhs *Fp2Element) - - // Set res = lhs * rhs. - // - // Allowed to overlap lhs or rhs with res. - Mul(res, lhs, rhs *Fp2Element) - // Set res = x * x - // - // Allowed to overlap res with x. - Square(res, x *Fp2Element) - // Set res = 1/x - // - // Allowed to overlap res with x. - Inv(res, x *Fp2Element) - // If choice = 1u8, set (x,y) = (y,x). If choice = 0u8, set (x,y) = (x,y). - CondSwap(xPx, xPz, xQx, xQz *Fp2Element, choice uint8) - // Converts Fp2Element to Montgomery domain (x*R mod p) - ToMontgomery(x *Fp2Element) - // Converts 'a' in montgomery domain to element from Fp2Element - // and stores it in 'x' - FromMontgomery(x *Fp2Element, a *Fp2Element) -} diff --git a/external/github.com/cloudflare/sidh/internal/utils/cpu.go b/external/github.com/cloudflare/sidh/internal/utils/cpu.go deleted file mode 100644 index 817a85e2fe..0000000000 --- a/external/github.com/cloudflare/sidh/internal/utils/cpu.go +++ /dev/null @@ -1,11 +0,0 @@ -package utils - -type x86 struct { - // Signals support for MULX which is in BMI2 - HasBMI2 bool - - // Signals support for ADX - HasADX bool -} - -var X86 x86 diff --git a/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.go b/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.go deleted file mode 100644 index 2666b7aa4b..0000000000 --- a/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.go +++ /dev/null @@ -1,29 +0,0 @@ -// +build amd64,!noasm - -// Sets capabilities flags for x86 according to information received from -// CPUID. It was written in accordance with -// "Intel® 64 and IA-32 Architectures Developer's Manual: Vol. 2A". -// https://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2a-manual.html - -package utils - -// Performs CPUID and returns values of registers -// go:nosplit -func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) - -// Returns true in case bit 'n' in 'bits' is set, otherwise false -func bitn(bits uint32, n uint8) bool { - return (bits>>n)&1 == 1 -} - -func init() { - // CPUID returns max possible input that can be requested - max, _, _, _ := cpuid(0, 0) - if max < 7 { - return - } - - _, ebx, _, _ := cpuid(7, 0) - X86.HasBMI2 = bitn(ebx, 8) - X86.HasADX = bitn(ebx, 19) -} diff --git a/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.s b/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.s deleted file mode 100644 index 2dff942dca..0000000000 --- a/external/github.com/cloudflare/sidh/internal/utils/cpuid_amd64.s +++ /dev/null @@ -1,13 +0,0 @@ -// +build amd64,!noasm - -#include "textflag.h" - -TEXT ·cpuid(SB), NOSPLIT, $0-4 - MOVL eaxArg+0(FP), AX - MOVL ecxArg+4(FP), CX - CPUID - MOVL AX, eax+8(FP) - MOVL BX, ebx+12(FP) - MOVL CX, ecx+16(FP) - MOVL DX, edx+20(FP) - RET diff --git a/external/github.com/cloudflare/sidh/p503/arith_amd64.s b/external/github.com/cloudflare/sidh/p503/arith_amd64.s deleted file mode 100644 index 2068e4ec15..0000000000 --- a/external/github.com/cloudflare/sidh/p503/arith_amd64.s +++ /dev/null @@ -1,1708 +0,0 @@ -// +build amd64,!noasm - -#include "textflag.h" - -// p503 -#define P503_0 $0xFFFFFFFFFFFFFFFF -#define P503_1 $0xFFFFFFFFFFFFFFFF -#define P503_2 $0xFFFFFFFFFFFFFFFF -#define P503_3 $0xABFFFFFFFFFFFFFF -#define P503_4 $0x13085BDA2211E7A0 -#define P503_5 $0x1B9BF6C87B7E7DAF -#define P503_6 $0x6045C6BDDA77A4D0 -#define P503_7 $0x004066F541811E1E - -// p503+1 -#define P503P1_3 $0xAC00000000000000 -#define P503P1_4 $0x13085BDA2211E7A0 -#define P503P1_5 $0x1B9BF6C87B7E7DAF -#define P503P1_6 $0x6045C6BDDA77A4D0 -#define P503P1_7 $0x004066F541811E1E - -// p503x2 -#define P503X2_0 $0xFFFFFFFFFFFFFFFE -#define P503X2_1 $0xFFFFFFFFFFFFFFFF -#define P503X2_2 $0xFFFFFFFFFFFFFFFF -#define P503X2_3 $0x57FFFFFFFFFFFFFF -#define P503X2_4 $0x2610B7B44423CF41 -#define P503X2_5 $0x3737ED90F6FCFB5E -#define P503X2_6 $0xC08B8D7BB4EF49A0 -#define P503X2_7 $0x0080CDEA83023C3C - -#define REG_P1 DI -#define REG_P2 SI -#define REG_P3 DX - -// Performs schoolbook multiplication of 2 256-bit numbers. This optimized version -// uses MULX instruction. Macro smashes value in DX. -// Input: I0 and I1. -// Output: O -// All the other arguments are resgisters, used for storing temporary values -#define MULS256_MULX(O, I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \ - MOVQ I0, DX \ - MULXQ I1, T1, T0 \ // T0:T1 = A0*B0 - MOVQ T1, O \ // O[0] - MULXQ 8+I1, T2, T1 \ // T1:T2 = U0*V1 - ADDQ T2, T0 \ - MULXQ 16+I1, T3, T2 \ // T2:T3 = U0*V2 - ADCQ T3, T1 \ - MULXQ 24+I1, T4, T3 \ // T3:T4 = U0*V3 - ADCQ T4, T2 \ - \ // Column U1 - MOVQ 8+I0, DX \ - ADCQ $0, T3 \ - MULXQ 0+I1, T4, T5 \ // T5:T4 = U1*V0 - MULXQ 8+I1, T7, T6 \ // T6:T7 = U1*V1 - ADDQ T7, T5 \ - MULXQ 16+I1, T8, T7 \ // T7:T8 = U1*V2 - ADCQ T8, T6 \ - MULXQ 24+I1, T9, T8 \ // T8:T9 = U1*V3 - ADCQ T9, T7 \ - ADCQ $0, T8 \ - ADDQ T0, T4 \ - MOVQ T4, 8+O \ // O[1] - ADCQ T1, T5 \ - ADCQ T2, T6 \ - ADCQ T3, T7 \ - \ // Column U2 - MOVQ 16+I0, DX \ - ADCQ $0, T8 \ - MULXQ 0+I1, T0, T1 \ // T1:T0 = U2*V0 - MULXQ 8+I1, T3, T2 \ // T2:T3 = U2*V1 - ADDQ T3, T1 \ - MULXQ 16+I1, T4, T3 \ // T3:T4 = U2*V2 - ADCQ T4, T2 \ - MULXQ 24+I1, T9, T4 \ // T4:T9 = U2*V3 - ADCQ T9, T3 \ - \ // Column U3 - MOVQ 24+I0, DX \ - ADCQ $0, T4 \ - ADDQ T5, T0 \ - MOVQ T0, 16+O \ // O[2] - ADCQ T6, T1 \ - ADCQ T7, T2 \ - ADCQ T8, T3 \ - ADCQ $0, T4 \ - MULXQ 0+I1, T0, T5 \ // T5:T0 = U3*V0 - MULXQ 8+I1, T7, T6 \ // T6:T7 = U3*V1 - ADDQ T7, T5 \ - MULXQ 16+I1, T8, T7 \ // T7:T8 = U3*V2 - ADCQ T8, T6 \ - MULXQ 24+I1, T9, T8 \ // T8:T9 = U3*V3 - ADCQ T9, T7 \ - ADCQ $0, T8 \ - \ // Add values in remaining columns - ADDQ T0, T1 \ - MOVQ T1, 24+O \ // O[3] - ADCQ T5, T2 \ - MOVQ T2, 32+O \ // O[4] - ADCQ T6, T3 \ - MOVQ T3, 40+O \ // O[5] - ADCQ T7, T4 \ - MOVQ T4, 48+O \ // O[6] - ADCQ $0, T8 \ // O[7] - MOVQ T8, 56+O - -// Performs schoolbook multiplication of 2 256-bit numbers. This optimized version -// uses ADOX, ADCX and MULX instructions. Macro smashes values in AX and DX. -// Input: I0 and I1. -// Output: O -// All the other arguments resgisters are used for storing temporary values -#define MULS256_MULX_ADCX_ADOX(O, I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \ - \ // U0[0] - MOVQ 0+I0, DX \ // MULX requires multiplayer in DX - \ // T0:T1 = I1*DX - MULXQ I1, T1, T0 \ // T0:T1 = U0*V0 (low:high) - MOVQ T1, O \ // O0[0] - MULXQ 8+I1, T2, T1 \ // T2:T1 = U0*V1 - XORQ AX, AX \ - ADOXQ T2, T0 \ - MULXQ 16+I1, T3, T2 \ // T2:T3 = U0*V2 - ADOXQ T3, T1 \ - MULXQ 24+I1, T4, T3 \ // T3:T4 = U0*V3 - ADOXQ T4, T2 \ - \ // Column U1 - MOVQ 8+I0, DX \ - MULXQ I1, T4, T5 \ // T5:T4 = U1*V0 - ADOXQ AX, T3 \ - XORQ AX, AX \ - MULXQ 8+I1, T7, T6 \ // T6:T7 = U1*V1 - ADOXQ T0, T4 \ - MOVQ T4, 8+O \ // O[1] - ADCXQ T7, T5 \ - MULXQ 16+I1, T8, T7 \ // T7:T8 = U1*V2 - ADCXQ T8, T6 \ - ADOXQ T1, T5 \ - MULXQ 24+I1, T9, T8 \ // T8:T9 = U1*V3 - ADCXQ T9, T7 \ - ADCXQ AX, T8 \ - ADOXQ T2, T6 \ - \ // Column U2 - MOVQ 16+I0, DX \ - MULXQ I1, T0, T1 \ // T1:T0 = U2*V0 - ADOXQ T3, T7 \ - ADOXQ AX, T8 \ - XORQ AX, AX \ - MULXQ 8+I1, T3, T2 \ // T2:T3 = U2*V1 - ADOXQ T5, T0 \ - MOVQ T0, 16+O \ // O[2] - ADCXQ T3, T1 \ - MULXQ 16+I1, T4, T3 \ // T3:T4 = U2*V2 - ADCXQ T4, T2 \ - ADOXQ T6, T1 \ - MULXQ 24+I1, T9, T4 \ // T9:T4 = U2*V3 - ADCXQ T9, T3 \ - MOVQ 24+I0, DX \ - ADCXQ AX, T4 \ - \ - ADOXQ T7, T2 \ - ADOXQ T8, T3 \ - ADOXQ AX, T4 \ - \ // Column U3 - MULXQ I1, T0, T5 \ // T5:T0 = U3*B0 - XORQ AX, AX \ - MULXQ 8+I1, T7, T6 \ // T6:T7 = U3*B1 - ADCXQ T7, T5 \ - ADOXQ T0, T1 \ - MULXQ 16+I1, T8, T7 \ // T7:T8 = U3*V2 - ADCXQ T8, T6 \ - ADOXQ T5, T2 \ - MULXQ 24+I1, T9, T8 \ // T8:T9 = U3*V3 - ADCXQ T9, T7 \ - ADCXQ AX, T8 \ - \ - ADOXQ T6, T3 \ - ADOXQ T7, T4 \ - ADOXQ AX, T8 \ - MOVQ T1, 24+O \ // O[3] - MOVQ T2, 32+O \ // O[4] - MOVQ T3, 40+O \ // O[5] - MOVQ T4, 48+O \ // O[6] and O[7] below - MOVQ T8, 56+O - -// Template of a macro that performs schoolbook multiplication of 128-bit with 320-bit -// number. It uses MULX instruction This template must be customized with functions -// performing ADD (add1, add2) and ADD-with-carry (adc1, adc2). addX/adcX may or may -// not be instructions that use two independent carry chains. -// Input: -// * I0 128-bit number -// * I1 320-bit number -// * add1, add2: instruction performing integer addition and starting carry chain -// * adc1, adc2: instruction performing integer addition with carry -// Output: T[0-6] registers -#define MULS_128x320(I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, add1, add2, adc1, adc2) \ - \ // Column 0 - MOVQ I0, DX \ - MULXQ I1+24(SB), T0, T1 \ - MULXQ I1+32(SB), T4, T2 \ - XORQ AX, AX \ - MULXQ I1+40(SB), T5, T3 \ - add1 T4, T1 \ - adc1 T5, T2 \ - MULXQ I1+48(SB), T7, T4 \ - adc1 T7, T3 \ - MULXQ I1+56(SB), T6, T5 \ - adc1 T6, T4 \ - adc1 AX, T5 \ - \ // Column 1 - MOVQ 8+I0, DX \ - MULXQ I1+24(SB), T6, T7 \ - add2 T6, T1 \ - adc2 T7, T2 \ - MULXQ I1+32(SB), T8, T6 \ - adc2 T6, T3 \ - MULXQ I1+40(SB), T7, T9 \ - adc2 T9, T4 \ - MULXQ I1+48(SB), T9, T6 \ - adc2 T6, T5 \ - MULXQ I1+56(SB), DX, T6 \ - adc2 AX, T6 \ - \ // Output - XORQ AX, AX \ - add1 T8, T2 \ - adc1 T7, T3 \ - adc1 T9, T4 \ - adc1 DX, T5 \ - adc1 AX, T6 - -// Multiplies 128-bit with 320-bit integer. Optimized with MULX instruction. -#define MULS_128x320_MULX(I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \ - MULS_128x320(I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, ADDQ, ADDQ, ADCQ, ADCQ) - -// Multiplies 128-bit with 320-bit integer. Optimized with MULX, ADOX and ADCX instructions -#define MULS_128x320_MULX_ADCX_ADOX(I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \ - MULS_128x320(I0, I1, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, ADOXQ, ADCXQ, ADOXQ, ADCXQ) - -// Template of a macro performing multiplication of two 512-bit numbers. It uses one -// level of Karatsuba and one level of schoolbook multiplication. Template must be -// customized with macro performing schoolbook multiplication. -// Input: -// * I0, I1 - two 512-bit numbers -// * MULS - either MULS256_MULX or MULS256_MULX_ADCX_ADOX -// Output: OUT - 1024-bit long -#define MUL(OUT, I0, I1, MULS) \ - \ // R[8-11]: U1+U0 - XORQ AX, AX \ - MOVQ ( 0)(I0), R8 \ - MOVQ ( 8)(I0), R9 \ - MOVQ (16)(I0), R10 \ - MOVQ (24)(I0), R11 \ - ADDQ (32)(I0), R8 \ - ADCQ (40)(I0), R9 \ - ADCQ (48)(I0), R10 \ - ADCQ (56)(I0), R11 \ - SBBQ $0, AX \ // store mask - MOVQ R8, ( 0)(SP) \ - MOVQ R9, ( 8)(SP) \ - MOVQ R10, (16)(SP) \ - MOVQ R11, (24)(SP) \ - \ - \ // R[12-15]: V1+V0 - XORQ BX, BX \ - MOVQ ( 0)(I1), R12 \ - MOVQ ( 8)(I1), R13 \ - MOVQ (16)(I1), R14 \ - MOVQ (24)(I1), R15 \ - ADDQ (32)(I1), R12 \ - ADCQ (40)(I1), R13 \ - ADCQ (48)(I1), R14 \ - ADCQ (56)(I1), R15 \ - SBBQ $0, BX \ // store mask - MOVQ R12, (32)(SP) \ - MOVQ R13, (40)(SP) \ - MOVQ R14, (48)(SP) \ - MOVQ R15, (56)(SP) \ - \ // Prepare mask for U0+U1 (U1+U0 mod 256^4 if U1+U0 sets carry flag, otherwise 0) - ANDQ AX, R12 \ - ANDQ AX, R13 \ - ANDQ AX, R14 \ - ANDQ AX, R15 \ - \ // Prepare mask for V0+V1 (V1+V0 mod 256^4 if U1+U0 sets carry flag, otherwise 0) - ANDQ BX, R8 \ - ANDQ BX, R9 \ - ANDQ BX, R10 \ - ANDQ BX, R11 \ - \ // res = masked(U0+U1) + masked(V0 + V1) - ADDQ R12, R8 \ - ADCQ R13, R9 \ - ADCQ R14, R10 \ - ADCQ R15, R11 \ - \ // SP[64-96] <- res - MOVQ R8, (64)(SP) \ - MOVQ R9, (72)(SP) \ - MOVQ R10, (80)(SP) \ - MOVQ R11, (88)(SP) \ - \ // BP will be used for schoolbook multiplication below - MOVQ BP, 96(SP) \ - \ // (U1+U0)*(V1+V0) - MULS((64)(OUT), 0(SP), 32(SP), R8, R9, R10, R11, R12, R13, R14, R15, BX, BP) \ - \ // U0 x V0 - MULS(0(OUT), 0(I0), 0(I1), R8, R9, R10, R11, R12, R13, R14, R15, BX, BP) \ - \ // U1 x V1 - MULS(0(SP), 32(I0), 32(I1), R8, R9, R10, R11, R12, R13, R14, R15, BX, BP) \ - \ // Recover BP - MOVQ 96(SP), BP \ - \ // Final part of schoolbook multiplication; R[8-11] = (U0+U1) x (V0+V1) - MOVQ (64)(SP), R8 \ - MOVQ (72)(SP), R9 \ - MOVQ (80)(SP), R10 \ - MOVQ (88)(SP), R11 \ - MOVQ (96)(OUT), AX \ - ADDQ AX, R8 \ - MOVQ (104)(OUT), AX \ - ADCQ AX, R9 \ - MOVQ (112)(OUT), AX \ - ADCQ AX, R10 \ - MOVQ (120)(OUT), AX \ - ADCQ AX, R11 \ - \ // R[12-15, 8-11] = (U0+U1) x (V0+V1) - U0xV0 - MOVQ (64)(OUT), R12 \ - MOVQ (72)(OUT), R13 \ - MOVQ (80)(OUT), R14 \ - MOVQ (88)(OUT), R15 \ - SUBQ ( 0)(OUT), R12 \ - SBBQ ( 8)(OUT), R13 \ - SBBQ (16)(OUT), R14 \ - SBBQ (24)(OUT), R15 \ - SBBQ (32)(OUT), R8 \ - SBBQ (40)(OUT), R9 \ - SBBQ (48)(OUT), R10 \ - SBBQ (56)(OUT), R11 \ - \ // r8-r15 <- (U0+U1) x (V0+V1) - U0xV0 - U1xV1 - SUBQ ( 0)(SP), R12 \ - SBBQ ( 8)(SP), R13 \ - SBBQ (16)(SP), R14 \ - SBBQ (24)(SP), R15 \ - SBBQ (32)(SP), R8 \ - SBBQ (40)(SP), R9 \ - SBBQ (48)(SP), R10 \ - SBBQ (56)(SP), R11 \ - \ - ; ADDQ (32)(OUT), R12; MOVQ R12, ( 32)(OUT) \ - ; ADCQ (40)(OUT), R13; MOVQ R13, ( 40)(OUT) \ - ; ADCQ (48)(OUT), R14; MOVQ R14, ( 48)(OUT) \ - ; ADCQ (56)(OUT), R15; MOVQ R15, ( 56)(OUT) \ - MOVQ ( 0)(SP), AX; ADCQ AX, R8; MOVQ R8, ( 64)(OUT) \ - MOVQ ( 8)(SP), AX; ADCQ AX, R9; MOVQ R9, ( 72)(OUT) \ - MOVQ (16)(SP), AX; ADCQ AX, R10; MOVQ R10, ( 80)(OUT) \ - MOVQ (24)(SP), AX; ADCQ AX, R11; MOVQ R11, ( 88)(OUT) \ - MOVQ (32)(SP), R12; ADCQ $0, R12; MOVQ R12, ( 96)(OUT) \ - MOVQ (40)(SP), R13; ADCQ $0, R13; MOVQ R13, (104)(OUT) \ - MOVQ (48)(SP), R14; ADCQ $0, R14; MOVQ R14, (112)(OUT) \ - MOVQ (56)(SP), R15; ADCQ $0, R15; MOVQ R15, (120)(OUT) - -// Template for calculating the Montgomery reduction algorithm described in -// section 5.2.3 of https://eprint.iacr.org/2017/1015.pdf. Template must be -// customized with schoolbook multiplicaton for 128 x 320-bit number. -// This macro reuses memory of IN value and *changes* it. Smashes registers -// R[8-15], BX, CX -// Input: -// * IN: 1024-bit number to be reduced -// * MULS: either MULS_128x320_MULX or MULS_128x320_MULX_ADCX_ADOX -// Output: OUT 512-bit -#define REDC(OUT, IN, MULS) \ - MULS(0(IN), ·p503p1, R8, R9, R10, R11, R12, R13, R14, BX, CX, R15) \ - XORQ R15, R15 \ - ADDQ (24)(IN), R8 \ - ADCQ (32)(IN), R9 \ - ADCQ (40)(IN), R10 \ - ADCQ (48)(IN), R11 \ - ADCQ (56)(IN), R12 \ - ADCQ (64)(IN), R13 \ - ADCQ (72)(IN), R14 \ - ADCQ (80)(IN), R15 \ - MOVQ R8, (24)(IN) \ - MOVQ R9, (32)(IN) \ - MOVQ R10, (40)(IN) \ - MOVQ R11, (48)(IN) \ - MOVQ R12, (56)(IN) \ - MOVQ R13, (64)(IN) \ - MOVQ R14, (72)(IN) \ - MOVQ R15, (80)(IN) \ - MOVQ (88)(IN), R8 \ - MOVQ (96)(IN), R9 \ - MOVQ (104)(IN), R10 \ - MOVQ (112)(IN), R11 \ - MOVQ (120)(IN), R12 \ - ADCQ $0, R8 \ - ADCQ $0, R9 \ - ADCQ $0, R10 \ - ADCQ $0, R11 \ - ADCQ $0, R12 \ - MOVQ R8, (88)(IN) \ - MOVQ R9, (96)(IN) \ - MOVQ R10, (104)(IN) \ - MOVQ R11, (112)(IN) \ - MOVQ R12, (120)(IN) \ - \ - MULS(16(IN), ·p503p1, R8, R9, R10, R11, R12, R13, R14, BX, CX, R15) \ - XORQ R15, R15 \ - ADDQ (40)(IN), R8 \ - ADCQ (48)(IN), R9 \ - ADCQ (56)(IN), R10 \ - ADCQ (64)(IN), R11 \ - ADCQ (72)(IN), R12 \ - ADCQ (80)(IN), R13 \ - ADCQ (88)(IN), R14 \ - ADCQ (96)(IN), R15 \ - MOVQ R8, (40)(IN) \ - MOVQ R9, (48)(IN) \ - MOVQ R10, (56)(IN) \ - MOVQ R11, (64)(IN) \ - MOVQ R12, (72)(IN) \ - MOVQ R13, (80)(IN) \ - MOVQ R14, (88)(IN) \ - MOVQ R15, (96)(IN) \ - MOVQ (104)(IN), R8 \ - MOVQ (112)(IN), R9 \ - MOVQ (120)(IN), R10 \ - ADCQ $0, R8 \ - ADCQ $0, R9 \ - ADCQ $0, R10 \ - MOVQ R8, (104)(IN) \ - MOVQ R9, (112)(IN) \ - MOVQ R10, (120)(IN) \ - \ - MULS(32(IN), ·p503p1, R8, R9, R10, R11, R12, R13, R14, BX, CX, R15) \ - XORQ R15, R15 \ - XORQ BX, BX \ - ADDQ ( 56)(IN), R8 \ - ADCQ ( 64)(IN), R9 \ - ADCQ ( 72)(IN), R10 \ - ADCQ ( 80)(IN), R11 \ - ADCQ ( 88)(IN), R12 \ - ADCQ ( 96)(IN), R13 \ - ADCQ (104)(IN), R14 \ - ADCQ (112)(IN), R15 \ - ADCQ (120)(IN), BX \ - MOVQ R8, ( 56)(IN) \ - MOVQ R10, ( 72)(IN) \ - MOVQ R11, ( 80)(IN) \ - MOVQ R12, ( 88)(IN) \ - MOVQ R13, ( 96)(IN) \ - MOVQ R14, (104)(IN) \ - MOVQ R15, (112)(IN) \ - MOVQ BX, (120)(IN) \ - MOVQ R9, ( 0)(OUT) \ // Result: OUT[0] - \ - MULS(48(IN), ·p503p1, R8, R9, R10, R11, R12, R13, R14, BX, CX, R15) \ - ADDQ ( 72)(IN), R8 \ - ADCQ ( 80)(IN), R9 \ - ADCQ ( 88)(IN), R10 \ - ADCQ ( 96)(IN), R11 \ - ADCQ (104)(IN), R12 \ - ADCQ (112)(IN), R13 \ - ADCQ (120)(IN), R14 \ - MOVQ R8, ( 8)(OUT) \ // Result: OUT[1] - MOVQ R9, (16)(OUT) \ // Result: OUT[2] - MOVQ R10, (24)(OUT) \ // Result: OUT[3] - MOVQ R11, (32)(OUT) \ // Result: OUT[4] - MOVQ R12, (40)(OUT) \ // Result: OUT[5] - MOVQ R13, (48)(OUT) \ // Result: OUT[6] and OUT[7] - MOVQ R14, (56)(OUT) - -TEXT ·fp503StrongReduce(SB), NOSPLIT, $0-8 - MOVQ x+0(FP), REG_P1 - - // Zero AX for later use: - XORQ AX, AX - - // Load p into registers: - MOVQ P503_0, R8 - // P503_{1,2} = P503_0, so reuse R8 - MOVQ P503_3, R9 - MOVQ P503_4, R10 - MOVQ P503_5, R11 - MOVQ P503_6, R12 - MOVQ P503_7, R13 - - // Set x <- x - p - SUBQ R8, ( 0)(REG_P1) - SBBQ R8, ( 8)(REG_P1) - SBBQ R8, (16)(REG_P1) - SBBQ R9, (24)(REG_P1) - SBBQ R10, (32)(REG_P1) - SBBQ R11, (40)(REG_P1) - SBBQ R12, (48)(REG_P1) - SBBQ R13, (56)(REG_P1) - - // Save carry flag indicating x-p < 0 as a mask - SBBQ $0, AX - - // Conditionally add p to x if x-p < 0 - ANDQ AX, R8 - ANDQ AX, R9 - ANDQ AX, R10 - ANDQ AX, R11 - ANDQ AX, R12 - ANDQ AX, R13 - - ADDQ R8, ( 0)(REG_P1) - ADCQ R8, ( 8)(REG_P1) - ADCQ R8, (16)(REG_P1) - ADCQ R9, (24)(REG_P1) - ADCQ R10,(32)(REG_P1) - ADCQ R11,(40)(REG_P1) - ADCQ R12,(48)(REG_P1) - ADCQ R13,(56)(REG_P1) - - RET - -TEXT ·fp503ConditionalSwap(SB),NOSPLIT,$0-17 - - MOVQ x+0(FP), REG_P1 - MOVQ y+8(FP), REG_P2 - MOVB choice+16(FP), AL // AL = 0 or 1 - MOVBLZX AL, AX // AX = 0 or 1 - NEGQ AX // AX = 0x00..00 or 0xff..ff - -#ifndef CSWAP_BLOCK -#define CSWAP_BLOCK(idx) \ - MOVQ (idx*8)(REG_P1), BX \ // BX = x[idx] - MOVQ (idx*8)(REG_P2), CX \ // CX = y[idx] - MOVQ CX, DX \ // DX = y[idx] - XORQ BX, DX \ // DX = y[idx] ^ x[idx] - ANDQ AX, DX \ // DX = (y[idx] ^ x[idx]) & mask - XORQ DX, BX \ // BX = (y[idx] ^ x[idx]) & mask) ^ x[idx] = x[idx] or y[idx] - XORQ DX, CX \ // CX = (y[idx] ^ x[idx]) & mask) ^ y[idx] = y[idx] or x[idx] - MOVQ BX, (idx*8)(REG_P1) \ - MOVQ CX, (idx*8)(REG_P2) -#endif - - CSWAP_BLOCK(0) - CSWAP_BLOCK(1) - CSWAP_BLOCK(2) - CSWAP_BLOCK(3) - CSWAP_BLOCK(4) - CSWAP_BLOCK(5) - CSWAP_BLOCK(6) - CSWAP_BLOCK(7) - -#ifdef CSWAP_BLOCK -#undef CSWAP_BLOCK -#endif - - RET - -TEXT ·fp503AddReduced(SB),NOSPLIT,$0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - // Used later to calculate a mask - XORQ CX, CX - - // [R8-R15]: z = x + y - MOVQ ( 0)(REG_P1), R8 - MOVQ ( 8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - ADDQ ( 0)(REG_P2), R8 - ADCQ ( 8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - - MOVQ P503X2_0, AX - SUBQ AX, R8 - MOVQ P503X2_1, AX - SBBQ AX, R9 - SBBQ AX, R10 - MOVQ P503X2_3, AX - SBBQ AX, R11 - MOVQ P503X2_4, AX - SBBQ AX, R12 - MOVQ P503X2_5, AX - SBBQ AX, R13 - MOVQ P503X2_6, AX - SBBQ AX, R14 - MOVQ P503X2_7, AX - SBBQ AX, R15 - - // mask - SBBQ $0, CX - - // move z to REG_P3 - MOVQ R8, ( 0)(REG_P3) - MOVQ R9, ( 8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - - // if z<0 add p503x2 back - MOVQ P503X2_0, R8 - MOVQ P503X2_1, R9 - MOVQ P503X2_3, R10 - MOVQ P503X2_4, R11 - MOVQ P503X2_5, R12 - MOVQ P503X2_6, R13 - MOVQ P503X2_7, R14 - ANDQ CX, R8 - ANDQ CX, R9 - ANDQ CX, R10 - ANDQ CX, R11 - ANDQ CX, R12 - ANDQ CX, R13 - ANDQ CX, R14 - MOVQ ( 0)(REG_P3), AX; ADDQ R8, AX; MOVQ AX, ( 0)(REG_P3) - MOVQ ( 8)(REG_P3), AX; ADCQ R9, AX; MOVQ AX, ( 8)(REG_P3) - MOVQ (16)(REG_P3), AX; ADCQ R9, AX; MOVQ AX, (16)(REG_P3) - MOVQ (24)(REG_P3), AX; ADCQ R10, AX; MOVQ AX, (24)(REG_P3) - MOVQ (32)(REG_P3), AX; ADCQ R11, AX; MOVQ AX, (32)(REG_P3) - MOVQ (40)(REG_P3), AX; ADCQ R12, AX; MOVQ AX, (40)(REG_P3) - MOVQ (48)(REG_P3), AX; ADCQ R13, AX; MOVQ AX, (48)(REG_P3) - MOVQ (56)(REG_P3), AX; ADCQ R14, AX; MOVQ AX, (56)(REG_P3) - RET - -TEXT ·fp503SubReduced(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - // Used later to calculate a mask - XORQ CX, CX - - MOVQ ( 0)(REG_P1), R8 - MOVQ ( 8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - - SUBQ ( 0)(REG_P2), R8 - SBBQ ( 8)(REG_P2), R9 - SBBQ (16)(REG_P2), R10 - SBBQ (24)(REG_P2), R11 - SBBQ (32)(REG_P2), R12 - SBBQ (40)(REG_P2), R13 - SBBQ (48)(REG_P2), R14 - SBBQ (56)(REG_P2), R15 - - // mask - SBBQ $0, CX - - // store x-y in REG_P3 - MOVQ R8, ( 0)(REG_P3) - MOVQ R9, ( 8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - - // if z<0 add p503x2 back - MOVQ P503X2_0, R8 - MOVQ P503X2_1, R9 - MOVQ P503X2_3, R10 - MOVQ P503X2_4, R11 - MOVQ P503X2_5, R12 - MOVQ P503X2_6, R13 - MOVQ P503X2_7, R14 - ANDQ CX, R8 - ANDQ CX, R9 - ANDQ CX, R10 - ANDQ CX, R11 - ANDQ CX, R12 - ANDQ CX, R13 - ANDQ CX, R14 - MOVQ ( 0)(REG_P3), AX; ADDQ R8, AX; MOVQ AX, ( 0)(REG_P3) - MOVQ ( 8)(REG_P3), AX; ADCQ R9, AX; MOVQ AX, ( 8)(REG_P3) - MOVQ (16)(REG_P3), AX; ADCQ R9, AX; MOVQ AX, (16)(REG_P3) - MOVQ (24)(REG_P3), AX; ADCQ R10, AX; MOVQ AX, (24)(REG_P3) - MOVQ (32)(REG_P3), AX; ADCQ R11, AX; MOVQ AX, (32)(REG_P3) - MOVQ (40)(REG_P3), AX; ADCQ R12, AX; MOVQ AX, (40)(REG_P3) - MOVQ (48)(REG_P3), AX; ADCQ R13, AX; MOVQ AX, (48)(REG_P3) - MOVQ (56)(REG_P3), AX; ADCQ R14, AX; MOVQ AX, (56)(REG_P3) - - RET - -TEXT ·fp503Mul(SB), NOSPLIT, $104-24 - MOVQ z+ 0(FP), CX - MOVQ x+ 8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - // Check wether to use optimized implementation - CMPB ·HasADXandBMI2(SB), $1 - JE mul_with_mulx_adcx_adox - CMPB ·HasBMI2(SB), $1 - JE mul_with_mulx - - // Generic x86 implementation (below) uses variant of Karatsuba method. - // - // Here we store the destination in CX instead of in REG_P3 because the - // multiplication instructions use DX as an implicit destination - // operand: MULQ $REG sets DX:AX <-- AX * $REG. - - // RAX and RDX will be used for a mask (0-borrow) - XORQ AX, AX - - // RCX[0-3]: U1+U0 - MOVQ (32)(REG_P1), R8 - MOVQ (40)(REG_P1), R9 - MOVQ (48)(REG_P1), R10 - MOVQ (56)(REG_P1), R11 - ADDQ ( 0)(REG_P1), R8 - ADCQ ( 8)(REG_P1), R9 - ADCQ (16)(REG_P1), R10 - ADCQ (24)(REG_P1), R11 - MOVQ R8, ( 0)(CX) - MOVQ R9, ( 8)(CX) - MOVQ R10, (16)(CX) - MOVQ R11, (24)(CX) - - SBBQ $0, AX - - // R12-R15: V1+V0 - XORQ DX, DX - MOVQ (32)(REG_P2), R12 - MOVQ (40)(REG_P2), R13 - MOVQ (48)(REG_P2), R14 - MOVQ (56)(REG_P2), R15 - ADDQ ( 0)(REG_P2), R12 - ADCQ ( 8)(REG_P2), R13 - ADCQ (16)(REG_P2), R14 - ADCQ (24)(REG_P2), R15 - - SBBQ $0, DX - - // Store carries on stack - MOVQ AX, (64)(SP) - MOVQ DX, (72)(SP) - - // (SP[0-3],R8,R9,R10,R11) <- (U0+U1)*(V0+V1). - // MUL using comba; In comments below U=U0+U1 V=V0+V1 - - // U0*V0 - MOVQ (CX), AX - MULQ R12 - MOVQ AX, (SP) // C0 - MOVQ DX, R8 - - // U0*V1 - XORQ R9, R9 - MOVQ (CX), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - - // U1*V0 - XORQ R10, R10 - MOVQ (8)(CX), AX - MULQ R12 - ADDQ AX, R8 - MOVQ R8, (8)(SP) // C1 - ADCQ DX, R9 - ADCQ $0, R10 - - // U0*V2 - XORQ R8, R8 - MOVQ (CX), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - // U2*V0 - MOVQ (16)(CX), AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - // U1*V1 - MOVQ (8)(CX), AX - MULQ R13 - ADDQ AX, R9 - MOVQ R9, (16)(SP) // C2 - ADCQ DX, R10 - ADCQ $0, R8 - - // U0*V3 - XORQ R9, R9 - MOVQ (CX), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U3*V0 - MOVQ (24)(CX), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U1*V2 - MOVQ (8)(CX), AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U2*V1 - MOVQ (16)(CX), AX - MULQ R13 - ADDQ AX, R10 - MOVQ R10, (24)(SP) // C3 - ADCQ DX, R8 - ADCQ $0, R9 - - // U1*V3 - XORQ R10, R10 - MOVQ (8)(CX), AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - // U3*V1 - MOVQ (24)(CX), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - // U2*V2 - MOVQ (16)(CX), AX - MULQ R14 - ADDQ AX, R8 - MOVQ R8, (32)(SP) // C4 - ADCQ DX, R9 - ADCQ $0, R10 - - // U2*V3 - XORQ R11, R11 - MOVQ (16)(CX), AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R11 - - // U3*V2 - MOVQ (24)(CX), AX - MULQ R14 - ADDQ AX, R9 // C5 - ADCQ DX, R10 - ADCQ $0, R11 - - // U3*V3 - MOVQ (24)(CX), AX - MULQ R15 - ADDQ AX, R10 // C6 - ADCQ DX, R11 // C7 - - MOVQ (64)(SP), AX - ANDQ AX, R12 - ANDQ AX, R13 - ANDQ AX, R14 - ANDQ AX, R15 - ADDQ R8, R12 - ADCQ R9, R13 - ADCQ R10, R14 - ADCQ R11, R15 - - MOVQ (72)(SP), AX - MOVQ (CX), R8 - MOVQ (8)(CX), R9 - MOVQ (16)(CX), R10 - MOVQ (24)(CX), R11 - ANDQ AX, R8 - ANDQ AX, R9 - ANDQ AX, R10 - ANDQ AX, R11 - ADDQ R12, R8 - ADCQ R13, R9 - ADCQ R14, R10 - ADCQ R15, R11 - MOVQ R8, (32)(SP) - MOVQ R9, (40)(SP) - MOVQ R10, (48)(SP) - MOVQ R11, (56)(SP) - - // CX[0-7] <- AL*BL - - // U0*V0 - MOVQ (REG_P1), R11 - MOVQ (REG_P2), AX - MULQ R11 - XORQ R9, R9 - MOVQ AX, (CX) // C0 - MOVQ DX, R8 - - // U0*V1 - MOVQ (16)(REG_P1), R14 - MOVQ (8)(REG_P2), AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - ADCQ DX, R9 - - // U1*V0 - MOVQ (8)(REG_P1), R12 - MOVQ (REG_P2), AX - MULQ R12 - ADDQ AX, R8 - MOVQ R8, (8)(CX) // C1 - ADCQ DX, R9 - ADCQ $0, R10 - - // U0*V2 - XORQ R8, R8 - MOVQ (16)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - // U2*V0 - MOVQ (REG_P2), R13 - MOVQ R14, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - // U1*V1 - MOVQ (8)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - MOVQ R9, (16)(CX) // C2 - ADCQ DX, R10 - ADCQ $0, R8 - - // U0*V3 - XORQ R9, R9 - MOVQ (24)(REG_P2), AX - MULQ R11 - MOVQ (24)(REG_P1), R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U3*V1 - MOVQ R15, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U2*V2 - MOVQ (16)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - // U2*V3 - MOVQ (8)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - MOVQ R10, (24)(CX) // C3 - ADCQ DX, R8 - ADCQ $0, R9 - - // U3*V2 - XORQ R10, R10 - MOVQ (24)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - // U3*V1 - MOVQ (8)(REG_P2), AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - // U2*V2 - MOVQ (16)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - MOVQ R8, (32)(CX) // C4 - ADCQ DX, R9 - ADCQ $0, R10 - - // U2*V3 - XORQ R8, R8 - MOVQ (24)(REG_P2), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - // U3*V2 - MOVQ (16)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - MOVQ R9, (40)(CX) // C5 - ADCQ DX, R10 - ADCQ $0, R8 - - // U3*V3 - MOVQ (24)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - MOVQ R10, (48)(CX) // C6 - ADCQ DX, R8 - MOVQ R8, (56)(CX) // C7 - - // CX[8-15] <- U1*V1 - MOVQ (32)(REG_P1), R11 - MOVQ (32)(REG_P2), AX - MULQ R11 - XORQ R9, R9 - MOVQ AX, (64)(CX) // C0 - MOVQ DX, R8 - - MOVQ (48)(REG_P1), R14 - MOVQ (40)(REG_P2), AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - ADCQ DX, R9 - - MOVQ (40)(REG_P1), R12 - MOVQ (32)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - MOVQ R8, (72)(CX) // C1 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (48)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (32)(REG_P2), R13 - MOVQ R14, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - MOVQ R9, (80)(CX) // C2 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (56)(REG_P2), AX - MULQ R11 - MOVQ (56)(REG_P1), R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ R15, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (48)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (40)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - MOVQ R10, (88)(CX) // C3 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (56)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (40)(REG_P2), AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (48)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - MOVQ R8, (96)(CX) // C4 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (56)(REG_P2), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (48)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - MOVQ R9, (104)(CX) // C5 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (56)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - MOVQ R10, (112)(CX) // C6 - ADCQ DX, R8 - MOVQ R8, (120)(CX) // C7 - - // [R8-R15] <- (U0+U1)*(V0+V1) - U1*V1 - MOVQ (SP), R8 - SUBQ (CX), R8 - MOVQ (8)(SP), R9 - SBBQ (8)(CX), R9 - MOVQ (16)(SP), R10 - SBBQ (16)(CX), R10 - MOVQ (24)(SP), R11 - SBBQ (24)(CX), R11 - MOVQ (32)(SP), R12 - SBBQ (32)(CX), R12 - MOVQ (40)(SP), R13 - SBBQ (40)(CX), R13 - MOVQ (48)(SP), R14 - SBBQ (48)(CX), R14 - MOVQ (56)(SP), R15 - SBBQ (56)(CX), R15 - - // [R8-R15] <- (U0+U1)*(V0+V1) - U1*V0 - U0*U1 - MOVQ ( 64)(CX), AX; SUBQ AX, R8 - MOVQ ( 72)(CX), AX; SBBQ AX, R9 - MOVQ ( 80)(CX), AX; SBBQ AX, R10 - MOVQ ( 88)(CX), AX; SBBQ AX, R11 - MOVQ ( 96)(CX), AX; SBBQ AX, R12 - MOVQ (104)(CX), DX; SBBQ DX, R13 - MOVQ (112)(CX), DI; SBBQ DI, R14 - MOVQ (120)(CX), SI; SBBQ SI, R15 - - // Final result - ADDQ (32)(CX), R8; MOVQ R8, (32)(CX) - ADCQ (40)(CX), R9; MOVQ R9, (40)(CX) - ADCQ (48)(CX), R10; MOVQ R10, (48)(CX) - ADCQ (56)(CX), R11; MOVQ R11, (56)(CX) - ADCQ (64)(CX), R12; MOVQ R12, (64)(CX) - ADCQ (72)(CX), R13; MOVQ R13, (72)(CX) - ADCQ (80)(CX), R14; MOVQ R14, (80)(CX) - ADCQ (88)(CX), R15; MOVQ R15, (88)(CX) - ADCQ $0, AX; MOVQ AX, (96)(CX) - ADCQ $0, DX; MOVQ DX, (104)(CX) - ADCQ $0, DI; MOVQ DI, (112)(CX) - ADCQ $0, SI; MOVQ SI, (120)(CX) - RET - -mul_with_mulx_adcx_adox: - // Mul implementation for CPUs supporting two independent carry chain - // (ADOX/ADCX) instructions and carry-less MULX multiplier - MUL(CX, REG_P1, REG_P2, MULS256_MULX_ADCX_ADOX) - RET - -mul_with_mulx: - // Mul implementation for CPUs supporting carry-less MULX multiplier. - MUL(CX, REG_P1, REG_P2, MULS256_MULX) - RET - -TEXT ·fp503MontgomeryReduce(SB), $0-16 - MOVQ z+0(FP), REG_P2 - MOVQ x+8(FP), REG_P1 - - // Check wether to use optimized implementation - CMPB ·HasADXandBMI2(SB), $1 - JE redc_with_mulx_adcx_adox - CMPB ·HasBMI2(SB), $1 - JE redc_with_mulx - - MOVQ (REG_P1), R11 - MOVQ P503P1_3, AX - MULQ R11 - XORQ R8, R8 - ADDQ (24)(REG_P1), AX - MOVQ AX, (24)(REG_P2) - ADCQ DX, R8 - - XORQ R9, R9 - MOVQ P503P1_4, AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - ADCQ DX, R9 - - MOVQ (8)(REG_P1), R12 - MOVQ P503P1_3, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (32)(REG_P1), R8 - MOVQ R8, (32)(REG_P2) // Z4 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P503P1_5, AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_4, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (16)(REG_P1), R13 - MOVQ P503P1_3, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (40)(REG_P1), R9 - MOVQ R9, (40)(REG_P2) // Z5 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P503P1_6, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_5, AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_4, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (24)(REG_P2), R14 - MOVQ P503P1_3, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (48)(REG_P1), R10 - MOVQ R10, (48)(REG_P2) // Z6 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P503P1_7, AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_6, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_5, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_4, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (32)(REG_P2), R15 - MOVQ P503P1_3, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (56)(REG_P1), R8 - MOVQ R8, (56)(REG_P2) // Z7 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P503P1_7, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_6, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_5, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_4, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(REG_P2), CX - MOVQ P503P1_3, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (64)(REG_P1), R9 - MOVQ R9, (REG_P2) // Z0 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P503P1_7, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_6, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_5, AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_4, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (48)(REG_P2), R13 - MOVQ P503P1_3, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (72)(REG_P1), R10 - MOVQ R10, (8)(REG_P2) // Z1 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P503P1_7, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_6, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_5, AX - MULQ CX - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_4, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (56)(REG_P2), R14 - MOVQ P503P1_3, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (80)(REG_P1), R8 - MOVQ R8, (16)(REG_P2) // Z2 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P503P1_7, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_6, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_5, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P503P1_4, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (88)(REG_P1), R9 - MOVQ R9, (24)(REG_P2) // Z3 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P503P1_7, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_6, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P503P1_5, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (96)(REG_P1), R10 - MOVQ R10, (32)(REG_P2) // Z4 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P503P1_7, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P503P1_6, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (104)(REG_P1), R8 // Z5 - MOVQ R8, (40)(REG_P2) // Z5 - ADCQ $0, R9 - ADCQ $0, R10 - - MOVQ P503P1_7, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADDQ (112)(REG_P1), R9 // Z6 - MOVQ R9, (48)(REG_P2) // Z6 - ADCQ $0, R10 - ADDQ (120)(REG_P1), R10 // Z7 - MOVQ R10, (56)(REG_P2) // Z7 - RET - -redc_with_mulx_adcx_adox: - // Implementation of the Montgomery reduction for CPUs - // supporting two independent carry chain (ADOX/ADCX) - // instructions and carry-less MULX multiplier - REDC(REG_P2, REG_P1, MULS_128x320_MULX_ADCX_ADOX) - RET - -redc_with_mulx: - // Implementation of the Montgomery reduction for CPUs - // supporting carry-less MULX multiplier. - REDC(REG_P2, REG_P1, MULS_128x320_MULX) - RET - -TEXT ·fp503AddLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - - RET - -TEXT ·fp503X2AddLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), AX - MOVQ (72)(REG_P1), BX - MOVQ (80)(REG_P1), CX - - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - ADCQ (64)(REG_P2), AX - ADCQ (72)(REG_P2), BX - ADCQ (80)(REG_P2), CX - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ AX, (64)(REG_P3) - MOVQ BX, (72)(REG_P3) - MOVQ CX, (80)(REG_P3) - - MOVQ (88)(REG_P1), R8 - MOVQ (96)(REG_P1), R9 - MOVQ (104)(REG_P1), R10 - MOVQ (112)(REG_P1), R11 - MOVQ (120)(REG_P1), R12 - - ADCQ (88)(REG_P2), R8 - ADCQ (96)(REG_P2), R9 - ADCQ (104)(REG_P2), R10 - ADCQ (112)(REG_P2), R11 - ADCQ (120)(REG_P2), R12 - - MOVQ R8, (88)(REG_P3) - MOVQ R9, (96)(REG_P3) - MOVQ R10, (104)(REG_P3) - MOVQ R11, (112)(REG_P3) - MOVQ R12, (120)(REG_P3) - - RET - -TEXT ·fp503X2SubLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - // Used later to store result of 0-borrow - XORQ CX, CX - - // SUBC for first 11 limbs - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), AX - MOVQ (72)(REG_P1), BX - - SUBQ (REG_P2), R8 - SBBQ (8)(REG_P2), R9 - SBBQ (16)(REG_P2), R10 - SBBQ (24)(REG_P2), R11 - SBBQ (32)(REG_P2), R12 - SBBQ (40)(REG_P2), R13 - SBBQ (48)(REG_P2), R14 - SBBQ (56)(REG_P2), R15 - SBBQ (64)(REG_P2), AX - SBBQ (72)(REG_P2), BX - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ AX, (64)(REG_P3) - MOVQ BX, (72)(REG_P3) - - // SUBC for last 5 limbs - MOVQ (80)(REG_P1), R8 - MOVQ (88)(REG_P1), R9 - MOVQ (96)(REG_P1), R10 - MOVQ (104)(REG_P1), R11 - MOVQ (112)(REG_P1), R12 - MOVQ (120)(REG_P1), R13 - - SBBQ (80)(REG_P2), R8 - SBBQ (88)(REG_P2), R9 - SBBQ (96)(REG_P2), R10 - SBBQ (104)(REG_P2), R11 - SBBQ (112)(REG_P2), R12 - SBBQ (120)(REG_P2), R13 - - MOVQ R8, (80)(REG_P3) - MOVQ R9, (88)(REG_P3) - MOVQ R10, (96)(REG_P3) - MOVQ R11, (104)(REG_P3) - MOVQ R12, (112)(REG_P3) - MOVQ R13, (120)(REG_P3) - - // Now the carry flag is 1 if x-y < 0. If so, add p*2^512. - SBBQ $0, CX - - // Load p into registers: - MOVQ P503_0, R8 - // P503_{1,2} = P503_0, so reuse R8 - MOVQ P503_3, R9 - MOVQ P503_4, R10 - MOVQ P503_5, R11 - MOVQ P503_6, R12 - MOVQ P503_7, R13 - - ANDQ CX, R8 - ANDQ CX, R9 - ANDQ CX, R10 - ANDQ CX, R11 - ANDQ CX, R12 - ANDQ CX, R13 - - MOVQ (64 )(REG_P3), AX; ADDQ R8, AX; MOVQ AX, (64 )(REG_P3) - MOVQ (64+ 8)(REG_P3), AX; ADCQ R8, AX; MOVQ AX, (64+ 8)(REG_P3) - MOVQ (64+16)(REG_P3), AX; ADCQ R8, AX; MOVQ AX, (64+16)(REG_P3) - MOVQ (64+24)(REG_P3), AX; ADCQ R9, AX; MOVQ AX, (64+24)(REG_P3) - MOVQ (64+32)(REG_P3), AX; ADCQ R10, AX; MOVQ AX, (64+32)(REG_P3) - MOVQ (64+40)(REG_P3), AX; ADCQ R11, AX; MOVQ AX, (64+40)(REG_P3) - MOVQ (64+48)(REG_P3), AX; ADCQ R12, AX; MOVQ AX, (64+48)(REG_P3) - MOVQ (64+56)(REG_P3), AX; ADCQ R13, AX; MOVQ AX, (64+56)(REG_P3) - - RET diff --git a/external/github.com/cloudflare/sidh/p503/arith_arm64.s b/external/github.com/cloudflare/sidh/p503/arith_arm64.s deleted file mode 100644 index 03eabe9e25..0000000000 --- a/external/github.com/cloudflare/sidh/p503/arith_arm64.s +++ /dev/null @@ -1,802 +0,0 @@ -// +build arm64,!noasm - -#include "textflag.h" - -TEXT ·fp503ConditionalSwap(SB), NOSPLIT, $0-17 - MOVD x+0(FP), R0 - MOVD y+8(FP), R1 - MOVB choice+16(FP), R2 - - // Set flags - // If choice is not 0 or 1, this implementation will swap completely - CMP $0, R2 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 0(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 0(R1) - - LDP 16(R0), (R3, R4) - LDP 16(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 16(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 16(R1) - - LDP 32(R0), (R3, R4) - LDP 32(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 32(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 32(R1) - - LDP 48(R0), (R3, R4) - LDP 48(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 48(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 48(R1) - - RET - -TEXT ·fp503AddReduced(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load first summand into R3-R10 - // Add first summand and second summand and store result in R3-R10 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R11, R12) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R13, R14) - ADDS R11, R3 - ADCS R12, R4 - ADCS R13, R5 - ADCS R14, R6 - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R11, R12) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R13, R14) - ADCS R11, R7 - ADCS R12, R8 - ADCS R13, R9 - ADC R14, R10 - - // Subtract 2 * p503 in R11-R17 from the result in R3-R10 - LDP ·p503x2+0(SB), (R11, R12) - LDP ·p503x2+24(SB), (R13, R14) - SUBS R11, R3 - SBCS R12, R4 - LDP ·p503x2+40(SB), (R15, R16) - SBCS R12, R5 - SBCS R13, R6 - MOVD ·p503x2+56(SB), R17 - SBCS R14, R7 - SBCS R15, R8 - SBCS R16, R9 - SBCS R17, R10 - SBC ZR, ZR, R19 - - // If x + y - 2 * p503 < 0, R19 is 1 and 2 * p503 should be added - AND R19, R11 - AND R19, R12 - AND R19, R13 - AND R19, R14 - AND R19, R15 - AND R19, R16 - AND R19, R17 - - ADDS R11, R3 - ADCS R12, R4 - STP (R3, R4), 0(R2) - ADCS R12, R5 - ADCS R13, R6 - STP (R5, R6), 16(R2) - ADCS R14, R7 - ADCS R15, R8 - STP (R7, R8), 32(R2) - ADCS R16, R9 - ADC R17, R10 - STP (R9, R10), 48(R2) - - RET - -TEXT ·fp503SubReduced(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load x into R3-R10 - // Subtract y from x and store result in R3-R10 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R11, R12) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R13, R14) - SUBS R11, R3 - SBCS R12, R4 - SBCS R13, R5 - SBCS R14, R6 - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R11, R12) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R13, R14) - SBCS R11, R7 - SBCS R12, R8 - SBCS R13, R9 - SBCS R14, R10 - SBC ZR, ZR, R19 - - // If x - y < 0, R19 is 1 and 2 * p503 should be added - LDP ·p503x2+0(SB), (R11, R12) - LDP ·p503x2+24(SB), (R13, R14) - AND R19, R11 - AND R19, R12 - LDP ·p503x2+40(SB), (R15, R16) - AND R19, R13 - AND R19, R14 - MOVD ·p503x2+56(SB), R17 - AND R19, R15 - AND R19, R16 - AND R19, R17 - - ADDS R11, R3 - ADCS R12, R4 - STP (R3, R4), 0(R2) - ADCS R12, R5 - ADCS R13, R6 - STP (R5, R6), 16(R2) - ADCS R14, R7 - ADCS R15, R8 - STP (R7, R8), 32(R2) - ADCS R16, R9 - ADC R17, R10 - STP (R9, R10), 48(R2) - - RET - -TEXT ·fp503AddLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load first summand into R3-R10 - // Add first summand and second summand and store result in R3-R10 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R11, R12) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R13, R14) - ADDS R11, R3 - ADCS R12, R4 - STP (R3, R4), 0(R2) - ADCS R13, R5 - ADCS R14, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R11, R12) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R13, R14) - ADCS R11, R7 - ADCS R12, R8 - STP (R7, R8), 32(R2) - ADCS R13, R9 - ADC R14, R10 - STP (R9, R10), 48(R2) - - RET - -TEXT ·fp503X2AddLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R11, R12) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R13, R14) - ADDS R11, R3 - ADCS R12, R4 - STP (R3, R4), 0(R2) - ADCS R13, R5 - ADCS R14, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R11, R12) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R13, R14) - ADCS R11, R7 - ADCS R12, R8 - STP (R7, R8), 32(R2) - ADCS R13, R9 - ADCS R14, R10 - STP (R9, R10), 48(R2) - - LDP 64(R0), (R3, R4) - LDP 64(R1), (R11, R12) - LDP 80(R0), (R5, R6) - LDP 80(R1), (R13, R14) - ADCS R11, R3 - ADCS R12, R4 - STP (R3, R4), 64(R2) - ADCS R13, R5 - ADCS R14, R6 - STP (R5, R6), 80(R2) - - LDP 96(R0), (R7, R8) - LDP 96(R1), (R11, R12) - LDP 112(R0), (R9, R10) - LDP 112(R1), (R13, R14) - ADCS R11, R7 - ADCS R12, R8 - STP (R7, R8), 96(R2) - ADCS R13, R9 - ADC R14, R10 - STP (R9, R10), 112(R2) - - RET - -TEXT ·fp503X2SubLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R11, R12) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R13, R14) - SUBS R11, R3 - SBCS R12, R4 - STP (R3, R4), 0(R2) - SBCS R13, R5 - SBCS R14, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R11, R12) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R13, R14) - SBCS R11, R7 - SBCS R12, R8 - STP (R7, R8), 32(R2) - SBCS R13, R9 - SBCS R14, R10 - STP (R9, R10), 48(R2) - - LDP 64(R0), (R3, R4) - LDP 64(R1), (R11, R12) - LDP 80(R0), (R5, R6) - LDP 80(R1), (R13, R14) - SBCS R11, R3 - SBCS R12, R4 - SBCS R13, R5 - SBCS R14, R6 - - LDP 96(R0), (R7, R8) - LDP 96(R1), (R11, R12) - LDP 112(R0), (R9, R10) - LDP 112(R1), (R13, R14) - SBCS R11, R7 - SBCS R12, R8 - SBCS R13, R9 - SBCS R14, R10 - SBC ZR, ZR, R15 - - // If x - y < 0, R15 is 1 and p503 should be added - LDP ·p503+16(SB), (R16, R17) - LDP ·p503+32(SB), (R19, R20) - AND R15, R16 - AND R15, R17 - LDP ·p503+48(SB), (R21, R22) - AND R15, R19 - AND R15, R20 - AND R15, R21 - AND R15, R22 - - ADDS R16, R3 - ADCS R16, R4 - STP (R3, R4), 64(R2) - ADCS R16, R5 - ADCS R17, R6 - STP (R5, R6), 80(R2) - ADCS R19, R7 - ADCS R20, R8 - STP (R7, R8), 96(R2) - ADCS R21, R9 - ADC R22, R10 - STP (R9, R10), 112(R2) - - RET - -// Expects that X0*Y0 is already in Z0(low),Z3(high) and X0*Y1 in Z1(low),Z2(high) -// Z0 is not actually touched -// Result of (X0-X1) * (Y0-Y1) will be in Z0-Z3 -// Inputs get overwritten, except for X1 -#define mul128x128comba(X0, X1, Y0, Y1, Z0, Z1, Z2, Z3, T0) \ - MUL X1, Y0, X0 \ - UMULH X1, Y0, Y0 \ - ADDS Z3, Z1 \ - ADC ZR, Z2 \ - \ - MUL Y1, X1, T0 \ - UMULH Y1, X1, Y1 \ - ADDS X0, Z1 \ - ADCS Y0, Z2 \ - ADC ZR, ZR, Z3 \ - \ - ADDS T0, Z2 \ - ADC Y1, Z3 - -// Expects that X points to (X0-X1) -// Result of (X0-X3) * (Y0-Y3) will be in Z0-Z7 -// Inputs get overwritten, except X2-X3 and Y2-Y3 -#define mul256x256karatsuba(X, X0, X1, X2, X3, Y0, Y1, Y2, Y3, Z0, Z1, Z2, Z3, Z4, Z5, Z6, Z7, T0, T1)\ - ADDS X2, X0 \ // xH + xL, destroys xL - ADCS X3, X1 \ - ADCS ZR, ZR, T0 \ - \ - ADDS Y2, Y0, Z6 \ // yH + yL - ADCS Y3, Y1, T1 \ - ADC ZR, ZR, Z7 \ - \ - SUB T0, ZR, Z2 \ - SUB Z7, ZR, Z3 \ - AND Z7, T0 \ // combined carry - \ - AND Z2, Z6, Z0 \ // masked(yH + yL) - AND Z2, T1, Z1 \ - \ - AND Z3, X0, Z4 \ // masked(xH + xL) - AND Z3, X1, Z5 \ - \ - MUL Z6, X0, Z2 \ - MUL T1, X0, Z3 \ - \ - ADDS Z4, Z0 \ - UMULH T1, X0, Z4 \ - ADCS Z5, Z1 \ - UMULH Z6, X0, Z5 \ - ADC ZR, T0 \ - \ // (xH + xL) * (yH + yL) - mul128x128comba(X0, X1, Z6, T1, Z2, Z3, Z4, Z5, Z7)\ - \ - LDP 0+X, (X0, X1) \ - \ - ADDS Z0, Z4 \ - UMULH Y0, X0, Z7 \ - UMULH Y1, X0, T1 \ - ADCS Z1, Z5 \ - MUL Y0, X0, Z0 \ - MUL Y1, X0, Z1 \ - ADC ZR, T0 \ - \ // xL * yL - mul128x128comba(X0, X1, Y0, Y1, Z0, Z1, T1, Z7, Z6)\ - \ - MUL Y2, X2, X0 \ - UMULH Y2, X2, Y0 \ - SUBS Z0, Z2 \ // (xH + xL) * (yH + yL) - xL * yL - SBCS Z1, Z3 \ - SBCS T1, Z4 \ - MUL Y3, X2, X1 \ - UMULH Y3, X2, Z6 \ - SBCS Z7, Z5 \ - SBCS ZR, T0 \ - \ // xH * yH - mul128x128comba(X2, X3, Y2, Y3, X0, X1, Z6, Y0, Y1)\ - \ - SUBS X0, Z2 \ // (xH + xL) * (yH + yL) - xL * yL - xH * yH - SBCS X1, Z3 \ - SBCS Z6, Z4 \ - SBCS Y0, Z5 \ - SBCS ZR, T0 \ - \ - ADDS T1, Z2 \ // (xH * yH) * 2^256 + ((xH + xL) * (yH + yL) - xL * yL - xH * yH) * 2^128 + xL * yL - ADCS Z7, Z3 \ - ADCS X0, Z4 \ - ADCS X1, Z5 \ - ADCS T0, Z6 \ - ADC Y0, ZR, Z7 - - -// This implements two-level Karatsuba with a 128x128 Comba multiplier -// at the bottom -TEXT ·fp503Mul(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load xL in R3-R6, xH in R7-R10 - // (xH + xL) in R25-R29 - LDP 0(R0), (R3, R4) - LDP 32(R0), (R7, R8) - ADDS R3, R7, R25 - ADCS R4, R8, R26 - LDP 16(R0), (R5, R6) - LDP 48(R0), (R9, R10) - ADCS R5, R9, R27 - ADCS R6, R10, R29 - ADC ZR, ZR, R7 - - // Load yL in R11-R14, yH in R15-19 - // (yH + yL) in R11-R14, destroys yL - LDP 0(R1), (R11, R12) - LDP 32(R1), (R15, R16) - ADDS R15, R11 - ADCS R16, R12 - LDP 16(R1), (R13, R14) - LDP 48(R1), (R17, R19) - ADCS R17, R13 - ADCS R19, R14 - ADC ZR, ZR, R8 - - // Compute maskes and combined carry - SUB R7, ZR, R9 - SUB R8, ZR, R10 - AND R8, R7 - - // masked(yH + yL) - AND R9, R11, R15 - AND R9, R12, R16 - AND R9, R13, R17 - AND R9, R14, R19 - - // masked(xH + xL) - AND R10, R25, R20 - AND R10, R26, R21 - AND R10, R27, R22 - AND R10, R29, R23 - - // masked(xH + xL) + masked(yH + yL) in R15-R19 - ADDS R20, R15 - ADCS R21, R16 - ADCS R22, R17 - ADCS R23, R19 - ADC ZR, R7 - - // Use z as temporary storage - STP (R25, R26), 0(R2) - - // (xH + xL) * (yH + yL) - mul256x256karatsuba(0(R2), R25, R26, R27, R29, R11, R12, R13, R14, R8, R9, R10, R20, R21, R22, R23, R24, R0, R1) - - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - ADDS R21, R15 - ADCS R22, R16 - ADCS R23, R17 - ADCS R24, R19 - ADC ZR, R7 - - // Load yL in R11-R14 - LDP 0(R1), (R11, R12) - LDP 16(R1), (R13, R14) - - // xL * yL - mul256x256karatsuba(0(R0), R3, R4, R5, R6, R11, R12, R13, R14, R21, R22, R23, R24, R25, R26, R27, R29, R1, R2) - - MOVD z+0(FP), R2 - MOVD y+16(FP), R1 - - // (xH + xL) * (yH + yL) - xL * yL - SUBS R21, R8 - SBCS R22, R9 - STP (R21, R22), 0(R2) - SBCS R23, R10 - SBCS R24, R20 - STP (R23, R24), 16(R2) - SBCS R25, R15 - SBCS R26, R16 - SBCS R27, R17 - SBCS R29, R19 - SBC ZR, R7 - - // Load xH in R3-R6, yH in R11-R14 - LDP 32(R0), (R3, R4) - LDP 48(R0), (R5, R6) - LDP 32(R1), (R11, R12) - LDP 48(R1), (R13, R14) - - ADDS R25, R8 - ADCS R26, R9 - ADCS R27, R10 - ADCS R29, R20 - ADC ZR, ZR, R1 - - MOVD R20, 32(R2) - - // xH * yH - mul256x256karatsuba(32(R0), R3, R4, R5, R6, R11, R12, R13, R14, R21, R22, R23, R24, R25, R26, R27, R29, R2, R20) - NEG R1, R1 - - MOVD z+0(FP), R2 - MOVD 32(R2), R20 - - // (xH + xL) * (yH + yL) - xL * yL - xH * yH in R8-R10,R20,R15-R19 - // Store lower half in z, that's done - SUBS R21, R8 - SBCS R22, R9 - STP (R8, R9), 32(R2) - SBCS R23, R10 - SBCS R24, R20 - STP (R10, R20), 48(R2) - SBCS R25, R15 - SBCS R26, R16 - SBCS R27, R17 - SBCS R29, R19 - SBC ZR, R7 - - // (xH * yH) * 2^512 + ((xH + xL) * (yH + yL) - xL * yL - xH * yH) * 2^256 + xL * yL - // Store remaining limbs in z - ADDS $1, R1 - ADCS R21, R15 - ADCS R22, R16 - STP (R15, R16), 64(R2) - ADCS R23, R17 - ADCS R24, R19 - STP (R17, R19), 80(R2) - ADCS R7, R25 - ADCS ZR, R26 - STP (R25, R26), 96(R2) - ADCS ZR, R27 - ADC ZR, R29 - STP (R27, R29), 112(R2) - - RET - -// Expects that X0*Y0 is already in Z0(low),Z3(high) and X0*Y1 in Z1(low),Z2(high) -// Z0 is not actually touched -// Result of (X0-X1) * (Y0-Y3) will be in Z0-Z5 -// Inputs remain intact -#define mul128x256comba(X0, X1, Y0, Y1, Y2, Y3, Z0, Z1, Z2, Z3, Z4, Z5, T0, T1, T2, T3)\ - MUL X1, Y0, T0 \ - UMULH X1, Y0, T1 \ - ADDS Z3, Z1 \ - ADC ZR, Z2 \ - \ - MUL X0, Y2, T2 \ - UMULH X0, Y2, T3 \ - ADDS T0, Z1 \ - ADCS T1, Z2 \ - ADC ZR, ZR, Z3 \ - \ - MUL X1, Y1, T0 \ - UMULH X1, Y1, T1 \ - ADDS T2, Z2 \ - ADCS T3, Z3 \ - ADC ZR, ZR, Z4 \ - \ - MUL X0, Y3, T2 \ - UMULH X0, Y3, T3 \ - ADDS T0, Z2 \ - ADCS T1, Z3 \ - ADC ZR, Z4 \ - \ - MUL X1, Y2, T0 \ - UMULH X1, Y2, T1 \ - ADDS T2, Z3 \ - ADCS T3, Z4 \ - ADC ZR, ZR, Z5 \ - \ - MUL X1, Y3, T2 \ - UMULH X1, Y3, T3 \ - ADDS T0, Z3 \ - ADCS T1, Z4 \ - ADC ZR, Z5 \ - ADDS T2, Z4 \ - ADC T3, Z5 - -// This implements the shifted 2^(B*w) Montgomery reduction from -// https://eprint.iacr.org/2016/986.pdf, section Section 3.2, with -// B = 4, w = 64. Performance results were reported in -// https://eprint.iacr.org/2018/700.pdf Section 6. -TEXT ·fp503MontgomeryReduce(SB), NOSPLIT, $0-16 - MOVD x+8(FP), R0 - - // Load x0-x1 - LDP 0(R0), (R2, R3) - - // Load the prime constant in R25-R29 - LDP ·p503p1s8+32(SB), (R25, R26) - LDP ·p503p1s8+48(SB), (R27, R29) - - // [x0,x1] * p503p1s8 to R4-R9 - MUL R2, R25, R4 // x0 * p503p1s8[0] - UMULH R2, R25, R7 - MUL R2, R26, R5 // x0 * p503p1s8[1] - UMULH R2, R26, R6 - - mul128x256comba(R2, R3, R25, R26, R27, R29, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13) - - LDP 16(R0), (R3, R11) // x2 - LDP 32(R0), (R12, R13) - LDP 48(R0), (R14, R15) - - // Left-shift result in R4-R9 by 56 to R4-R10 - ORR R9>>8, ZR, R10 - LSL $56, R9 - ORR R8>>8, R9 - LSL $56, R8 - ORR R7>>8, R8 - LSL $56, R7 - ORR R6>>8, R7 - LSL $56, R6 - ORR R5>>8, R6 - LSL $56, R5 - ORR R4>>8, R5 - LSL $56, R4 - - ADDS R4, R11 // x3 - ADCS R5, R12 // x4 - ADCS R6, R13 - ADCS R7, R14 - ADCS R8, R15 - LDP 64(R0), (R16, R17) - LDP 80(R0), (R19, R20) - MUL R3, R25, R4 // x2 * p503p1s8[0] - UMULH R3, R25, R7 - ADCS R9, R16 - ADCS R10, R17 - ADCS ZR, R19 - ADCS ZR, R20 - LDP 96(R0), (R21, R22) - LDP 112(R0), (R23, R24) - MUL R3, R26, R5 // x2 * p503p1s8[1] - UMULH R3, R26, R6 - ADCS ZR, R21 - ADCS ZR, R22 - ADCS ZR, R23 - ADC ZR, R24 - - // [x2,x3] * p503p1s8 to R4-R9 - mul128x256comba(R3, R11, R25, R26, R27, R29, R4, R5, R6, R7, R8, R9, R10, R0, R1, R2) - - ORR R9>>8, ZR, R10 - LSL $56, R9 - ORR R8>>8, R9 - LSL $56, R8 - ORR R7>>8, R8 - LSL $56, R7 - ORR R6>>8, R7 - LSL $56, R6 - ORR R5>>8, R6 - LSL $56, R5 - ORR R4>>8, R5 - LSL $56, R4 - - ADDS R4, R13 // x5 - ADCS R5, R14 // x6 - ADCS R6, R15 - ADCS R7, R16 - MUL R12, R25, R4 // x4 * p503p1s8[0] - UMULH R12, R25, R7 - ADCS R8, R17 - ADCS R9, R19 - ADCS R10, R20 - ADCS ZR, R21 - MUL R12, R26, R5 // x4 * p503p1s8[1] - UMULH R12, R26, R6 - ADCS ZR, R22 - ADCS ZR, R23 - ADC ZR, R24 - - // [x4,x5] * p503p1s8 to R4-R9 - mul128x256comba(R12, R13, R25, R26, R27, R29, R4, R5, R6, R7, R8, R9, R10, R0, R1, R2) - - ORR R9>>8, ZR, R10 - LSL $56, R9 - ORR R8>>8, R9 - LSL $56, R8 - ORR R7>>8, R8 - LSL $56, R7 - ORR R6>>8, R7 - LSL $56, R6 - ORR R5>>8, R6 - LSL $56, R5 - ORR R4>>8, R5 - LSL $56, R4 - - ADDS R4, R15 // x7 - ADCS R5, R16 // x8 - ADCS R6, R17 - ADCS R7, R19 - MUL R14, R25, R4 // x6 * p503p1s8[0] - UMULH R14, R25, R7 - ADCS R8, R20 - ADCS R9, R21 - ADCS R10, R22 - MUL R14, R26, R5 // x6 * p503p1s8[1] - UMULH R14, R26, R6 - ADCS ZR, R23 - ADC ZR, R24 - - // [x6,x7] * p503p1s8 to R4-R9 - mul128x256comba(R14, R15, R25, R26, R27, R29, R4, R5, R6, R7, R8, R9, R10, R0, R1, R2) - - ORR R9>>8, ZR, R10 - LSL $56, R9 - ORR R8>>8, R9 - LSL $56, R8 - ORR R7>>8, R8 - LSL $56, R7 - ORR R6>>8, R7 - LSL $56, R6 - ORR R5>>8, R6 - LSL $56, R5 - ORR R4>>8, R5 - LSL $56, R4 - - MOVD z+0(FP), R0 - ADDS R4, R17 - ADCS R5, R19 - STP (R16, R17), 0(R0) // Store final result to z - ADCS R6, R20 - ADCS R7, R21 - STP (R19, R20), 16(R0) - ADCS R8, R22 - ADCS R9, R23 - STP (R21, R22), 32(R0) - ADC R10, R24 - STP (R23, R24), 48(R0) - - RET - -TEXT ·fp503StrongReduce(SB), NOSPLIT, $0-8 - MOVD x+0(FP), R0 - - // Keep x in R1-R8, p503 in R9-R14, subtract to R1-R8 - LDP ·p503+16(SB), (R9, R10) - LDP 0(R0), (R1, R2) - LDP 16(R0), (R3, R4) - SUBS R9, R1 - SBCS R9, R2 - - LDP 32(R0), (R5, R6) - LDP ·p503+32(SB), (R11, R12) - SBCS R9, R3 - SBCS R10, R4 - - LDP 48(R0), (R7, R8) - LDP ·p503+48(SB), (R13, R14) - SBCS R11, R5 - SBCS R12, R6 - - SBCS R13, R7 - SBCS R14, R8 - SBC ZR, ZR, R15 - - // Mask with the borrow and add p503 - AND R15, R9 - AND R15, R10 - AND R15, R11 - AND R15, R12 - AND R15, R13 - AND R15, R14 - - ADDS R9, R1 - ADCS R9, R2 - STP (R1, R2), 0(R0) - ADCS R9, R3 - ADCS R10, R4 - STP (R3, R4), 16(R0) - ADCS R11, R5 - ADCS R12, R6 - STP (R5, R6), 32(R0) - ADCS R13, R7 - ADCS R14, R8 - STP (R7, R8), 48(R0) - - RET diff --git a/external/github.com/cloudflare/sidh/p503/arith_decl.go b/external/github.com/cloudflare/sidh/p503/arith_decl.go deleted file mode 100644 index 2929561d27..0000000000 --- a/external/github.com/cloudflare/sidh/p503/arith_decl.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build amd64,!noasm arm64,!noasm - -package p503 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x. -// If choice is neither 0 nor 1 then behaviour is undefined. -// This function executes in constant time. -//go:noescape -func fp503ConditionalSwap(x, y *FpElement, choice uint8) - -// Compute z = x + y (mod p). -//go:noescape -func fp503AddReduced(z, x, y *FpElement) - -// Compute z = x - y (mod p). -//go:noescape -func fp503SubReduced(z, x, y *FpElement) - -// Compute z = x + y, without reducing mod p. -//go:noescape -func fp503AddLazy(z, x, y *FpElement) - -// Compute z = x + y, without reducing mod p. -//go:noescape -func fp503X2AddLazy(z, x, y *FpElementX2) - -// Compute z = x - y, without reducing mod p. -//go:noescape -func fp503X2SubLazy(z, x, y *FpElementX2) - -// Reduce a field element in [0, 2*p) to one in [0,p). -//go:noescape -func fp503StrongReduce(x *FpElement) - -// Computes z = x * y. -//go:noescape -func fp503Mul(z *FpElementX2, x, y *FpElement) - -// Computes the Montgomery reduction z = x R^{-1} (mod 2*p). On return value -// of x may be changed. z=x not allowed. -//go:noescape -func fp503MontgomeryReduce(z *FpElement, x *FpElementX2) diff --git a/external/github.com/cloudflare/sidh/p503/arith_generic.go b/external/github.com/cloudflare/sidh/p503/arith_generic.go deleted file mode 100644 index ee8cc6e030..0000000000 --- a/external/github.com/cloudflare/sidh/p503/arith_generic.go +++ /dev/null @@ -1,197 +0,0 @@ -// +build noasm !amd64,!arm64 - -package p503 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/arith" - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -// Compute z = x + y (mod p). -func fp503AddReduced(z, x, y *FpElement) { - var carry uint64 - - // z=x+y % p503 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } - - // z = z - p503x2 - carry = 0 - for i := 0; i < NumWords; i++ { - z[i], carry = Subc64(carry, z[i], p503x2[i]) - } - - // if z<0 add p503x2 back - mask := uint64(0 - carry) - carry = 0 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, z[i], p503x2[i]&mask) - } -} - -// Compute z = x - y (mod p). -func fp503SubReduced(z, x, y *FpElement) { - var borrow uint64 - - // z = z - p503x2 - for i := 0; i < NumWords; i++ { - z[i], borrow = Subc64(borrow, x[i], y[i]) - } - - // if z<0 add p503x2 back - mask := uint64(0 - borrow) - borrow = 0 - for i := 0; i < NumWords; i++ { - z[i], borrow = Addc64(borrow, z[i], p503x2[i]&mask) - } -} - -// Conditionally swaps bits in x and y in constant time. -// mask indicates bits to be swapped (set bits are swapped) -// For details see "Hackers Delight, 2.20" -// -// Implementation doesn't actually depend on a prime field. -func fp503ConditionalSwap(x, y *FpElement, mask uint8) { - var tmp, mask64 uint64 - - mask64 = 0 - uint64(mask) - for i := 0; i < NumWords; i++ { - tmp = mask64 & (x[i] ^ y[i]) - x[i] = tmp ^ x[i] - y[i] = tmp ^ y[i] - } -} - -// Perform Montgomery reduction: set z = x R^{-1} (mod 2*p) -// with R=2^512. Destroys the input value. -func fp503MontgomeryReduce(z *FpElement, x *FpElementX2) { - var carry, t, u, v uint64 - var uv Uint128 - var count int - - count = 3 // number of 0 digits in the least significat part of p503 + 1 - - for i := 0; i < NumWords; i++ { - for j := 0; j < i; j++ { - if j < (i - count + 1) { - uv = Mul64(z[j], p503p1[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - } - v, carry = Addc64(0, v, x[i]) - u, carry = Addc64(carry, u, 0) - t += carry - - z[i] = v - v = u - u = t - t = 0 - } - - for i := NumWords; i < 2*NumWords-1; i++ { - if count > 0 { - count-- - } - for j := i - NumWords + 1; j < NumWords; j++ { - if j < (NumWords - count) { - uv = Mul64(z[j], p503p1[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - } - v, carry = Addc64(0, v, x[i]) - u, carry = Addc64(carry, u, 0) - - t += carry - z[i-NumWords] = v - v = u - u = t - t = 0 - } - v, carry = Addc64(0, v, x[2*NumWords-1]) - z[NumWords-1] = v -} - -// Compute z = x * y. -func fp503Mul(z *FpElementX2, x, y *FpElement) { - var u, v, t uint64 - var carry uint64 - var uv Uint128 - - for i := uint64(0); i < NumWords; i++ { - for j := uint64(0); j <= i; j++ { - uv = Mul64(x[j], y[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - z[i] = v - v = u - u = t - t = 0 - } - - for i := NumWords; i < (2*NumWords)-1; i++ { - for j := i - NumWords + 1; j < NumWords; j++ { - uv = Mul64(x[j], y[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - z[i] = v - v = u - u = t - t = 0 - } - z[2*NumWords-1] = v -} - -// Compute z = x + y, without reducing mod p. -func fp503AddLazy(z, x, y *FpElement) { - var carry uint64 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } -} - -// Compute z = x + y, without reducing mod p. -func fp503X2AddLazy(z, x, y *FpElementX2) { - var carry uint64 - for i := 0; i < 2*NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } -} - -// Reduce a field element in [0, 2*p) to one in [0,p). -func fp503StrongReduce(x *FpElement) { - var borrow, mask uint64 - for i := 0; i < NumWords; i++ { - x[i], borrow = Subc64(borrow, x[i], p503[i]) - } - - // Sets all bits if borrow = 1 - mask = 0 - borrow - borrow = 0 - for i := 0; i < NumWords; i++ { - x[i], borrow = Addc64(borrow, x[i], p503[i]&mask) - } -} - -// Compute z = x - y, without reducing mod p. -func fp503X2SubLazy(z, x, y *FpElementX2) { - var borrow, mask uint64 - for i := 0; i < 2*NumWords; i++ { - z[i], borrow = Subc64(borrow, x[i], y[i]) - } - - // Sets all bits if borrow = 1 - mask = 0 - borrow - borrow = 0 - for i := NumWords; i < 2*NumWords; i++ { - z[i], borrow = Addc64(borrow, z[i], p503[i-NumWords]&mask) - } -} diff --git a/external/github.com/cloudflare/sidh/p503/consts.go b/external/github.com/cloudflare/sidh/p503/consts.go deleted file mode 100644 index fddf6be623..0000000000 --- a/external/github.com/cloudflare/sidh/p503/consts.go +++ /dev/null @@ -1,178 +0,0 @@ -package p503 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" - cpu "v2ray.com/core/external/github.com/cloudflare/sidh/internal/utils" -) - -const ( - // SIDH public key byte size - P503_PublicKeySize = 378 - // SIDH shared secret byte size. - P503_SharedSecretSize = 126 - // Max size of secret key for 2-torsion group, corresponds to 2^e2 - 1 - P503_SecretBitLenA = 250 - // Size of secret key for 3-torsion group, corresponds to log_2(3^e3) - 1 - P503_SecretBitLenB = 252 - // Size of a compuatation strategy for 2-torsion group - strategySizeA = 124 - // Size of a compuatation strategy for 3-torsion group - strategySizeB = 158 - // ceil(503+7/8) - P503_Bytelen = 63 - // Number of limbs for a field element - NumWords = 8 -) - -// CPU Capabilities. Those flags are referred by assembly code. According to -// https://github.com/golang/go/issues/28230, variables referred from the -// assembly must be in the same package. -// We declare them variables not constants in order to facilitate testing. -var ( - // Signals support for MULX which is in BMI2 - HasBMI2 = cpu.X86.HasBMI2 - // Signals support for ADX and BMI2 - HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX -) - -// The x-coordinate of PA -var P503_affine_PA = Fp2Element{ - A: FpElement{ - 0xE7EF4AA786D855AF, 0xED5758F03EB34D3B, 0x09AE172535A86AA9, 0x237B9CC07D622723, - 0xE3A284CBA4E7932D, 0x27481D9176C5E63F, 0x6A323FF55C6E71BF, 0x002ECC31A6FB8773, - }, - B: FpElement{ - 0x64D02E4E90A620B8, 0xDAB8128537D4B9F1, 0x4BADF77B8A228F98, 0x0F5DBDF9D1FB7D1B, - 0xBEC4DB288E1A0DCC, 0xE76A8665E80675DB, 0x6D6F252E12929463, 0x003188BD1463FACC, - }, -} - -// The x-coordinate of QA -var P503_affine_QA = Fp2Element{ - A: FpElement{ - 0xB79D41025DE85D56, 0x0B867DA9DF169686, 0x740E5368021C827D, 0x20615D72157BF25C, - 0xFF1590013C9B9F5B, 0xC884DCADE8C16CEA, 0xEBD05E53BF724E01, 0x0032FEF8FDA5748C, - }, - B: FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - }, -} - -// The x-coordinate of RA = PA-QA -var P503_affine_RA = Fp2Element{ - A: FpElement{ - 0x12E2E849AA0A8006, 0x41CF47008635A1E8, 0x9CD720A70798AED7, 0x42A820B42FCF04CF, - 0x7BF9BAD32AAE88B1, 0xF619127A54090BBE, 0x1CB10D8F56408EAA, 0x001D6B54C3C0EDEB, - }, - B: FpElement{ - 0x34DB54931CBAAC36, 0x420A18CB8DD5F0C4, 0x32008C1A48C0F44D, 0x3B3BA772B1CFD44D, - 0xA74B058FDAF13515, 0x095FC9CA7EEC17B4, 0x448E829D28F120F8, 0x00261EC3ED16A489, - }, -} - -// The x-coordinate of PB -var P503_affine_PB = Fp2Element{ - A: FpElement{ - 0x7EDE37F4FA0BC727, 0xF7F8EC5C8598941C, 0xD15519B516B5F5C8, 0xF6D5AC9B87A36282, - 0x7B19F105B30E952E, 0x13BD8B2025B4EBEE, 0x7B96D27F4EC579A2, 0x00140850CAB7E5DE, - }, - B: FpElement{ - 0x7764909DAE7B7B2D, 0x578ABB16284911AB, 0x76E2BFD146A6BF4D, 0x4824044B23AA02F0, - 0x1105048912A321F3, 0xB8A2E482CF0F10C1, 0x42FF7D0BE2152085, 0x0018E599C5223352, - }, -} - -// The x-coordinate of QB -var P503_affine_QB = Fp2Element{ - A: FpElement{ - 0x4256C520FB388820, 0x744FD7C3BAAF0A13, 0x4B6A2DDDB12CBCB8, 0xE46826E27F427DF8, - 0xFE4A663CD505A61B, 0xD6B3A1BAF025C695, 0x7C3BB62B8FCC00BD, 0x003AFDDE4A35746C, - }, - B: FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - }, -} - -// The x-coordinate of RB = PB - QB -var P503_affine_RB = Fp2Element{ - A: FpElement{ - 0x75601CD1E6C0DFCB, 0x1A9007239B58F93E, 0xC1F1BE80C62107AC, 0x7F513B898F29FF08, - 0xEA0BEDFF43E1F7B2, 0x2C6D94018CBAE6D0, 0x3A430D31BCD84672, 0x000D26892ECCFE83, - }, - B: FpElement{ - 0x1119D62AEA3007A1, 0xE3702AA4E04BAE1B, 0x9AB96F7D59F990E7, 0xF58440E8B43319C0, - 0xAF8134BEE1489775, 0xE7F7774E905192AA, 0xF54AE09308E98039, 0x001EF7A041A86112, - }, -} - -// 2-torsion group computation strategy -var P503_AliceIsogenyStrategy = [strategySizeA]uint32{ - 0x3D, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, - 0x01, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, - 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x1D, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, - 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x0D, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x05, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01} - -// 3-torsion group computation strategy -var P503_BobIsogenyStrategy = [strategySizeB]uint32{ - 0x47, 0x26, 0x15, 0x0D, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x05, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x09, - 0x05, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x11, 0x09, 0x05, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, - 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, - 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x21, 0x11, 0x09, 0x05, 0x03, 0x02, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, 0x04, - 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x10, 0x08, - 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01} - -// Used internally by this package -// ------------------------------- - -var p503 = FpElement{ - 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xABFFFFFFFFFFFFFF, - 0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, -} - -// 2*503 -var p503x2 = FpElement{ - 0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0x57FFFFFFFFFFFFFF, - 0x2610B7B44423CF41, 0x3737ED90F6FCFB5E, 0xC08B8D7BB4EF49A0, 0x0080CDEA83023C3C, -} - -// p503 + 1 -var p503p1 = FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0xAC00000000000000, - 0x13085BDA2211E7A0, 0x1B9BF6C87B7E7DAF, 0x6045C6BDDA77A4D0, 0x004066F541811E1E, -} - -// R^2=(2^512)^2 mod p -var p503R2 = FpElement{ - 0x5289A0CF641D011F, 0x9B88257189FED2B9, 0xA3B365D58DC8F17A, 0x5BC57AB6EFF168EC, - 0x9E51998BD84D4423, 0xBF8999CBAC3B5695, 0x46E9127BCE14CDB6, 0x003F6CFCE8B81771, -} - -// p503 + 1 left-shifted by 8, assuming little endianness -var p503p1s8 = FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x085BDA2211E7A0AC, 0x9BF6C87B7E7DAF13, 0x45C6BDDA77A4D01B, 0x4066F541811E1E60, -} - -// 1*R mod p -var P503_OneFp2 = Fp2Element{ - A: FpElement{ - 0x00000000000003F9, 0x0000000000000000, 0x0000000000000000, 0xB400000000000000, - 0x63CB1A6EA6DED2B4, 0x51689D8D667EB37D, 0x8ACD77C71AB24142, 0x0026FBAEC60F5953}, -} - -// 1/2 * R mod p -var P503_HalfFp2 = Fp2Element{ - A: FpElement{ - 0x00000000000001FC, 0x0000000000000000, 0x0000000000000000, 0xB000000000000000, - 0x3B69BB2464785D2A, 0x36824A2AF0FE9896, 0xF5899F427A94F309, 0x0033B15203C83BB8}, -} diff --git a/external/github.com/cloudflare/sidh/p503/field_ops.go b/external/github.com/cloudflare/sidh/p503/field_ops.go deleted file mode 100644 index 04223d6086..0000000000 --- a/external/github.com/cloudflare/sidh/p503/field_ops.go +++ /dev/null @@ -1,249 +0,0 @@ -package p503 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -type fp503Ops struct{} - -func FieldOperations() FieldOps { - return &fp503Ops{} -} - -func (fp503Ops) Add(dest, lhs, rhs *Fp2Element) { - fp503AddReduced(&dest.A, &lhs.A, &rhs.A) - fp503AddReduced(&dest.B, &lhs.B, &rhs.B) -} - -func (fp503Ops) Sub(dest, lhs, rhs *Fp2Element) { - fp503SubReduced(&dest.A, &lhs.A, &rhs.A) - fp503SubReduced(&dest.B, &lhs.B, &rhs.B) -} - -func (fp503Ops) Mul(dest, lhs, rhs *Fp2Element) { - // Let (a,b,c,d) = (lhs.a,lhs.b,rhs.a,rhs.b). - a := &lhs.A - b := &lhs.B - c := &rhs.A - d := &rhs.B - - // We want to compute - // - // (a + bi)*(c + di) = (a*c - b*d) + (a*d + b*c)i - // - // Use Karatsuba's trick: note that - // - // (b - a)*(c - d) = (b*c + a*d) - a*c - b*d - // - // so (a*d + b*c) = (b-a)*(c-d) + a*c + b*d. - - var ac, bd FpElementX2 - fp503Mul(&ac, a, c) // = a*c*R*R - fp503Mul(&bd, b, d) // = b*d*R*R - - var b_minus_a, c_minus_d FpElement - fp503SubReduced(&b_minus_a, b, a) // = (b-a)*R - fp503SubReduced(&c_minus_d, c, d) // = (c-d)*R - - var ad_plus_bc FpElementX2 - fp503Mul(&ad_plus_bc, &b_minus_a, &c_minus_d) // = (b-a)*(c-d)*R*R - fp503X2AddLazy(&ad_plus_bc, &ad_plus_bc, &ac) // = ((b-a)*(c-d) + a*c)*R*R - fp503X2AddLazy(&ad_plus_bc, &ad_plus_bc, &bd) // = ((b-a)*(c-d) + a*c + b*d)*R*R - - fp503MontgomeryReduce(&dest.B, &ad_plus_bc) // = (a*d + b*c)*R mod p - - var ac_minus_bd FpElementX2 - fp503X2SubLazy(&ac_minus_bd, &ac, &bd) // = (a*c - b*d)*R*R - fp503MontgomeryReduce(&dest.A, &ac_minus_bd) // = (a*c - b*d)*R mod p -} - -// Set dest = 1/x -// -// Allowed to overlap dest with x. -// -// Returns dest to allow chaining operations. -func (fp503Ops) Inv(dest, x *Fp2Element) { - a := &x.A - b := &x.B - - // We want to compute - // - // 1 1 (a - bi) (a - bi) - // -------- = -------- -------- = ----------- - // (a + bi) (a + bi) (a - bi) (a^2 + b^2) - // - // Letting c = 1/(a^2 + b^2), this is - // - // 1/(a+bi) = a*c - b*ci. - - var asq_plus_bsq primeFieldElement - var asq, bsq FpElementX2 - fp503Mul(&asq, a, a) // = a*a*R*R - fp503Mul(&bsq, b, b) // = b*b*R*R - fp503X2AddLazy(&asq, &asq, &bsq) // = (a^2 + b^2)*R*R - fp503MontgomeryReduce(&asq_plus_bsq.A, &asq) // = (a^2 + b^2)*R mod p - // Now asq_plus_bsq = a^2 + b^2 - - inv := asq_plus_bsq - inv.Mul(&asq_plus_bsq, &asq_plus_bsq) - inv.P34(&inv) - inv.Mul(&inv, &inv) - inv.Mul(&inv, &asq_plus_bsq) - - var ac FpElementX2 - fp503Mul(&ac, a, &inv.A) - fp503MontgomeryReduce(&dest.A, &ac) - - var minus_b FpElement - fp503SubReduced(&minus_b, &minus_b, b) - var minus_bc FpElementX2 - fp503Mul(&minus_bc, &minus_b, &inv.A) - fp503MontgomeryReduce(&dest.B, &minus_bc) -} - -func (fp503Ops) Square(dest, x *Fp2Element) { - a := &x.A - b := &x.B - - // We want to compute - // - // (a + bi)*(a + bi) = (a^2 - b^2) + 2abi. - - var a2, a_plus_b, a_minus_b FpElement - fp503AddReduced(&a2, a, a) // = a*R + a*R = 2*a*R - fp503AddReduced(&a_plus_b, a, b) // = a*R + b*R = (a+b)*R - fp503SubReduced(&a_minus_b, a, b) // = a*R - b*R = (a-b)*R - - var asq_minus_bsq, ab2 FpElementX2 - fp503Mul(&asq_minus_bsq, &a_plus_b, &a_minus_b) // = (a+b)*(a-b)*R*R = (a^2 - b^2)*R*R - fp503Mul(&ab2, &a2, b) // = 2*a*b*R*R - - fp503MontgomeryReduce(&dest.A, &asq_minus_bsq) // = (a^2 - b^2)*R mod p - fp503MontgomeryReduce(&dest.B, &ab2) // = 2*a*b*R mod p -} - -// In case choice == 1, performs following swap in constant time: -// xPx <-> xQx -// xPz <-> xQz -// Otherwise returns xPx, xPz, xQx, xQz unchanged -func (fp503Ops) CondSwap(xPx, xPz, xQx, xQz *Fp2Element, choice uint8) { - fp503ConditionalSwap(&xPx.A, &xQx.A, choice) - fp503ConditionalSwap(&xPx.B, &xQx.B, choice) - fp503ConditionalSwap(&xPz.A, &xQz.A, choice) - fp503ConditionalSwap(&xPz.B, &xQz.B, choice) -} - -// Converts values in x.A and x.B to Montgomery domain -// x.A = x.A * R mod p -// x.B = x.B * R mod p -// Performs v = v*R^2*R^(-1) mod p, for both x.A and x.B -func (fp503Ops) ToMontgomery(x *Fp2Element) { - var aRR FpElementX2 - - // convert to montgomery domain - fp503Mul(&aRR, &x.A, &p503R2) // = a*R*R - fp503MontgomeryReduce(&x.A, &aRR) // = a*R mod p - fp503Mul(&aRR, &x.B, &p503R2) - fp503MontgomeryReduce(&x.B, &aRR) -} - -// Converts values in x.A and x.B from Montgomery domain -// a = x.A mod p -// b = x.B mod p -// -// After returning from the call x is not modified. -func (fp503Ops) FromMontgomery(x *Fp2Element, out *Fp2Element) { - var aR FpElementX2 - - // convert from montgomery domain - // TODO: make fpXXXMontgomeryReduce use stack instead of reusing aR - // so that we don't have do this copy here - copy(aR[:], x.A[:]) - fp503MontgomeryReduce(&out.A, &aR) // = a mod p in [0, 2p) - fp503StrongReduce(&out.A) // = a mod p in [0, p) - for i := range aR { - aR[i] = 0 - } - copy(aR[:], x.B[:]) - fp503MontgomeryReduce(&out.B, &aR) - fp503StrongReduce(&out.B) -} - -//------------------------------------------------------------------------------ -// Prime Field -//------------------------------------------------------------------------------ - -// Represents an element of the prime field F_p. -type primeFieldElement struct { - // This field element is in Montgomery form, so that the value `A` is - // represented by `aR mod p`. - A FpElement -} - -// Set dest = lhs * rhs. -// -// Allowed to overlap lhs or rhs with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) Mul(lhs, rhs *primeFieldElement) *primeFieldElement { - a := &lhs.A // = a*R - b := &rhs.A // = b*R - - var ab FpElementX2 - fp503Mul(&ab, a, b) // = a*b*R*R - fp503MontgomeryReduce(&dest.A, &ab) // = a*b*R mod p - - return dest -} - -// Set dest = x^(2^k), for k >= 1, by repeated squarings. -// -// Allowed to overlap x with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) Pow2k(x *primeFieldElement, k uint8) *primeFieldElement { - dest.Mul(x, x) - for i := uint8(1); i < k; i++ { - dest.Mul(dest, dest) - } - - return dest -} - -// Set dest = x^((p-3)/4). If x is square, this is 1/sqrt(x). -// Uses variation of sliding-window algorithm from with window size -// of 5 and least to most significant bit sliding (left-to-right) -// See HAC 14.85 for general description. -// -// Allowed to overlap x with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) P34(x *primeFieldElement) *primeFieldElement { - // Sliding-window strategy computed with etc/scripts/sliding_window_strat_calc.py - // - // This performs sum(powStrategy) + 1 squarings and len(lookup) + len(mulStrategy) - // multiplications. - powStrategy := []uint8{1, 12, 5, 5, 2, 7, 11, 3, 8, 4, 11, 4, 7, 5, 6, 3, 7, 5, 7, 2, 12, 5, 6, 4, 6, 8, 6, 4, 7, 5, 5, 8, 5, 8, 5, 5, 8, 9, 3, 6, 2, 10, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3} - mulStrategy := []uint8{0, 12, 11, 10, 0, 1, 8, 3, 7, 1, 8, 3, 6, 7, 14, 2, 14, 14, 9, 0, 13, 9, 15, 5, 12, 7, 13, 7, 15, 6, 7, 9, 0, 5, 7, 6, 8, 8, 3, 7, 0, 10, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3} - - // Precompute lookup table of odd multiples of x for window - // size k=5. - lookup := [16]primeFieldElement{} - xx := &primeFieldElement{} - xx.Mul(x, x) - lookup[0] = *x - for i := 1; i < 16; i++ { - lookup[i].Mul(&lookup[i-1], xx) - } - - // Now lookup = {x, x^3, x^5, ... } - // so that lookup[i] = x^{2*i + 1} - // so that lookup[k/2] = x^k, for odd k - *dest = lookup[mulStrategy[0]] - for i := uint8(1); i < uint8(len(powStrategy)); i++ { - dest.Pow2k(dest, powStrategy[i]) - dest.Mul(dest, &lookup[mulStrategy[i]]) - } - - return dest -} diff --git a/external/github.com/cloudflare/sidh/p751/arith_amd64.s b/external/github.com/cloudflare/sidh/p751/arith_amd64.s deleted file mode 100644 index 5213ca3871..0000000000 --- a/external/github.com/cloudflare/sidh/p751/arith_amd64.s +++ /dev/null @@ -1,2620 +0,0 @@ -// +build amd64,!noasm - -#include "textflag.h" - -// p751 + 1 -#define P751P1_5 $0xEEB0000000000000 -#define P751P1_6 $0xE3EC968549F878A8 -#define P751P1_7 $0xDA959B1A13F7CC76 -#define P751P1_8 $0x084E9867D6EBE876 -#define P751P1_9 $0x8562B5045CB25748 -#define P751P1_10 $0x0E12909F97BADC66 -#define P751P1_11 $0x00006FE5D541F71C - -#define P751_0 $0xFFFFFFFFFFFFFFFF -#define P751_5 $0xEEAFFFFFFFFFFFFF -#define P751_6 $0xE3EC968549F878A8 -#define P751_7 $0xDA959B1A13F7CC76 -#define P751_8 $0x084E9867D6EBE876 -#define P751_9 $0x8562B5045CB25748 -#define P751_10 $0x0E12909F97BADC66 -#define P751_11 $0x00006FE5D541F71C - -#define P751X2_0 $0xFFFFFFFFFFFFFFFE -#define P751X2_1 $0xFFFFFFFFFFFFFFFF -#define P751X2_5 $0xDD5FFFFFFFFFFFFF -#define P751X2_6 $0xC7D92D0A93F0F151 -#define P751X2_7 $0xB52B363427EF98ED -#define P751X2_8 $0x109D30CFADD7D0ED -#define P751X2_9 $0x0AC56A08B964AE90 -#define P751X2_10 $0x1C25213F2F75B8CD -#define P751X2_11 $0x0000DFCBAA83EE38 - -// The MSR code uses these registers for parameter passing. Keep using -// them to avoid significant code changes. This means that when the Go -// assembler does something strange, we can diff the machine code -// against a different assembler to find out what Go did. - -#define REG_P1 DI -#define REG_P2 SI -#define REG_P3 DX - -TEXT ·fp751StrongReduce(SB), NOSPLIT, $0-8 - MOVQ x+0(FP), REG_P1 - - // Zero AX for later use: - XORQ AX, AX - - // Load p into registers: - MOVQ P751_0, R8 - // P751_{1,2,3,4} = P751_0, so reuse R8 - MOVQ P751_5, R9 - MOVQ P751_6, R10 - MOVQ P751_7, R11 - MOVQ P751_8, R12 - MOVQ P751_9, R13 - MOVQ P751_10, R14 - MOVQ P751_11, R15 - - // Set x <- x - p - SUBQ R8, (REG_P1) - SBBQ R8, (8)(REG_P1) - SBBQ R8, (16)(REG_P1) - SBBQ R8, (24)(REG_P1) - SBBQ R8, (32)(REG_P1) - SBBQ R9, (40)(REG_P1) - SBBQ R10, (48)(REG_P1) - SBBQ R11, (56)(REG_P1) - SBBQ R12, (64)(REG_P1) - SBBQ R13, (72)(REG_P1) - SBBQ R14, (80)(REG_P1) - SBBQ R15, (88)(REG_P1) - - // Save carry flag indicating x-p < 0 as a mask in AX - SBBQ $0, AX - - // Conditionally add p to x if x-p < 0 - ANDQ AX, R8 - ANDQ AX, R9 - ANDQ AX, R10 - ANDQ AX, R11 - ANDQ AX, R12 - ANDQ AX, R13 - ANDQ AX, R14 - ANDQ AX, R15 - - ADDQ R8, (REG_P1) - ADCQ R8, (8)(REG_P1) - ADCQ R8, (16)(REG_P1) - ADCQ R8, (24)(REG_P1) - ADCQ R8, (32)(REG_P1) - ADCQ R9, (40)(REG_P1) - ADCQ R10, (48)(REG_P1) - ADCQ R11, (56)(REG_P1) - ADCQ R12, (64)(REG_P1) - ADCQ R13, (72)(REG_P1) - ADCQ R14, (80)(REG_P1) - ADCQ R15, (88)(REG_P1) - - RET - -TEXT ·fp751ConditionalSwap(SB), NOSPLIT, $0-17 - - MOVQ x+0(FP), REG_P1 - MOVQ y+8(FP), REG_P2 - MOVB choice+16(FP), AL // AL = 0 or 1 - MOVBLZX AL, AX // AX = 0 or 1 - NEGQ AX // RAX = 0x00..00 or 0xff..ff - - MOVQ (0*8)(REG_P1), BX // BX = x[0] - MOVQ (0*8)(REG_P2), CX // CX = y[0] - MOVQ CX, DX // DX = y[0] - XORQ BX, DX // DX = y[0] ^ x[0] - ANDQ AX, DX // DX = (y[0] ^ x[0]) & mask - XORQ DX, BX // BX = (y[0] ^ x[0]) & mask) ^ x[0] = x[0] or y[0] - XORQ DX, CX // CX = (y[0] ^ x[0]) & mask) ^ y[0] = y[0] or x[0] - MOVQ BX, (0*8)(REG_P1) - MOVQ CX, (0*8)(REG_P2) - - MOVQ (1*8)(REG_P1), BX - MOVQ (1*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (1*8)(REG_P1) - MOVQ CX, (1*8)(REG_P2) - - MOVQ (2*8)(REG_P1), BX - MOVQ (2*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (2*8)(REG_P1) - MOVQ CX, (2*8)(REG_P2) - - MOVQ (3*8)(REG_P1), BX - MOVQ (3*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (3*8)(REG_P1) - MOVQ CX, (3*8)(REG_P2) - - MOVQ (4*8)(REG_P1), BX - MOVQ (4*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (4*8)(REG_P1) - MOVQ CX, (4*8)(REG_P2) - - MOVQ (5*8)(REG_P1), BX - MOVQ (5*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (5*8)(REG_P1) - MOVQ CX, (5*8)(REG_P2) - - MOVQ (6*8)(REG_P1), BX - MOVQ (6*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (6*8)(REG_P1) - MOVQ CX, (6*8)(REG_P2) - - MOVQ (7*8)(REG_P1), BX - MOVQ (7*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (7*8)(REG_P1) - MOVQ CX, (7*8)(REG_P2) - - MOVQ (8*8)(REG_P1), BX - MOVQ (8*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (8*8)(REG_P1) - MOVQ CX, (8*8)(REG_P2) - - MOVQ (9*8)(REG_P1), BX - MOVQ (9*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (9*8)(REG_P1) - MOVQ CX, (9*8)(REG_P2) - - MOVQ (10*8)(REG_P1), BX - MOVQ (10*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (10*8)(REG_P1) - MOVQ CX, (10*8)(REG_P2) - - MOVQ (11*8)(REG_P1), BX - MOVQ (11*8)(REG_P2), CX - MOVQ CX, DX - XORQ BX, DX - ANDQ AX, DX - XORQ DX, BX - XORQ DX, CX - MOVQ BX, (11*8)(REG_P1) - MOVQ CX, (11*8)(REG_P2) - - RET - -TEXT ·fp751AddReduced(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), CX - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - ADCQ (64)(REG_P2), CX - MOVQ (72)(REG_P1), AX - ADCQ (72)(REG_P2), AX - MOVQ AX, (72)(REG_P3) - MOVQ (80)(REG_P1), AX - ADCQ (80)(REG_P2), AX - MOVQ AX, (80)(REG_P3) - MOVQ (88)(REG_P1), AX - ADCQ (88)(REG_P2), AX - MOVQ AX, (88)(REG_P3) - - MOVQ P751X2_0, AX - SUBQ AX, R8 - MOVQ P751X2_1, AX - SBBQ AX, R9 - SBBQ AX, R10 - SBBQ AX, R11 - SBBQ AX, R12 - MOVQ P751X2_5, AX - SBBQ AX, R13 - MOVQ P751X2_6, AX - SBBQ AX, R14 - MOVQ P751X2_7, AX - SBBQ AX, R15 - MOVQ P751X2_8, AX - SBBQ AX, CX - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ CX, (64)(REG_P3) - MOVQ (72)(REG_P3), R8 - MOVQ (80)(REG_P3), R9 - MOVQ (88)(REG_P3), R10 - MOVQ P751X2_9, AX - SBBQ AX, R8 - MOVQ P751X2_10, AX - SBBQ AX, R9 - MOVQ P751X2_11, AX - SBBQ AX, R10 - MOVQ R8, (72)(REG_P3) - MOVQ R9, (80)(REG_P3) - MOVQ R10, (88)(REG_P3) - MOVQ $0, AX - SBBQ $0, AX - - MOVQ P751X2_0, SI - ANDQ AX, SI - MOVQ P751X2_1, R8 - ANDQ AX, R8 - MOVQ P751X2_5, R9 - ANDQ AX, R9 - MOVQ P751X2_6, R10 - ANDQ AX, R10 - MOVQ P751X2_7, R11 - ANDQ AX, R11 - MOVQ P751X2_8, R12 - ANDQ AX, R12 - MOVQ P751X2_9, R13 - ANDQ AX, R13 - MOVQ P751X2_10, R14 - ANDQ AX, R14 - MOVQ P751X2_11, R15 - ANDQ AX, R15 - - MOVQ (REG_P3), AX - ADDQ SI, AX - MOVQ AX, (REG_P3) - MOVQ (8)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (8)(REG_P3) - MOVQ (16)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (16)(REG_P3) - MOVQ (24)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (24)(REG_P3) - MOVQ (32)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (32)(REG_P3) - MOVQ (40)(REG_P3), AX - ADCQ R9, AX - MOVQ AX, (40)(REG_P3) - MOVQ (48)(REG_P3), AX - ADCQ R10, AX - MOVQ AX, (48)(REG_P3) - MOVQ (56)(REG_P3), AX - ADCQ R11, AX - MOVQ AX, (56)(REG_P3) - MOVQ (64)(REG_P3), AX - ADCQ R12, AX - MOVQ AX, (64)(REG_P3) - MOVQ (72)(REG_P3), AX - ADCQ R13, AX - MOVQ AX, (72)(REG_P3) - MOVQ (80)(REG_P3), AX - ADCQ R14, AX - MOVQ AX, (80)(REG_P3) - MOVQ (88)(REG_P3), AX - ADCQ R15, AX - MOVQ AX, (88)(REG_P3) - - RET - -TEXT ·fp751SubReduced(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), CX - SUBQ (REG_P2), R8 - SBBQ (8)(REG_P2), R9 - SBBQ (16)(REG_P2), R10 - SBBQ (24)(REG_P2), R11 - SBBQ (32)(REG_P2), R12 - SBBQ (40)(REG_P2), R13 - SBBQ (48)(REG_P2), R14 - SBBQ (56)(REG_P2), R15 - SBBQ (64)(REG_P2), CX - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ CX, (64)(REG_P3) - MOVQ (72)(REG_P1), AX - SBBQ (72)(REG_P2), AX - MOVQ AX, (72)(REG_P3) - MOVQ (80)(REG_P1), AX - SBBQ (80)(REG_P2), AX - MOVQ AX, (80)(REG_P3) - MOVQ (88)(REG_P1), AX - SBBQ (88)(REG_P2), AX - MOVQ AX, (88)(REG_P3) - MOVQ $0, AX - SBBQ $0, AX - - MOVQ P751X2_0, SI - ANDQ AX, SI - MOVQ P751X2_1, R8 - ANDQ AX, R8 - MOVQ P751X2_5, R9 - ANDQ AX, R9 - MOVQ P751X2_6, R10 - ANDQ AX, R10 - MOVQ P751X2_7, R11 - ANDQ AX, R11 - MOVQ P751X2_8, R12 - ANDQ AX, R12 - MOVQ P751X2_9, R13 - ANDQ AX, R13 - MOVQ P751X2_10, R14 - ANDQ AX, R14 - MOVQ P751X2_11, R15 - ANDQ AX, R15 - - MOVQ (REG_P3), AX - ADDQ SI, AX - MOVQ AX, (REG_P3) - MOVQ (8)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (8)(REG_P3) - MOVQ (16)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (16)(REG_P3) - MOVQ (24)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (24)(REG_P3) - MOVQ (32)(REG_P3), AX - ADCQ R8, AX - MOVQ AX, (32)(REG_P3) - MOVQ (40)(REG_P3), AX - ADCQ R9, AX - MOVQ AX, (40)(REG_P3) - MOVQ (48)(REG_P3), AX - ADCQ R10, AX - MOVQ AX, (48)(REG_P3) - MOVQ (56)(REG_P3), AX - ADCQ R11, AX - MOVQ AX, (56)(REG_P3) - MOVQ (64)(REG_P3), AX - ADCQ R12, AX - MOVQ AX, (64)(REG_P3) - MOVQ (72)(REG_P3), AX - ADCQ R13, AX - MOVQ AX, (72)(REG_P3) - MOVQ (80)(REG_P3), AX - ADCQ R14, AX - MOVQ AX, (80)(REG_P3) - MOVQ (88)(REG_P3), AX - ADCQ R15, AX - MOVQ AX, (88)(REG_P3) - - RET - -TEXT ·fp751Mul(SB), $96-24 - - // Here we store the destination in CX instead of in REG_P3 because the - // multiplication instructions use DX as an implicit destination - // operand: MULQ $REG sets DX:AX <-- AX * $REG. - - MOVQ z+0(FP), CX - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - XORQ AX, AX - MOVQ (48)(REG_P1), R8 - MOVQ (56)(REG_P1), R9 - MOVQ (64)(REG_P1), R10 - MOVQ (72)(REG_P1), R11 - MOVQ (80)(REG_P1), R12 - MOVQ (88)(REG_P1), R13 - ADDQ (REG_P1), R8 - ADCQ (8)(REG_P1), R9 - ADCQ (16)(REG_P1), R10 - ADCQ (24)(REG_P1), R11 - ADCQ (32)(REG_P1), R12 - ADCQ (40)(REG_P1), R13 - MOVQ R8, (CX) - MOVQ R9, (8)(CX) - MOVQ R10, (16)(CX) - MOVQ R11, (24)(CX) - MOVQ R12, (32)(CX) - MOVQ R13, (40)(CX) - SBBQ $0, AX - - XORQ DX, DX - MOVQ (48)(REG_P2), R8 - MOVQ (56)(REG_P2), R9 - MOVQ (64)(REG_P2), R10 - MOVQ (72)(REG_P2), R11 - MOVQ (80)(REG_P2), R12 - MOVQ (88)(REG_P2), R13 - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - MOVQ R8, (48)(CX) - MOVQ R9, (56)(CX) - MOVQ R10, (64)(CX) - MOVQ R11, (72)(CX) - MOVQ R12, (80)(CX) - MOVQ R13, (88)(CX) - SBBQ $0, DX - MOVQ AX, (80)(SP) - MOVQ DX, (88)(SP) - - // (SP[0-8],R10,R8,R9) <- (AH+AL)*(BH+BL) - - MOVQ (CX), R11 - MOVQ R8, AX - MULQ R11 - MOVQ AX, (SP) // c0 - MOVQ DX, R14 - - XORQ R15, R15 - MOVQ R9, AX - MULQ R11 - XORQ R9, R9 - ADDQ AX, R14 - ADCQ DX, R9 - - MOVQ (8)(CX), R12 - MOVQ R8, AX - MULQ R12 - ADDQ AX, R14 - MOVQ R14, (8)(SP) // c1 - ADCQ DX, R9 - ADCQ $0, R15 - - XORQ R8, R8 - MOVQ R10, AX - MULQ R11 - ADDQ AX, R9 - MOVQ (48)(CX), R13 - ADCQ DX, R15 - ADCQ $0, R8 - - MOVQ (16)(CX), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R15 - MOVQ (56)(CX), AX - ADCQ $0, R8 - - MULQ R12 - ADDQ AX, R9 - MOVQ R9, (16)(SP) // c2 - ADCQ DX, R15 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (72)(CX), AX - MULQ R11 - ADDQ AX, R15 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (24)(CX), AX - MULQ R13 - ADDQ AX, R15 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ R10, AX - MULQ R12 - ADDQ AX, R15 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (16)(CX), R14 - MOVQ (56)(CX), AX - MULQ R14 - ADDQ AX, R15 - MOVQ R15, (24)(SP) // c3 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (80)(CX), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (64)(CX), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (48)(CX), R15 - MOVQ (32)(CX), AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (72)(CX), AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (24)(CX), R13 - MOVQ (56)(CX), AX - MULQ R13 - ADDQ AX, R8 - MOVQ R8, (32)(SP) // c4 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (88)(CX), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (64)(CX), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (72)(CX), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(CX), AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (80)(CX), AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (32)(CX), R15 - MOVQ (56)(CX), AX - MULQ R15 - ADDQ AX, R9 - MOVQ R9, (40)(SP) // c5 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (64)(CX), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (88)(CX), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (80)(CX), AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (40)(CX), R11 - MOVQ (56)(CX), AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (72)(CX), AX - MULQ R13 - ADDQ AX, R10 - MOVQ R10, (48)(SP) // c6 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (88)(CX), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (64)(CX), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (80)(CX), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (72)(CX), AX - MULQ R15 - ADDQ AX, R8 - MOVQ R8, (56)(SP) // c7 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (72)(CX), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (80)(CX), AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (88)(CX), AX - MULQ R13 - ADDQ AX, R9 - MOVQ R9, (64)(SP) // c8 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (88)(CX), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (80)(CX), AX - MULQ R11 - ADDQ AX, R10 // c9 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (88)(CX), AX - MULQ R11 - ADDQ AX, R8 // c10 - ADCQ DX, R9 // c11 - - MOVQ (88)(SP), AX - MOVQ (CX), DX - ANDQ AX, R12 - ANDQ AX, R14 - ANDQ AX, DX - ANDQ AX, R13 - ANDQ AX, R15 - ANDQ AX, R11 - MOVQ (48)(SP), AX - ADDQ AX, DX - MOVQ (56)(SP), AX - ADCQ AX, R12 - MOVQ (64)(SP), AX - ADCQ AX, R14 - ADCQ R10, R13 - ADCQ R8, R15 - ADCQ R9, R11 - MOVQ (80)(SP), AX - MOVQ DX, (48)(SP) - MOVQ R12, (56)(SP) - MOVQ R14, (64)(SP) - MOVQ R13, (72)(SP) - MOVQ R15, (80)(SP) - MOVQ R11, (88)(SP) - - MOVQ (48)(CX), R8 - MOVQ (56)(CX), R9 - MOVQ (64)(CX), R10 - MOVQ (72)(CX), R11 - MOVQ (80)(CX), R12 - MOVQ (88)(CX), R13 - ANDQ AX, R8 - ANDQ AX, R9 - ANDQ AX, R10 - ANDQ AX, R11 - ANDQ AX, R12 - ANDQ AX, R13 - MOVQ (48)(SP), AX - ADDQ AX, R8 - MOVQ (56)(SP), AX - ADCQ AX, R9 - MOVQ (64)(SP), AX - ADCQ AX, R10 - MOVQ (72)(SP), AX - ADCQ AX, R11 - MOVQ (80)(SP), AX - ADCQ AX, R12 - MOVQ (88)(SP), AX - ADCQ AX, R13 - MOVQ R8, (48)(SP) - MOVQ R9, (56)(SP) - MOVQ R11, (72)(SP) - - // CX[0-11] <- AL*BL - MOVQ (REG_P1), R11 - MOVQ (REG_P2), AX - MULQ R11 - XORQ R9, R9 - MOVQ AX, (CX) // c0 - MOVQ R10, (64)(SP) - MOVQ DX, R8 - - MOVQ (8)(REG_P2), AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - MOVQ R12, (80)(SP) - ADCQ DX, R9 - - MOVQ (8)(REG_P1), R12 - MOVQ (REG_P2), AX - MULQ R12 - ADDQ AX, R8 - MOVQ R8, (8)(CX) // c1 - ADCQ DX, R9 - MOVQ R13, (88)(SP) - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (16)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (REG_P2), R13 - MOVQ (16)(REG_P1), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (8)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - MOVQ R9, (16)(CX) // c2 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (24)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (24)(REG_P1), AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (16)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (16)(REG_P1), R14 - MOVQ (8)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - MOVQ R10, (24)(CX) // c3 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (32)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (16)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (32)(REG_P1), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (24)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (24)(REG_P1), R13 - MOVQ (8)(REG_P2), AX - MULQ R13 - ADDQ AX, R8 - MOVQ R8, (32)(CX) // c4 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (40)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (16)(REG_P2), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (24)(REG_P2), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(REG_P1), R11 - MOVQ (REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (32)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (32)(REG_P1), R15 - MOVQ (8)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - MOVQ R9, (40)(CX) //c5 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (16)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (40)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (32)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (8)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (24)(REG_P2), AX - MULQ R13 - ADDQ AX, R10 - MOVQ R10, (48)(CX) // c6 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (40)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (16)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (32)(REG_P2), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (24)(REG_P2), AX - MULQ R15 - ADDQ AX, R8 - MOVQ R8, (56)(CX) // c7 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (24)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (32)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(REG_P2), AX - MULQ R13 - ADDQ AX, R9 - MOVQ R9, (64)(CX) // c8 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (40)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (32)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - MOVQ R10, (72)(CX) // c9 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (40)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - MOVQ R8, (80)(CX) // c10 - ADCQ DX, R9 - MOVQ R9, (88)(CX) // c11 - - // CX[12-23] <- AH*BH - MOVQ (48)(REG_P1), R11 - MOVQ (48)(REG_P2), AX - MULQ R11 - XORQ R9, R9 - MOVQ AX, (96)(CX) // c0 - MOVQ DX, R8 - - MOVQ (56)(REG_P2), AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - ADCQ DX, R9 - - MOVQ (56)(REG_P1), R12 - MOVQ (48)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - MOVQ R8, (104)(CX) // c1 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (64)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (48)(REG_P2), R13 - MOVQ (64)(REG_P1), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (56)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - MOVQ R9, (112)(CX) // c2 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (72)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (72)(REG_P1), AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (64)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (64)(REG_P1), R14 - MOVQ (56)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - MOVQ R10, (120)(CX) // c3 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (80)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (64)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (80)(REG_P1), R15 - MOVQ R13, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (72)(REG_P2), AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (72)(REG_P1), R13 - MOVQ (56)(REG_P2), AX - MULQ R13 - ADDQ AX, R8 - MOVQ R8, (128)(CX) // c4 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (88)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (64)(REG_P2), AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (72)(REG_P2), AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (88)(REG_P1), R11 - MOVQ (48)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (80)(REG_P2), AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (56)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - MOVQ R9, (136)(CX) // c5 - ADCQ DX, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ (64)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (88)(REG_P2), AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (80)(REG_P2), AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (56)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (72)(REG_P2), AX - MULQ R13 - ADDQ AX, R10 - MOVQ R10, (144)(CX) // c6 - ADCQ DX, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ (88)(REG_P2), AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (64)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (80)(REG_P2), AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (72)(REG_P2), AX - MULQ R15 - ADDQ AX, R8 - MOVQ R8, (152)(CX) // c7 - ADCQ DX, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ (72)(REG_P2), AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (80)(REG_P2), AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (88)(REG_P2), AX - MULQ R13 - ADDQ AX, R9 - MOVQ R9, (160)(CX) // c8 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (88)(REG_P2), AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - - MOVQ (80)(REG_P2), AX - MULQ R11 - ADDQ AX, R10 - MOVQ R10, (168)(CX) // c9 - ADCQ DX, R8 - - MOVQ (88)(REG_P2), AX - MULQ R11 - ADDQ AX, R8 - MOVQ R8, (176)(CX) // c10 - ADCQ $0, DX - MOVQ DX, (184)(CX) // c11 - - // [R8-R15,AX,DX,DI,(SP)] <- (AH+AL)*(BH+BL)-AL*BL - MOVQ (SP), R8 - SUBQ (CX), R8 - MOVQ (8)(SP), R9 - SBBQ (8)(CX), R9 - MOVQ (16)(SP), R10 - SBBQ (16)(CX), R10 - MOVQ (24)(SP), R11 - SBBQ (24)(CX), R11 - MOVQ (32)(SP), R12 - SBBQ (32)(CX), R12 - MOVQ (40)(SP), R13 - SBBQ (40)(CX), R13 - MOVQ (48)(SP), R14 - SBBQ (48)(CX), R14 - MOVQ (56)(SP), R15 - SBBQ (56)(CX), R15 - MOVQ (64)(SP), AX - SBBQ (64)(CX), AX - MOVQ (72)(SP), DX - SBBQ (72)(CX), DX - MOVQ (80)(SP), DI - SBBQ (80)(CX), DI - MOVQ (88)(SP), SI - SBBQ (88)(CX), SI - MOVQ SI, (SP) - - // [R8-R15,AX,DX,DI,(SP)] <- (AH+AL)*(BH+BL) - AL*BL - AH*BH - MOVQ (96)(CX), SI - SUBQ SI, R8 - MOVQ (104)(CX), SI - SBBQ SI, R9 - MOVQ (112)(CX), SI - SBBQ SI, R10 - MOVQ (120)(CX), SI - SBBQ SI, R11 - MOVQ (128)(CX), SI - SBBQ SI, R12 - MOVQ (136)(CX), SI - SBBQ SI, R13 - MOVQ (144)(CX), SI - SBBQ SI, R14 - MOVQ (152)(CX), SI - SBBQ SI, R15 - MOVQ (160)(CX), SI - SBBQ SI, AX - MOVQ (168)(CX), SI - SBBQ SI, DX - MOVQ (176)(CX), SI - SBBQ SI, DI - MOVQ (SP), SI - SBBQ (184)(CX), SI - - // FINAL RESULT - ADDQ (48)(CX), R8 - MOVQ R8, (48)(CX) - ADCQ (56)(CX), R9 - MOVQ R9, (56)(CX) - ADCQ (64)(CX), R10 - MOVQ R10, (64)(CX) - ADCQ (72)(CX), R11 - MOVQ R11, (72)(CX) - ADCQ (80)(CX), R12 - MOVQ R12, (80)(CX) - ADCQ (88)(CX), R13 - MOVQ R13, (88)(CX) - ADCQ (96)(CX), R14 - MOVQ R14, (96)(CX) - ADCQ (104)(CX), R15 - MOVQ R15, (104)(CX) - ADCQ (112)(CX), AX - MOVQ AX, (112)(CX) - ADCQ (120)(CX), DX - MOVQ DX, (120)(CX) - ADCQ (128)(CX), DI - MOVQ DI, (128)(CX) - ADCQ (136)(CX), SI - MOVQ SI, (136)(CX) - MOVQ (144)(CX), AX - ADCQ $0, AX - MOVQ AX, (144)(CX) - MOVQ (152)(CX), AX - ADCQ $0, AX - MOVQ AX, (152)(CX) - MOVQ (160)(CX), AX - ADCQ $0, AX - MOVQ AX, (160)(CX) - MOVQ (168)(CX), AX - ADCQ $0, AX - MOVQ AX, (168)(CX) - MOVQ (176)(CX), AX - ADCQ $0, AX - MOVQ AX, (176)(CX) - MOVQ (184)(CX), AX - ADCQ $0, AX - MOVQ AX, (184)(CX) - - RET - -// This multiplies a 256-bit number pointed to by M0 with p751+1. -// It is assumed that M1 points to p751+1 stored as a 768-bit Fp751Element. -// C points to the place to store the result and should be at least 192 bits. -// This should only be used when the BMI2 and ADX instruction set extensions -// are available. -#define mul256x448bmi2adx(M0, M1, C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) \ - MOVQ 0+M0, DX \ - MULXQ M1+40(SB), T1, T0 \ - MULXQ M1+48(SB), T3, T2 \ - MOVQ T1, 0+C \ // C0_final - XORQ AX, AX \ - MULXQ M1+56(SB), T5, T4 \ - ADOXQ T3, T0 \ - ADOXQ T5, T2 \ - MULXQ M1+64(SB), T3, T1 \ - ADOXQ T3, T4 \ - MULXQ M1+72(SB), T6, T5 \ - ADOXQ T6, T1 \ - MULXQ M1+80(SB), T7, T3 \ - ADOXQ T7, T5 \ - MULXQ M1+88(SB), T8, T6 \ - ADOXQ T8, T3 \ - ADOXQ AX, T6 \ - \ - MOVQ 8+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - XORQ AX, AX \ - ADCXQ T7, T0 \ - MOVQ T0, 8+C \ // C1_final - ADCXQ T8, T2 \ - MULXQ M1+48(SB), T8, T7 \ - ADOXQ T8, T2 \ - ADCXQ T7, T4 \ - MULXQ M1+56(SB), T8, T0 \ - ADOXQ T8, T4 \ - ADCXQ T1, T0 \ - MULXQ M1+64(SB), T7, T1 \ - ADCXQ T5, T1 \ - MULXQ M1+72(SB), T8, T5 \ - ADCXQ T5, T3 \ - MULXQ M1+80(SB), T9, T5 \ - ADCXQ T5, T6 \ - MULXQ M1+88(SB), DX, T5 \ - ADCXQ AX, T5 \ - \ - ADOXQ T7, T0 \ - ADOXQ T8, T1 \ - ADOXQ T9, T3 \ - ADOXQ DX, T6 \ - ADOXQ AX, T5 \ - \ - MOVQ 16+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - XORQ AX, AX \ - ADCXQ T7, T2 \ - MOVQ T2, 16+C \ // C2_final - ADCXQ T8, T4 \ - MULXQ M1+48(SB), T7, T8 \ - ADOXQ T7, T4 \ - ADCXQ T8, T0 \ - MULXQ M1+56(SB), T8, T2 \ - ADOXQ T8, T0 \ - ADCXQ T2, T1 \ - MULXQ M1+64(SB), T7, T2 \ - ADCXQ T2, T3 \ - MULXQ M1+72(SB), T8, T2 \ - ADCXQ T2, T6 \ - MULXQ M1+80(SB), T9, T2 \ - ADCXQ T2, T5 \ - MULXQ M1+88(SB), DX, T2 \ - ADCXQ AX, T2 \ - \ - ADOXQ T7, T1 \ - ADOXQ T8, T3 \ - ADOXQ T9, T6 \ - ADOXQ DX, T5 \ - ADOXQ AX, T2 \ - \ - MOVQ 24+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - XORQ AX, AX \ - ADCXQ T4, T7 \ - ADCXQ T8, T0 \ - MULXQ M1+48(SB), T10, T8 \ - ADOXQ T10, T0 \ - ADCXQ T8, T1 \ - MULXQ M1+56(SB), T8, T4 \ - ADOXQ T8, T1 \ - ADCXQ T4, T3 \ - MULXQ M1+64(SB), T10, T4 \ - ADCXQ T4, T6 \ - MULXQ M1+72(SB), T8, T4 \ - ADCXQ T4, T5 \ - MULXQ M1+80(SB), T9, T4 \ - ADCXQ T4, T2 \ - MULXQ M1+88(SB), DX, T4 \ - ADCXQ AX, T4 \ - \ - ADOXQ T10, T3 \ - ADOXQ T8, T6 \ - ADOXQ T9, T5 \ - ADOXQ DX, T2 \ - ADOXQ AX, T4 - -// This multiplies a 256-bit number pointed to by M0 with p751+1. -// It is assumed that M1 points to p751+1 stored as a 768-bit Fp751Element. -// C points to the place to store the result and should be at least 192 bits. -// This should only be used when the BMI2 instruction set extension is -// available. -#define mul256x448bmi2(M0, M1, C, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) \ - MOVQ 0+M0, DX \ - MULXQ M1+40(SB), T1, T0 \ - MULXQ M1+48(SB), T3, T2 \ - MOVQ T1, 0+C \ // C0_final - XORQ AX, AX \ - MULXQ M1+56(SB), T5, T4 \ - ADDQ T3, T0 \ - ADCQ T5, T2 \ - MULXQ M1+64(SB), T3, T1 \ - ADCQ T3, T4 \ - MULXQ M1+72(SB), T6, T5 \ - ADCQ T6, T1 \ - MULXQ M1+80(SB), T7, T3 \ - ADCQ T7, T5 \ - MULXQ M1+88(SB), T8, T6 \ - ADCQ T8, T3 \ - ADCQ AX, T6 \ - \ - MOVQ 8+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - ADDQ T7, T0 \ - MOVQ T0, 8+C \ // C1_final - ADCQ T8, T2 \ - MULXQ M1+48(SB), T8, T7 \ - MOVQ T8, 32+C \ - ADCQ T7, T4 \ - MULXQ M1+56(SB), T8, T0 \ - MOVQ T8, 40+C \ - ADCQ T1, T0 \ - MULXQ M1+64(SB), T7, T1 \ - ADCQ T5, T1 \ - MULXQ M1+72(SB), T8, T5 \ - ADCQ T5, T3 \ - MULXQ M1+80(SB), T9, T5 \ - ADCQ T5, T6 \ - MULXQ M1+88(SB), DX, T5 \ - ADCQ AX, T5 \ - \ - XORQ AX, AX \ - ADDQ 32+C, T2 \ - ADCQ 40+C, T4 \ - ADCQ T7, T0 \ - ADCQ T8, T1 \ - ADCQ T9, T3 \ - ADCQ DX, T6 \ - ADCQ AX, T5 \ - \ - MOVQ 16+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - ADDQ T7, T2 \ - MOVQ T2, 16+C \ // C2_final - ADCQ T8, T4 \ - MULXQ M1+48(SB), T7, T8 \ - MOVQ T7, 32+C \ - ADCQ T8, T0 \ - MULXQ M1+56(SB), T8, T2 \ - MOVQ T8, 40+C \ - ADCQ T2, T1 \ - MULXQ M1+64(SB), T7, T2 \ - ADCQ T2, T3 \ - MULXQ M1+72(SB), T8, T2 \ - ADCQ T2, T6 \ - MULXQ M1+80(SB), T9, T2 \ - ADCQ T2, T5 \ - MULXQ M1+88(SB), DX, T2 \ - ADCQ AX, T2 \ - \ - XORQ AX, AX \ - ADDQ 32+C, T4 \ - ADCQ 40+C, T0 \ - ADCQ T7, T1 \ - ADCQ T8, T3 \ - ADCQ T9, T6 \ - ADCQ DX, T5 \ - ADCQ AX, T2 \ - \ - MOVQ 24+M0, DX \ - MULXQ M1+40(SB), T7, T8 \ - ADDQ T4, T7 \ - ADCQ T8, T0 \ - MULXQ M1+48(SB), T10, T8 \ - MOVQ T10, 32+C \ - ADCQ T8, T1 \ - MULXQ M1+56(SB), T8, T4 \ - MOVQ T8, 40+C \ - ADCQ T4, T3 \ - MULXQ M1+64(SB), T10, T4 \ - ADCQ T4, T6 \ - MULXQ M1+72(SB), T8, T4 \ - ADCQ T4, T5 \ - MULXQ M1+80(SB), T9, T4 \ - ADCQ T4, T2 \ - MULXQ M1+88(SB), DX, T4 \ - ADCQ AX, T4 \ - \ - XORQ AX, AX \ - ADDQ 32+C, T0 \ - ADCQ 40+C, T1 \ - ADCQ T10, T3 \ - ADCQ T8, T6 \ - ADCQ T9, T5 \ - ADCQ DX, T2 \ - ADCQ AX, T4 - -// Template for calculating the Montgomery reduction algorithm described in -// section 5.2.3 of https://eprint.iacr.org/2017/1015.pdf. Template must be -// customized with schoolbook multiplicaton for 256 x 448-bit number. -// This macro reuses memory of IN value and *changes* it. Smashes registers -// R[8-15], AX, BX, CX, DX, BP. -// Input: -// * M0: 1536-bit number to be reduced -// * C : either mul256x448bmi2 or mul256x448bmi2adx -// Output: OUT 768-bit -#define REDC(C, M0, MULS) \ - \ // a[0-3] x p751p1_nz --> result: [reg_p2+48], [reg_p2+56], [reg_p2+64], and rbp, r8:r14 - MULS(M0, ·p751p1, 48+C, R8, R9, R13, R10, R14, R12, R11, BP, BX, CX, R15) \ - XORQ R15, R15 \ - MOVQ 48+C, AX \ - MOVQ 56+C, DX \ - MOVQ 64+C, BX \ - ADDQ 40+M0, AX \ - ADCQ 48+M0, DX \ - ADCQ 56+M0, BX \ - MOVQ AX, 40+M0 \ - MOVQ DX, 48+M0 \ - MOVQ BX, 56+M0 \ - ADCQ 64+M0, BP \ - ADCQ 72+M0, R8 \ - ADCQ 80+M0, R9 \ - ADCQ 88+M0, R10 \ - ADCQ 96+M0, R11 \ - ADCQ 104+M0, R12 \ - ADCQ 112+M0, R13 \ - ADCQ 120+M0, R14 \ - ADCQ 128+M0, R15 \ - MOVQ BP, 64+M0 \ - MOVQ R8, 72+M0 \ - MOVQ R9, 80+M0 \ - MOVQ R10, 88+M0 \ - MOVQ R11, 96+M0 \ - MOVQ R12, 104+M0 \ - MOVQ R13, 112+M0 \ - MOVQ R14, 120+M0 \ - MOVQ R15, 128+M0 \ - MOVQ 136+M0, R8 \ - MOVQ 144+M0, R9 \ - MOVQ 152+M0, R10 \ - MOVQ 160+M0, R11 \ - MOVQ 168+M0, R12 \ - MOVQ 176+M0, R13 \ - MOVQ 184+M0, R14 \ - ADCQ $0, R8 \ - ADCQ $0, R9 \ - ADCQ $0, R10 \ - ADCQ $0, R11 \ - ADCQ $0, R12 \ - ADCQ $0, R13 \ - ADCQ $0, R14 \ - MOVQ R8, 136+M0 \ - MOVQ R9, 144+M0 \ - MOVQ R10, 152+M0 \ - MOVQ R11, 160+M0 \ - MOVQ R12, 168+M0 \ - MOVQ R13, 176+M0 \ - MOVQ R14, 184+M0 \ - \ // a[4-7] x p751p1_nz --> result: [reg_p2+48], [reg_p2+56], [reg_p2+64], and rbp, r8:r14 - MULS(32+M0, ·p751p1, 48+C, R8, R9, R13, R10, R14, R12, R11, BP, BX, CX, R15) \ - XORQ R15, R15 \ - MOVQ 48+C, AX \ - MOVQ 56+C, DX \ - MOVQ 64+C, BX \ - ADDQ 72+M0, AX \ - ADCQ 80+M0, DX \ - ADCQ 88+M0, BX \ - MOVQ AX, 72+M0 \ - MOVQ DX, 80+M0 \ - MOVQ BX, 88+M0 \ - ADCQ 96+M0, BP \ - ADCQ 104+M0, R8 \ - ADCQ 112+M0, R9 \ - ADCQ 120+M0, R10 \ - ADCQ 128+M0, R11 \ - ADCQ 136+M0, R12 \ - ADCQ 144+M0, R13 \ - ADCQ 152+M0, R14 \ - ADCQ 160+M0, R15 \ - MOVQ BP, 0+C \ // Final result c0 - MOVQ R8, 104+M0 \ - MOVQ R9, 112+M0 \ - MOVQ R10, 120+M0 \ - MOVQ R11, 128+M0 \ - MOVQ R12, 136+M0 \ - MOVQ R13, 144+M0 \ - MOVQ R14, 152+M0 \ - MOVQ R15, 160+M0 \ - MOVQ 168+M0, R12 \ - MOVQ 176+M0, R13 \ - MOVQ 184+M0, R14 \ - ADCQ $0, R12 \ - ADCQ $0, R13 \ - ADCQ $0, R14 \ - MOVQ R12, 168+M0 \ - MOVQ R13, 176+M0 \ - MOVQ R14, 184+M0 \ - \ // a[8-11] x p751p1_nz --> result: [reg_p2+48], [reg_p2+56], [reg_p2+64], and rbp, r8:r14 - MULS(64+M0, ·p751p1, 48+C, R8, R9, R13, R10, R14, R12, R11, BP, BX, CX, R15) \ - MOVQ 48+C, AX \ // Final result c1:c11 - MOVQ 56+C, DX \ - MOVQ 64+C, BX \ - ADDQ 104+M0, AX \ - ADCQ 112+M0, DX \ - ADCQ 120+M0, BX \ - MOVQ AX, 8+C \ - MOVQ DX, 16+C \ - MOVQ BX, 24+C \ - ADCQ 128+M0, BP \ - ADCQ 136+M0, R8 \ - ADCQ 144+M0, R9 \ - ADCQ 152+M0, R10 \ - ADCQ 160+M0, R11 \ - ADCQ 168+M0, R12 \ - ADCQ 176+M0, R13 \ - ADCQ 184+M0, R14 \ - MOVQ BP, 32+C \ - MOVQ R8, 40+C \ - MOVQ R9, 48+C \ - MOVQ R10, 56+C \ - MOVQ R11, 64+C \ - MOVQ R12, 72+C \ - MOVQ R13, 80+C \ - MOVQ R14, 88+C - -TEXT ·fp751MontgomeryReduce(SB), $0-16 - MOVQ z+0(FP), REG_P2 - MOVQ x+8(FP), REG_P1 - - // Check wether to use optimized implementation - CMPB ·HasADXandBMI2(SB), $1 - JE redc_with_mulx_adcx_adox - CMPB ·HasBMI2(SB), $1 - JE redc_with_mulx - - MOVQ (REG_P1), R11 - MOVQ P751P1_5, AX - MULQ R11 - XORQ R8, R8 - ADDQ (40)(REG_P1), AX - MOVQ AX, (40)(REG_P2) // Z5 - ADCQ DX, R8 - - XORQ R9, R9 - MOVQ P751P1_6, AX - MULQ R11 - XORQ R10, R10 - ADDQ AX, R8 - ADCQ DX, R9 - - MOVQ (8)(REG_P1), R12 - MOVQ P751P1_5, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (48)(REG_P1), R8 - MOVQ R8, (48)(REG_P2) // Z6 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P751P1_7, AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_6, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (16)(REG_P1), R13 - MOVQ P751P1_5, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (56)(REG_P1), R9 - MOVQ R9, (56)(REG_P2) // Z7 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P751P1_8, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_7, AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_6, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (24)(REG_P1), R14 - MOVQ P751P1_5, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (64)(REG_P1), R10 - MOVQ R10, (64)(REG_P2) // Z8 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P751P1_9, AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_8, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_7, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_6, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (32)(REG_P1), R15 - MOVQ P751P1_5, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (72)(REG_P1), R8 - MOVQ R8, (72)(REG_P2) // Z9 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P751P1_10, AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_9, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_8, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_7, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_6, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (40)(REG_P2), CX - MOVQ P751P1_5, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (80)(REG_P1), R9 - MOVQ R9, (80)(REG_P2) // Z10 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P751P1_11, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_10, AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_9, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_8, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_7, AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_6, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (48)(REG_P2), R11 - MOVQ P751P1_5, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (88)(REG_P1), R10 - MOVQ R10, (88)(REG_P2) // Z11 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P751P1_11, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_10, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_9, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_8, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_7, AX - MULQ CX - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_6, AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (56)(REG_P2), R12 - MOVQ P751P1_5, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (96)(REG_P1), R8 - MOVQ R8, (REG_P2) // Z0 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P751P1_11, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_10, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_9, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_8, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_7, AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_6, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (64)(REG_P2), R13 - MOVQ P751P1_5, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (104)(REG_P1), R9 - MOVQ R9, (8)(REG_P2) // Z1 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P751P1_11, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_10, AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_9, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_8, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_7, AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_6, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ (72)(REG_P2), R14 - MOVQ P751P1_5, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (112)(REG_P1), R10 - MOVQ R10, (16)(REG_P2) // Z2 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P751P1_11, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_10, AX - MULQ CX - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_9, AX - MULQ R11 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_8, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_7, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_6, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ (80)(REG_P2), R15 - MOVQ P751P1_5, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (120)(REG_P1), R8 - MOVQ R8, (24)(REG_P2) // Z3 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P751P1_11, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_10, AX - MULQ R11 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_9, AX - MULQ R12 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_8, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_7, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_6, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ (88)(REG_P2), CX - MOVQ P751P1_5, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (128)(REG_P1), R9 - MOVQ R9, (32)(REG_P2) // Z4 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P751P1_11, AX - MULQ R11 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_10, AX - MULQ R12 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_9, AX - MULQ R13 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_8, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_7, AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_6, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (136)(REG_P1), R10 - MOVQ R10, (40)(REG_P2) // Z5 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P751P1_11, AX - MULQ R12 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_10, AX - MULQ R13 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_9, AX - MULQ R14 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_8, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_7, AX - MULQ CX - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (144)(REG_P1), R8 - MOVQ R8, (48)(REG_P2) // Z6 - ADCQ $0, R9 - ADCQ $0, R10 - - XORQ R8, R8 - MOVQ P751P1_11, AX - MULQ R13 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_10, AX - MULQ R14 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_9, AX - MULQ R15 - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - - MOVQ P751P1_8, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADCQ $0, R8 - ADDQ (152)(REG_P1), R9 - MOVQ R9, (56)(REG_P2) // Z7 - ADCQ $0, R10 - ADCQ $0, R8 - - XORQ R9, R9 - MOVQ P751P1_11, AX - MULQ R14 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_10, AX - MULQ R15 - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - - MOVQ P751P1_9, AX - MULQ CX - ADDQ AX, R10 - ADCQ DX, R8 - ADCQ $0, R9 - ADDQ (160)(REG_P1), R10 - MOVQ R10, (64)(REG_P2) // Z8 - ADCQ $0, R8 - ADCQ $0, R9 - - XORQ R10, R10 - MOVQ P751P1_11, AX - MULQ R15 - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - - MOVQ P751P1_10, AX - MULQ CX - ADDQ AX, R8 - ADCQ DX, R9 - ADCQ $0, R10 - ADDQ (168)(REG_P1), R8 // Z9 - MOVQ R8, (72)(REG_P2) // Z9 - ADCQ $0, R9 - ADCQ $0, R10 - - MOVQ P751P1_11, AX - MULQ CX - ADDQ AX, R9 - ADCQ DX, R10 - ADDQ (176)(REG_P1), R9 // Z10 - MOVQ R9, (80)(REG_P2) // Z10 - ADCQ $0, R10 - ADDQ (184)(REG_P1), R10 // Z11 - MOVQ R10, (88)(REG_P2) // Z11 - RET - -redc_with_mulx_adcx_adox: - // This implements the Montgomery reduction algorithm described in - // section 5.2.3 of https://eprint.iacr.org/2017/1015.pdf. - // This assumes that the BMI2 and ADX instruction set extensions are available. - REDC(0(REG_P2), 0(REG_P1), mul256x448bmi2adx) - RET - -redc_with_mulx: - // This implements the Montgomery reduction algorithm described in - // section 5.2.3 of https://eprint.iacr.org/2017/1015.pdf. - // This assumes that the BMI2 instruction set extension is available. - REDC(0(REG_P2), 0(REG_P1), mul256x448bmi2) - RET - -TEXT ·fp751AddLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), AX - MOVQ (72)(REG_P1), BX - MOVQ (80)(REG_P1), CX - MOVQ (88)(REG_P1), DI - - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - ADCQ (64)(REG_P2), AX - ADCQ (72)(REG_P2), BX - ADCQ (80)(REG_P2), CX - ADCQ (88)(REG_P2), DI - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ AX, (64)(REG_P3) - MOVQ BX, (72)(REG_P3) - MOVQ CX, (80)(REG_P3) - MOVQ DI, (88)(REG_P3) - - RET - -TEXT ·fp751X2AddLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), AX - MOVQ (72)(REG_P1), BX - MOVQ (80)(REG_P1), CX - - ADDQ (REG_P2), R8 - ADCQ (8)(REG_P2), R9 - ADCQ (16)(REG_P2), R10 - ADCQ (24)(REG_P2), R11 - ADCQ (32)(REG_P2), R12 - ADCQ (40)(REG_P2), R13 - ADCQ (48)(REG_P2), R14 - ADCQ (56)(REG_P2), R15 - ADCQ (64)(REG_P2), AX - ADCQ (72)(REG_P2), BX - ADCQ (80)(REG_P2), CX - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ AX, (64)(REG_P3) - MOVQ BX, (72)(REG_P3) - MOVQ CX, (80)(REG_P3) - MOVQ (88)(REG_P1), AX - ADCQ (88)(REG_P2), AX - MOVQ AX, (88)(REG_P3) - - MOVQ (96)(REG_P1), R8 - MOVQ (104)(REG_P1), R9 - MOVQ (112)(REG_P1), R10 - MOVQ (120)(REG_P1), R11 - MOVQ (128)(REG_P1), R12 - MOVQ (136)(REG_P1), R13 - MOVQ (144)(REG_P1), R14 - MOVQ (152)(REG_P1), R15 - MOVQ (160)(REG_P1), AX - MOVQ (168)(REG_P1), BX - MOVQ (176)(REG_P1), CX - MOVQ (184)(REG_P1), DI - - ADCQ (96)(REG_P2), R8 - ADCQ (104)(REG_P2), R9 - ADCQ (112)(REG_P2), R10 - ADCQ (120)(REG_P2), R11 - ADCQ (128)(REG_P2), R12 - ADCQ (136)(REG_P2), R13 - ADCQ (144)(REG_P2), R14 - ADCQ (152)(REG_P2), R15 - ADCQ (160)(REG_P2), AX - ADCQ (168)(REG_P2), BX - ADCQ (176)(REG_P2), CX - ADCQ (184)(REG_P2), DI - - MOVQ R8, (96)(REG_P3) - MOVQ R9, (104)(REG_P3) - MOVQ R10, (112)(REG_P3) - MOVQ R11, (120)(REG_P3) - MOVQ R12, (128)(REG_P3) - MOVQ R13, (136)(REG_P3) - MOVQ R14, (144)(REG_P3) - MOVQ R15, (152)(REG_P3) - MOVQ AX, (160)(REG_P3) - MOVQ BX, (168)(REG_P3) - MOVQ CX, (176)(REG_P3) - MOVQ DI, (184)(REG_P3) - - RET - - -TEXT ·fp751X2SubLazy(SB), NOSPLIT, $0-24 - - MOVQ z+0(FP), REG_P3 - MOVQ x+8(FP), REG_P1 - MOVQ y+16(FP), REG_P2 - - MOVQ (REG_P1), R8 - MOVQ (8)(REG_P1), R9 - MOVQ (16)(REG_P1), R10 - MOVQ (24)(REG_P1), R11 - MOVQ (32)(REG_P1), R12 - MOVQ (40)(REG_P1), R13 - MOVQ (48)(REG_P1), R14 - MOVQ (56)(REG_P1), R15 - MOVQ (64)(REG_P1), AX - MOVQ (72)(REG_P1), BX - MOVQ (80)(REG_P1), CX - - SUBQ (REG_P2), R8 - SBBQ (8)(REG_P2), R9 - SBBQ (16)(REG_P2), R10 - SBBQ (24)(REG_P2), R11 - SBBQ (32)(REG_P2), R12 - SBBQ (40)(REG_P2), R13 - SBBQ (48)(REG_P2), R14 - SBBQ (56)(REG_P2), R15 - SBBQ (64)(REG_P2), AX - SBBQ (72)(REG_P2), BX - SBBQ (80)(REG_P2), CX - - MOVQ R8, (REG_P3) - MOVQ R9, (8)(REG_P3) - MOVQ R10, (16)(REG_P3) - MOVQ R11, (24)(REG_P3) - MOVQ R12, (32)(REG_P3) - MOVQ R13, (40)(REG_P3) - MOVQ R14, (48)(REG_P3) - MOVQ R15, (56)(REG_P3) - MOVQ AX, (64)(REG_P3) - MOVQ BX, (72)(REG_P3) - MOVQ CX, (80)(REG_P3) - MOVQ (88)(REG_P1), AX - SBBQ (88)(REG_P2), AX - MOVQ AX, (88)(REG_P3) - - MOVQ (96)(REG_P1), R8 - MOVQ (104)(REG_P1), R9 - MOVQ (112)(REG_P1), R10 - MOVQ (120)(REG_P1), R11 - MOVQ (128)(REG_P1), R12 - MOVQ (136)(REG_P1), R13 - MOVQ (144)(REG_P1), R14 - MOVQ (152)(REG_P1), R15 - MOVQ (160)(REG_P1), AX - MOVQ (168)(REG_P1), BX - MOVQ (176)(REG_P1), CX - MOVQ (184)(REG_P1), DI - - SBBQ (96)(REG_P2), R8 - SBBQ (104)(REG_P2), R9 - SBBQ (112)(REG_P2), R10 - SBBQ (120)(REG_P2), R11 - SBBQ (128)(REG_P2), R12 - SBBQ (136)(REG_P2), R13 - SBBQ (144)(REG_P2), R14 - SBBQ (152)(REG_P2), R15 - SBBQ (160)(REG_P2), AX - SBBQ (168)(REG_P2), BX - SBBQ (176)(REG_P2), CX - SBBQ (184)(REG_P2), DI - - MOVQ R8, (96)(REG_P3) - MOVQ R9, (104)(REG_P3) - MOVQ R10, (112)(REG_P3) - MOVQ R11, (120)(REG_P3) - MOVQ R12, (128)(REG_P3) - MOVQ R13, (136)(REG_P3) - MOVQ R14, (144)(REG_P3) - MOVQ R15, (152)(REG_P3) - MOVQ AX, (160)(REG_P3) - MOVQ BX, (168)(REG_P3) - MOVQ CX, (176)(REG_P3) - MOVQ DI, (184)(REG_P3) - - // Now the carry flag is 1 if x-y < 0. If so, add p*2^768. - MOVQ $0, AX - SBBQ $0, AX - - // Load p into registers: - MOVQ P751_0, R8 - // P751_{1,2,3,4} = P751_0, so reuse R8 - MOVQ P751_5, R9 - MOVQ P751_6, R10 - MOVQ P751_7, R11 - MOVQ P751_8, R12 - MOVQ P751_9, R13 - MOVQ P751_10, R14 - MOVQ P751_11, R15 - - ANDQ AX, R8 - ANDQ AX, R9 - ANDQ AX, R10 - ANDQ AX, R11 - ANDQ AX, R12 - ANDQ AX, R13 - ANDQ AX, R14 - ANDQ AX, R15 - - ADDQ R8, (96 )(REG_P3) - ADCQ R8, (96+ 8)(REG_P3) - ADCQ R8, (96+16)(REG_P3) - ADCQ R8, (96+24)(REG_P3) - ADCQ R8, (96+32)(REG_P3) - ADCQ R9, (96+40)(REG_P3) - ADCQ R10, (96+48)(REG_P3) - ADCQ R11, (96+56)(REG_P3) - ADCQ R12, (96+64)(REG_P3) - ADCQ R13, (96+72)(REG_P3) - ADCQ R14, (96+80)(REG_P3) - ADCQ R15, (96+88)(REG_P3) - - RET - diff --git a/external/github.com/cloudflare/sidh/p751/arith_arm64.s b/external/github.com/cloudflare/sidh/p751/arith_arm64.s deleted file mode 100644 index 730936e1e7..0000000000 --- a/external/github.com/cloudflare/sidh/p751/arith_arm64.s +++ /dev/null @@ -1,1520 +0,0 @@ -// +build arm64,!noasm - -#include "textflag.h" - -TEXT ·fp751ConditionalSwap(SB), NOSPLIT, $0-17 - MOVD x+0(FP), R0 - MOVD y+8(FP), R1 - MOVB choice+16(FP), R2 - - // Set flags - // If choice is not 0 or 1, this implementation will swap completely - CMP $0, R2 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 0(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 0(R1) - - LDP 16(R0), (R3, R4) - LDP 16(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 16(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 16(R1) - - LDP 32(R0), (R3, R4) - LDP 32(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 32(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 32(R1) - - LDP 48(R0), (R3, R4) - LDP 48(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 48(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 48(R1) - - LDP 64(R0), (R3, R4) - LDP 64(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 64(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 64(R1) - - LDP 80(R0), (R3, R4) - LDP 80(R1), (R5, R6) - CSEL EQ, R3, R5, R7 - CSEL EQ, R4, R6, R8 - STP (R7, R8), 80(R0) - CSEL NE, R3, R5, R9 - CSEL NE, R4, R6, R10 - STP (R9, R10), 80(R1) - - RET - -TEXT ·fp751AddReduced(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load first summand into R3-R14 - // Add first summand and second summand and store result in R3-R14 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R15, R16) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R17, R19) - ADDS R15, R3 - ADCS R16, R4 - ADCS R17, R5 - ADCS R19, R6 - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R15, R16) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R17, R19) - ADCS R15, R7 - ADCS R16, R8 - ADCS R17, R9 - ADCS R19, R10 - - LDP 64(R0), (R11, R12) - LDP 64(R1), (R15, R16) - LDP 80(R0), (R13, R14) - LDP 80(R1), (R17, R19) - ADCS R15, R11 - ADCS R16, R12 - ADCS R17, R13 - ADC R19, R14 - - // Subtract 2 * p751 in R15-R24 from the result in R3-R14 - LDP ·p751x2+0(SB), (R15, R16) - SUBS R15, R3 - SBCS R16, R4 - LDP ·p751x2+40(SB), (R17, R19) - SBCS R16, R5 - SBCS R16, R6 - SBCS R16, R7 - LDP ·p751x2+56(SB), (R20, R21) - SBCS R17, R8 - SBCS R19, R9 - LDP ·p751x2+72(SB), (R22, R23) - SBCS R20, R10 - SBCS R21, R11 - MOVD ·p751x2+88(SB), R24 - SBCS R22, R12 - SBCS R23, R13 - SBCS R24, R14 - SBC ZR, ZR, R25 - - // If x + y - 2 * p751 < 0, R25 is 1 and 2 * p751 should be added - AND R25, R15 - AND R25, R16 - AND R25, R17 - AND R25, R19 - AND R25, R20 - AND R25, R21 - AND R25, R22 - AND R25, R23 - AND R25, R24 - - ADDS R15, R3 - ADCS R16, R4 - STP (R3, R4), 0(R2) - ADCS R16, R5 - ADCS R16, R6 - STP (R5, R6), 16(R2) - ADCS R16, R7 - ADCS R17, R8 - STP (R7, R8), 32(R2) - ADCS R19, R9 - ADCS R20, R10 - STP (R9, R10), 48(R2) - ADCS R21, R11 - ADCS R22, R12 - STP (R11, R12), 64(R2) - ADCS R23, R13 - ADC R24, R14 - STP (R13, R14), 80(R2) - - RET - -TEXT ·fp751SubReduced(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load x into R3-R14 - // Subtract y from x and store result in R3-R14 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R15, R16) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R17, R19) - SUBS R15, R3 - SBCS R16, R4 - SBCS R17, R5 - SBCS R19, R6 - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R15, R16) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R17, R19) - SBCS R15, R7 - SBCS R16, R8 - SBCS R17, R9 - SBCS R19, R10 - - LDP 64(R0), (R11, R12) - LDP 64(R1), (R15, R16) - LDP 80(R0), (R13, R14) - LDP 80(R1), (R17, R19) - SBCS R15, R11 - SBCS R16, R12 - SBCS R17, R13 - SBCS R19, R14 - SBC ZR, ZR, R15 - - // If x - y < 0, R15 is 1 and 2 * p751 should be added - LDP ·p751x2+0(SB), (R16, R17) - AND R15, R16 - AND R15, R17 - LDP ·p751x2+40(SB), (R19, R20) - AND R15, R19 - AND R15, R20 - - ADDS R16, R3 - ADCS R17, R4 - STP (R3, R4), 0(R2) - ADCS R17, R5 - ADCS R17, R6 - STP (R5, R6), 16(R2) - ADCS R17, R7 - ADCS R19, R8 - STP (R7, R8), 32(R2) - ADCS R20, R9 - - LDP ·p751x2+56(SB), (R16, R17) - AND R15, R16 - AND R15, R17 - LDP ·p751x2+72(SB), (R19, R20) - AND R15, R19 - AND R15, R20 - - ADCS R16, R10 - STP (R9, R10), 48(R2) - ADCS R17, R11 - ADCS R19, R12 - STP (R11, R12), 64(R2) - ADCS R20, R13 - - MOVD ·p751x2+88(SB), R16 - AND R15, R16 - ADC R16, R14 - STP (R13, R14), 80(R2) - - RET - -TEXT ·fp751AddLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load first summand into R3-R14 - // Add first summand and second summand and store result in R3-R14 - LDP 0(R0), (R3, R4) - LDP 0(R1), (R15, R16) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R17, R19) - ADDS R15, R3 - ADCS R16, R4 - STP (R3, R4), 0(R2) - ADCS R17, R5 - ADCS R19, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R15, R16) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R17, R19) - ADCS R15, R7 - ADCS R16, R8 - STP (R7, R8), 32(R2) - ADCS R17, R9 - ADCS R19, R10 - STP (R9, R10), 48(R2) - - LDP 64(R0), (R11, R12) - LDP 64(R1), (R15, R16) - LDP 80(R0), (R13, R14) - LDP 80(R1), (R17, R19) - ADCS R15, R11 - ADCS R16, R12 - STP (R11, R12), 64(R2) - ADCS R17, R13 - ADC R19, R14 - STP (R13, R14), 80(R2) - - RET - -TEXT ·fp751X2AddLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R15, R16) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R17, R19) - ADDS R15, R3 - ADCS R16, R4 - STP (R3, R4), 0(R2) - ADCS R17, R5 - ADCS R19, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R15, R16) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R17, R19) - ADCS R15, R7 - ADCS R16, R8 - STP (R7, R8), 32(R2) - ADCS R17, R9 - ADCS R19, R10 - STP (R9, R10), 48(R2) - - LDP 64(R0), (R11, R12) - LDP 64(R1), (R15, R16) - LDP 80(R0), (R13, R14) - LDP 80(R1), (R17, R19) - ADCS R15, R11 - ADCS R16, R12 - STP (R11, R12), 64(R2) - ADCS R17, R13 - ADCS R19, R14 - STP (R13, R14), 80(R2) - - LDP 96(R0), (R3, R4) - LDP 96(R1), (R15, R16) - LDP 112(R0), (R5, R6) - LDP 112(R1), (R17, R19) - ADCS R15, R3 - ADCS R16, R4 - STP (R3, R4), 96(R2) - ADCS R17, R5 - ADCS R19, R6 - STP (R5, R6), 112(R2) - - LDP 128(R0), (R7, R8) - LDP 128(R1), (R15, R16) - LDP 144(R0), (R9, R10) - LDP 144(R1), (R17, R19) - ADCS R15, R7 - ADCS R16, R8 - STP (R7, R8), 128(R2) - ADCS R17, R9 - ADCS R19, R10 - STP (R9, R10), 144(R2) - - LDP 160(R0), (R11, R12) - LDP 160(R1), (R15, R16) - LDP 176(R0), (R13, R14) - LDP 176(R1), (R17, R19) - ADCS R15, R11 - ADCS R16, R12 - STP (R11, R12), 160(R2) - ADCS R17, R13 - ADC R19, R14 - STP (R13, R14), 176(R2) - - RET - -TEXT ·fp751X2SubLazy(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - LDP 0(R0), (R3, R4) - LDP 0(R1), (R15, R16) - LDP 16(R0), (R5, R6) - LDP 16(R1), (R17, R19) - SUBS R15, R3 - SBCS R16, R4 - STP (R3, R4), 0(R2) - SBCS R17, R5 - SBCS R19, R6 - STP (R5, R6), 16(R2) - - LDP 32(R0), (R7, R8) - LDP 32(R1), (R15, R16) - LDP 48(R0), (R9, R10) - LDP 48(R1), (R17, R19) - SBCS R15, R7 - SBCS R16, R8 - STP (R7, R8), 32(R2) - SBCS R17, R9 - SBCS R19, R10 - STP (R9, R10), 48(R2) - - LDP 64(R0), (R11, R12) - LDP 64(R1), (R15, R16) - LDP 80(R0), (R13, R14) - LDP 80(R1), (R17, R19) - SBCS R15, R11 - SBCS R16, R12 - STP (R11, R12), 64(R2) - SBCS R17, R13 - SBCS R19, R14 - STP (R13, R14), 80(R2) - - LDP 96(R0), (R3, R4) - LDP 96(R1), (R15, R16) - LDP 112(R0), (R5, R6) - LDP 112(R1), (R17, R19) - SBCS R15, R3 - SBCS R16, R4 - SBCS R17, R5 - SBCS R19, R6 - - LDP 128(R0), (R7, R8) - LDP 128(R1), (R15, R16) - LDP 144(R0), (R9, R10) - LDP 144(R1), (R17, R19) - SBCS R15, R7 - SBCS R16, R8 - SBCS R17, R9 - SBCS R19, R10 - - LDP 160(R0), (R11, R12) - LDP 160(R1), (R15, R16) - LDP 176(R0), (R13, R14) - LDP 176(R1), (R17, R19) - SBCS R15, R11 - SBCS R16, R12 - SBCS R17, R13 - SBCS R19, R14 - SBC ZR, ZR, R15 - - // If x - y < 0, R15 is 1 and p751 should be added - MOVD ·p751+0(SB), R20 - AND R15, R20 - LDP ·p751+40(SB), (R16, R17) - ADDS R20, R3 - ADCS R20, R4 - STP (R3, R4), 96(R2) - ADCS R20, R5 - ADCS R20, R6 - STP (R5, R6), 112(R2) - ADCS R20, R7 - - LDP ·p751+56(SB), (R19, R20) - AND R15, R16 - AND R15, R17 - ADCS R16, R8 - STP (R7, R8), 128(R2) - ADCS R17, R9 - - LDP ·p751+72(SB), (R16, R17) - AND R15, R19 - AND R15, R20 - ADCS R19, R10 - STP (R9, R10), 144(R2) - ADCS R20, R11 - - MOVD ·p751+88(SB), R19 - AND R15, R16 - AND R15, R17 - ADCS R16, R12 - STP (R11, R12), 160(R2) - ADCS R17, R13 - - AND R15, R19 - ADC R19, R14 - STP (R13, R14), 176(R2) - - RET - -// Expects that X0*Y0 is already in Z0(low),Z3(high) and X0*Y1 in Z1(low),Z2(high) -// Z0 is not actually touched -// Result of (X0-X2) * (Y0-Y2) will be in Z0-Z5 -// Inputs remain intact -#define mul192x192comba(X0, X1, X2, Y0, Y1, Y2, Z0, Z1, Z2, Z3, Z4, Z5, T0, T1, T2, T3) \ - MUL X1, Y0, T2 \ - UMULH X1, Y0, T3 \ - \ - ADDS Z3, Z1 \ - ADCS ZR, Z2 \ - ADC ZR, ZR, Z3 \ - \ - MUL X0, Y2, T0 \ - UMULH X0, Y2, T1 \ - \ - ADDS T2, Z1 \ - ADCS T3, Z2 \ - ADC ZR, Z3 \ - \ - MUL X1, Y1, T2 \ - UMULH X1, Y1, T3 \ - \ - ADDS T0, Z2 \ - ADCS T1, Z3 \ - ADC ZR, ZR, Z4 \ - \ - MUL X2, Y0, T0 \ - UMULH X2, Y0, T1 \ - \ - ADDS T2, Z2 \ - ADCS T3, Z3 \ - ADC ZR, Z4 \ - \ - MUL X1, Y2, T2 \ - UMULH X1, Y2, T3 \ - \ - ADDS T0, Z2 \ - ADCS T1, Z3 \ - ADC ZR, Z4 \ - \ - MUL X2, Y1, T0 \ - UMULH X2, Y1, T1 \ - \ - ADDS T2, Z3 \ - ADCS T3, Z4 \ - ADC ZR, ZR, Z5 \ - \ - MUL X2, Y2, T2 \ - UMULH X2, Y2, T3 \ - \ - ADDS T0, Z3 \ - ADCS T1, Z4 \ - ADC ZR, Z5 \ - \ - ADDS T2, Z4 \ - ADC T3, Z5 - -// Expects that X points to (X4-X6), Y to (Y4-Y6) -// Result of (X0-X5) * (Y0-Y5) will be in (0(Z), 8(Z), 16(Z), T0-T8) -// Inputs get overwritten -#define mul384x384karatsuba(X, Y, Z, X0, X1, X2, X3, X4, X5, Y0, Y1, Y2, Y3, Y4, Y5, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)\ - ADDS X0, X3 \ // xH + xL, destroys xH - ADCS X1, X4 \ - ADCS X2, X5 \ - ADC ZR, ZR, T10 \ - \ - ADDS Y0, Y3 \ // yH + yL, destroys yH - ADCS Y1, Y4 \ - ADCS Y2, Y5 \ - ADC ZR, ZR, T6 \ - \ - SUB T10, ZR, T7 \ - SUB T6, ZR, T8 \ - AND T6, T10 \ // combined carry - \ - AND T7, Y3, T0 \ // masked(yH + yL) - AND T7, Y4, T1 \ - AND T7, Y5, T2 \ - \ - AND T8, X3, T3 \ // masked(xH + xL) - AND T8, X4, T4 \ - AND T8, X5, T5 \ - \ - ADDS T3, T0 \ - ADCS T4, T1 \ - STP (T0, T1), 0+Z \ - \ - MUL X3, Y3, T0 \ - MUL X3, Y4, T1 \ - \ - ADCS T5, T2 \ - MOVD T2, 16+Z \ - \ - UMULH X3, Y4, T2 \ - UMULH X3, Y3, T3 \ - \ - ADC ZR, T10 \ - \ // (xH + xL) * (yH + yL) - mul192x192comba(X3, X4, X5, Y3, Y4, Y5, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)\ - \ - MUL X0, Y0, X3 \ - LDP 0+Z, (T6, T7) \ - MOVD 16+Z, T8 \ - \ - UMULH X0, Y0, Y3 \ - ADDS T6, T3 \ - ADCS T7, T4 \ - MUL X0, Y1, X4 \ - ADCS T8, T5 \ - ADC ZR, T10 \ - UMULH X0, Y1, X5 \ - \ // xL * yL - mul192x192comba(X0, X1, X2, Y0, Y1, Y2, X3, X4, X5, Y3, Y4, Y5, T6, T7, T8, T9)\ - \ - STP (X3, X4), 0+Z \ - MOVD X5, 16+Z \ - \ - SUBS X3, T0 \ // (xH + xL) * (yH + yL) - xL * yL - SBCS X4, T1 \ - LDP 0+X, (X3, X4) \ - SBCS X5, T2 \ - MOVD 16+X, X5 \ - SBCS Y3, T3 \ - SBCS Y4, T4 \ - SBCS Y5, T5 \ - SBC ZR, T10 \ - \ - ADDS Y3, T0 \ // ((xH + xL) * (yH + yL) - xL * yL) * 2^192 + xL * yL - ADCS Y4, T1 \ - LDP 0+Y, (Y3, Y4) \ - MUL X3, Y3, X0 \ - ADCS Y5, T2 \ - UMULH X3, Y3, Y0 \ - MOVD 16+Y, Y5 \ - MUL X3, Y4, X1 \ - ADCS ZR, T3 \ - UMULH X3, Y4, X2 \ - ADCS ZR, T4 \ - ADCS ZR, T5 \ - ADC ZR, T10 \ - \ // xH * yH, overwrite xLow, yLow - mul192x192comba(X3, X4, X5, Y3, Y4, Y5, X0, X1, X2, Y0, Y1, Y2, T6, T7, T8, T9)\ - \ - SUBS X0, T0 \ // ((xH + xL) * (yH + yL) - xL * yL - xH * yH) - SBCS X1, T1 \ - SBCS X2, T2 \ - SBCS Y0, T3 \ - SBCS Y1, T4 \ - SBCS Y2, T5 \ - SBC ZR, T10 \ - \ - ADDS X0, T3 \ - ADCS X1, T4 \ - ADCS X2, T5 \ - ADCS T10, Y0, T6 \ - ADCS ZR, Y1, T7 \ - ADC ZR, Y2, T8 - - -TEXT ·fp751Mul(SB), NOSPLIT, $0-24 - MOVD z+0(FP), R2 - MOVD x+8(FP), R0 - MOVD y+16(FP), R1 - - // Load xL in R3-R8, xH in R9-R14 - // (xH + xL) in R3-R8, destroys xH - LDP 0(R0), (R3, R4) - LDP 48(R0), (R9, R10) - ADDS R9, R3 - ADCS R10, R4 - LDP 16(R0), (R5, R6) - LDP 64(R0), (R11, R12) - ADCS R11, R5 - ADCS R12, R6 - LDP 32(R0), (R7, R8) - LDP 80(R0), (R13, R14) - ADCS R13, R7 - ADCS R14, R8 - ADC ZR, ZR, R22 - - // Load yL in R9-R14, yH in R15-21 - // (yH + yL) in R9-R14, destroys yH - LDP 0(R1), (R9, R10) - LDP 48(R1), (R15, R16) - ADDS R15, R9 - ADCS R16, R10 - LDP 16(R1), (R11, R12) - LDP 64(R1), (R17, R19) - ADCS R17, R11 - ADCS R19, R12 - LDP 32(R1), (R13, R14) - LDP 80(R1), (R20, R21) - ADCS R20, R13 - ADCS R21, R14 - ADC ZR, ZR, R23 - - // Compute masks and combined carry - SUB R22, ZR, R24 - SUB R23, ZR, R25 - AND R23, R22 - - // Store xH, yH in z so mul384x384karatsuba can retrieve them from memory - // It doesn't have enough registers - // Meanwhile computed masked(xH + xL) in R15-R21 - STP (R6, R7), 0(R2) - AND R25, R3, R15 - AND R25, R4, R16 - STP (R8, R12), 16(R2) - AND R25, R5, R17 - AND R25, R6, R19 - STP (R13, R14), 32(R2) - AND R25, R7, R20 - AND R25, R8, R21 - - // Masked(xH + xL) + masked(yH + yL) in R15-R21 - // Store intermediate values in z - AND R24, R9, R25 - AND R24, R10, R26 - ADDS R25, R15 - ADCS R26, R16 - STP (R15, R16), 96(R2) - AND R24, R11, R25 - AND R24, R12, R26 - ADCS R25, R17 - ADCS R26, R19 - STP (R17, R19), 112(R2) - AND R24, R13, R25 - AND R24, R14, R26 - ADCS R25, R20 - ADCS R26, R21 - STP (R20, R21), 128(R2) - // Store carry in R29 so it can remain there - ADC ZR, R22, R29 - - // (xH + xL) * (yH + yL) - mul384x384karatsuba(0(R2), 24(R2), 48(R2), R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R19, R20, R21, R22, R23, R24, R25, R26) - - // Load masked(xH + xL) + masked(yH + yL) and add that to its top half - // Store the result back in z - STP (R15, R16), 72(R2) - LDP 96(R2), (R3, R4) - ADDS R3, R19 - STP (R17, R19), 88(R2) - ADCS R4, R20 - LDP 112(R2), (R5, R6) - ADCS R5, R21 - STP (R20, R21), 104(R2) - ADCS R6, R22 - LDP 128(R2), (R7, R8) - ADCS R7, R23 - STP (R22, R23), 120(R2) - ADCS R8, R24 - MOVD R24, 136(R2) - ADC ZR, R29 - - // Load xL, yL - LDP 0(R0), (R3, R4) - LDP 16(R0), (R5, R6) - LDP 32(R0), (R7, R8) - LDP 0(R1), (R9, R10) - LDP 16(R1), (R11, R12) - LDP 32(R1), (R13, R14) - - // xL * yL - mul384x384karatsuba(24(R0), 24(R1), 0(R2), R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R19, R20, R21, R22, R23, R24, R25, R26) - - // (xH + xL) * (yH + yL) - xL * yL in R3-R14 - LDP 0(R2), (R12, R13) - LDP 48(R2), (R3, R4) - SUBS R12, R3 - LDP 64(R2), (R5, R6) - MOVD 16(R2), R14 - SBCS R13, R4 - SBCS R14, R5 - LDP 80(R2), (R7, R8) - SBCS R15, R6 - SBCS R16, R7 - LDP 96(R2), (R9, R10) - SBCS R17, R8 - SBCS R19, R9 - LDP 112(R2), (R11, R12) - SBCS R20, R10 - SBCS R21, R11 - LDP 128(R2), (R13, R14) - SBCS R22, R12 - SBCS R23, R13 - SBCS R24, R14 - SBC ZR, R29 - - STP (R15, R16), 24(R2) - MOVD R17, 40(R2) - - // ((xH + xL) * (yH + yL) - xL * yL) * 2^384 + xL * yL and store back in z - ADDS R19, R3 - ADCS R20, R4 - STP (R3, R4), 48(R2) - ADCS R21, R5 - ADCS R22, R6 - STP (R5, R6), 64(R2) - ADCS R23, R7 - ADCS R24, R8 - STP (R7, R8), 80(R2) - ADCS ZR, R9 - ADCS ZR, R10 - STP (R9, R10), 96(R2) - ADCS ZR, R11 - ADCS ZR, R12 - STP (R11, R12), 112(R2) - ADCS ZR, R13 - ADCS ZR, R14 - STP (R13, R14), 128(R2) - ADC ZR, R29 - - // Load xH, yH - LDP 48(R0), (R3, R4) - LDP 64(R0), (R5, R6) - LDP 80(R0), (R7, R8) - LDP 48(R1), (R9, R10) - LDP 64(R1), (R11, R12) - LDP 80(R1), (R13, R14) - - // xH * yH - mul384x384karatsuba(72(R0), 72(R1), 144(R2), R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R19, R20, R21, R22, R23, R24, R25, R26) - - LDP 144(R2), (R12, R13) - MOVD 160(R2), R14 - - // (xH + xL) * (yH + yL) - xL * yL - xH * yH in R3-R14 - // Store lower half in z, that's done - LDP 48(R2), (R3, R4) - SUBS R12, R3 - LDP 64(R2), (R5, R6) - SBCS R13, R4 - SBCS R14, R5 - LDP 80(R2), (R7, R8) - SBCS R15, R6 - SBCS R16, R7 - LDP 96(R2), (R9, R10) - SBCS R17, R8 - SBCS R19, R9 - LDP 112(R2), (R11, R12) - SBCS R20, R10 - SBCS R21, R11 - LDP 128(R2), (R13, R14) - SBCS R22, R12 - SBCS R23, R13 - STP (R3, R4), 48(R2) - SBCS R24, R14 - STP (R5, R6), 64(R2) - SBC ZR, R29 - STP (R7, R8), 80(R2) - - // (xH * yH) * 2^768 + ((xH + xL) * (yH + yL) - xL * yL - xH * yH) * 2^384 + xL * yL - // Store remaining limbs in z - LDP 144(R2), (R3, R4) - MOVD 160(R2), R5 - - ADDS R3, R9 - ADCS R4, R10 - STP (R9, R10), 96(R2) - ADCS R5, R11 - ADCS R15, R12 - STP (R11, R12), 112(R2) - ADCS R16, R13 - ADCS R17, R14 - STP (R13, R14), 128(R2) - - ADCS R29, R19 - ADCS ZR, R20 - STP (R19, R20), 144(R2) - ADCS ZR, R21 - ADCS ZR, R22 - STP (R21, R22), 160(R2) - ADCS ZR, R23 - ADC ZR, R24 - STP (R23, R24), 176(R2) - - RET - -TEXT ·fp751MontgomeryReduce(SB), NOSPLIT, $0-16 - MOVD z+0(FP), R0 - MOVD x+8(FP), R1 - - // Load p751+1 in R14-R17, R29, R19-R20, spread over arithmetic - LDP ·p751p1+40(SB), (R14, R15) - // z0-z11 will be R2-R13 - // Load x0-x4 to z0-z4 and x5, spread over arithmetic - LDP 0(R1), (R2, R3) - - // x5 iteration - MUL R2, R14, R22 - LDP 32(R1), (R6, R21) - UMULH R2, R14, R23 - ADDS R21, R22, R7 // Set z5 - ADC ZR, R23, R25 - - // x6 iteration - MUL R2, R15, R22 - MOVD 48(R1), R21 - UMULH R2, R15, R23 - ADDS R22, R25 - ADC R23, ZR, R26 - - MUL R3, R14, R22 - LDP ·p751p1+56(SB), (R16, R17) - UMULH R3, R14, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - ADDS R21, R25, R8 // Set z6 - ADCS ZR, R26 - ADC ZR, R24 - - // x7 iteration - MUL R2, R16, R22 - MOVD 56(R1), R21 - UMULH R2, R16, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, ZR, R25 - - MUL R3, R15, R22 - LDP 16(R1), (R4, R5) - UMULH R3, R15, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R4, R14, R22 - LDP ·p751p1+72(SB), (R29, R19) - UMULH R4, R14, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - ADDS R21, R26, R9 // Set z7 - ADCS ZR, R24 - ADC ZR, R25 - - // x8 iteration - MUL R2, R17, R22 - MOVD 64(R1), R21 - UMULH R2, R17, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, ZR, R26 - - MUL R3, R16, R22 - MOVD ·p751p1+88(SB), R20 - UMULH R3, R16, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R4, R15, R22 - UMULH R4, R15, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R5, R14, R22 - UMULH R5, R14, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - ADDS R24, R21, R10 // Set z8 - ADCS ZR, R25 - ADC ZR, R26 - - // x9 iteration - MUL R2, R29, R22 - MOVD 72(R1), R21 - UMULH R2, R29, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - MUL R3, R17, R22 - UMULH R3, R17, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R4, R16, R22 - UMULH R4, R16, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R5, R15, R22 - UMULH R5, R15, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R6, R14, R22 - UMULH R6, R14, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - ADDS R21, R25, R11 // Set z9 - ADCS ZR, R26 - ADC ZR, R24 - - // x10 iteration - MUL R2, R19, R22 - MOVD 80(R1), R21 - UMULH R2, R19, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, ZR, R25 - - MUL R3, R29, R22 - UMULH R3, R29, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R4, R17, R22 - UMULH R4, R17, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R5, R16, R22 - UMULH R5, R16, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R6, R15, R22 - UMULH R6, R15, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R7, R14, R22 - UMULH R7, R14, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - ADDS R21, R26, R12 // Set z10 - ADCS ZR, R24 - ADC ZR, R25 - - // x11 iteration - MUL R2, R20, R22 - MOVD 88(R1), R21 - UMULH R2, R20, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, ZR, R26 - - MUL R3, R19, R22 - UMULH R3, R19, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R4, R29, R22 - UMULH R4, R29, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R5, R17, R22 - UMULH R5, R17, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R6, R16, R22 - UMULH R6, R16, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R7, R15, R22 - UMULH R7, R15, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R8, R14, R22 - UMULH R8, R14, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - ADDS R21, R24, R13 // Set z11 - ADCS ZR, R25 - ADC ZR, R26 - - // x12 iteration - MUL R3, R20, R22 - MOVD 96(R1), R21 - UMULH R3, R20, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - MUL R4, R19, R22 - UMULH R4, R19, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R5, R29, R22 - UMULH R5, R29, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R6, R17, R22 - UMULH R6, R17, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R7, R16, R22 - UMULH R7, R16, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R8, R15, R22 - UMULH R8, R15, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R9, R14, R22 - UMULH R9, R14, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - ADDS R21, R25, R2 // Set z0 - ADCS ZR, R26 - ADC ZR, R24 - - // x13 iteration - MUL R4, R20, R22 - MOVD 104(R1), R21 - UMULH R4, R20, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, ZR, R25 - - MUL R5, R19, R22 - UMULH R5, R19, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R6, R29, R22 - UMULH R6, R29, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R7, R17, R22 - UMULH R7, R17, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R8, R16, R22 - UMULH R8, R16, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R9, R15, R22 - UMULH R9, R15, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R10, R14, R22 - UMULH R10, R14, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - ADDS R21, R26, R3 // Set z1 - STP (R2, R3), 0(R0) - ADCS ZR, R24 - ADC ZR, R25 - - // x14 iteration - MUL R5, R20, R22 - MOVD 112(R1), R21 - UMULH R5, R20, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, ZR, R26 - - MUL R6, R19, R22 - UMULH R6, R19, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R7, R29, R22 - UMULH R7, R29, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R8, R17, R22 - UMULH R8, R17, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R9, R16, R22 - UMULH R9, R16, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R10, R15, R22 - UMULH R10, R15, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R11, R14, R22 - UMULH R11, R14, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - ADDS R21, R24, R4 // Set z2 - ADCS ZR, R25 - ADC ZR, R26 - - // x15 iteration - MUL R6, R20, R22 - MOVD 120(R1), R21 - UMULH R6, R20, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - MUL R7, R19, R22 - UMULH R7, R19, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R8, R29, R22 - UMULH R8, R29, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R9, R17, R22 - UMULH R9, R17, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R10, R16, R22 - UMULH R10, R16, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R11, R15, R22 - UMULH R11, R15, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R12, R14, R22 - UMULH R12, R14, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - ADDS R21, R25, R5 // Set z3 - STP (R4, R5), 16(R0) - ADCS ZR, R26 - ADC ZR, R24 - - // x16 iteration - MUL R7, R20, R22 - MOVD 128(R1), R21 - UMULH R7, R20, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, ZR, R25 - - MUL R8, R19, R22 - UMULH R8, R19, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R9, R29, R22 - UMULH R9, R29, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R10, R17, R22 - UMULH R10, R17, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R11, R16, R22 - UMULH R11, R16, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R12, R15, R22 - UMULH R12, R15, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R13, R14, R22 - UMULH R13, R14, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - ADDS R21, R26, R6 // Set z4 - ADCS ZR, R24 - ADC ZR, R25 - - // x17 iteration - MUL R8, R20, R22 - MOVD 136(R1), R21 - UMULH R8, R20, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, ZR, R26 - - MUL R9, R19, R22 - UMULH R9, R19, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R10, R29, R22 - UMULH R10, R29, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R11, R17, R22 - UMULH R11, R17, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R12, R16, R22 - UMULH R12, R16, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R13, R15, R22 - UMULH R13, R15, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - ADDS R21, R24, R7 // Set z5 - STP (R6, R7), 32(R0) - ADCS ZR, R25 - ADC ZR, R26 - - // x18 iteration - MUL R9, R20, R22 - MOVD 144(R1), R21 - UMULH R9, R20, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - MUL R10, R19, R22 - UMULH R10, R19, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R11, R29, R22 - UMULH R11, R29, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R12, R17, R22 - UMULH R12, R17, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - MUL R13, R16, R22 - UMULH R13, R16, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - ADDS R21, R25, R8 // Set z6 - ADCS ZR, R26 - ADC ZR, R24 - - // x19 iteration - MUL R10, R20, R22 - MOVD 152(R1), R21 - UMULH R10, R20, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, ZR, R25 - - MUL R11, R19, R22 - UMULH R11, R19, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R12, R29, R22 - UMULH R12, R29, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - MUL R13, R17, R22 - UMULH R13, R17, R23 - ADDS R22, R26 - ADCS R23, R24 - ADC ZR, R25 - - ADDS R21, R26, R9 // Set z7 - STP (R8, R9), 48(R0) - ADCS ZR, R24 - ADC ZR, R25 - - // x20 iteration - MUL R11, R20, R22 - MOVD 160(R1), R21 - UMULH R11, R20, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, ZR, R26 - - MUL R12, R19, R22 - UMULH R12, R19, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - MUL R13, R29, R22 - UMULH R13, R29, R23 - ADDS R22, R24 - ADCS R23, R25 - ADC ZR, R26 - - ADDS R21, R24, R10 // Set z8 - ADCS ZR, R25 - ADC ZR, R26 - - // x21 iteration - MUL R12, R20, R22 - MOVD 168(R1), R21 - UMULH R12, R20, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, ZR, R24 - - MUL R13, R19, R22 - UMULH R13, R19, R23 - ADDS R22, R25 - ADCS R23, R26 - ADC ZR, R24 - - ADDS R21, R25, R11 // Set z9 - STP (R10, R11), 64(R0) - ADCS ZR, R26 - ADC ZR, R24 - - // x22 iteration - MUL R13, R20, R22 - MOVD 176(R1), R21 - UMULH R13, R20, R23 - ADDS R22, R26 - ADC R23, R24 - ADDS R21, R26, R12 // Set z10 - - MOVD 184(R1), R21 - ADC R21, R24, R13 // Set z11 - STP (R12, R13), 80(R0) - - RET - -TEXT ·fp751StrongReduce(SB), NOSPLIT, $0-8 - MOVD x+0(FP), R0 - - // Keep x in R1-R12, p751 in R13-R21, subtract to R1-R12 - MOVD ·p751+0(SB), R13 - LDP 0(R0), (R1, R2) - LDP 16(R0), (R3, R4) - SUBS R13, R1 - SBCS R13, R2 - - LDP 32(R0), (R5, R6) - LDP ·p751+40(SB), (R14, R15) - SBCS R13, R3 - SBCS R13, R4 - - LDP 48(R0), (R7, R8) - LDP ·p751+56(SB), (R16, R17) - SBCS R13, R5 - SBCS R14, R6 - - LDP 64(R0), (R9, R10) - LDP ·p751+72(SB), (R19, R20) - SBCS R15, R7 - SBCS R16, R8 - - LDP 80(R0), (R11, R12) - MOVD ·p751+88(SB), R21 - SBCS R17, R9 - SBCS R19, R10 - - SBCS R20, R11 - SBCS R21, R12 - SBC ZR, ZR, R22 - - // Mask with the borrow and add p751 - AND R22, R13 - AND R22, R14 - AND R22, R15 - AND R22, R16 - AND R22, R17 - AND R22, R19 - AND R22, R20 - AND R22, R21 - - ADDS R13, R1 - ADCS R13, R2 - STP (R1, R2), 0(R0) - ADCS R13, R3 - ADCS R13, R4 - STP (R3, R4), 16(R0) - ADCS R13, R5 - ADCS R14, R6 - STP (R5, R6), 32(R0) - ADCS R15, R7 - ADCS R16, R8 - STP (R7, R8), 48(R0) - ADCS R17, R9 - ADCS R19, R10 - STP (R9, R10), 64(R0) - ADCS R20, R11 - ADC R21, R12 - STP (R11, R12), 80(R0) - - RET diff --git a/external/github.com/cloudflare/sidh/p751/arith_decl.go b/external/github.com/cloudflare/sidh/p751/arith_decl.go deleted file mode 100644 index 6c48f4dd7c..0000000000 --- a/external/github.com/cloudflare/sidh/p751/arith_decl.go +++ /dev/null @@ -1,46 +0,0 @@ -// +build amd64,!noasm arm64,!noasm - -package p751 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x. -// If choice is neither 0 nor 1 then behaviour is undefined. -// This function executes in constant time. -//go:noescape -func fp751ConditionalSwap(x, y *FpElement, choice uint8) - -// Compute z = x + y (mod p). -//go:noescape -func fp751AddReduced(z, x, y *FpElement) - -// Compute z = x - y (mod p). -//go:noescape -func fp751SubReduced(z, x, y *FpElement) - -// Compute z = x + y, without reducing mod p. -//go:noescape -func fp751AddLazy(z, x, y *FpElement) - -// Compute z = x + y, without reducing mod p. -//go:noescape -func fp751X2AddLazy(z, x, y *FpElementX2) - -// Compute z = x - y, without reducing mod p. -//go:noescape -func fp751X2SubLazy(z, x, y *FpElementX2) - -// Compute z = x * y. -//go:noescape -func fp751Mul(z *FpElementX2, x, y *FpElement) - -// Compute Montgomery reduction: set z = x * R^{-1} (mod 2*p). -// It may destroy the input value. -//go:noescape -func fp751MontgomeryReduce(z *FpElement, x *FpElementX2) - -// Reduce a field element in [0, 2*p) to one in [0,p). -//go:noescape -func fp751StrongReduce(x *FpElement) diff --git a/external/github.com/cloudflare/sidh/p751/arith_generic.go b/external/github.com/cloudflare/sidh/p751/arith_generic.go deleted file mode 100644 index 0173011275..0000000000 --- a/external/github.com/cloudflare/sidh/p751/arith_generic.go +++ /dev/null @@ -1,196 +0,0 @@ -// +build noasm !amd64,!arm64 - -package p751 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/arith" - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -// Compute z = x + y (mod p). -func fp751AddReduced(z, x, y *FpElement) { - var carry uint64 - - // z=x+y % p751 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } - - // z = z - p751x2 - carry = 0 - for i := 0; i < NumWords; i++ { - z[i], carry = Subc64(carry, z[i], p751x2[i]) - } - - // z = z + p751x2 - mask := uint64(0 - carry) - carry = 0 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, z[i], p751x2[i]&mask) - } -} - -// Compute z = x - y (mod p). -func fp751SubReduced(z, x, y *FpElement) { - var borrow uint64 - - for i := 0; i < NumWords; i++ { - z[i], borrow = Subc64(borrow, x[i], y[i]) - } - - mask := uint64(0 - borrow) - borrow = 0 - - for i := 0; i < NumWords; i++ { - z[i], borrow = Addc64(borrow, z[i], p751x2[i]&mask) - } -} - -// Conditionally swaps bits in x and y in constant time. -// mask indicates bits to be swaped (set bits are swapped) -// For details see "Hackers Delight, 2.20" -// -// Implementation doesn't actually depend on a prime field. -func fp751ConditionalSwap(x, y *FpElement, mask uint8) { - var tmp, mask64 uint64 - - mask64 = 0 - uint64(mask) - for i := 0; i < len(x); i++ { - tmp = mask64 & (x[i] ^ y[i]) - x[i] = tmp ^ x[i] - y[i] = tmp ^ y[i] - } -} - -// Perform Montgomery reduction: set z = x R^{-1} (mod 2*p) -// with R=2^768. Destroys the input value. -func fp751MontgomeryReduce(z *FpElement, x *FpElementX2) { - var carry, t, u, v uint64 - var uv Uint128 - var count int - - count = 5 // number of 0 digits in the least significat part of p751 + 1 - - for i := 0; i < NumWords; i++ { - for j := 0; j < i; j++ { - if j < (i - count + 1) { - uv = Mul64(z[j], p751p1[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - } - v, carry = Addc64(0, v, x[i]) - u, carry = Addc64(carry, u, 0) - t += carry - - z[i] = v - v = u - u = t - t = 0 - } - - for i := NumWords; i < 2*NumWords-1; i++ { - if count > 0 { - count-- - } - for j := i - NumWords + 1; j < NumWords; j++ { - if j < (NumWords - count) { - uv = Mul64(z[j], p751p1[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - } - v, carry = Addc64(0, v, x[i]) - u, carry = Addc64(carry, u, 0) - - t += carry - z[i-NumWords] = v - v = u - u = t - t = 0 - } - v, carry = Addc64(0, v, x[2*NumWords-1]) - z[NumWords-1] = v -} - -// Compute z = x * y. -func fp751Mul(z *FpElementX2, x, y *FpElement) { - var u, v, t uint64 - var carry uint64 - var uv Uint128 - - for i := uint64(0); i < NumWords; i++ { - for j := uint64(0); j <= i; j++ { - uv = Mul64(x[j], y[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - z[i] = v - v = u - u = t - t = 0 - } - - for i := NumWords; i < (2*NumWords)-1; i++ { - for j := i - NumWords + 1; j < NumWords; j++ { - uv = Mul64(x[j], y[i-j]) - v, carry = Addc64(0, uv.L, v) - u, carry = Addc64(carry, uv.H, u) - t += carry - } - z[i] = v - v = u - u = t - t = 0 - } - z[2*NumWords-1] = v -} - -// Compute z = x + y, without reducing mod p. -func fp751AddLazy(z, x, y *FpElement) { - var carry uint64 - for i := 0; i < NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } -} - -// Compute z = x + y, without reducing mod p. -func fp751X2AddLazy(z, x, y *FpElementX2) { - var carry uint64 - for i := 0; i < 2*NumWords; i++ { - z[i], carry = Addc64(carry, x[i], y[i]) - } -} - -// Reduce a field element in [0, 2*p) to one in [0,p). -func fp751StrongReduce(x *FpElement) { - var borrow, mask uint64 - for i := 0; i < NumWords; i++ { - x[i], borrow = Subc64(borrow, x[i], p751[i]) - } - - // Sets all bits if borrow = 1 - mask = 0 - borrow - borrow = 0 - for i := 0; i < NumWords; i++ { - x[i], borrow = Addc64(borrow, x[i], p751[i]&mask) - } -} - -// Compute z = x - y, without reducing mod p. -func fp751X2SubLazy(z, x, y *FpElementX2) { - var borrow, mask uint64 - for i := 0; i < len(z); i++ { - z[i], borrow = Subc64(borrow, x[i], y[i]) - } - - // Sets all bits if borrow = 1 - mask = 0 - borrow - borrow = 0 - for i := NumWords; i < len(z); i++ { - z[i], borrow = Addc64(borrow, z[i], p751[i-NumWords]&mask) - } -} diff --git a/external/github.com/cloudflare/sidh/p751/consts.go b/external/github.com/cloudflare/sidh/p751/consts.go deleted file mode 100644 index 57e49faae1..0000000000 --- a/external/github.com/cloudflare/sidh/p751/consts.go +++ /dev/null @@ -1,227 +0,0 @@ -package p751 - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" - cpu "v2ray.com/core/external/github.com/cloudflare/sidh/internal/utils" -) - -const ( - // SIDH public key byte size - P751_PublicKeySize = 564 - // SIDH shared secret byte size. - P751_SharedSecretSize = 188 - // Max size of secret key for 2-torsion group, corresponds to 2^e2 - P751_SecretBitLenA = 372 - // Size of secret key for 3-torsion group, corresponds to floor(log_2(3^e3)) - P751_SecretBitLenB = 378 - // P751 bytelen ceil(751/8) - P751_Bytelen = 94 - // Size of a compuatation strategy for 2-torsion group - strategySizeA = 185 - // Size of a compuatation strategy for 3-torsion group - strategySizeB = 238 - // Number of 64-bit limbs used to store Fp element - NumWords = 12 -) - -// CPU Capabilities. Those flags are referred by assembly code. According to -// https://github.com/golang/go/issues/28230, variables referred from the -// assembly must be in the same package. -// We declare them variables not constants in order to facilitate testing. -var ( - // Signals support for MULX which is in BMI2 - HasBMI2 = cpu.X86.HasBMI2 - // Signals support for ADX and BMI2 - HasADXandBMI2 = cpu.X86.HasBMI2 && cpu.X86.HasADX -) - -// The x-coordinate of PA -var P751_affine_PA = Fp2Element{ - A: FpElement{ - 0xC2FC08CEAB50AD8B, 0x1D7D710F55E457B1, 0xE8738D92953DCD6E, - 0xBAA7EBEE8A3418AA, 0xC9A288345F03F46F, 0xC8D18D167CFE2616, - 0x02043761F6B1C045, 0xAA1975E13180E7E9, 0x9E13D3FDC6690DE6, - 0x3A024640A3A3BB4F, 0x4E5AD44E6ACBBDAE, 0x0000544BEB561DAD, - }, - B: FpElement{ - 0xE6CC41D21582E411, 0x07C2ECB7C5DF400A, 0xE8E34B521432AEC4, - 0x50761E2AB085167D, 0x032CFBCAA6094B3C, 0x6C522F5FDF9DDD71, - 0x1319217DC3A1887D, 0xDC4FB25803353A86, 0x362C8D7B63A6AB09, - 0x39DCDFBCE47EA488, 0x4C27C99A2C28D409, 0x00003CB0075527C4, - }, -} - -// The x-coordinate of QA -var P751_affine_QA = Fp2Element{ - A: FpElement{ - 0xD56FE52627914862, 0x1FAD60DC96B5BAEA, 0x01E137D0BF07AB91, - 0x404D3E9252161964, 0x3C5385E4CD09A337, 0x4476426769E4AF73, - 0x9790C6DB989DFE33, 0xE06E1C04D2AA8B5E, 0x38C08185EDEA73B9, - 0xAA41F678A4396CA6, 0x92B9259B2229E9A0, 0x00002F9326818BE0, - }, - B: FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - }, -} - -// The x-coordinate of RA = PA-QA -var P751_affine_RA = Fp2Element{ - A: FpElement{ - 0x0BB84441DFFD19B3, 0x84B4DEA99B48C18E, 0x692DE648AD313805, - 0xE6D72761B6DFAEE0, 0x223975C672C3058D, 0xA0FDE0C3CBA26FDC, - 0xA5326132A922A3CA, 0xCA5E7F5D5EA96FA4, 0x127C7EFE33FFA8C6, - 0x4749B1567E2A23C4, 0x2B7DF5B4AF413BFA, 0x0000656595B9623C, - }, - B: FpElement{ - 0xED78C17F1EC71BE8, 0xF824D6DF753859B1, 0x33A10839B2A8529F, - 0xFC03E9E25FDEA796, 0xC4708A8054DF1762, 0x4034F2EC034C6467, - 0xABFB70FBF06ECC79, 0xDABE96636EC108B7, 0x49CBCFB090605FD3, - 0x20B89711819A45A7, 0xFB8E1590B2B0F63E, 0x0000556A5F964AB2, - }, -} - -// The x-coordinate of PB -var P751_affine_PB = Fp2Element{ - A: FpElement{ - 0xCFB6D71EF867AB0B, 0x4A5FDD76E9A45C76, 0x38B1EE69194B1F03, - 0xF6E7B18A7761F3F0, 0xFCF01A486A52C84C, 0xCBE2F63F5AA75466, - 0x6487BCE837B5E4D6, 0x7747F5A8C622E9B8, 0x4CBFE1E4EE6AEBBA, - 0x8A8616A13FA91512, 0x53DB980E1579E0A5, 0x000058FEBFF3BE69, - }, - B: FpElement{ - 0xA492034E7C075CC3, 0x677BAF00B04AA430, 0x3AAE0C9A755C94C8, - 0x1DC4B064E9EBB08B, 0x3684EDD04E826C66, 0x9BAA6CB661F01B22, - 0x20285A00AD2EFE35, 0xDCE95ABD0497065F, 0x16C7FBB3778E3794, - 0x26B3AC29CEF25AAF, 0xFB3C28A31A30AC1D, 0x000046ED190624EE, - }, -} - -// The x-coordinate of QB -var P751_affine_QB = Fp2Element{ - A: FpElement{ - 0xF1A8C9ED7B96C4AB, 0x299429DA5178486E, 0xEF4926F20CD5C2F4, - 0x683B2E2858B4716A, 0xDDA2FBCC3CAC3EEB, 0xEC055F9F3A600460, - 0xD5A5A17A58C3848B, 0x4652D836F42EAED5, 0x2F2E71ED78B3A3B3, - 0xA771C057180ADD1D, 0xC780A5D2D835F512, 0x0000114EA3B55AC1, - }, - B: FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - }, -} - -// The x-coordinate of RB = PB - QB -var P751_affine_RB = Fp2Element{ - A: FpElement{ - 0x1C0D6733769D0F31, 0xF084C3086E2659D1, 0xE23D5DA27BCBD133, - 0xF38EC9A8D5864025, 0x6426DC781B3B645B, 0x4B24E8E3C9FB03EE, - 0x6432792F9D2CEA30, 0x7CC8E8B1AE76E857, 0x7F32BFB626BB8963, - 0xB9F05995B48D7B74, 0x4D71200A7D67E042, 0x0000228457AF0637, - }, - B: FpElement{ - 0x4AE37E7D8F72BD95, 0xDD2D504B3E993488, 0x5D14E7FA1ECB3C3E, - 0x127610CEB75D6350, 0x255B4B4CAC446B11, 0x9EA12336C1F70CAF, - 0x79FA68A2147BC2F8, 0x11E895CFDADBBC49, 0xE4B9D3C4D6356C18, - 0x44B25856A67F951C, 0x5851541F61308D0B, 0x00002FFD994F7E4C, - }, -} - -// 2-torsion group computation strategy -var P751_AliceIsogenyStrategy = [strategySizeA]uint32{ - 0x50, 0x30, 0x1B, 0x0F, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x07, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x01, - 0x01, 0x01, 0x01, 0x0C, 0x07, 0x04, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x05, 0x03, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x15, - 0x0C, 0x07, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, - 0x02, 0x01, 0x01, 0x01, 0x01, 0x05, 0x03, 0x02, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x09, 0x05, 0x03, 0x02, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, 0x02, - 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x21, 0x14, 0x0C, 0x07, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x01, - 0x01, 0x01, 0x01, 0x05, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x01, 0x08, 0x05, 0x03, 0x02, 0x01, 0x01, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, - 0x01, 0x01, 0x02, 0x01, 0x01} - -// 3-torsion group computation strategy -var P751_BobIsogenyStrategy = [strategySizeB]uint32{ - 0x70, 0x3F, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, - 0x01, 0x02, 0x01, 0x01, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x1F, 0x10, 0x08, 0x04, 0x02, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, - 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x0F, 0x08, 0x04, - 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x07, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, - 0x01, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x31, 0x1F, 0x10, - 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, 0x02, - 0x01, 0x01, 0x02, 0x01, 0x01, 0x08, 0x04, 0x02, 0x01, 0x01, - 0x02, 0x01, 0x01, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x0F, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x04, - 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x07, 0x04, 0x02, 0x01, - 0x01, 0x02, 0x01, 0x01, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, - 0x15, 0x0C, 0x08, 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, - 0x04, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x05, 0x03, 0x02, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x09, 0x05, - 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, - 0x04, 0x02, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01} - -// Used internally by this package. Not consts as Go doesn't allow arrays to be consts -// ------------------------------- - -// p751 -var p751 = FpElement{ - 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, - 0xffffffffffffffff, 0xffffffffffffffff, 0xeeafffffffffffff, - 0xe3ec968549f878a8, 0xda959b1a13f7cc76, 0x084e9867d6ebe876, - 0x8562b5045cb25748, 0x0e12909f97badc66, 0x00006fe5d541f71c} - -// 2*p751 -var p751x2 = FpElement{ - 0xFFFFFFFFFFFFFFFE, 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, - 0xFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF, 0xDD5FFFFFFFFFFFFF, - 0xC7D92D0A93F0F151, 0xB52B363427EF98ED, 0x109D30CFADD7D0ED, - 0x0AC56A08B964AE90, 0x1C25213F2F75B8CD, 0x0000DFCBAA83EE38} - -// p751 + 1 -var p751p1 = FpElement{ - 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0xeeb0000000000000, - 0xe3ec968549f878a8, 0xda959b1a13f7cc76, 0x084e9867d6ebe876, - 0x8562b5045cb25748, 0x0e12909f97badc66, 0x00006fe5d541f71c} - -// R^2 = (2^768)^2 mod p -var p751R2 = FpElement{ - 2535603850726686808, 15780896088201250090, 6788776303855402382, - 17585428585582356230, 5274503137951975249, 2266259624764636289, - 11695651972693921304, 13072885652150159301, 4908312795585420432, - 6229583484603254826, 488927695601805643, 72213483953973} - -// 1*R mod p -var P751_OneFp2 = Fp2Element{ - A: FpElement{ - 0x249ad, 0x0, 0x0, 0x0, 0x0, 0x8310000000000000, 0x5527b1e4375c6c66, 0x697797bf3f4f24d0, 0xc89db7b2ac5c4e2e, 0x4ca4b439d2076956, 0x10f7926c7512c7e9, 0x2d5b24bce5e2}, -} - -// 1/2 * R mod p -var P751_HalfFp2 = Fp2Element{ - A: FpElement{ - 0x00000000000124D6, 0x0000000000000000, 0x0000000000000000, - 0x0000000000000000, 0x0000000000000000, 0xB8E0000000000000, - 0x9C8A2434C0AA7287, 0xA206996CA9A378A3, 0x6876280D41A41B52, - 0xE903B49F175CE04F, 0x0F8511860666D227, 0x00004EA07CFF6E7F}, -} diff --git a/external/github.com/cloudflare/sidh/p751/field_ops.go b/external/github.com/cloudflare/sidh/p751/field_ops.go deleted file mode 100644 index c416c74ac6..0000000000 --- a/external/github.com/cloudflare/sidh/p751/field_ops.go +++ /dev/null @@ -1,254 +0,0 @@ -package p751 - -import . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" - -// 2*p751 -var () - -//------------------------------------------------------------------------------ -// Implementtaion of FieldOperations -//------------------------------------------------------------------------------ - -// Implements FieldOps -type fp751Ops struct{} - -func FieldOperations() FieldOps { - return &fp751Ops{} -} - -func (fp751Ops) Add(dest, lhs, rhs *Fp2Element) { - fp751AddReduced(&dest.A, &lhs.A, &rhs.A) - fp751AddReduced(&dest.B, &lhs.B, &rhs.B) -} - -func (fp751Ops) Sub(dest, lhs, rhs *Fp2Element) { - fp751SubReduced(&dest.A, &lhs.A, &rhs.A) - fp751SubReduced(&dest.B, &lhs.B, &rhs.B) -} - -func (fp751Ops) Mul(dest, lhs, rhs *Fp2Element) { - // Let (a,b,c,d) = (lhs.a,lhs.b,rhs.a,rhs.b). - a := &lhs.A - b := &lhs.B - c := &rhs.A - d := &rhs.B - - // We want to compute - // - // (a + bi)*(c + di) = (a*c - b*d) + (a*d + b*c)i - // - // Use Karatsuba's trick: note that - // - // (b - a)*(c - d) = (b*c + a*d) - a*c - b*d - // - // so (a*d + b*c) = (b-a)*(c-d) + a*c + b*d. - - var ac, bd FpElementX2 - fp751Mul(&ac, a, c) // = a*c*R*R - fp751Mul(&bd, b, d) // = b*d*R*R - - var b_minus_a, c_minus_d FpElement - fp751SubReduced(&b_minus_a, b, a) // = (b-a)*R - fp751SubReduced(&c_minus_d, c, d) // = (c-d)*R - - var ad_plus_bc FpElementX2 - fp751Mul(&ad_plus_bc, &b_minus_a, &c_minus_d) // = (b-a)*(c-d)*R*R - fp751X2AddLazy(&ad_plus_bc, &ad_plus_bc, &ac) // = ((b-a)*(c-d) + a*c)*R*R - fp751X2AddLazy(&ad_plus_bc, &ad_plus_bc, &bd) // = ((b-a)*(c-d) + a*c + b*d)*R*R - - fp751MontgomeryReduce(&dest.B, &ad_plus_bc) // = (a*d + b*c)*R mod p - - var ac_minus_bd FpElementX2 - fp751X2SubLazy(&ac_minus_bd, &ac, &bd) // = (a*c - b*d)*R*R - fp751MontgomeryReduce(&dest.A, &ac_minus_bd) // = (a*c - b*d)*R mod p -} - -func (fp751Ops) Square(dest, x *Fp2Element) { - a := &x.A - b := &x.B - - // We want to compute - // - // (a + bi)*(a + bi) = (a^2 - b^2) + 2abi. - - var a2, a_plus_b, a_minus_b FpElement - fp751AddReduced(&a2, a, a) // = a*R + a*R = 2*a*R - fp751AddReduced(&a_plus_b, a, b) // = a*R + b*R = (a+b)*R - fp751SubReduced(&a_minus_b, a, b) // = a*R - b*R = (a-b)*R - - var asq_minus_bsq, ab2 FpElementX2 - fp751Mul(&asq_minus_bsq, &a_plus_b, &a_minus_b) // = (a+b)*(a-b)*R*R = (a^2 - b^2)*R*R - fp751Mul(&ab2, &a2, b) // = 2*a*b*R*R - - fp751MontgomeryReduce(&dest.A, &asq_minus_bsq) // = (a^2 - b^2)*R mod p - fp751MontgomeryReduce(&dest.B, &ab2) // = 2*a*b*R mod p -} - -// Set dest = 1/x -// -// Allowed to overlap dest with x. -// -// Returns dest to allow chaining operations. -func (fp751Ops) Inv(dest, x *Fp2Element) { - a := &x.A - b := &x.B - - // We want to compute - // - // 1 1 (a - bi) (a - bi) - // -------- = -------- -------- = ----------- - // (a + bi) (a + bi) (a - bi) (a^2 + b^2) - // - // Letting c = 1/(a^2 + b^2), this is - // - // 1/(a+bi) = a*c - b*ci. - - var asq_plus_bsq primeFieldElement - var asq, bsq FpElementX2 - fp751Mul(&asq, a, a) // = a*a*R*R - fp751Mul(&bsq, b, b) // = b*b*R*R - fp751X2AddLazy(&asq, &asq, &bsq) // = (a^2 + b^2)*R*R - fp751MontgomeryReduce(&asq_plus_bsq.A, &asq) // = (a^2 + b^2)*R mod p - // Now asq_plus_bsq = a^2 + b^2 - - // Invert asq_plus_bsq - inv := asq_plus_bsq - inv.Mul(&asq_plus_bsq, &asq_plus_bsq) - inv.P34(&inv) - inv.Mul(&inv, &inv) - inv.Mul(&inv, &asq_plus_bsq) - - var ac FpElementX2 - fp751Mul(&ac, a, &inv.A) - fp751MontgomeryReduce(&dest.A, &ac) - - var minus_b FpElement - fp751SubReduced(&minus_b, &minus_b, b) - var minus_bc FpElementX2 - fp751Mul(&minus_bc, &minus_b, &inv.A) - fp751MontgomeryReduce(&dest.B, &minus_bc) -} - -// In case choice == 1, performs following swap in constant time: -// xPx <-> xQx -// xPz <-> xQz -// Otherwise returns xPx, xPz, xQx, xQz unchanged -func (fp751Ops) CondSwap(xPx, xPz, xQx, xQz *Fp2Element, choice uint8) { - fp751ConditionalSwap(&xPx.A, &xQx.A, choice) - fp751ConditionalSwap(&xPx.B, &xQx.B, choice) - fp751ConditionalSwap(&xPz.A, &xQz.A, choice) - fp751ConditionalSwap(&xPz.B, &xQz.B, choice) -} - -// Converts values in x.A and x.B to Montgomery domain -// x.A = x.A * R mod p -// x.B = x.B * R mod p -func (fp751Ops) ToMontgomery(x *Fp2Element) { - var aRR FpElementX2 - - // convert to montgomery domain - fp751Mul(&aRR, &x.A, &p751R2) // = a*R*R - fp751MontgomeryReduce(&x.A, &aRR) // = a*R mod p - fp751Mul(&aRR, &x.B, &p751R2) - fp751MontgomeryReduce(&x.B, &aRR) -} - -// Converts values in x.A and x.B from Montgomery domain -// a = x.A mod p -// b = x.B mod p -// -// After returning from the call x is not modified. -func (fp751Ops) FromMontgomery(x *Fp2Element, out *Fp2Element) { - var aR FpElementX2 - - // convert from montgomery domain - copy(aR[:], x.A[:]) - fp751MontgomeryReduce(&out.A, &aR) // = a mod p in [0, 2p) - fp751StrongReduce(&out.A) // = a mod p in [0, p) - for i := range aR { - aR[i] = 0 - } - copy(aR[:], x.B[:]) - fp751MontgomeryReduce(&out.B, &aR) - fp751StrongReduce(&out.B) -} - -//------------------------------------------------------------------------------ -// Prime Field -//------------------------------------------------------------------------------ - -// Represents an element of the prime field F_p in Montgomery domain -type primeFieldElement struct { - // The value `A`is represented by `aR mod p`. - A FpElement -} - -// Set dest = lhs * rhs. -// -// Allowed to overlap lhs or rhs with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) Mul(lhs, rhs *primeFieldElement) *primeFieldElement { - a := &lhs.A // = a*R - b := &rhs.A // = b*R - - var ab FpElementX2 - fp751Mul(&ab, a, b) // = a*b*R*R - fp751MontgomeryReduce(&dest.A, &ab) // = a*b*R mod p - - return dest -} - -// Set dest = x^(2^k), for k >= 1, by repeated squarings. -// -// Allowed to overlap x with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) Pow2k(x *primeFieldElement, k uint8) *primeFieldElement { - dest.Mul(x, x) - for i := uint8(1); i < k; i++ { - dest.Mul(dest, dest) - } - - return dest -} - -// Set dest = x^((p-3)/4). If x is square, this is 1/sqrt(x). -// -// Allowed to overlap x with dest. -// -// Returns dest to allow chaining operations. -func (dest *primeFieldElement) P34(x *primeFieldElement) *primeFieldElement { - // Sliding-window strategy computed with Sage, awk, sed, and tr. - // - // This performs sum(powStrategy) = 744 squarings and len(mulStrategy) - // = 137 multiplications, in addition to 1 squaring and 15 - // multiplications to build a lookup table. - // - // In total this is 745 squarings, 152 multiplications. Since squaring - // is not implemented for the prime field, this is 897 multiplications - // in total. - powStrategy := [137]uint8{5, 7, 6, 2, 10, 4, 6, 9, 8, 5, 9, 4, 7, 5, 5, 4, 8, 3, 9, 5, 5, 4, 10, 4, 6, 6, 6, 5, 8, 9, 3, 4, 9, 4, 5, 6, 6, 2, 9, 4, 5, 5, 5, 7, 7, 9, 4, 6, 4, 8, 5, 8, 6, 6, 2, 9, 7, 4, 8, 8, 8, 4, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 2} - mulStrategy := [137]uint8{31, 23, 21, 1, 31, 7, 7, 7, 9, 9, 19, 15, 23, 23, 11, 7, 25, 5, 21, 17, 11, 5, 17, 7, 11, 9, 23, 9, 1, 19, 5, 3, 25, 15, 11, 29, 31, 1, 29, 11, 13, 9, 11, 27, 13, 19, 15, 31, 3, 29, 23, 31, 25, 11, 1, 21, 19, 15, 15, 21, 29, 13, 23, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 3} - initialMul := uint8(27) - - // Build a lookup table of odd multiples of x. - lookup := [16]primeFieldElement{} - xx := &primeFieldElement{} - xx.Mul(x, x) // Set xx = x^2 - lookup[0] = *x - for i := 1; i < 16; i++ { - lookup[i].Mul(&lookup[i-1], xx) - } - // Now lookup = {x, x^3, x^5, ... } - // so that lookup[i] = x^{2*i + 1} - // so that lookup[k/2] = x^k, for odd k - - *dest = lookup[initialMul/2] - for i := uint8(0); i < 137; i++ { - dest.Pow2k(dest, powStrategy[i]) - dest.Mul(dest, &lookup[mulStrategy[i]/2]) - } - - return dest -} diff --git a/external/github.com/cloudflare/sidh/sidh/api.go b/external/github.com/cloudflare/sidh/sidh/api.go deleted file mode 100644 index 50dd137124..0000000000 --- a/external/github.com/cloudflare/sidh/sidh/api.go +++ /dev/null @@ -1,226 +0,0 @@ -package sidh - -import ( - "errors" - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" - "io" -) - -// I keep it bool in order to be able to apply logical NOT -type KeyVariant uint - -// Id's correspond to bitlength of the prime field characteristic -// Currently FP_751 is the only one supported by this implementation -const ( - FP_503 uint8 = iota - FP_751 - FP_964 - maxPrimeFieldId -) - -const ( - // First 2 bits identify SIDH variant third bit indicates - // wether key is a SIKE variant (set) or SIDH (not set) - - // 001 - SIDH: corresponds to 2-torsion group - KeyVariant_SIDH_A KeyVariant = 1 << 0 - // 010 - SIDH: corresponds to 3-torsion group - KeyVariant_SIDH_B = 1 << 1 - // 110 - SIKE - KeyVariant_SIKE = 1<<2 | KeyVariant_SIDH_B -) - -// Base type for public and private key. Used mainly to carry domain -// parameters. -type key struct { - // Domain parameters of the algorithm to be used with a key - params *SidhParams - // Flag indicates wether corresponds to 2-, 3-torsion group or SIKE - keyVariant KeyVariant -} - -// Defines operations on public key -type PublicKey struct { - key - affine_xP Fp2Element - affine_xQ Fp2Element - affine_xQmP Fp2Element -} - -// Defines operations on private key -type PrivateKey struct { - key - // Secret key - Scalar []byte - // Used only by KEM - S []byte -} - -// Accessor to the domain parameters -func (key *key) Params() *SidhParams { - return key.params -} - -// Accessor to key variant -func (key *key) Variant() KeyVariant { - return key.keyVariant -} - -// NewPrivateKey initializes private key. -// Usage of this function guarantees that the object is correctly initialized. -func NewPrivateKey(id uint8, v KeyVariant) *PrivateKey { - prv := &PrivateKey{key: key{params: Params(id), keyVariant: v}} - if (v & KeyVariant_SIDH_A) == KeyVariant_SIDH_A { - prv.Scalar = make([]byte, prv.params.A.SecretByteLen) - } else { - prv.Scalar = make([]byte, prv.params.B.SecretByteLen) - } - if v == KeyVariant_SIKE { - prv.S = make([]byte, prv.params.MsgLen) - } - return prv -} - -// NewPublicKey initializes public key. -// Usage of this function guarantees that the object is correctly initialized. -func NewPublicKey(id uint8, v KeyVariant) *PublicKey { - return &PublicKey{key: key{params: Params(id), keyVariant: v}} -} - -// Import clears content of the public key currently stored in the structure -// and imports key stored in the byte string. Returns error in case byte string -// size is wrong. Doesn't perform any validation. -func (pub *PublicKey) Import(input []byte) error { - if len(input) != pub.Size() { - return errors.New("sidh: input to short") - } - op := CurveOperations{Params: pub.params} - ssSz := pub.params.SharedSecretSize - op.Fp2FromBytes(&pub.affine_xP, input[0:ssSz]) - op.Fp2FromBytes(&pub.affine_xQ, input[ssSz:2*ssSz]) - op.Fp2FromBytes(&pub.affine_xQmP, input[2*ssSz:3*ssSz]) - return nil -} - -// Exports currently stored key. In case structure hasn't been filled with key data -// returned byte string is filled with zeros. -func (pub *PublicKey) Export() []byte { - output := make([]byte, pub.params.PublicKeySize) - op := CurveOperations{Params: pub.params} - ssSz := pub.params.SharedSecretSize - op.Fp2ToBytes(output[0:ssSz], &pub.affine_xP) - op.Fp2ToBytes(output[ssSz:2*ssSz], &pub.affine_xQ) - op.Fp2ToBytes(output[2*ssSz:3*ssSz], &pub.affine_xQmP) - return output -} - -// Size returns size of the public key in bytes -func (pub *PublicKey) Size() int { - return pub.params.PublicKeySize -} - -// Exports currently stored key. In case structure hasn't been filled with key data -// returned byte string is filled with zeros. -func (prv *PrivateKey) Export() []byte { - ret := make([]byte, len(prv.Scalar)+len(prv.S)) - copy(ret, prv.S) - copy(ret[len(prv.S):], prv.Scalar) - return ret -} - -// Size returns size of the private key in bytes -func (prv *PrivateKey) Size() int { - tmp := len(prv.Scalar) - if prv.Variant() == KeyVariant_SIKE { - tmp += int(prv.params.MsgLen) - } - return tmp -} - -// Import clears content of the private key currently stored in the structure -// and imports key from octet string. In case of SIKE, the random value 'S' -// must be prepended to the value of actual private key (see SIKE spec for details). -// Function doesn't import public key value to PrivateKey object. -func (prv *PrivateKey) Import(input []byte) error { - if len(input) != prv.Size() { - return errors.New("sidh: input to short") - } - copy(prv.S, input[:len(prv.S)]) - copy(prv.Scalar, input[len(prv.S):]) - return nil -} - -// Generates random private key for SIDH or SIKE. Generated value is -// formed as little-endian integer from key-space <2^(e2-1)..2^e2 - 1> -// for KeyVariant_A or <2^(s-1)..2^s - 1>, where s = floor(log_2(3^e3)), -// for KeyVariant_B. -// -// Returns error in case user provided RNG fails. -func (prv *PrivateKey) Generate(rand io.Reader) error { - var err error - var dp *DomainParams - - if (prv.keyVariant & KeyVariant_SIDH_A) == KeyVariant_SIDH_A { - dp = &prv.params.A - } else { - dp = &prv.params.B - } - - if prv.keyVariant == KeyVariant_SIKE && err == nil { - _, err = io.ReadFull(rand, prv.S) - } - - // Private key generation takes advantage of the fact that keyspace for secret - // key is (0, 2^x - 1), for some possitivite value of 'x' (see SIKE, 1.3.8). - // It means that all bytes in the secret key, but the last one, can take any - // value between <0x00,0xFF>. Similarily for the last byte, but generation - // needs to chop off some bits, to make sure generated value is an element of - // a key-space. - _, err = io.ReadFull(rand, prv.Scalar) - if err != nil { - return err - } - prv.Scalar[len(prv.Scalar)-1] &= (1 << (dp.SecretBitLen % 8)) - 1 - // Make sure scalar is SecretBitLen long. SIKE spec says that key - // space starts from 0, but I'm not confortable with having low - // value scalars used for private keys. It is still secrure as per - // table 5.1 in [SIKE]. - prv.Scalar[len(prv.Scalar)-1] |= 1 << ((dp.SecretBitLen % 8) - 1) - return err -} - -// Generates public key. -// -// Constant time. -func (prv *PrivateKey) GeneratePublicKey() *PublicKey { - if (prv.keyVariant & KeyVariant_SIDH_A) == KeyVariant_SIDH_A { - return publicKeyGenA(prv) - } - return publicKeyGenB(prv) -} - -// Computes a shared secret which is a j-invariant. Function requires that pub has -// different KeyVariant than prv. Length of returned output is 2*ceil(log_2 P)/8), -// where P is a prime defining finite field. -// -// It's important to notice that each keypair must not be used more than once -// to calculate shared secret. -// -// Function may return error. This happens only in case provided input is invalid. -// Constant time for properly initialized private and public key. -func DeriveSecret(prv *PrivateKey, pub *PublicKey) ([]byte, error) { - - if (pub == nil) || (prv == nil) { - return nil, errors.New("sidh: invalid arguments") - } - - if (pub.keyVariant == prv.keyVariant) || (pub.params.Id != prv.params.Id) { - return nil, errors.New("sidh: public and private are incompatbile") - } - - if (prv.keyVariant & KeyVariant_SIDH_A) == KeyVariant_SIDH_A { - return deriveSecretA(prv, pub), nil - } else { - return deriveSecretB(prv, pub), nil - } -} diff --git a/external/github.com/cloudflare/sidh/sidh/params.go b/external/github.com/cloudflare/sidh/sidh/params.go deleted file mode 100644 index d1e2c39120..0000000000 --- a/external/github.com/cloudflare/sidh/sidh/params.go +++ /dev/null @@ -1,82 +0,0 @@ -package sidh - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" - p503 "v2ray.com/core/external/github.com/cloudflare/sidh/p503" - p751 "v2ray.com/core/external/github.com/cloudflare/sidh/p751" -) - -// Keeps mapping: SIDH prime field ID to domain parameters -var sidhParams = make(map[uint8]SidhParams) - -// Params returns domain parameters corresponding to finite field and identified by -// `id` provieded by the caller. Function panics in case `id` wasn't registered earlier. -func Params(id uint8) *SidhParams { - if val, ok := sidhParams[id]; ok { - return &val - } - panic("sidh: SIDH Params ID unregistered") -} - -func init() { - p503 := SidhParams{ - Id: FP_503, - PublicKeySize: p503.P503_PublicKeySize, - SharedSecretSize: p503.P503_SharedSecretSize, - A: DomainParams{ - Affine_P: p503.P503_affine_PA, - Affine_Q: p503.P503_affine_QA, - Affine_R: p503.P503_affine_RA, - SecretBitLen: p503.P503_SecretBitLenA, - SecretByteLen: uint((p503.P503_SecretBitLenA + 7) / 8), - IsogenyStrategy: p503.P503_AliceIsogenyStrategy[:], - }, - B: DomainParams{ - Affine_P: p503.P503_affine_PB, - Affine_Q: p503.P503_affine_QB, - Affine_R: p503.P503_affine_RB, - SecretBitLen: p503.P503_SecretBitLenB, - SecretByteLen: uint((p503.P503_SecretBitLenB + 7) / 8), - IsogenyStrategy: p503.P503_BobIsogenyStrategy[:], - }, - OneFp2: p503.P503_OneFp2, - HalfFp2: p503.P503_HalfFp2, - MsgLen: 24, - // SIKEp751 provides 128 bit of classical security ([SIKE], 5.1) - KemSize: 16, - Bytelen: p503.P503_Bytelen, - Op: p503.FieldOperations(), - } - - p751 := SidhParams{ - Id: FP_751, - PublicKeySize: p751.P751_PublicKeySize, - SharedSecretSize: p751.P751_SharedSecretSize, - A: DomainParams{ - Affine_P: p751.P751_affine_PA, - Affine_Q: p751.P751_affine_QA, - Affine_R: p751.P751_affine_RA, - IsogenyStrategy: p751.P751_AliceIsogenyStrategy[:], - SecretBitLen: p751.P751_SecretBitLenA, - SecretByteLen: uint((p751.P751_SecretBitLenA + 7) / 8), - }, - B: DomainParams{ - Affine_P: p751.P751_affine_PB, - Affine_Q: p751.P751_affine_QB, - Affine_R: p751.P751_affine_RB, - IsogenyStrategy: p751.P751_BobIsogenyStrategy[:], - SecretBitLen: p751.P751_SecretBitLenB, - SecretByteLen: uint((p751.P751_SecretBitLenB + 7) / 8), - }, - OneFp2: p751.P751_OneFp2, - HalfFp2: p751.P751_HalfFp2, - MsgLen: 32, - // SIKEp751 provides 192 bit of classical security ([SIKE], 5.1) - KemSize: 24, - Bytelen: p751.P751_Bytelen, - Op: p751.FieldOperations(), - } - - sidhParams[FP_503] = p503 - sidhParams[FP_751] = p751 -} diff --git a/external/github.com/cloudflare/sidh/sidh/sidh.go b/external/github.com/cloudflare/sidh/sidh/sidh.go deleted file mode 100644 index 17177484c0..0000000000 --- a/external/github.com/cloudflare/sidh/sidh/sidh.go +++ /dev/null @@ -1,302 +0,0 @@ -package sidh - -import ( - . "v2ray.com/core/external/github.com/cloudflare/sidh/internal/isogeny" -) - -// ----------------------------------------------------------------------------- -// Functions for traversing isogeny trees acoording to strategy. Key type 'A' is -// - -// Traverses isogeny tree in order to compute xR, xP, xQ and xQmP needed -// for public key generation. -func traverseTreePublicKeyA(curve *ProjectiveCurveParameters, xR, phiP, phiQ, phiR *ProjectivePoint, pub *PublicKey) { - var points = make([]ProjectivePoint, 0, 8) - var indices = make([]int, 0, 8) - var i, sidx int - var op = CurveOperations{Params: pub.params} - - cparam := op.CalcCurveParamsEquiv4(curve) - phi := Newisogeny4(op.Params.Op) - strat := pub.params.A.IsogenyStrategy - stratSz := len(strat) - - for j := 1; j <= stratSz; j++ { - for i <= stratSz-j { - points = append(points, *xR) - indices = append(indices, i) - - k := strat[sidx] - sidx++ - op.Pow2k(xR, &cparam, 2*k) - i += int(k) - } - - cparam = phi.GenerateCurve(xR) - for k := 0; k < len(points); k++ { - points[k] = phi.EvaluatePoint(&points[k]) - } - - *phiP = phi.EvaluatePoint(phiP) - *phiQ = phi.EvaluatePoint(phiQ) - *phiR = phi.EvaluatePoint(phiR) - - // pop xR from points - *xR, points = points[len(points)-1], points[:len(points)-1] - i, indices = int(indices[len(indices)-1]), indices[:len(indices)-1] - } -} - -// Traverses isogeny tree in order to compute xR needed -// for public key generation. -func traverseTreeSharedKeyA(curve *ProjectiveCurveParameters, xR *ProjectivePoint, pub *PublicKey) { - var points = make([]ProjectivePoint, 0, 8) - var indices = make([]int, 0, 8) - var i, sidx int - var op = CurveOperations{Params: pub.params} - - cparam := op.CalcCurveParamsEquiv4(curve) - phi := Newisogeny4(op.Params.Op) - strat := pub.params.A.IsogenyStrategy - stratSz := len(strat) - - for j := 1; j <= stratSz; j++ { - for i <= stratSz-j { - points = append(points, *xR) - indices = append(indices, i) - - k := strat[sidx] - sidx++ - op.Pow2k(xR, &cparam, 2*k) - i += int(k) - } - - cparam = phi.GenerateCurve(xR) - for k := 0; k < len(points); k++ { - points[k] = phi.EvaluatePoint(&points[k]) - } - - // pop xR from points - *xR, points = points[len(points)-1], points[:len(points)-1] - i, indices = int(indices[len(indices)-1]), indices[:len(indices)-1] - } -} - -// Traverses isogeny tree in order to compute xR, xP, xQ and xQmP needed -// for public key generation. -func traverseTreePublicKeyB(curve *ProjectiveCurveParameters, xR, phiP, phiQ, phiR *ProjectivePoint, pub *PublicKey) { - var points = make([]ProjectivePoint, 0, 8) - var indices = make([]int, 0, 8) - var i, sidx int - var op = CurveOperations{Params: pub.params} - - cparam := op.CalcCurveParamsEquiv3(curve) - phi := Newisogeny3(op.Params.Op) - strat := pub.params.B.IsogenyStrategy - stratSz := len(strat) - - for j := 1; j <= stratSz; j++ { - for i <= stratSz-j { - points = append(points, *xR) - indices = append(indices, i) - - k := strat[sidx] - sidx++ - op.Pow3k(xR, &cparam, k) - i += int(k) - } - - cparam = phi.GenerateCurve(xR) - for k := 0; k < len(points); k++ { - points[k] = phi.EvaluatePoint(&points[k]) - } - - *phiP = phi.EvaluatePoint(phiP) - *phiQ = phi.EvaluatePoint(phiQ) - *phiR = phi.EvaluatePoint(phiR) - - // pop xR from points - *xR, points = points[len(points)-1], points[:len(points)-1] - i, indices = int(indices[len(indices)-1]), indices[:len(indices)-1] - } -} - -// Traverses isogeny tree in order to compute xR, xP, xQ and xQmP needed -// for public key generation. -func traverseTreeSharedKeyB(curve *ProjectiveCurveParameters, xR *ProjectivePoint, pub *PublicKey) { - var points = make([]ProjectivePoint, 0, 8) - var indices = make([]int, 0, 8) - var i, sidx int - var op = CurveOperations{Params: pub.params} - - cparam := op.CalcCurveParamsEquiv3(curve) - phi := Newisogeny3(op.Params.Op) - strat := pub.params.B.IsogenyStrategy - stratSz := len(strat) - - for j := 1; j <= stratSz; j++ { - for i <= stratSz-j { - points = append(points, *xR) - indices = append(indices, i) - - k := strat[sidx] - sidx++ - op.Pow3k(xR, &cparam, k) - i += int(k) - } - - cparam = phi.GenerateCurve(xR) - for k := 0; k < len(points); k++ { - points[k] = phi.EvaluatePoint(&points[k]) - } - - // pop xR from points - *xR, points = points[len(points)-1], points[:len(points)-1] - i, indices = int(indices[len(indices)-1]), indices[:len(indices)-1] - } -} - -// Generate a public key in the 2-torsion group -func publicKeyGenA(prv *PrivateKey) (pub *PublicKey) { - var xPA, xQA, xRA ProjectivePoint - var xPB, xQB, xRB, xR ProjectivePoint - var invZP, invZQ, invZR Fp2Element - var tmp ProjectiveCurveParameters - - pub = NewPublicKey(prv.params.Id, KeyVariant_SIDH_A) - var op = CurveOperations{Params: pub.params} - var phi = Newisogeny4(op.Params.Op) - - // Load points for A - xPA = ProjectivePoint{X: prv.params.A.Affine_P, Z: prv.params.OneFp2} - xQA = ProjectivePoint{X: prv.params.A.Affine_Q, Z: prv.params.OneFp2} - xRA = ProjectivePoint{X: prv.params.A.Affine_R, Z: prv.params.OneFp2} - - // Load points for B - xRB = ProjectivePoint{X: prv.params.B.Affine_R, Z: prv.params.OneFp2} - xQB = ProjectivePoint{X: prv.params.B.Affine_Q, Z: prv.params.OneFp2} - xPB = ProjectivePoint{X: prv.params.B.Affine_P, Z: prv.params.OneFp2} - - // Find isogeny kernel - tmp.C = pub.params.OneFp2 - xR = op.ScalarMul3Pt(&tmp, &xPA, &xQA, &xRA, prv.params.A.SecretBitLen, prv.Scalar) - - // Reset params object and travers isogeny tree - tmp.C = pub.params.OneFp2 - tmp.A.Zeroize() - traverseTreePublicKeyA(&tmp, &xR, &xPB, &xQB, &xRB, pub) - - // Secret isogeny - phi.GenerateCurve(&xR) - xPA = phi.EvaluatePoint(&xPB) - xQA = phi.EvaluatePoint(&xQB) - xRA = phi.EvaluatePoint(&xRB) - op.Fp2Batch3Inv(&xPA.Z, &xQA.Z, &xRA.Z, &invZP, &invZQ, &invZR) - - op.Params.Op.Mul(&pub.affine_xP, &xPA.X, &invZP) - op.Params.Op.Mul(&pub.affine_xQ, &xQA.X, &invZQ) - op.Params.Op.Mul(&pub.affine_xQmP, &xRA.X, &invZR) - return -} - -// Generate a public key in the 3-torsion group -func publicKeyGenB(prv *PrivateKey) (pub *PublicKey) { - var xPB, xQB, xRB, xR ProjectivePoint - var xPA, xQA, xRA ProjectivePoint - var invZP, invZQ, invZR Fp2Element - var tmp ProjectiveCurveParameters - - pub = NewPublicKey(prv.params.Id, prv.keyVariant) - var op = CurveOperations{Params: pub.params} - var phi = Newisogeny3(op.Params.Op) - - // Load points for B - xRB = ProjectivePoint{X: prv.params.B.Affine_R, Z: prv.params.OneFp2} - xQB = ProjectivePoint{X: prv.params.B.Affine_Q, Z: prv.params.OneFp2} - xPB = ProjectivePoint{X: prv.params.B.Affine_P, Z: prv.params.OneFp2} - - // Load points for A - xPA = ProjectivePoint{X: prv.params.A.Affine_P, Z: prv.params.OneFp2} - xQA = ProjectivePoint{X: prv.params.A.Affine_Q, Z: prv.params.OneFp2} - xRA = ProjectivePoint{X: prv.params.A.Affine_R, Z: prv.params.OneFp2} - - tmp.C = pub.params.OneFp2 - xR = op.ScalarMul3Pt(&tmp, &xPB, &xQB, &xRB, prv.params.B.SecretBitLen, prv.Scalar) - - tmp.C = pub.params.OneFp2 - tmp.A.Zeroize() - traverseTreePublicKeyB(&tmp, &xR, &xPA, &xQA, &xRA, pub) - - phi.GenerateCurve(&xR) - xPB = phi.EvaluatePoint(&xPA) - xQB = phi.EvaluatePoint(&xQA) - xRB = phi.EvaluatePoint(&xRA) - op.Fp2Batch3Inv(&xPB.Z, &xQB.Z, &xRB.Z, &invZP, &invZQ, &invZR) - - op.Params.Op.Mul(&pub.affine_xP, &xPB.X, &invZP) - op.Params.Op.Mul(&pub.affine_xQ, &xQB.X, &invZQ) - op.Params.Op.Mul(&pub.affine_xQmP, &xRB.X, &invZR) - return -} - -// ----------------------------------------------------------------------------- -// Key agreement functions -// - -// Establishing shared keys in in 2-torsion group -func deriveSecretA(prv *PrivateKey, pub *PublicKey) []byte { - var sharedSecret = make([]byte, pub.params.SharedSecretSize) - var cparam ProjectiveCurveParameters - var xP, xQ, xQmP ProjectivePoint - var xR ProjectivePoint - var op = CurveOperations{Params: prv.params} - var phi = Newisogeny4(op.Params.Op) - - // Recover curve coefficients - cparam.C = pub.params.OneFp2 - op.RecoverCoordinateA(&cparam, &pub.affine_xP, &pub.affine_xQ, &pub.affine_xQmP) - - // Find kernel of the morphism - xP = ProjectivePoint{X: pub.affine_xP, Z: pub.params.OneFp2} - xQ = ProjectivePoint{X: pub.affine_xQ, Z: pub.params.OneFp2} - xQmP = ProjectivePoint{X: pub.affine_xQmP, Z: pub.params.OneFp2} - xR = op.ScalarMul3Pt(&cparam, &xP, &xQ, &xQmP, pub.params.A.SecretBitLen, prv.Scalar) - - // Traverse isogeny tree - traverseTreeSharedKeyA(&cparam, &xR, pub) - - // Calculate j-invariant on isogeneus curve - c := phi.GenerateCurve(&xR) - op.RecoverCurveCoefficients4(&cparam, &c) - op.Jinvariant(&cparam, sharedSecret) - return sharedSecret -} - -// Establishing shared keys in in 3-torsion group -func deriveSecretB(prv *PrivateKey, pub *PublicKey) []byte { - var sharedSecret = make([]byte, pub.params.SharedSecretSize) - var xP, xQ, xQmP ProjectivePoint - var xR ProjectivePoint - var cparam ProjectiveCurveParameters - var op = CurveOperations{Params: prv.params} - var phi = Newisogeny3(op.Params.Op) - - // Recover curve coefficients - cparam.C = pub.params.OneFp2 - op.RecoverCoordinateA(&cparam, &pub.affine_xP, &pub.affine_xQ, &pub.affine_xQmP) - - // Find kernel of the morphism - xP = ProjectivePoint{X: pub.affine_xP, Z: pub.params.OneFp2} - xQ = ProjectivePoint{X: pub.affine_xQ, Z: pub.params.OneFp2} - xQmP = ProjectivePoint{X: pub.affine_xQmP, Z: pub.params.OneFp2} - xR = op.ScalarMul3Pt(&cparam, &xP, &xQ, &xQmP, pub.params.B.SecretBitLen, prv.Scalar) - - // Traverse isogeny tree - traverseTreeSharedKeyB(&cparam, &xR, pub) - - // Calculate j-invariant on isogeneus curve - c := phi.GenerateCurve(&xR) - op.RecoverCurveCoefficients3(&cparam, &c) - op.Jinvariant(&cparam, sharedSecret) - return sharedSecret -} diff --git a/external/github.com/lucas-clemente/quic-go/Changelog.md b/external/github.com/lucas-clemente/quic-go/Changelog.md deleted file mode 100644 index cbc88e73ef..0000000000 --- a/external/github.com/lucas-clemente/quic-go/Changelog.md +++ /dev/null @@ -1,44 +0,0 @@ -# Changelog - -## v0.10.0 (2018-08-28) - -- Add support for QUIC 44, drop support for QUIC 42. - -## v0.9.0 (2018-08-15) - -- Add a `quic.Config` option for the length of the connection ID (for IETF QUIC). -- Split Session.Close into one method for regular closing and one for closing with an error. - -## v0.8.0 (2018-06-26) - -- Add support for unidirectional streams (for IETF QUIC). -- Add a `quic.Config` option for the maximum number of incoming streams. -- Add support for QUIC 42 and 43. -- Add dial functions that use a context. -- Multiplex clients on a net.PacketConn, when using Dial(conn). - -## v0.7.0 (2018-02-03) - -- The lower boundary for packets included in ACKs is now derived, and the value sent in STOP_WAITING frames is ignored. -- Remove `DialNonFWSecure` and `DialAddrNonFWSecure`. -- Expose the `ConnectionState` in the `Session` (experimental API). -- Implement packet pacing. - -## v0.6.0 (2017-12-12) - -- Add support for QUIC 39, drop support for QUIC 35 - 37 -- Added `quic.Config` options for maximal flow control windows -- Add a `quic.Config` option for QUIC versions -- Add a `quic.Config` option to request omission of the connection ID from a server -- Add a `quic.Config` option to configure the source address validation -- Add a `quic.Config` option to configure the handshake timeout -- Add a `quic.Config` option to configure the idle timeout -- Add a `quic.Config` option to configure keep-alive -- Rename the STK to Cookie -- Implement `net.Conn`-style deadlines for streams -- Remove the `tls.Config` from the `quic.Config`. The `tls.Config` must now be passed to the `Dial` and `Listen` functions as a separate parameter. See the [Godoc](https://godoc.org/github.com/lucas-clemente/quic-go) for details. -- Changed the log level environment variable to only accept strings ("DEBUG", "INFO", "ERROR"), see [the wiki](https://github.com/lucas-clemente/quic-go/wiki/Logging) for more details. -- Rename the `h2quic.QuicRoundTripper` to `h2quic.RoundTripper` -- Changed `h2quic.Server.Serve()` to accept a `net.PacketConn` -- Drop support for Go 1.7 and 1.8. -- Various bugfixes diff --git a/external/github.com/lucas-clemente/quic-go/LICENSE b/external/github.com/lucas-clemente/quic-go/LICENSE deleted file mode 100644 index 51378befb8..0000000000 --- a/external/github.com/lucas-clemente/quic-go/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 the quic-go authors & Google, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/external/github.com/lucas-clemente/quic-go/README.md b/external/github.com/lucas-clemente/quic-go/README.md deleted file mode 100644 index ae1fa9cd22..0000000000 --- a/external/github.com/lucas-clemente/quic-go/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# A QUIC implementation in pure Go - - - -[![Godoc Reference](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/lucas-clemente/quic-go) -[![Travis Build Status](https://img.shields.io/travis/lucas-clemente/quic-go/master.svg?style=flat-square&label=Travis+build)](https://travis-ci.org/lucas-clemente/quic-go) -[![CircleCI Build Status](https://img.shields.io/circleci/project/github/lucas-clemente/quic-go.svg?style=flat-square&label=CircleCI+build)](https://circleci.com/gh/lucas-clemente/quic-go) -[![Windows Build Status](https://img.shields.io/appveyor/ci/lucas-clemente/quic-go/master.svg?style=flat-square&label=windows+build)](https://ci.appveyor.com/project/lucas-clemente/quic-go/branch/master) -[![Code Coverage](https://img.shields.io/codecov/c/github/lucas-clemente/quic-go/master.svg?style=flat-square)](https://codecov.io/gh/lucas-clemente/quic-go/) - -quic-go is an implementation of the [QUIC](https://en.wikipedia.org/wiki/QUIC) protocol in Go. It roughly implements the [IETF QUIC draft](https://github.com/quicwg/base-drafts), although we don't fully support any of the draft versions at the moment. - -## Version compatibility - -Since quic-go is under active development, there's no guarantee that two builds of different commits are interoperable. The QUIC version used in the *master* branch is just a placeholder, and should not be considered stable. - -If you want to use quic-go as a library in other projects, please consider using a [tagged release](https://github.com/lucas-clemente/quic-go/releases). These releases expose [experimental QUIC versions](https://github.com/quicwg/base-drafts/wiki/QUIC-Versions), which are guaranteed to be stable. - -## Google QUIC - -quic-go used to support both the QUIC versions supported by Google Chrome and QUIC as deployed on Google's servers, as well as IETF QUIC. Due to the divergence of the two protocols, we decided to not support both versions any more. - -The *master* branch **only** supports IETF QUIC. For Google QUIC support, please refer to the [gquic branch](https://github.com/lucas-clemente/quic-go/tree/gquic). - -## Guides - -We currently support Go 1.9+. - -Installing and updating dependencies: - - go get -t -u ./... - -Running tests: - - go test ./... - -### HTTP mapping - -We're currently not implementing the HTTP mapping as described in the [QUIC over HTTP draft](https://quicwg.org/base-drafts/draft-ietf-quic-http.html). The HTTP mapping here is a leftover from Google QUIC. - -### QUIC without HTTP/2 - -Take a look at [this echo example](example/echo/echo.go). - -## Usage - -### As a server - -See the [example server](example/main.go). Starting a QUIC server is very similar to the standard lib http in go: - -```go -http.Handle("/", http.FileServer(http.Dir(wwwDir))) -h2quic.ListenAndServeQUIC("localhost:4242", "/path/to/cert/chain.pem", "/path/to/privkey.pem", nil) -``` - -### As a client - -See the [example client](example/client/main.go). Use a `h2quic.RoundTripper` as a `Transport` in a `http.Client`. - -```go -http.Client{ - Transport: &h2quic.RoundTripper{}, -} -``` - -## Contributing - -We are always happy to welcome new contributors! We have a number of self-contained issues that are suitable for first-time contributors, they are tagged with [help wanted](https://github.com/lucas-clemente/quic-go/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). If you have any questions, please feel free to reach out by opening an issue or leaving a comment. diff --git a/external/github.com/lucas-clemente/quic-go/buffer_pool.go b/external/github.com/lucas-clemente/quic-go/buffer_pool.go deleted file mode 100644 index 2966dbd70d..0000000000 --- a/external/github.com/lucas-clemente/quic-go/buffer_pool.go +++ /dev/null @@ -1,56 +0,0 @@ -package quic - -import ( - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/common/bytespool" -) - -type packetBuffer struct { - Slice []byte - - // refCount counts how many packets the Slice is used in. - // It doesn't support concurrent use. - // It is > 1 when used for coalesced packet. - refCount int -} - -// Split increases the refCount. -// It must be called when a packet buffer is used for more than one packet, -// e.g. when splitting coalesced packets. -func (b *packetBuffer) Split() { - b.refCount++ -} - -// Release decreases the refCount. -// It should be called when processing the packet is finished. -// When the refCount reaches 0, the packet buffer is put back into the pool. -func (b *packetBuffer) Release() { - if cap(b.Slice) < 2048 { - return - } - b.refCount-- - if b.refCount < 0 { - panic("negative packetBuffer refCount") - } - // only put the packetBuffer back if it's not used any more - if b.refCount == 0 { - buffer := b.Slice[0:cap(b.Slice)] - bufferPool.Put(buffer) - } -} - -var bufferPool *sync.Pool - -func getPacketBuffer() *packetBuffer { - buffer := bufferPool.Get().([]byte) - return &packetBuffer{ - refCount: 1, - Slice: buffer[:protocol.MaxReceivePacketSize], - } -} - -func init() { - bufferPool = bytespool.GetPool(int32(protocol.MaxReceivePacketSize)) -} diff --git a/external/github.com/lucas-clemente/quic-go/client.go b/external/github.com/lucas-clemente/quic-go/client.go deleted file mode 100644 index 18391fd4fc..0000000000 --- a/external/github.com/lucas-clemente/quic-go/client.go +++ /dev/null @@ -1,443 +0,0 @@ -package quic - -import ( - "context" - "crypto/tls" - "fmt" - "net" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type client struct { - mutex sync.Mutex - - conn connection - // If the client is created with DialAddr, we create a packet conn. - // If it is started with Dial, we take a packet conn as a parameter. - createdPacketConn bool - - packetHandlers packetHandlerManager - - token []byte - - versionNegotiated utils.AtomicBool // has the server accepted our version - receivedVersionNegotiationPacket bool - negotiatedVersions []protocol.VersionNumber // the list of versions from the version negotiation packet - - tlsConf *tls.Config - config *Config - - srcConnID protocol.ConnectionID - destConnID protocol.ConnectionID - origDestConnID protocol.ConnectionID // the destination conn ID used on the first Initial (before a Retry) - - initialPacketNumber protocol.PacketNumber - - initialVersion protocol.VersionNumber - version protocol.VersionNumber - - handshakeChan chan struct{} - - session quicSession - - logger utils.Logger -} - -var _ packetHandler = &client{} - -var ( - // make it possible to mock connection ID generation in the tests - generateConnectionID = protocol.GenerateConnectionID - generateConnectionIDForInitial = protocol.GenerateConnectionIDForInitial -) - -// DialAddr establishes a new QUIC connection to a server. -// It uses a new UDP connection and closes this connection when the QUIC session is closed. -// The hostname for SNI is taken from the given address. -func DialAddr( - addr string, - tlsConf *tls.Config, - config *Config, -) (Session, error) { - return DialAddrContext(context.Background(), addr, tlsConf, config) -} - -// DialAddrContext establishes a new QUIC connection to a server using the provided context. -// See DialAddr for details. -func DialAddrContext( - ctx context.Context, - addr string, - tlsConf *tls.Config, - config *Config, -) (Session, error) { - udpAddr, err := net.ResolveUDPAddr("udp", addr) - if err != nil { - return nil, err - } - udpConn, err := net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4zero, Port: 0}) - if err != nil { - return nil, err - } - return dialContext(ctx, udpConn, udpAddr, addr, tlsConf, config, true) -} - -// Dial establishes a new QUIC connection to a server using a net.PacketConn. -// The same PacketConn can be used for multiple calls to Dial and Listen, -// QUIC connection IDs are used for demultiplexing the different connections. -// The host parameter is used for SNI. -func Dial( - pconn net.PacketConn, - remoteAddr net.Addr, - host string, - tlsConf *tls.Config, - config *Config, -) (Session, error) { - return DialContext(context.Background(), pconn, remoteAddr, host, tlsConf, config) -} - -// DialContext establishes a new QUIC connection to a server using a net.PacketConn using the provided context. -// See Dial for details. -func DialContext( - ctx context.Context, - pconn net.PacketConn, - remoteAddr net.Addr, - host string, - tlsConf *tls.Config, - config *Config, -) (Session, error) { - return dialContext(ctx, pconn, remoteAddr, host, tlsConf, config, false) -} - -func dialContext( - ctx context.Context, - pconn net.PacketConn, - remoteAddr net.Addr, - host string, - tlsConf *tls.Config, - config *Config, - createdPacketConn bool, -) (Session, error) { - config = populateClientConfig(config, createdPacketConn) - packetHandlers, err := getMultiplexer().AddConn(pconn, config.ConnectionIDLength) - if err != nil { - return nil, err - } - c, err := newClient(pconn, remoteAddr, config, tlsConf, host, createdPacketConn) - if err != nil { - return nil, err - } - c.packetHandlers = packetHandlers - if err := c.dial(ctx); err != nil { - return nil, err - } - return c.session, nil -} - -func newClient( - pconn net.PacketConn, - remoteAddr net.Addr, - config *Config, - tlsConf *tls.Config, - host string, - createdPacketConn bool, -) (*client, error) { - if tlsConf == nil { - tlsConf = &tls.Config{} - } - if tlsConf.ServerName == "" { - var err error - tlsConf.ServerName, _, err = net.SplitHostPort(host) - if err != nil { - return nil, err - } - } - - // check that all versions are actually supported - if config != nil { - for _, v := range config.Versions { - if !protocol.IsValidVersion(v) { - return nil, fmt.Errorf("%s is not a valid QUIC version", v) - } - } - } - - srcConnID, err := generateConnectionID(config.ConnectionIDLength) - if err != nil { - return nil, err - } - destConnID, err := generateConnectionIDForInitial() - if err != nil { - return nil, err - } - c := &client{ - srcConnID: srcConnID, - destConnID: destConnID, - conn: &conn{pconn: pconn, currentAddr: remoteAddr}, - createdPacketConn: createdPacketConn, - tlsConf: tlsConf, - config: config, - version: config.Versions[0], - handshakeChan: make(chan struct{}), - logger: utils.DefaultLogger.WithPrefix("client"), - } - return c, nil -} - -// populateClientConfig populates fields in the quic.Config with their default values, if none are set -// it may be called with nil -func populateClientConfig(config *Config, createdPacketConn bool) *Config { - if config == nil { - config = &Config{} - } - versions := config.Versions - if len(versions) == 0 { - versions = protocol.SupportedVersions - } - - handshakeTimeout := protocol.DefaultHandshakeTimeout - if config.HandshakeTimeout != 0 { - handshakeTimeout = config.HandshakeTimeout - } - idleTimeout := protocol.DefaultIdleTimeout - if config.IdleTimeout != 0 { - idleTimeout = config.IdleTimeout - } - - maxReceiveStreamFlowControlWindow := config.MaxReceiveStreamFlowControlWindow - if maxReceiveStreamFlowControlWindow == 0 { - maxReceiveStreamFlowControlWindow = protocol.DefaultMaxReceiveStreamFlowControlWindow - } - maxReceiveConnectionFlowControlWindow := config.MaxReceiveConnectionFlowControlWindow - if maxReceiveConnectionFlowControlWindow == 0 { - maxReceiveConnectionFlowControlWindow = protocol.DefaultMaxReceiveConnectionFlowControlWindow - } - maxIncomingStreams := config.MaxIncomingStreams - if maxIncomingStreams == 0 { - maxIncomingStreams = protocol.DefaultMaxIncomingStreams - } else if maxIncomingStreams < 0 { - maxIncomingStreams = 0 - } - maxIncomingUniStreams := config.MaxIncomingUniStreams - if maxIncomingUniStreams == 0 { - maxIncomingUniStreams = protocol.DefaultMaxIncomingUniStreams - } else if maxIncomingUniStreams < 0 { - maxIncomingUniStreams = 0 - } - connIDLen := config.ConnectionIDLength - if connIDLen == 0 && !createdPacketConn { - connIDLen = protocol.DefaultConnectionIDLength - } - - return &Config{ - Versions: versions, - HandshakeTimeout: handshakeTimeout, - IdleTimeout: idleTimeout, - ConnectionIDLength: connIDLen, - MaxReceiveStreamFlowControlWindow: maxReceiveStreamFlowControlWindow, - MaxReceiveConnectionFlowControlWindow: maxReceiveConnectionFlowControlWindow, - MaxIncomingStreams: maxIncomingStreams, - MaxIncomingUniStreams: maxIncomingUniStreams, - KeepAlive: config.KeepAlive, - } -} - -func (c *client) dial(ctx context.Context) error { - c.logger.Infof("Starting new connection to %s (%s -> %s), source connection ID %s, destination connection ID %s, version %s", c.tlsConf.ServerName, c.conn.LocalAddr(), c.conn.RemoteAddr(), c.srcConnID, c.destConnID, c.version) - - if err := c.createNewTLSSession(c.version); err != nil { - return err - } - err := c.establishSecureConnection(ctx) - if err == errCloseForRecreating { - return c.dial(ctx) - } - return err -} - -// establishSecureConnection runs the session, and tries to establish a secure connection -// It returns: -// - errCloseSessionRecreating when the server sends a version negotiation packet, or a stateless retry is performed -// - any other error that might occur -// - when the connection is forward-secure -func (c *client) establishSecureConnection(ctx context.Context) error { - errorChan := make(chan error, 1) - - go func() { - err := c.session.run() // returns as soon as the session is closed - if err != errCloseForRecreating && c.createdPacketConn { - c.conn.Close() - } - errorChan <- err - }() - - select { - case <-ctx.Done(): - // The session will send a PeerGoingAway error to the server. - c.session.Close() - return ctx.Err() - case err := <-errorChan: - return err - case <-c.handshakeChan: - // handshake successfully completed - return nil - } -} - -func (c *client) handlePacket(p *receivedPacket) { - if p.hdr.IsVersionNegotiation() { - go c.handleVersionNegotiationPacket(p.hdr) - return - } - - if p.hdr.Type == protocol.PacketTypeRetry { - go c.handleRetryPacket(p.hdr) - return - } - - // this is the first packet we are receiving - // since it is not a Version Negotiation Packet, this means the server supports the suggested version - if !c.versionNegotiated.Get() { - c.versionNegotiated.Set(true) - } - - c.session.handlePacket(p) -} - -func (c *client) handleVersionNegotiationPacket(hdr *wire.Header) { - c.mutex.Lock() - defer c.mutex.Unlock() - - // ignore delayed / duplicated version negotiation packets - if c.receivedVersionNegotiationPacket || c.versionNegotiated.Get() { - c.logger.Debugf("Received a delayed Version Negotiation packet.") - return - } - - for _, v := range hdr.SupportedVersions { - if v == c.version { - // The Version Negotiation packet contains the version that we offered. - // This might be a packet sent by an attacker (or by a terribly broken server implementation). - return - } - } - - c.logger.Infof("Received a Version Negotiation packet. Supported Versions: %s", hdr.SupportedVersions) - newVersion, ok := protocol.ChooseSupportedVersion(c.config.Versions, hdr.SupportedVersions) - if !ok { - c.session.destroy(qerr.InvalidVersion) - c.logger.Debugf("No compatible version found.") - return - } - c.receivedVersionNegotiationPacket = true - c.negotiatedVersions = hdr.SupportedVersions - - // switch to negotiated version - c.initialVersion = c.version - c.version = newVersion - - c.logger.Infof("Switching to QUIC version %s. New connection ID: %s", newVersion, c.destConnID) - c.initialPacketNumber = c.session.closeForRecreating() -} - -func (c *client) handleRetryPacket(hdr *wire.Header) { - c.mutex.Lock() - defer c.mutex.Unlock() - - c.logger.Debugf("<- Received Retry") - (&wire.ExtendedHeader{Header: *hdr}).Log(c.logger) - if !hdr.OrigDestConnectionID.Equal(c.destConnID) { - c.logger.Debugf("Ignoring spoofed Retry. Original Destination Connection ID: %s, expected: %s", hdr.OrigDestConnectionID, c.destConnID) - return - } - if hdr.SrcConnectionID.Equal(c.destConnID) { - c.logger.Debugf("Ignoring Retry, since the server didn't change the Source Connection ID.") - return - } - // If a token is already set, this means that we already received a Retry from the server. - // Ignore this Retry packet. - if len(c.token) > 0 { - c.logger.Debugf("Ignoring Retry, since a Retry was already received.") - return - } - c.origDestConnID = c.destConnID - c.destConnID = hdr.SrcConnectionID - c.token = hdr.Token - c.initialPacketNumber = c.session.closeForRecreating() -} - -func (c *client) createNewTLSSession(version protocol.VersionNumber) error { - params := &handshake.TransportParameters{ - InitialMaxStreamDataBidiRemote: protocol.InitialMaxStreamData, - InitialMaxStreamDataBidiLocal: protocol.InitialMaxStreamData, - InitialMaxStreamDataUni: protocol.InitialMaxStreamData, - InitialMaxData: protocol.InitialMaxData, - IdleTimeout: c.config.IdleTimeout, - MaxBidiStreams: uint64(c.config.MaxIncomingStreams), - MaxUniStreams: uint64(c.config.MaxIncomingUniStreams), - DisableMigration: true, - } - - c.mutex.Lock() - defer c.mutex.Unlock() - runner := &runner{ - onHandshakeCompleteImpl: func(_ Session) { close(c.handshakeChan) }, - retireConnectionIDImpl: c.packetHandlers.Retire, - removeConnectionIDImpl: c.packetHandlers.Remove, - } - sess, err := newClientSession( - c.conn, - runner, - c.token, - c.origDestConnID, - c.destConnID, - c.srcConnID, - c.config, - c.tlsConf, - c.initialPacketNumber, - params, - c.initialVersion, - c.logger, - c.version, - ) - if err != nil { - return err - } - c.session = sess - c.packetHandlers.Add(c.srcConnID, c) - return nil -} - -func (c *client) Close() error { - c.mutex.Lock() - defer c.mutex.Unlock() - if c.session == nil { - return nil - } - return c.session.Close() -} - -func (c *client) destroy(e error) { - c.mutex.Lock() - defer c.mutex.Unlock() - if c.session == nil { - return - } - c.session.destroy(e) -} - -func (c *client) GetVersion() protocol.VersionNumber { - c.mutex.Lock() - v := c.version - c.mutex.Unlock() - return v -} - -func (c *client) GetPerspective() protocol.Perspective { - return protocol.PerspectiveClient -} diff --git a/external/github.com/lucas-clemente/quic-go/conn.go b/external/github.com/lucas-clemente/quic-go/conn.go deleted file mode 100644 index 700c1471c6..0000000000 --- a/external/github.com/lucas-clemente/quic-go/conn.go +++ /dev/null @@ -1,54 +0,0 @@ -package quic - -import ( - "net" - "sync" -) - -type connection interface { - Write([]byte) error - Read([]byte) (int, net.Addr, error) - Close() error - LocalAddr() net.Addr - RemoteAddr() net.Addr - SetCurrentRemoteAddr(net.Addr) -} - -type conn struct { - mutex sync.RWMutex - - pconn net.PacketConn - currentAddr net.Addr -} - -var _ connection = &conn{} - -func (c *conn) Write(p []byte) error { - _, err := c.pconn.WriteTo(p, c.currentAddr) - return err -} - -func (c *conn) Read(p []byte) (int, net.Addr, error) { - return c.pconn.ReadFrom(p) -} - -func (c *conn) SetCurrentRemoteAddr(addr net.Addr) { - c.mutex.Lock() - c.currentAddr = addr - c.mutex.Unlock() -} - -func (c *conn) LocalAddr() net.Addr { - return c.pconn.LocalAddr() -} - -func (c *conn) RemoteAddr() net.Addr { - c.mutex.RLock() - addr := c.currentAddr - c.mutex.RUnlock() - return addr -} - -func (c *conn) Close() error { - return c.pconn.Close() -} diff --git a/external/github.com/lucas-clemente/quic-go/crypto_stream.go b/external/github.com/lucas-clemente/quic-go/crypto_stream.go deleted file mode 100644 index 806347f7d9..0000000000 --- a/external/github.com/lucas-clemente/quic-go/crypto_stream.go +++ /dev/null @@ -1,108 +0,0 @@ -package quic - -import ( - "errors" - "fmt" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type cryptoStream interface { - // for receiving data - HandleCryptoFrame(*wire.CryptoFrame) error - GetCryptoData() []byte - Finish() error - // for sending data - io.Writer - HasData() bool - PopCryptoFrame(protocol.ByteCount) *wire.CryptoFrame -} - -type cryptoStreamImpl struct { - queue *frameSorter - msgBuf []byte - - highestOffset protocol.ByteCount - finished bool - - writeOffset protocol.ByteCount - writeBuf []byte -} - -func newCryptoStream() cryptoStream { - return &cryptoStreamImpl{ - queue: newFrameSorter(), - } -} - -func (s *cryptoStreamImpl) HandleCryptoFrame(f *wire.CryptoFrame) error { - highestOffset := f.Offset + protocol.ByteCount(len(f.Data)) - if maxOffset := highestOffset; maxOffset > protocol.MaxCryptoStreamOffset { - return fmt.Errorf("received invalid offset %d on crypto stream, maximum allowed %d", maxOffset, protocol.MaxCryptoStreamOffset) - } - if s.finished { - if highestOffset > s.highestOffset { - // reject crypto data received after this stream was already finished - return errors.New("received crypto data after change of encryption level") - } - // ignore data with a smaller offset than the highest received - // could e.g. be a retransmission - return nil - } - s.highestOffset = utils.MaxByteCount(s.highestOffset, highestOffset) - if err := s.queue.Push(f.Data, f.Offset, false); err != nil { - return err - } - for { - data, _ := s.queue.Pop() - if data == nil { - return nil - } - s.msgBuf = append(s.msgBuf, data...) - } -} - -// GetCryptoData retrieves data that was received in CRYPTO frames -func (s *cryptoStreamImpl) GetCryptoData() []byte { - if len(s.msgBuf) < 4 { - return nil - } - msgLen := 4 + int(s.msgBuf[1])<<16 + int(s.msgBuf[2])<<8 + int(s.msgBuf[3]) - if len(s.msgBuf) < msgLen { - return nil - } - msg := make([]byte, msgLen) - copy(msg, s.msgBuf[:msgLen]) - s.msgBuf = s.msgBuf[msgLen:] - return msg -} - -func (s *cryptoStreamImpl) Finish() error { - if s.queue.HasMoreData() { - return errors.New("encryption level changed, but crypto stream has more data to read") - } - s.finished = true - return nil -} - -// Writes writes data that should be sent out in CRYPTO frames -func (s *cryptoStreamImpl) Write(p []byte) (int, error) { - s.writeBuf = append(s.writeBuf, p...) - return len(p), nil -} - -func (s *cryptoStreamImpl) HasData() bool { - return len(s.writeBuf) > 0 -} - -func (s *cryptoStreamImpl) PopCryptoFrame(maxLen protocol.ByteCount) *wire.CryptoFrame { - f := &wire.CryptoFrame{Offset: s.writeOffset} - n := utils.MinByteCount(f.MaxDataLen(maxLen), protocol.ByteCount(len(s.writeBuf))) - f.Data = s.writeBuf[:n] - s.writeBuf = s.writeBuf[n:] - s.writeOffset += n - return f -} diff --git a/external/github.com/lucas-clemente/quic-go/crypto_stream_manager.go b/external/github.com/lucas-clemente/quic-go/crypto_stream_manager.go deleted file mode 100644 index 526c98aa44..0000000000 --- a/external/github.com/lucas-clemente/quic-go/crypto_stream_manager.go +++ /dev/null @@ -1,55 +0,0 @@ -package quic - -import ( - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type cryptoDataHandler interface { - HandleMessage([]byte, protocol.EncryptionLevel) bool -} - -type cryptoStreamManager struct { - cryptoHandler cryptoDataHandler - - initialStream cryptoStream - handshakeStream cryptoStream -} - -func newCryptoStreamManager( - cryptoHandler cryptoDataHandler, - initialStream cryptoStream, - handshakeStream cryptoStream, -) *cryptoStreamManager { - return &cryptoStreamManager{ - cryptoHandler: cryptoHandler, - initialStream: initialStream, - handshakeStream: handshakeStream, - } -} - -func (m *cryptoStreamManager) HandleCryptoFrame(frame *wire.CryptoFrame, encLevel protocol.EncryptionLevel) (bool /* encryption level changed */, error) { - var str cryptoStream - switch encLevel { - case protocol.EncryptionInitial: - str = m.initialStream - case protocol.EncryptionHandshake: - str = m.handshakeStream - default: - return false, fmt.Errorf("received CRYPTO frame with unexpected encryption level: %s", encLevel) - } - if err := str.HandleCryptoFrame(frame); err != nil { - return false, err - } - for { - data := str.GetCryptoData() - if data == nil { - return false, nil - } - if encLevelFinished := m.cryptoHandler.HandleMessage(data, encLevel); encLevelFinished { - return true, str.Finish() - } - } -} diff --git a/external/github.com/lucas-clemente/quic-go/frame_sorter.go b/external/github.com/lucas-clemente/quic-go/frame_sorter.go deleted file mode 100644 index 087265e2e1..0000000000 --- a/external/github.com/lucas-clemente/quic-go/frame_sorter.go +++ /dev/null @@ -1,163 +0,0 @@ -package quic - -import ( - "errors" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type frameSorter struct { - queue map[protocol.ByteCount][]byte - readPos protocol.ByteCount - finalOffset protocol.ByteCount - gaps *utils.ByteIntervalList -} - -var errDuplicateStreamData = errors.New("Duplicate Stream Data") - -func newFrameSorter() *frameSorter { - s := frameSorter{ - gaps: utils.NewByteIntervalList(), - queue: make(map[protocol.ByteCount][]byte), - finalOffset: protocol.MaxByteCount, - } - s.gaps.PushFront(utils.ByteInterval{Start: 0, End: protocol.MaxByteCount}) - return &s -} - -func (s *frameSorter) Push(data []byte, offset protocol.ByteCount, fin bool) error { - err := s.push(data, offset, fin) - if err == errDuplicateStreamData { - return nil - } - return err -} - -func (s *frameSorter) push(data []byte, offset protocol.ByteCount, fin bool) error { - if fin { - s.finalOffset = offset + protocol.ByteCount(len(data)) - } - if len(data) == 0 { - return nil - } - - var wasCut bool - if oldData, ok := s.queue[offset]; ok { - if len(data) <= len(oldData) { - return errDuplicateStreamData - } - data = data[len(oldData):] - offset += protocol.ByteCount(len(oldData)) - wasCut = true - } - - start := offset - end := offset + protocol.ByteCount(len(data)) - - // skip all gaps that are before this stream frame - var gap *utils.ByteIntervalElement - for gap = s.gaps.Front(); gap != nil; gap = gap.Next() { - // the frame is a duplicate. Ignore it - if end <= gap.Value.Start { - return errDuplicateStreamData - } - if end > gap.Value.Start && start <= gap.Value.End { - break - } - } - - if gap == nil { - return errors.New("StreamFrameSorter BUG: no gap found") - } - - if start < gap.Value.Start { - add := gap.Value.Start - start - offset += add - start += add - data = data[add:] - wasCut = true - } - - // find the highest gaps whose Start lies before the end of the frame - endGap := gap - for end >= endGap.Value.End { - nextEndGap := endGap.Next() - if nextEndGap == nil { - return errors.New("StreamFrameSorter BUG: no end gap found") - } - if endGap != gap { - s.gaps.Remove(endGap) - } - if end <= nextEndGap.Value.Start { - break - } - // delete queued frames completely covered by the current frame - delete(s.queue, endGap.Value.End) - endGap = nextEndGap - } - - if end > endGap.Value.End { - cutLen := end - endGap.Value.End - len := protocol.ByteCount(len(data)) - cutLen - end -= cutLen - data = data[:len] - wasCut = true - } - - if start == gap.Value.Start { - if end >= gap.Value.End { - // the frame completely fills this gap - // delete the gap - s.gaps.Remove(gap) - } - if end < endGap.Value.End { - // the frame covers the beginning of the gap - // adjust the Start value to shrink the gap - endGap.Value.Start = end - } - } else if end == endGap.Value.End { - // the frame covers the end of the gap - // adjust the End value to shrink the gap - gap.Value.End = start - } else { - if gap == endGap { - // the frame lies within the current gap, splitting it into two - // insert a new gap and adjust the current one - intv := utils.ByteInterval{Start: end, End: gap.Value.End} - s.gaps.InsertAfter(intv, gap) - gap.Value.End = start - } else { - gap.Value.End = start - endGap.Value.Start = end - } - } - - if s.gaps.Len() > protocol.MaxStreamFrameSorterGaps { - return errors.New("Too many gaps in received data") - } - - if wasCut { - newData := make([]byte, len(data)) - copy(newData, data) - data = newData - } - - s.queue[offset] = data - return nil -} - -func (s *frameSorter) Pop() ([]byte /* data */, bool /* fin */) { - data, ok := s.queue[s.readPos] - if !ok { - return nil, s.readPos >= s.finalOffset - } - delete(s.queue, s.readPos) - s.readPos += protocol.ByteCount(len(data)) - return data, s.readPos >= s.finalOffset -} - -// HasMoreData says if there is any more data queued at *any* offset. -func (s *frameSorter) HasMoreData() bool { - return len(s.queue) > 0 -} diff --git a/external/github.com/lucas-clemente/quic-go/framer.go b/external/github.com/lucas-clemente/quic-go/framer.go deleted file mode 100644 index 88b14ad91e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/framer.go +++ /dev/null @@ -1,109 +0,0 @@ -package quic - -import ( - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type framer interface { - QueueControlFrame(wire.Frame) - AppendControlFrames([]wire.Frame, protocol.ByteCount) ([]wire.Frame, protocol.ByteCount) - - AddActiveStream(protocol.StreamID) - AppendStreamFrames([]wire.Frame, protocol.ByteCount) []wire.Frame -} - -type framerI struct { - mutex sync.Mutex - - streamGetter streamGetter - version protocol.VersionNumber - - activeStreams map[protocol.StreamID]struct{} - streamQueue []protocol.StreamID - - controlFrameMutex sync.Mutex - controlFrames []wire.Frame -} - -var _ framer = &framerI{} - -func newFramer( - streamGetter streamGetter, - v protocol.VersionNumber, -) framer { - return &framerI{ - streamGetter: streamGetter, - activeStreams: make(map[protocol.StreamID]struct{}), - version: v, - } -} - -func (f *framerI) QueueControlFrame(frame wire.Frame) { - f.controlFrameMutex.Lock() - f.controlFrames = append(f.controlFrames, frame) - f.controlFrameMutex.Unlock() -} - -func (f *framerI) AppendControlFrames(frames []wire.Frame, maxLen protocol.ByteCount) ([]wire.Frame, protocol.ByteCount) { - var length protocol.ByteCount - f.controlFrameMutex.Lock() - for len(f.controlFrames) > 0 { - frame := f.controlFrames[len(f.controlFrames)-1] - frameLen := frame.Length(f.version) - if length+frameLen > maxLen { - break - } - frames = append(frames, frame) - length += frameLen - f.controlFrames = f.controlFrames[:len(f.controlFrames)-1] - } - f.controlFrameMutex.Unlock() - return frames, length -} - -func (f *framerI) AddActiveStream(id protocol.StreamID) { - f.mutex.Lock() - if _, ok := f.activeStreams[id]; !ok { - f.streamQueue = append(f.streamQueue, id) - f.activeStreams[id] = struct{}{} - } - f.mutex.Unlock() -} - -func (f *framerI) AppendStreamFrames(frames []wire.Frame, maxLen protocol.ByteCount) []wire.Frame { - var length protocol.ByteCount - f.mutex.Lock() - // pop STREAM frames, until less than MinStreamFrameSize bytes are left in the packet - numActiveStreams := len(f.streamQueue) - for i := 0; i < numActiveStreams; i++ { - if maxLen-length < protocol.MinStreamFrameSize { - break - } - id := f.streamQueue[0] - f.streamQueue = f.streamQueue[1:] - // This should never return an error. Better check it anyway. - // The stream will only be in the streamQueue, if it enqueued itself there. - str, err := f.streamGetter.GetOrOpenSendStream(id) - // The stream can be nil if it completed after it said it had data. - if str == nil || err != nil { - delete(f.activeStreams, id) - continue - } - frame, hasMoreData := str.popStreamFrame(maxLen - length) - if hasMoreData { // put the stream back in the queue (at the end) - f.streamQueue = append(f.streamQueue, id) - } else { // no more data to send. Stream is not active any more - delete(f.activeStreams, id) - } - if frame == nil { // can happen if the receiveStream was canceled after it said it had data - continue - } - frames = append(frames, frame) - length += frame.Length(f.version) - } - f.mutex.Unlock() - return frames -} diff --git a/external/github.com/lucas-clemente/quic-go/interface.go b/external/github.com/lucas-clemente/quic-go/interface.go deleted file mode 100644 index 5b52e8366d..0000000000 --- a/external/github.com/lucas-clemente/quic-go/interface.go +++ /dev/null @@ -1,214 +0,0 @@ -package quic - -import ( - "context" - "io" - "net" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// The StreamID is the ID of a QUIC stream. -type StreamID = protocol.StreamID - -// A VersionNumber is a QUIC version number. -type VersionNumber = protocol.VersionNumber - -// A Cookie can be used to verify the ownership of the client address. -type Cookie struct { - RemoteAddr string - SentTime time.Time -} - -// ConnectionState records basic details about the QUIC connection. -type ConnectionState = handshake.ConnectionState - -// An ErrorCode is an application-defined error code. -type ErrorCode = protocol.ApplicationErrorCode - -// Stream is the interface implemented by QUIC streams -type Stream interface { - // StreamID returns the stream ID. - StreamID() StreamID - // Read reads data from the stream. - // Read can be made to time out and return a net.Error with Timeout() == true - // after a fixed time limit; see SetDeadline and SetReadDeadline. - // If the stream was canceled by the peer, the error implements the StreamError - // interface, and Canceled() == true. - io.Reader - // Write writes data to the stream. - // Write can be made to time out and return a net.Error with Timeout() == true - // after a fixed time limit; see SetDeadline and SetWriteDeadline. - // If the stream was canceled by the peer, the error implements the StreamError - // interface, and Canceled() == true. - io.Writer - // Close closes the write-direction of the stream. - // Future calls to Write are not permitted after calling Close. - // It must not be called concurrently with Write. - // It must not be called after calling CancelWrite. - io.Closer - // CancelWrite aborts sending on this stream. - // It must not be called after Close. - // Data already written, but not yet delivered to the peer is not guaranteed to be delivered reliably. - // Write will unblock immediately, and future calls to Write will fail. - CancelWrite(ErrorCode) error - // CancelRead aborts receiving on this stream. - // It will ask the peer to stop transmitting stream data. - // Read will unblock immediately, and future Read calls will fail. - CancelRead(ErrorCode) error - // The context is canceled as soon as the write-side of the stream is closed. - // This happens when Close() is called, or when the stream is reset (either locally or remotely). - // Warning: This API should not be considered stable and might change soon. - Context() context.Context - // SetReadDeadline sets the deadline for future Read calls and - // any currently-blocked Read call. - // A zero value for t means Read will not time out. - SetReadDeadline(t time.Time) error - // SetWriteDeadline sets the deadline for future Write calls - // and any currently-blocked Write call. - // Even if write times out, it may return n > 0, indicating that - // some of the data was successfully written. - // A zero value for t means Write will not time out. - SetWriteDeadline(t time.Time) error - // SetDeadline sets the read and write deadlines associated - // with the connection. It is equivalent to calling both - // SetReadDeadline and SetWriteDeadline. - SetDeadline(t time.Time) error - - HasMoreData() bool -} - -// A ReceiveStream is a unidirectional Receive Stream. -type ReceiveStream interface { - // see Stream.StreamID - StreamID() StreamID - // see Stream.Read - io.Reader - // see Stream.CancelRead - CancelRead(ErrorCode) error - // see Stream.SetReadDealine - SetReadDeadline(t time.Time) error - - HasMoreData() bool -} - -// A SendStream is a unidirectional Send Stream. -type SendStream interface { - // see Stream.StreamID - StreamID() StreamID - // see Stream.Write - io.Writer - // see Stream.Close - io.Closer - // see Stream.CancelWrite - CancelWrite(ErrorCode) error - // see Stream.Context - Context() context.Context - // see Stream.SetWriteDeadline - SetWriteDeadline(t time.Time) error -} - -// StreamError is returned by Read and Write when the peer cancels the stream. -type StreamError interface { - error - Canceled() bool - ErrorCode() ErrorCode -} - -// A Session is a QUIC connection between two peers. -type Session interface { - // AcceptStream returns the next stream opened by the peer, blocking until one is available. - AcceptStream() (Stream, error) - // AcceptUniStream returns the next unidirectional stream opened by the peer, blocking until one is available. - AcceptUniStream() (ReceiveStream, error) - // OpenStream opens a new bidirectional QUIC stream. - // There is no signaling to the peer about new streams: - // The peer can only accept the stream after data has been sent on the stream. - // If the error is non-nil, it satisfies the net.Error interface. - // When reaching the peer's stream limit, err.Temporary() will be true. - OpenStream() (Stream, error) - // OpenStreamSync opens a new bidirectional QUIC stream. - // It blocks until a new stream can be opened. - // If the error is non-nil, it satisfies the net.Error interface. - OpenStreamSync() (Stream, error) - // OpenUniStream opens a new outgoing unidirectional QUIC stream. - // If the error is non-nil, it satisfies the net.Error interface. - // When reaching the peer's stream limit, Temporary() will be true. - OpenUniStream() (SendStream, error) - // OpenUniStreamSync opens a new outgoing unidirectional QUIC stream. - // It blocks until a new stream can be opened. - // If the error is non-nil, it satisfies the net.Error interface. - OpenUniStreamSync() (SendStream, error) - // LocalAddr returns the local address. - LocalAddr() net.Addr - // RemoteAddr returns the address of the peer. - RemoteAddr() net.Addr - // Close the connection. - io.Closer - // Close the connection with an error. - // The error must not be nil. - CloseWithError(ErrorCode, error) error - // The context is cancelled when the session is closed. - // Warning: This API should not be considered stable and might change soon. - Context() context.Context - // ConnectionState returns basic details about the QUIC connection. - // Warning: This API should not be considered stable and might change soon. - ConnectionState() ConnectionState -} - -// Config contains all configuration data needed for a QUIC server or client. -type Config struct { - // The QUIC versions that can be negotiated. - // If not set, it uses all versions available. - // Warning: This API should not be considered stable and will change soon. - Versions []VersionNumber - // The length of the connection ID in bytes. - // It can be 0, or any value between 4 and 18. - // If not set, the interpretation depends on where the Config is used: - // If used for dialing an address, a 0 byte connection ID will be used. - // If used for a server, or dialing on a packet conn, a 4 byte connection ID will be used. - // When dialing on a packet conn, the ConnectionIDLength value must be the same for every Dial call. - ConnectionIDLength int - // HandshakeTimeout is the maximum duration that the cryptographic handshake may take. - // If the timeout is exceeded, the connection is closed. - // If this value is zero, the timeout is set to 10 seconds. - HandshakeTimeout time.Duration - // IdleTimeout is the maximum duration that may pass without any incoming network activity. - // This value only applies after the handshake has completed. - // If the timeout is exceeded, the connection is closed. - // If this value is zero, the timeout is set to 30 seconds. - IdleTimeout time.Duration - // AcceptCookie determines if a Cookie is accepted. - // It is called with cookie = nil if the client didn't send an Cookie. - // If not set, it verifies that the address matches, and that the Cookie was issued within the last 24 hours. - // This option is only valid for the server. - AcceptCookie func(clientAddr net.Addr, cookie *Cookie) bool - // MaxReceiveStreamFlowControlWindow is the maximum stream-level flow control window for receiving data. - // If this value is zero, it will default to 1 MB for the server and 6 MB for the client. - MaxReceiveStreamFlowControlWindow uint64 - // MaxReceiveConnectionFlowControlWindow is the connection-level flow control window for receiving data. - // If this value is zero, it will default to 1.5 MB for the server and 15 MB for the client. - MaxReceiveConnectionFlowControlWindow uint64 - // MaxIncomingStreams is the maximum number of concurrent bidirectional streams that a peer is allowed to open. - // If not set, it will default to 100. - // If set to a negative value, it doesn't allow any bidirectional streams. - MaxIncomingStreams int - // MaxIncomingUniStreams is the maximum number of concurrent unidirectional streams that a peer is allowed to open. - // If not set, it will default to 100. - // If set to a negative value, it doesn't allow any unidirectional streams. - MaxIncomingUniStreams int - // KeepAlive defines whether this peer will periodically send PING frames to keep the connection alive. - KeepAlive bool -} - -// A Listener for incoming QUIC connections -type Listener interface { - // Close the server, sending CONNECTION_CLOSE frames to each peer. - Close() error - // Addr returns the local network addr that the server is listening on. - Addr() net.Addr - // Accept returns new sessions. It should be called in a loop. - Accept() (Session, error) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/gen.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/gen.go deleted file mode 100644 index 32235f81ab..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package ackhandler - -//go:generate genny -pkg ackhandler -in ../utils/linkedlist/linkedlist.go -out packet_linkedlist.go gen Item=Packet diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/interfaces.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/interfaces.go deleted file mode 100644 index b839cba1aa..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/interfaces.go +++ /dev/null @@ -1,49 +0,0 @@ -package ackhandler - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -// SentPacketHandler handles ACKs received for outgoing packets -type SentPacketHandler interface { - // SentPacket may modify the packet - SentPacket(packet *Packet) - SentPacketsAsRetransmission(packets []*Packet, retransmissionOf protocol.PacketNumber) - ReceivedAck(ackFrame *wire.AckFrame, withPacketNumber protocol.PacketNumber, encLevel protocol.EncryptionLevel, recvTime time.Time) error - SetHandshakeComplete() - - // The SendMode determines if and what kind of packets can be sent. - SendMode() SendMode - // TimeUntilSend is the time when the next packet should be sent. - // It is used for pacing packets. - TimeUntilSend() time.Time - // ShouldSendNumPackets returns the number of packets that should be sent immediately. - // It always returns a number greater or equal than 1. - // A number greater than 1 is returned when the pacing delay is smaller than the minimum pacing delay. - // Note that the number of packets is only calculated based on the pacing algorithm. - // Before sending any packet, SendingAllowed() must be called to learn if we can actually send it. - ShouldSendNumPackets() int - - // only to be called once the handshake is complete - GetLowestPacketNotConfirmedAcked() protocol.PacketNumber - DequeuePacketForRetransmission() *Packet - DequeueProbePacket() (*Packet, error) - - PeekPacketNumber() (protocol.PacketNumber, protocol.PacketNumberLen) - PopPacketNumber() protocol.PacketNumber - - GetAlarmTimeout() time.Time - OnAlarm() error -} - -// ReceivedPacketHandler handles ACKs needed to send for incoming packets -type ReceivedPacketHandler interface { - ReceivedPacket(pn protocol.PacketNumber, encLevel protocol.EncryptionLevel, rcvTime time.Time, shouldInstigateAck bool) error - IgnoreBelow(protocol.PacketNumber) - - GetAlarmTimeout() time.Time - GetAckFrame(protocol.EncryptionLevel) *wire.AckFrame -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet.go deleted file mode 100644 index 53e6687747..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet.go +++ /dev/null @@ -1,29 +0,0 @@ -package ackhandler - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -// A Packet is a packet -type Packet struct { - PacketNumber protocol.PacketNumber - PacketType protocol.PacketType - Frames []wire.Frame - Length protocol.ByteCount - EncryptionLevel protocol.EncryptionLevel - SendTime time.Time - - largestAcked protocol.PacketNumber // if the packet contains an ACK, the LargestAcked value of that ACK - - // There are two reasons why a packet cannot be retransmitted: - // * it was already retransmitted - // * this packet is a retransmission, and we already received an ACK for the original packet - canBeRetransmitted bool - includedInBytesInFlight bool - retransmittedAs []protocol.PacketNumber - isRetransmission bool // we need a separate bool here because 0 is a valid packet number - retransmissionOf protocol.PacketNumber -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_linkedlist.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_linkedlist.go deleted file mode 100644 index bb74f4ef93..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_linkedlist.go +++ /dev/null @@ -1,217 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package ackhandler - -// Linked list implementation from the Go standard library. - -// PacketElement is an element of a linked list. -type PacketElement struct { - // Next and previous pointers in the doubly-linked list of elements. - // To simplify the implementation, internally a list l is implemented - // as a ring, such that &l.root is both the next element of the last - // list element (l.Back()) and the previous element of the first list - // element (l.Front()). - next, prev *PacketElement - - // The list to which this element belongs. - list *PacketList - - // The value stored with this element. - Value Packet -} - -// Next returns the next list element or nil. -func (e *PacketElement) Next() *PacketElement { - if p := e.next; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// Prev returns the previous list element or nil. -func (e *PacketElement) Prev() *PacketElement { - if p := e.prev; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// PacketList is a linked list of Packets. -type PacketList struct { - root PacketElement // sentinel list element, only &root, root.prev, and root.next are used - len int // current list length excluding (this) sentinel element -} - -// Init initializes or clears list l. -func (l *PacketList) Init() *PacketList { - l.root.next = &l.root - l.root.prev = &l.root - l.len = 0 - return l -} - -// NewPacketList returns an initialized list. -func NewPacketList() *PacketList { return new(PacketList).Init() } - -// Len returns the number of elements of list l. -// The complexity is O(1). -func (l *PacketList) Len() int { return l.len } - -// Front returns the first element of list l or nil if the list is empty. -func (l *PacketList) Front() *PacketElement { - if l.len == 0 { - return nil - } - return l.root.next -} - -// Back returns the last element of list l or nil if the list is empty. -func (l *PacketList) Back() *PacketElement { - if l.len == 0 { - return nil - } - return l.root.prev -} - -// lazyInit lazily initializes a zero List value. -func (l *PacketList) lazyInit() { - if l.root.next == nil { - l.Init() - } -} - -// insert inserts e after at, increments l.len, and returns e. -func (l *PacketList) insert(e, at *PacketElement) *PacketElement { - n := at.next - at.next = e - e.prev = at - e.next = n - n.prev = e - e.list = l - l.len++ - return e -} - -// insertValue is a convenience wrapper for insert(&Element{Value: v}, at). -func (l *PacketList) insertValue(v Packet, at *PacketElement) *PacketElement { - return l.insert(&PacketElement{Value: v}, at) -} - -// remove removes e from its list, decrements l.len, and returns e. -func (l *PacketList) remove(e *PacketElement) *PacketElement { - e.prev.next = e.next - e.next.prev = e.prev - e.next = nil // avoid memory leaks - e.prev = nil // avoid memory leaks - e.list = nil - l.len-- - return e -} - -// Remove removes e from l if e is an element of list l. -// It returns the element value e.Value. -// The element must not be nil. -func (l *PacketList) Remove(e *PacketElement) Packet { - if e.list == l { - // if e.list == l, l must have been initialized when e was inserted - // in l or l == nil (e is a zero Element) and l.remove will crash - l.remove(e) - } - return e.Value -} - -// PushFront inserts a new element e with value v at the front of list l and returns e. -func (l *PacketList) PushFront(v Packet) *PacketElement { - l.lazyInit() - return l.insertValue(v, &l.root) -} - -// PushBack inserts a new element e with value v at the back of list l and returns e. -func (l *PacketList) PushBack(v Packet) *PacketElement { - l.lazyInit() - return l.insertValue(v, l.root.prev) -} - -// InsertBefore inserts a new element e with value v immediately before mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark.prev) -} - -// InsertAfter inserts a new element e with value v immediately after mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *PacketList) InsertAfter(v Packet, mark *PacketElement) *PacketElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark) -} - -// MoveToFront moves element e to the front of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *PacketList) MoveToFront(e *PacketElement) { - if e.list != l || l.root.next == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), &l.root) -} - -// MoveToBack moves element e to the back of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *PacketList) MoveToBack(e *PacketElement) { - if e.list != l || l.root.prev == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), l.root.prev) -} - -// MoveBefore moves element e to its new position before mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *PacketList) MoveBefore(e, mark *PacketElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark.prev) -} - -// MoveAfter moves element e to its new position after mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *PacketList) MoveAfter(e, mark *PacketElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark) -} - -// PushBackList inserts a copy of an other list at the back of list l. -// The lists l and other may be the same. They must not be nil. -func (l *PacketList) PushBackList(other *PacketList) { - l.lazyInit() - for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() { - l.insertValue(e.Value, l.root.prev) - } -} - -// PushFrontList inserts a copy of an other list at the front of list l. -// The lists l and other may be the same. They must not be nil. -func (l *PacketList) PushFrontList(other *PacketList) { - l.lazyInit() - for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() { - l.insertValue(e.Value, &l.root) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_number_generator.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_number_generator.go deleted file mode 100644 index 9d613792d7..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/packet_number_generator.go +++ /dev/null @@ -1,78 +0,0 @@ -package ackhandler - -import ( - "crypto/rand" - "math" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -// The packetNumberGenerator generates the packet number for the next packet -// it randomly skips a packet number every averagePeriod packets (on average) -// it is guarantued to never skip two consecutive packet numbers -type packetNumberGenerator struct { - averagePeriod protocol.PacketNumber - - next protocol.PacketNumber - nextToSkip protocol.PacketNumber - - history []protocol.PacketNumber -} - -func newPacketNumberGenerator(initial, averagePeriod protocol.PacketNumber) *packetNumberGenerator { - g := &packetNumberGenerator{ - next: initial, - averagePeriod: averagePeriod, - } - g.generateNewSkip() - return g -} - -func (p *packetNumberGenerator) Peek() protocol.PacketNumber { - return p.next -} - -func (p *packetNumberGenerator) Pop() protocol.PacketNumber { - next := p.next - - // generate a new packet number for the next packet - p.next++ - - if p.next == p.nextToSkip { - if len(p.history)+1 > protocol.MaxTrackedSkippedPackets { - p.history = p.history[1:] - } - p.history = append(p.history, p.next) - p.next++ - p.generateNewSkip() - } - - return next -} - -func (p *packetNumberGenerator) generateNewSkip() { - num := p.getRandomNumber() - skip := protocol.PacketNumber(num) * (p.averagePeriod - 1) / (math.MaxUint16 / 2) - // make sure that there are never two consecutive packet numbers that are skipped - p.nextToSkip = p.next + 2 + skip -} - -// getRandomNumber() generates a cryptographically secure random number between 0 and MaxUint16 (= 65535) -// The expectation value is 65535/2 -func (p *packetNumberGenerator) getRandomNumber() uint16 { - b := make([]byte, 2) - rand.Read(b) // ignore the error here - - num := uint16(b[0])<<8 + uint16(b[1]) - return num -} - -func (p *packetNumberGenerator) Validate(ack *wire.AckFrame) bool { - for _, pn := range p.history { - if ack.AcksPacket(pn) { - return false - } - } - return true -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_handler.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_handler.go deleted file mode 100644 index 0b1719b29f..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_handler.go +++ /dev/null @@ -1,98 +0,0 @@ -package ackhandler - -import ( - "fmt" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -const ( - // maximum delay that can be applied to an ACK for a retransmittable packet - ackSendDelay = 25 * time.Millisecond - // initial maximum number of retransmittable packets received before sending an ack. - initialRetransmittablePacketsBeforeAck = 2 - // number of retransmittable that an ACK is sent for - retransmittablePacketsBeforeAck = 10 - // 1/5 RTT delay when doing ack decimation - ackDecimationDelay = 1.0 / 4 - // 1/8 RTT delay when doing ack decimation - shortAckDecimationDelay = 1.0 / 8 - // Minimum number of packets received before ack decimation is enabled. - // This intends to avoid the beginning of slow start, when CWNDs may be - // rapidly increasing. - minReceivedBeforeAckDecimation = 100 - // Maximum number of packets to ack immediately after a missing packet for - // fast retransmission to kick in at the sender. This limit is created to - // reduce the number of acks sent that have no benefit for fast retransmission. - // Set to the number of nacks needed for fast retransmit plus one for protection - // against an ack loss - maxPacketsAfterNewMissing = 4 -) - -type receivedPacketHandler struct { - initialPackets *receivedPacketTracker - handshakePackets *receivedPacketTracker - oneRTTPackets *receivedPacketTracker -} - -var _ ReceivedPacketHandler = &receivedPacketHandler{} - -// NewReceivedPacketHandler creates a new receivedPacketHandler -func NewReceivedPacketHandler( - rttStats *congestion.RTTStats, - logger utils.Logger, - version protocol.VersionNumber, -) ReceivedPacketHandler { - return &receivedPacketHandler{ - initialPackets: newReceivedPacketTracker(rttStats, logger, version), - handshakePackets: newReceivedPacketTracker(rttStats, logger, version), - oneRTTPackets: newReceivedPacketTracker(rttStats, logger, version), - } -} - -func (h *receivedPacketHandler) ReceivedPacket( - pn protocol.PacketNumber, - encLevel protocol.EncryptionLevel, - rcvTime time.Time, - shouldInstigateAck bool, -) error { - switch encLevel { - case protocol.EncryptionInitial: - return h.initialPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck) - case protocol.EncryptionHandshake: - return h.handshakePackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck) - case protocol.Encryption1RTT: - return h.oneRTTPackets.ReceivedPacket(pn, rcvTime, shouldInstigateAck) - default: - return fmt.Errorf("received packet with unknown encryption level: %s", encLevel) - } -} - -// only to be used with 1-RTT packets -func (h *receivedPacketHandler) IgnoreBelow(pn protocol.PacketNumber) { - h.oneRTTPackets.IgnoreBelow(pn) -} - -func (h *receivedPacketHandler) GetAlarmTimeout() time.Time { - initialAlarm := h.initialPackets.GetAlarmTimeout() - handshakeAlarm := h.handshakePackets.GetAlarmTimeout() - oneRTTAlarm := h.oneRTTPackets.GetAlarmTimeout() - return utils.MinNonZeroTime(utils.MinNonZeroTime(initialAlarm, handshakeAlarm), oneRTTAlarm) -} - -func (h *receivedPacketHandler) GetAckFrame(encLevel protocol.EncryptionLevel) *wire.AckFrame { - switch encLevel { - case protocol.EncryptionInitial: - return h.initialPackets.GetAckFrame() - case protocol.EncryptionHandshake: - return h.handshakePackets.GetAckFrame() - case protocol.Encryption1RTT: - return h.oneRTTPackets.GetAckFrame() - default: - return nil - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_history.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_history.go deleted file mode 100644 index 4519a1da76..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_history.go +++ /dev/null @@ -1,122 +0,0 @@ -package ackhandler - -import ( - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -// The receivedPacketHistory stores if a packet number has already been received. -// It generates ACK ranges which can be used to assemble an ACK frame. -// It does not store packet contents. -type receivedPacketHistory struct { - ranges *utils.PacketIntervalList - - lowestInReceivedPacketNumbers protocol.PacketNumber -} - -var errTooManyOutstandingReceivedAckRanges = qerr.Error(qerr.TooManyOutstandingReceivedPackets, "Too many outstanding received ACK ranges") - -// newReceivedPacketHistory creates a new received packet history -func newReceivedPacketHistory() *receivedPacketHistory { - return &receivedPacketHistory{ - ranges: utils.NewPacketIntervalList(), - } -} - -// ReceivedPacket registers a packet with PacketNumber p and updates the ranges -func (h *receivedPacketHistory) ReceivedPacket(p protocol.PacketNumber) error { - if h.ranges.Len() >= protocol.MaxTrackedReceivedAckRanges { - return errTooManyOutstandingReceivedAckRanges - } - - if h.ranges.Len() == 0 { - h.ranges.PushBack(utils.PacketInterval{Start: p, End: p}) - return nil - } - - for el := h.ranges.Back(); el != nil; el = el.Prev() { - // p already included in an existing range. Nothing to do here - if p >= el.Value.Start && p <= el.Value.End { - return nil - } - - var rangeExtended bool - if el.Value.End == p-1 { // extend a range at the end - rangeExtended = true - el.Value.End = p - } else if el.Value.Start == p+1 { // extend a range at the beginning - rangeExtended = true - el.Value.Start = p - } - - // if a range was extended (either at the beginning or at the end, maybe it is possible to merge two ranges into one) - if rangeExtended { - prev := el.Prev() - if prev != nil && prev.Value.End+1 == el.Value.Start { // merge two ranges - prev.Value.End = el.Value.End - h.ranges.Remove(el) - return nil - } - return nil // if the two ranges were not merge, we're done here - } - - // create a new range at the end - if p > el.Value.End { - h.ranges.InsertAfter(utils.PacketInterval{Start: p, End: p}, el) - return nil - } - } - - // create a new range at the beginning - h.ranges.InsertBefore(utils.PacketInterval{Start: p, End: p}, h.ranges.Front()) - - return nil -} - -// DeleteBelow deletes all entries below (but not including) p -func (h *receivedPacketHistory) DeleteBelow(p protocol.PacketNumber) { - if p <= h.lowestInReceivedPacketNumbers { - return - } - h.lowestInReceivedPacketNumbers = p - - nextEl := h.ranges.Front() - for el := h.ranges.Front(); nextEl != nil; el = nextEl { - nextEl = el.Next() - - if p > el.Value.Start && p <= el.Value.End { - el.Value.Start = p - } else if el.Value.End < p { // delete a whole range - h.ranges.Remove(el) - } else { // no ranges affected. Nothing to do - return - } - } -} - -// GetAckRanges gets a slice of all AckRanges that can be used in an AckFrame -func (h *receivedPacketHistory) GetAckRanges() []wire.AckRange { - if h.ranges.Len() == 0 { - return nil - } - - ackRanges := make([]wire.AckRange, h.ranges.Len()) - i := 0 - for el := h.ranges.Back(); el != nil; el = el.Prev() { - ackRanges[i] = wire.AckRange{Smallest: el.Value.Start, Largest: el.Value.End} - i++ - } - return ackRanges -} - -func (h *receivedPacketHistory) GetHighestAckRange() wire.AckRange { - ackRange := wire.AckRange{} - if h.ranges.Len() > 0 { - r := h.ranges.Back().Value - ackRange.Smallest = r.Start - ackRange.Largest = r.End - } - return ackRange -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_tracker.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_tracker.go deleted file mode 100644 index 0863ab5ef9..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/received_packet_tracker.go +++ /dev/null @@ -1,191 +0,0 @@ -package ackhandler - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type receivedPacketTracker struct { - largestObserved protocol.PacketNumber - ignoreBelow protocol.PacketNumber - largestObservedReceivedTime time.Time - - packetHistory *receivedPacketHistory - - ackSendDelay time.Duration - rttStats *congestion.RTTStats - - packetsReceivedSinceLastAck int - retransmittablePacketsReceivedSinceLastAck int - ackQueued bool - ackAlarm time.Time - lastAck *wire.AckFrame - - logger utils.Logger - - version protocol.VersionNumber -} - -func newReceivedPacketTracker( - rttStats *congestion.RTTStats, - logger utils.Logger, - version protocol.VersionNumber, -) *receivedPacketTracker { - return &receivedPacketTracker{ - packetHistory: newReceivedPacketHistory(), - ackSendDelay: ackSendDelay, - rttStats: rttStats, - logger: logger, - version: version, - } -} - -func (h *receivedPacketTracker) ReceivedPacket(packetNumber protocol.PacketNumber, rcvTime time.Time, shouldInstigateAck bool) error { - if packetNumber < h.ignoreBelow { - return nil - } - - isMissing := h.isMissing(packetNumber) - if packetNumber >= h.largestObserved { - h.largestObserved = packetNumber - h.largestObservedReceivedTime = rcvTime - } - - if err := h.packetHistory.ReceivedPacket(packetNumber); err != nil { - return err - } - h.maybeQueueAck(packetNumber, rcvTime, shouldInstigateAck, isMissing) - return nil -} - -// IgnoreBelow sets a lower limit for acking packets. -// Packets with packet numbers smaller than p will not be acked. -func (h *receivedPacketTracker) IgnoreBelow(p protocol.PacketNumber) { - if p <= h.ignoreBelow { - return - } - h.ignoreBelow = p - h.packetHistory.DeleteBelow(p) - if h.logger.Debug() { - h.logger.Debugf("\tIgnoring all packets below %#x.", p) - } -} - -// isMissing says if a packet was reported missing in the last ACK. -func (h *receivedPacketTracker) isMissing(p protocol.PacketNumber) bool { - if h.lastAck == nil || p < h.ignoreBelow { - return false - } - return p < h.lastAck.LargestAcked() && !h.lastAck.AcksPacket(p) -} - -func (h *receivedPacketTracker) hasNewMissingPackets() bool { - if h.lastAck == nil { - return false - } - highestRange := h.packetHistory.GetHighestAckRange() - return highestRange.Smallest >= h.lastAck.LargestAcked() && highestRange.Len() <= maxPacketsAfterNewMissing -} - -// maybeQueueAck queues an ACK, if necessary. -// It is implemented analogously to Chrome's QuicConnection::MaybeQueueAck() -// in ACK_DECIMATION_WITH_REORDERING mode. -func (h *receivedPacketTracker) maybeQueueAck(packetNumber protocol.PacketNumber, rcvTime time.Time, shouldInstigateAck, wasMissing bool) { - h.packetsReceivedSinceLastAck++ - - // always ack the first packet - if h.lastAck == nil { - h.logger.Debugf("\tQueueing ACK because the first packet should be acknowledged.") - h.ackQueued = true - return - } - - // Send an ACK if this packet was reported missing in an ACK sent before. - // Ack decimation with reordering relies on the timer to send an ACK, but if - // missing packets we reported in the previous ack, send an ACK immediately. - if wasMissing { - if h.logger.Debug() { - h.logger.Debugf("\tQueueing ACK because packet %#x was missing before.", packetNumber) - } - h.ackQueued = true - } - - if !h.ackQueued && shouldInstigateAck { - h.retransmittablePacketsReceivedSinceLastAck++ - - if packetNumber > minReceivedBeforeAckDecimation { - // ack up to 10 packets at once - if h.retransmittablePacketsReceivedSinceLastAck >= retransmittablePacketsBeforeAck { - h.ackQueued = true - if h.logger.Debug() { - h.logger.Debugf("\tQueueing ACK because packet %d packets were received after the last ACK (using threshold: %d).", h.retransmittablePacketsReceivedSinceLastAck, retransmittablePacketsBeforeAck) - } - } else if h.ackAlarm.IsZero() { - // wait for the minimum of the ack decimation delay or the delayed ack time before sending an ack - ackDelay := utils.MinDuration(ackSendDelay, time.Duration(float64(h.rttStats.MinRTT())*float64(ackDecimationDelay))) - h.ackAlarm = rcvTime.Add(ackDelay) - if h.logger.Debug() { - h.logger.Debugf("\tSetting ACK timer to min(1/4 min-RTT, max ack delay): %s (%s from now)", ackDelay, time.Until(h.ackAlarm)) - } - } - } else { - // send an ACK every 2 retransmittable packets - if h.retransmittablePacketsReceivedSinceLastAck >= initialRetransmittablePacketsBeforeAck { - if h.logger.Debug() { - h.logger.Debugf("\tQueueing ACK because packet %d packets were received after the last ACK (using initial threshold: %d).", h.retransmittablePacketsReceivedSinceLastAck, initialRetransmittablePacketsBeforeAck) - } - h.ackQueued = true - } else if h.ackAlarm.IsZero() { - if h.logger.Debug() { - h.logger.Debugf("\tSetting ACK timer to max ack delay: %s", ackSendDelay) - } - h.ackAlarm = rcvTime.Add(ackSendDelay) - } - } - // If there are new missing packets to report, set a short timer to send an ACK. - if h.hasNewMissingPackets() { - // wait the minimum of 1/8 min RTT and the existing ack time - ackDelay := time.Duration(float64(h.rttStats.MinRTT()) * float64(shortAckDecimationDelay)) - ackTime := rcvTime.Add(ackDelay) - if h.ackAlarm.IsZero() || h.ackAlarm.After(ackTime) { - h.ackAlarm = ackTime - if h.logger.Debug() { - h.logger.Debugf("\tSetting ACK timer to 1/8 min-RTT: %s (%s from now)", ackDelay, time.Until(h.ackAlarm)) - } - } - } - } - - if h.ackQueued { - // cancel the ack alarm - h.ackAlarm = time.Time{} - } -} - -func (h *receivedPacketTracker) GetAckFrame() *wire.AckFrame { - now := time.Now() - if !h.ackQueued && (h.ackAlarm.IsZero() || h.ackAlarm.After(now)) { - return nil - } - if h.logger.Debug() && !h.ackQueued && !h.ackAlarm.IsZero() { - h.logger.Debugf("Sending ACK because the ACK timer expired.") - } - - ack := &wire.AckFrame{ - AckRanges: h.packetHistory.GetAckRanges(), - DelayTime: now.Sub(h.largestObservedReceivedTime), - } - - h.lastAck = ack - h.ackAlarm = time.Time{} - h.ackQueued = false - h.packetsReceivedSinceLastAck = 0 - h.retransmittablePacketsReceivedSinceLastAck = 0 - return ack -} - -func (h *receivedPacketTracker) GetAlarmTimeout() time.Time { return h.ackAlarm } diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/retransmittable.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/retransmittable.go deleted file mode 100644 index 18971750bc..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/retransmittable.go +++ /dev/null @@ -1,34 +0,0 @@ -package ackhandler - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" - -// Returns a new slice with all non-retransmittable frames deleted. -func stripNonRetransmittableFrames(fs []wire.Frame) []wire.Frame { - res := make([]wire.Frame, 0, len(fs)) - for _, f := range fs { - if IsFrameRetransmittable(f) { - res = append(res, f) - } - } - return res -} - -// IsFrameRetransmittable returns true if the frame should be retransmitted. -func IsFrameRetransmittable(f wire.Frame) bool { - switch f.(type) { - case *wire.AckFrame: - return false - default: - return true - } -} - -// HasRetransmittableFrames returns true if at least one frame is retransmittable. -func HasRetransmittableFrames(fs []wire.Frame) bool { - for _, f := range fs { - if IsFrameRetransmittable(f) { - return true - } - } - return false -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/send_mode.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/send_mode.go deleted file mode 100644 index 8cdaa7e6bb..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/send_mode.go +++ /dev/null @@ -1,36 +0,0 @@ -package ackhandler - -import "fmt" - -// The SendMode says what kind of packets can be sent. -type SendMode uint8 - -const ( - // SendNone means that no packets should be sent - SendNone SendMode = iota - // SendAck means an ACK-only packet should be sent - SendAck - // SendRetransmission means that retransmissions should be sent - SendRetransmission - // SendPTO means that a probe packet should be sent - SendPTO - // SendAny means that any packet should be sent - SendAny -) - -func (s SendMode) String() string { - switch s { - case SendNone: - return "none" - case SendAck: - return "ack" - case SendRetransmission: - return "retransmission" - case SendPTO: - return "pto" - case SendAny: - return "any" - default: - return fmt.Sprintf("invalid send mode: %d", s) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_handler.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_handler.go deleted file mode 100644 index 83ddc8c994..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_handler.go +++ /dev/null @@ -1,580 +0,0 @@ -package ackhandler - -import ( - "errors" - "fmt" - "math" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -const ( - // Maximum reordering in time space before time based loss detection considers a packet lost. - // In fraction of an RTT. - timeReorderingFraction = 1.0 / 8 - // Timer granularity. The timer will not be set to a value smaller than granularity. - granularity = time.Millisecond -) - -type sentPacketHandler struct { - lastSentPacketNumber protocol.PacketNumber - packetNumberGenerator *packetNumberGenerator - - lastSentRetransmittablePacketTime time.Time - lastSentCryptoPacketTime time.Time - - nextPacketSendTime time.Time - - largestAcked protocol.PacketNumber - largestReceivedPacketWithAck protocol.PacketNumber - // lowestPacketNotConfirmedAcked is the lowest packet number that we sent an ACK for, but haven't received confirmation, that this ACK actually arrived - // example: we send an ACK for packets 90-100 with packet number 20 - // once we receive an ACK from the peer for packet 20, the lowestPacketNotConfirmedAcked is 101 - lowestPacketNotConfirmedAcked protocol.PacketNumber - - packetHistory *sentPacketHistory - - retransmissionQueue []*Packet - - bytesInFlight protocol.ByteCount - - congestion congestion.SendAlgorithm - rttStats *congestion.RTTStats - - handshakeComplete bool - - // The number of times the crypto packets have been retransmitted without receiving an ack. - cryptoCount uint32 - // The number of times a PTO has been sent without receiving an ack. - ptoCount uint32 - // The number of PTO probe packets that should be sent. - numProbesToSend int - - // The time at which the next packet will be considered lost based on early transmit or exceeding the reordering window in time. - lossTime time.Time - - // The alarm timeout - alarm time.Time - - logger utils.Logger -} - -// NewSentPacketHandler creates a new sentPacketHandler -func NewSentPacketHandler( - initialPacketNumber protocol.PacketNumber, - rttStats *congestion.RTTStats, - logger utils.Logger, -) SentPacketHandler { - congestion := congestion.NewCubicSender( - congestion.DefaultClock{}, - rttStats, - false, /* don't use reno since chromium doesn't (why?) */ - protocol.InitialCongestionWindow, - protocol.DefaultMaxCongestionWindow, - ) - - return &sentPacketHandler{ - packetNumberGenerator: newPacketNumberGenerator(initialPacketNumber, protocol.SkipPacketAveragePeriodLength), - packetHistory: newSentPacketHistory(), - rttStats: rttStats, - congestion: congestion, - logger: logger, - } -} - -func (h *sentPacketHandler) lowestUnacked() protocol.PacketNumber { - if p := h.packetHistory.FirstOutstanding(); p != nil { - return p.PacketNumber - } - return h.largestAcked + 1 -} - -func (h *sentPacketHandler) SetHandshakeComplete() { - h.logger.Debugf("Handshake complete. Discarding all outstanding crypto packets.") - var queue []*Packet - for _, packet := range h.retransmissionQueue { - if packet.EncryptionLevel == protocol.Encryption1RTT { - queue = append(queue, packet) - } - } - var cryptoPackets []*Packet - h.packetHistory.Iterate(func(p *Packet) (bool, error) { - if p.EncryptionLevel != protocol.Encryption1RTT { - cryptoPackets = append(cryptoPackets, p) - } - return true, nil - }) - for _, p := range cryptoPackets { - h.packetHistory.Remove(p.PacketNumber) - } - h.retransmissionQueue = queue - h.handshakeComplete = true -} - -func (h *sentPacketHandler) SentPacket(packet *Packet) { - if isRetransmittable := h.sentPacketImpl(packet); isRetransmittable { - h.packetHistory.SentPacket(packet) - h.updateLossDetectionAlarm() - } -} - -func (h *sentPacketHandler) SentPacketsAsRetransmission(packets []*Packet, retransmissionOf protocol.PacketNumber) { - var p []*Packet - for _, packet := range packets { - if isRetransmittable := h.sentPacketImpl(packet); isRetransmittable { - p = append(p, packet) - } - } - h.packetHistory.SentPacketsAsRetransmission(p, retransmissionOf) - h.updateLossDetectionAlarm() -} - -func (h *sentPacketHandler) sentPacketImpl(packet *Packet) bool /* isRetransmittable */ { - if h.logger.Debug() && h.lastSentPacketNumber != 0 { - for p := h.lastSentPacketNumber + 1; p < packet.PacketNumber; p++ { - h.logger.Debugf("Skipping packet number %#x", p) - } - } - - h.lastSentPacketNumber = packet.PacketNumber - - if len(packet.Frames) > 0 { - if ackFrame, ok := packet.Frames[0].(*wire.AckFrame); ok { - packet.largestAcked = ackFrame.LargestAcked() - } - } - - packet.Frames = stripNonRetransmittableFrames(packet.Frames) - isRetransmittable := len(packet.Frames) != 0 - - if isRetransmittable { - if packet.EncryptionLevel != protocol.Encryption1RTT { - h.lastSentCryptoPacketTime = packet.SendTime - } - h.lastSentRetransmittablePacketTime = packet.SendTime - packet.includedInBytesInFlight = true - h.bytesInFlight += packet.Length - packet.canBeRetransmitted = true - if h.numProbesToSend > 0 { - h.numProbesToSend-- - } - } - h.congestion.OnPacketSent(packet.SendTime, h.bytesInFlight, packet.PacketNumber, packet.Length, isRetransmittable) - - h.nextPacketSendTime = utils.MaxTime(h.nextPacketSendTime, packet.SendTime).Add(h.congestion.TimeUntilSend(h.bytesInFlight)) - return isRetransmittable -} - -func (h *sentPacketHandler) ReceivedAck(ackFrame *wire.AckFrame, withPacketNumber protocol.PacketNumber, encLevel protocol.EncryptionLevel, rcvTime time.Time) error { - largestAcked := ackFrame.LargestAcked() - if largestAcked > h.lastSentPacketNumber { - return qerr.Error(qerr.InvalidAckData, "Received ACK for an unsent package") - } - - // duplicate or out of order ACK - if withPacketNumber != 0 && withPacketNumber < h.largestReceivedPacketWithAck { - h.logger.Debugf("Ignoring ACK frame (duplicate or out of order).") - return nil - } - h.largestReceivedPacketWithAck = withPacketNumber - h.largestAcked = utils.MaxPacketNumber(h.largestAcked, largestAcked) - - if !h.packetNumberGenerator.Validate(ackFrame) { - return qerr.Error(qerr.InvalidAckData, "Received an ACK for a skipped packet number") - } - - if rttUpdated := h.maybeUpdateRTT(largestAcked, ackFrame.DelayTime, rcvTime); rttUpdated { - h.congestion.MaybeExitSlowStart() - } - - ackedPackets, err := h.determineNewlyAckedPackets(ackFrame) - if err != nil { - return err - } - if len(ackedPackets) == 0 { - return nil - } - - priorInFlight := h.bytesInFlight - for _, p := range ackedPackets { - // TODO(#1534): check the encryption level - // if encLevel < p.EncryptionLevel { - // return fmt.Errorf("Received ACK with encryption level %s that acks a packet %d (encryption level %s)", encLevel, p.PacketNumber, p.EncryptionLevel) - // } - - // largestAcked == 0 either means that the packet didn't contain an ACK, or it just acked packet 0 - // It is safe to ignore the corner case of packets that just acked packet 0, because - // the lowestPacketNotConfirmedAcked is only used to limit the number of ACK ranges we will send. - if p.largestAcked != 0 { - h.lowestPacketNotConfirmedAcked = utils.MaxPacketNumber(h.lowestPacketNotConfirmedAcked, p.largestAcked+1) - } - if err := h.onPacketAcked(p, rcvTime); err != nil { - return err - } - if p.includedInBytesInFlight { - h.congestion.OnPacketAcked(p.PacketNumber, p.Length, priorInFlight, rcvTime) - } - } - - if err := h.detectLostPackets(rcvTime, priorInFlight); err != nil { - return err - } - - h.ptoCount = 0 - h.cryptoCount = 0 - - h.updateLossDetectionAlarm() - return nil -} - -func (h *sentPacketHandler) GetLowestPacketNotConfirmedAcked() protocol.PacketNumber { - return h.lowestPacketNotConfirmedAcked -} - -func (h *sentPacketHandler) determineNewlyAckedPackets(ackFrame *wire.AckFrame) ([]*Packet, error) { - var ackedPackets []*Packet - ackRangeIndex := 0 - lowestAcked := ackFrame.LowestAcked() - largestAcked := ackFrame.LargestAcked() - err := h.packetHistory.Iterate(func(p *Packet) (bool, error) { - // Ignore packets below the lowest acked - if p.PacketNumber < lowestAcked { - return true, nil - } - // Break after largest acked is reached - if p.PacketNumber > largestAcked { - return false, nil - } - - if ackFrame.HasMissingRanges() { - ackRange := ackFrame.AckRanges[len(ackFrame.AckRanges)-1-ackRangeIndex] - - for p.PacketNumber > ackRange.Largest && ackRangeIndex < len(ackFrame.AckRanges)-1 { - ackRangeIndex++ - ackRange = ackFrame.AckRanges[len(ackFrame.AckRanges)-1-ackRangeIndex] - } - - if p.PacketNumber >= ackRange.Smallest { // packet i contained in ACK range - if p.PacketNumber > ackRange.Largest { - return false, fmt.Errorf("BUG: ackhandler would have acked wrong packet 0x%x, while evaluating range 0x%x -> 0x%x", p.PacketNumber, ackRange.Smallest, ackRange.Largest) - } - ackedPackets = append(ackedPackets, p) - } - } else { - ackedPackets = append(ackedPackets, p) - } - return true, nil - }) - if h.logger.Debug() && len(ackedPackets) > 0 { - pns := make([]protocol.PacketNumber, len(ackedPackets)) - for i, p := range ackedPackets { - pns[i] = p.PacketNumber - } - h.logger.Debugf("\tnewly acked packets (%d): %#x", len(pns), pns) - } - return ackedPackets, err -} - -func (h *sentPacketHandler) maybeUpdateRTT(largestAcked protocol.PacketNumber, ackDelay time.Duration, rcvTime time.Time) bool { - if p := h.packetHistory.GetPacket(largestAcked); p != nil { - h.rttStats.UpdateRTT(rcvTime.Sub(p.SendTime), ackDelay, rcvTime) - if h.logger.Debug() { - h.logger.Debugf("\tupdated RTT: %s (σ: %s)", h.rttStats.SmoothedRTT(), h.rttStats.MeanDeviation()) - } - return true - } - return false -} - -func (h *sentPacketHandler) updateLossDetectionAlarm() { - // Cancel the alarm if no packets are outstanding - if !h.packetHistory.HasOutstandingPackets() { - h.alarm = time.Time{} - return - } - - if h.packetHistory.HasOutstandingCryptoPackets() { - h.alarm = h.lastSentCryptoPacketTime.Add(h.computeCryptoTimeout()) - } else if !h.lossTime.IsZero() { - // Early retransmit timer or time loss detection. - h.alarm = h.lossTime - } else { // PTO alarm - h.alarm = h.lastSentRetransmittablePacketTime.Add(h.computePTOTimeout()) - } -} - -func (h *sentPacketHandler) detectLostPackets(now time.Time, priorInFlight protocol.ByteCount) error { - h.lossTime = time.Time{} - - maxRTT := float64(utils.MaxDuration(h.rttStats.LatestRTT(), h.rttStats.SmoothedRTT())) - delayUntilLost := time.Duration((1.0 + timeReorderingFraction) * maxRTT) - - var lostPackets []*Packet - h.packetHistory.Iterate(func(packet *Packet) (bool, error) { - if packet.PacketNumber > h.largestAcked { - return false, nil - } - - timeSinceSent := now.Sub(packet.SendTime) - if timeSinceSent > delayUntilLost { - lostPackets = append(lostPackets, packet) - } else if h.lossTime.IsZero() { - if h.logger.Debug() { - h.logger.Debugf("\tsetting loss timer for packet %#x to %s (in %s)", packet.PacketNumber, delayUntilLost, delayUntilLost-timeSinceSent) - } - // Note: This conditional is only entered once per call - h.lossTime = now.Add(delayUntilLost - timeSinceSent) - } - return true, nil - }) - - if h.logger.Debug() && len(lostPackets) > 0 { - pns := make([]protocol.PacketNumber, len(lostPackets)) - for i, p := range lostPackets { - pns[i] = p.PacketNumber - } - h.logger.Debugf("\tlost packets (%d): %#x", len(pns), pns) - } - - for _, p := range lostPackets { - // the bytes in flight need to be reduced no matter if this packet will be retransmitted - if p.includedInBytesInFlight { - h.bytesInFlight -= p.Length - h.congestion.OnPacketLost(p.PacketNumber, p.Length, priorInFlight) - } - if p.canBeRetransmitted { - // queue the packet for retransmission, and report the loss to the congestion controller - if err := h.queuePacketForRetransmission(p); err != nil { - return err - } - } - h.packetHistory.Remove(p.PacketNumber) - } - return nil -} - -func (h *sentPacketHandler) OnAlarm() error { - // When all outstanding are acknowledged, the alarm is canceled in - // updateLossDetectionAlarm. This doesn't reset the timer in the session though. - // When OnAlarm is called, we therefore need to make sure that there are - // actually packets outstanding. - if h.packetHistory.HasOutstandingPackets() { - if err := h.onVerifiedAlarm(); err != nil { - return err - } - } - h.updateLossDetectionAlarm() - return nil -} - -func (h *sentPacketHandler) onVerifiedAlarm() error { - var err error - if h.packetHistory.HasOutstandingCryptoPackets() { - if h.logger.Debug() { - h.logger.Debugf("Loss detection alarm fired in crypto mode. Crypto count: %d", h.cryptoCount) - } - h.cryptoCount++ - err = h.queueCryptoPacketsForRetransmission() - } else if !h.lossTime.IsZero() { - if h.logger.Debug() { - h.logger.Debugf("Loss detection alarm fired in loss timer mode. Loss time: %s", h.lossTime) - } - // Early retransmit or time loss detection - err = h.detectLostPackets(time.Now(), h.bytesInFlight) - } else { // PTO - if h.logger.Debug() { - h.logger.Debugf("Loss detection alarm fired in PTO mode. PTO count: %d", h.ptoCount) - } - h.ptoCount++ - h.numProbesToSend += 2 - } - return err -} - -func (h *sentPacketHandler) GetAlarmTimeout() time.Time { - return h.alarm -} - -func (h *sentPacketHandler) onPacketAcked(p *Packet, rcvTime time.Time) error { - // This happens if a packet and its retransmissions is acked in the same ACK. - // As soon as we process the first one, this will remove all the retransmissions, - // so we won't find the retransmitted packet number later. - if packet := h.packetHistory.GetPacket(p.PacketNumber); packet == nil { - return nil - } - - // only report the acking of this packet to the congestion controller if: - // * it is a retransmittable packet - // * this packet wasn't retransmitted yet - if p.isRetransmission { - // that the parent doesn't exist is expected to happen every time the original packet was already acked - if parent := h.packetHistory.GetPacket(p.retransmissionOf); parent != nil { - if len(parent.retransmittedAs) == 1 { - parent.retransmittedAs = nil - } else { - // remove this packet from the slice of retransmission - retransmittedAs := make([]protocol.PacketNumber, 0, len(parent.retransmittedAs)-1) - for _, pn := range parent.retransmittedAs { - if pn != p.PacketNumber { - retransmittedAs = append(retransmittedAs, pn) - } - } - parent.retransmittedAs = retransmittedAs - } - } - } - // this also applies to packets that have been retransmitted as probe packets - if p.includedInBytesInFlight { - h.bytesInFlight -= p.Length - } - if err := h.stopRetransmissionsFor(p); err != nil { - return err - } - return h.packetHistory.Remove(p.PacketNumber) -} - -func (h *sentPacketHandler) stopRetransmissionsFor(p *Packet) error { - if err := h.packetHistory.MarkCannotBeRetransmitted(p.PacketNumber); err != nil { - return err - } - for _, r := range p.retransmittedAs { - packet := h.packetHistory.GetPacket(r) - if packet == nil { - return fmt.Errorf("sent packet handler BUG: marking packet as not retransmittable %d (retransmission of %d) not found in history", r, p.PacketNumber) - } - h.stopRetransmissionsFor(packet) - } - return nil -} - -func (h *sentPacketHandler) DequeuePacketForRetransmission() *Packet { - if len(h.retransmissionQueue) == 0 { - return nil - } - packet := h.retransmissionQueue[0] - // Shift the slice and don't retain anything that isn't needed. - copy(h.retransmissionQueue, h.retransmissionQueue[1:]) - h.retransmissionQueue[len(h.retransmissionQueue)-1] = nil - h.retransmissionQueue = h.retransmissionQueue[:len(h.retransmissionQueue)-1] - return packet -} - -func (h *sentPacketHandler) DequeueProbePacket() (*Packet, error) { - if len(h.retransmissionQueue) == 0 { - p := h.packetHistory.FirstOutstanding() - if p == nil { - return nil, errors.New("cannot dequeue a probe packet. No outstanding packets") - } - if err := h.queuePacketForRetransmission(p); err != nil { - return nil, err - } - } - return h.DequeuePacketForRetransmission(), nil -} - -func (h *sentPacketHandler) PeekPacketNumber() (protocol.PacketNumber, protocol.PacketNumberLen) { - pn := h.packetNumberGenerator.Peek() - return pn, protocol.GetPacketNumberLengthForHeader(pn, h.lowestUnacked()) -} - -func (h *sentPacketHandler) PopPacketNumber() protocol.PacketNumber { - return h.packetNumberGenerator.Pop() -} - -func (h *sentPacketHandler) SendMode() SendMode { - numTrackedPackets := len(h.retransmissionQueue) + h.packetHistory.Len() - - // Don't send any packets if we're keeping track of the maximum number of packets. - // Note that since MaxOutstandingSentPackets is smaller than MaxTrackedSentPackets, - // we will stop sending out new data when reaching MaxOutstandingSentPackets, - // but still allow sending of retransmissions and ACKs. - if numTrackedPackets >= protocol.MaxTrackedSentPackets { - if h.logger.Debug() { - h.logger.Debugf("Limited by the number of tracked packets: tracking %d packets, maximum %d", numTrackedPackets, protocol.MaxTrackedSentPackets) - } - return SendNone - } - if h.numProbesToSend > 0 { - return SendPTO - } - // Only send ACKs if we're congestion limited. - if cwnd := h.congestion.GetCongestionWindow(); h.bytesInFlight > cwnd { - if h.logger.Debug() { - h.logger.Debugf("Congestion limited: bytes in flight %d, window %d", h.bytesInFlight, cwnd) - } - return SendAck - } - // Send retransmissions first, if there are any. - if len(h.retransmissionQueue) > 0 { - return SendRetransmission - } - if numTrackedPackets >= protocol.MaxOutstandingSentPackets { - if h.logger.Debug() { - h.logger.Debugf("Max outstanding limited: tracking %d packets, maximum: %d", numTrackedPackets, protocol.MaxOutstandingSentPackets) - } - return SendAck - } - return SendAny -} - -func (h *sentPacketHandler) TimeUntilSend() time.Time { - return h.nextPacketSendTime -} - -func (h *sentPacketHandler) ShouldSendNumPackets() int { - if h.numProbesToSend > 0 { - // RTO probes should not be paced, but must be sent immediately. - return h.numProbesToSend - } - delay := h.congestion.TimeUntilSend(h.bytesInFlight) - if delay == 0 || delay > protocol.MinPacingDelay { - return 1 - } - return int(math.Ceil(float64(protocol.MinPacingDelay) / float64(delay))) -} - -func (h *sentPacketHandler) queueCryptoPacketsForRetransmission() error { - var cryptoPackets []*Packet - h.packetHistory.Iterate(func(p *Packet) (bool, error) { - if p.canBeRetransmitted && p.EncryptionLevel != protocol.Encryption1RTT { - cryptoPackets = append(cryptoPackets, p) - } - return true, nil - }) - for _, p := range cryptoPackets { - h.logger.Debugf("Queueing packet %#x as a crypto retransmission", p.PacketNumber) - if err := h.queuePacketForRetransmission(p); err != nil { - return err - } - } - return nil -} - -func (h *sentPacketHandler) queuePacketForRetransmission(p *Packet) error { - if !p.canBeRetransmitted { - return fmt.Errorf("sent packet handler BUG: packet %d already queued for retransmission", p.PacketNumber) - } - if err := h.packetHistory.MarkCannotBeRetransmitted(p.PacketNumber); err != nil { - return err - } - h.retransmissionQueue = append(h.retransmissionQueue, p) - return nil -} - -func (h *sentPacketHandler) computeCryptoTimeout() time.Duration { - duration := utils.MaxDuration(2*h.rttStats.SmoothedOrInitialRTT(), granularity) - // exponential backoff - // There's an implicit limit to this set by the crypto timeout. - return duration << h.cryptoCount -} - -func (h *sentPacketHandler) computePTOTimeout() time.Duration { - // TODO(#1236): include the max_ack_delay - duration := utils.MaxDuration(h.rttStats.SmoothedOrInitialRTT()+4*h.rttStats.MeanDeviation(), granularity) - return duration << h.ptoCount -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_history.go b/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_history.go deleted file mode 100644 index 0b85993f22..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/ackhandler/sent_packet_history.go +++ /dev/null @@ -1,168 +0,0 @@ -package ackhandler - -import ( - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -type sentPacketHistory struct { - packetList *PacketList - packetMap map[protocol.PacketNumber]*PacketElement - - numOutstandingPackets int - numOutstandingCryptoPackets int - - firstOutstanding *PacketElement -} - -func newSentPacketHistory() *sentPacketHistory { - return &sentPacketHistory{ - packetList: NewPacketList(), - packetMap: make(map[protocol.PacketNumber]*PacketElement), - } -} - -func (h *sentPacketHistory) SentPacket(p *Packet) { - h.sentPacketImpl(p) -} - -func (h *sentPacketHistory) sentPacketImpl(p *Packet) *PacketElement { - el := h.packetList.PushBack(*p) - h.packetMap[p.PacketNumber] = el - if h.firstOutstanding == nil { - h.firstOutstanding = el - } - if p.canBeRetransmitted { - h.numOutstandingPackets++ - if p.EncryptionLevel != protocol.Encryption1RTT { - h.numOutstandingCryptoPackets++ - } - } - return el -} - -func (h *sentPacketHistory) SentPacketsAsRetransmission(packets []*Packet, retransmissionOf protocol.PacketNumber) { - retransmission, ok := h.packetMap[retransmissionOf] - // The retransmitted packet is not present anymore. - // This can happen if it was acked in between dequeueing of the retransmission and sending. - // Just treat the retransmissions as normal packets. - // TODO: This won't happen if we clear packets queued for retransmission on new ACKs. - if !ok { - for _, packet := range packets { - h.sentPacketImpl(packet) - } - return - } - retransmission.Value.retransmittedAs = make([]protocol.PacketNumber, len(packets)) - for i, packet := range packets { - retransmission.Value.retransmittedAs[i] = packet.PacketNumber - el := h.sentPacketImpl(packet) - el.Value.isRetransmission = true - el.Value.retransmissionOf = retransmissionOf - } -} - -func (h *sentPacketHistory) GetPacket(p protocol.PacketNumber) *Packet { - if el, ok := h.packetMap[p]; ok { - return &el.Value - } - return nil -} - -// Iterate iterates through all packets. -// The callback must not modify the history. -func (h *sentPacketHistory) Iterate(cb func(*Packet) (cont bool, err error)) error { - cont := true - for el := h.packetList.Front(); cont && el != nil; el = el.Next() { - var err error - cont, err = cb(&el.Value) - if err != nil { - return err - } - } - return nil -} - -// FirstOutStanding returns the first outstanding packet. -// It must not be modified (e.g. retransmitted). -// Use DequeueFirstPacketForRetransmission() to retransmit it. -func (h *sentPacketHistory) FirstOutstanding() *Packet { - if h.firstOutstanding == nil { - return nil - } - return &h.firstOutstanding.Value -} - -// QueuePacketForRetransmission marks a packet for retransmission. -// A packet can only be queued once. -func (h *sentPacketHistory) MarkCannotBeRetransmitted(pn protocol.PacketNumber) error { - el, ok := h.packetMap[pn] - if !ok { - return fmt.Errorf("sent packet history: packet %d not found", pn) - } - if el.Value.canBeRetransmitted { - h.numOutstandingPackets-- - if h.numOutstandingPackets < 0 { - panic("numOutstandingHandshakePackets negative") - } - if el.Value.EncryptionLevel != protocol.Encryption1RTT { - h.numOutstandingCryptoPackets-- - if h.numOutstandingCryptoPackets < 0 { - panic("numOutstandingHandshakePackets negative") - } - } - } - el.Value.canBeRetransmitted = false - if el == h.firstOutstanding { - h.readjustFirstOutstanding() - } - return nil -} - -// readjustFirstOutstanding readjusts the pointer to the first outstanding packet. -// This is necessary every time the first outstanding packet is deleted or retransmitted. -func (h *sentPacketHistory) readjustFirstOutstanding() { - el := h.firstOutstanding.Next() - for el != nil && !el.Value.canBeRetransmitted { - el = el.Next() - } - h.firstOutstanding = el -} - -func (h *sentPacketHistory) Len() int { - return len(h.packetMap) -} - -func (h *sentPacketHistory) Remove(p protocol.PacketNumber) error { - el, ok := h.packetMap[p] - if !ok { - return fmt.Errorf("packet %d not found in sent packet history", p) - } - if el == h.firstOutstanding { - h.readjustFirstOutstanding() - } - if el.Value.canBeRetransmitted { - h.numOutstandingPackets-- - if h.numOutstandingPackets < 0 { - panic("numOutstandingHandshakePackets negative") - } - if el.Value.EncryptionLevel != protocol.Encryption1RTT { - h.numOutstandingCryptoPackets-- - if h.numOutstandingCryptoPackets < 0 { - panic("numOutstandingHandshakePackets negative") - } - } - } - h.packetList.Remove(el) - delete(h.packetMap, p) - return nil -} - -func (h *sentPacketHistory) HasOutstandingPackets() bool { - return h.numOutstandingPackets > 0 -} - -func (h *sentPacketHistory) HasOutstandingCryptoPackets() bool { - return h.numOutstandingCryptoPackets > 0 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/bandwidth.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/bandwidth.go deleted file mode 100644 index aff34ddb6b..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/bandwidth.go +++ /dev/null @@ -1,22 +0,0 @@ -package congestion - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// Bandwidth of a connection -type Bandwidth uint64 - -const ( - // BitsPerSecond is 1 bit per second - BitsPerSecond Bandwidth = 1 - // BytesPerSecond is 1 byte per second - BytesPerSecond = 8 * BitsPerSecond -) - -// BandwidthFromDelta calculates the bandwidth from a number of bytes and a time delta -func BandwidthFromDelta(bytes protocol.ByteCount, delta time.Duration) Bandwidth { - return Bandwidth(bytes) * Bandwidth(time.Second) / Bandwidth(delta) * BytesPerSecond -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/clock.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/clock.go deleted file mode 100644 index 405fae70f9..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/clock.go +++ /dev/null @@ -1,18 +0,0 @@ -package congestion - -import "time" - -// A Clock returns the current time -type Clock interface { - Now() time.Time -} - -// DefaultClock implements the Clock interface using the Go stdlib clock. -type DefaultClock struct{} - -var _ Clock = DefaultClock{} - -// Now gets the current time -func (DefaultClock) Now() time.Time { - return time.Now() -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic.go deleted file mode 100644 index 6b32e9bd24..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic.go +++ /dev/null @@ -1,210 +0,0 @@ -package congestion - -import ( - "math" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// This cubic implementation is based on the one found in Chromiums's QUIC -// implementation, in the files net/quic/congestion_control/cubic.{hh,cc}. - -// Constants based on TCP defaults. -// The following constants are in 2^10 fractions of a second instead of ms to -// allow a 10 shift right to divide. - -// 1024*1024^3 (first 1024 is from 0.100^3) -// where 0.100 is 100 ms which is the scaling round trip time. -const cubeScale = 40 -const cubeCongestionWindowScale = 410 -const cubeFactor protocol.ByteCount = 1 << cubeScale / cubeCongestionWindowScale / protocol.DefaultTCPMSS - -const defaultNumConnections = 2 - -// Default Cubic backoff factor -const beta float32 = 0.7 - -// Additional backoff factor when loss occurs in the concave part of the Cubic -// curve. This additional backoff factor is expected to give up bandwidth to -// new concurrent flows and speed up convergence. -const betaLastMax float32 = 0.85 - -// Cubic implements the cubic algorithm from TCP -type Cubic struct { - clock Clock - - // Number of connections to simulate. - numConnections int - - // Time when this cycle started, after last loss event. - epoch time.Time - - // Max congestion window used just before last loss event. - // Note: to improve fairness to other streams an additional back off is - // applied to this value if the new value is below our latest value. - lastMaxCongestionWindow protocol.ByteCount - - // Number of acked bytes since the cycle started (epoch). - ackedBytesCount protocol.ByteCount - - // TCP Reno equivalent congestion window in packets. - estimatedTCPcongestionWindow protocol.ByteCount - - // Origin point of cubic function. - originPointCongestionWindow protocol.ByteCount - - // Time to origin point of cubic function in 2^10 fractions of a second. - timeToOriginPoint uint32 - - // Last congestion window in packets computed by cubic function. - lastTargetCongestionWindow protocol.ByteCount -} - -// NewCubic returns a new Cubic instance -func NewCubic(clock Clock) *Cubic { - c := &Cubic{ - clock: clock, - numConnections: defaultNumConnections, - } - c.Reset() - return c -} - -// Reset is called after a timeout to reset the cubic state -func (c *Cubic) Reset() { - c.epoch = time.Time{} - c.lastMaxCongestionWindow = 0 - c.ackedBytesCount = 0 - c.estimatedTCPcongestionWindow = 0 - c.originPointCongestionWindow = 0 - c.timeToOriginPoint = 0 - c.lastTargetCongestionWindow = 0 -} - -func (c *Cubic) alpha() float32 { - // TCPFriendly alpha is described in Section 3.3 of the CUBIC paper. Note that - // beta here is a cwnd multiplier, and is equal to 1-beta from the paper. - // We derive the equivalent alpha for an N-connection emulation as: - b := c.beta() - return 3 * float32(c.numConnections) * float32(c.numConnections) * (1 - b) / (1 + b) -} - -func (c *Cubic) beta() float32 { - // kNConnectionBeta is the backoff factor after loss for our N-connection - // emulation, which emulates the effective backoff of an ensemble of N - // TCP-Reno connections on a single loss event. The effective multiplier is - // computed as: - return (float32(c.numConnections) - 1 + beta) / float32(c.numConnections) -} - -func (c *Cubic) betaLastMax() float32 { - // betaLastMax is the additional backoff factor after loss for our - // N-connection emulation, which emulates the additional backoff of - // an ensemble of N TCP-Reno connections on a single loss event. The - // effective multiplier is computed as: - return (float32(c.numConnections) - 1 + betaLastMax) / float32(c.numConnections) -} - -// OnApplicationLimited is called on ack arrival when sender is unable to use -// the available congestion window. Resets Cubic state during quiescence. -func (c *Cubic) OnApplicationLimited() { - // When sender is not using the available congestion window, the window does - // not grow. But to be RTT-independent, Cubic assumes that the sender has been - // using the entire window during the time since the beginning of the current - // "epoch" (the end of the last loss recovery period). Since - // application-limited periods break this assumption, we reset the epoch when - // in such a period. This reset effectively freezes congestion window growth - // through application-limited periods and allows Cubic growth to continue - // when the entire window is being used. - c.epoch = time.Time{} -} - -// CongestionWindowAfterPacketLoss computes a new congestion window to use after -// a loss event. Returns the new congestion window in packets. The new -// congestion window is a multiplicative decrease of our current window. -func (c *Cubic) CongestionWindowAfterPacketLoss(currentCongestionWindow protocol.ByteCount) protocol.ByteCount { - if currentCongestionWindow+protocol.DefaultTCPMSS < c.lastMaxCongestionWindow { - // We never reached the old max, so assume we are competing with another - // flow. Use our extra back off factor to allow the other flow to go up. - c.lastMaxCongestionWindow = protocol.ByteCount(c.betaLastMax() * float32(currentCongestionWindow)) - } else { - c.lastMaxCongestionWindow = currentCongestionWindow - } - c.epoch = time.Time{} // Reset time. - return protocol.ByteCount(float32(currentCongestionWindow) * c.beta()) -} - -// CongestionWindowAfterAck computes a new congestion window to use after a received ACK. -// Returns the new congestion window in packets. The new congestion window -// follows a cubic function that depends on the time passed since last -// packet loss. -func (c *Cubic) CongestionWindowAfterAck( - ackedBytes protocol.ByteCount, - currentCongestionWindow protocol.ByteCount, - delayMin time.Duration, - eventTime time.Time, -) protocol.ByteCount { - c.ackedBytesCount += ackedBytes - - if c.epoch.IsZero() { - // First ACK after a loss event. - c.epoch = eventTime // Start of epoch. - c.ackedBytesCount = ackedBytes // Reset count. - // Reset estimated_tcp_congestion_window_ to be in sync with cubic. - c.estimatedTCPcongestionWindow = currentCongestionWindow - if c.lastMaxCongestionWindow <= currentCongestionWindow { - c.timeToOriginPoint = 0 - c.originPointCongestionWindow = currentCongestionWindow - } else { - c.timeToOriginPoint = uint32(math.Cbrt(float64(cubeFactor * (c.lastMaxCongestionWindow - currentCongestionWindow)))) - c.originPointCongestionWindow = c.lastMaxCongestionWindow - } - } - - // Change the time unit from microseconds to 2^10 fractions per second. Take - // the round trip time in account. This is done to allow us to use shift as a - // divide operator. - elapsedTime := int64(eventTime.Add(delayMin).Sub(c.epoch)/time.Microsecond) << 10 / (1000 * 1000) - - // Right-shifts of negative, signed numbers have implementation-dependent - // behavior, so force the offset to be positive, as is done in the kernel. - offset := int64(c.timeToOriginPoint) - elapsedTime - if offset < 0 { - offset = -offset - } - - deltaCongestionWindow := protocol.ByteCount(cubeCongestionWindowScale*offset*offset*offset) * protocol.DefaultTCPMSS >> cubeScale - var targetCongestionWindow protocol.ByteCount - if elapsedTime > int64(c.timeToOriginPoint) { - targetCongestionWindow = c.originPointCongestionWindow + deltaCongestionWindow - } else { - targetCongestionWindow = c.originPointCongestionWindow - deltaCongestionWindow - } - // Limit the CWND increase to half the acked bytes. - targetCongestionWindow = utils.MinByteCount(targetCongestionWindow, currentCongestionWindow+c.ackedBytesCount/2) - - // Increase the window by approximately Alpha * 1 MSS of bytes every - // time we ack an estimated tcp window of bytes. For small - // congestion windows (less than 25), the formula below will - // increase slightly slower than linearly per estimated tcp window - // of bytes. - c.estimatedTCPcongestionWindow += protocol.ByteCount(float32(c.ackedBytesCount) * c.alpha() * float32(protocol.DefaultTCPMSS) / float32(c.estimatedTCPcongestionWindow)) - c.ackedBytesCount = 0 - - // We have a new cubic congestion window. - c.lastTargetCongestionWindow = targetCongestionWindow - - // Compute target congestion_window based on cubic target and estimated TCP - // congestion_window, use highest (fastest). - if targetCongestionWindow < c.estimatedTCPcongestionWindow { - targetCongestionWindow = c.estimatedTCPcongestionWindow - } - return targetCongestionWindow -} - -// SetNumConnections sets the number of emulated connections -func (c *Cubic) SetNumConnections(n int) { - c.numConnections = n -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic_sender.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic_sender.go deleted file mode 100644 index 9eb8986446..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/cubic_sender.go +++ /dev/null @@ -1,318 +0,0 @@ -package congestion - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -const ( - maxBurstBytes = 3 * protocol.DefaultTCPMSS - renoBeta float32 = 0.7 // Reno backoff factor. - defaultMinimumCongestionWindow protocol.ByteCount = 2 * protocol.DefaultTCPMSS -) - -type cubicSender struct { - hybridSlowStart HybridSlowStart - prr PrrSender - rttStats *RTTStats - stats connectionStats - cubic *Cubic - - reno bool - - // Track the largest packet that has been sent. - largestSentPacketNumber protocol.PacketNumber - - // Track the largest packet that has been acked. - largestAckedPacketNumber protocol.PacketNumber - - // Track the largest packet number outstanding when a CWND cutback occurs. - largestSentAtLastCutback protocol.PacketNumber - - // Whether the last loss event caused us to exit slowstart. - // Used for stats collection of slowstartPacketsLost - lastCutbackExitedSlowstart bool - - // When true, exit slow start with large cutback of congestion window. - slowStartLargeReduction bool - - // Congestion window in packets. - congestionWindow protocol.ByteCount - - // Minimum congestion window in packets. - minCongestionWindow protocol.ByteCount - - // Maximum congestion window. - maxCongestionWindow protocol.ByteCount - - // Slow start congestion window in bytes, aka ssthresh. - slowstartThreshold protocol.ByteCount - - // Number of connections to simulate. - numConnections int - - // ACK counter for the Reno implementation. - numAckedPackets uint64 - - initialCongestionWindow protocol.ByteCount - initialMaxCongestionWindow protocol.ByteCount - - minSlowStartExitWindow protocol.ByteCount -} - -var _ SendAlgorithm = &cubicSender{} -var _ SendAlgorithmWithDebugInfo = &cubicSender{} - -// NewCubicSender makes a new cubic sender -func NewCubicSender(clock Clock, rttStats *RTTStats, reno bool, initialCongestionWindow, initialMaxCongestionWindow protocol.ByteCount) SendAlgorithmWithDebugInfo { - return &cubicSender{ - rttStats: rttStats, - initialCongestionWindow: initialCongestionWindow, - initialMaxCongestionWindow: initialMaxCongestionWindow, - congestionWindow: initialCongestionWindow, - minCongestionWindow: defaultMinimumCongestionWindow, - slowstartThreshold: initialMaxCongestionWindow, - maxCongestionWindow: initialMaxCongestionWindow, - numConnections: defaultNumConnections, - cubic: NewCubic(clock), - reno: reno, - } -} - -// TimeUntilSend returns when the next packet should be sent. -func (c *cubicSender) TimeUntilSend(bytesInFlight protocol.ByteCount) time.Duration { - if c.InRecovery() { - // PRR is used when in recovery. - if c.prr.CanSend(c.GetCongestionWindow(), bytesInFlight, c.GetSlowStartThreshold()) { - return 0 - } - } - delay := c.rttStats.SmoothedRTT() / time.Duration(2*c.GetCongestionWindow()) - if !c.InSlowStart() { // adjust delay, such that it's 1.25*cwd/rtt - delay = delay * 8 / 5 - } - return delay -} - -func (c *cubicSender) OnPacketSent( - sentTime time.Time, - bytesInFlight protocol.ByteCount, - packetNumber protocol.PacketNumber, - bytes protocol.ByteCount, - isRetransmittable bool, -) { - if !isRetransmittable { - return - } - if c.InRecovery() { - // PRR is used when in recovery. - c.prr.OnPacketSent(bytes) - } - c.largestSentPacketNumber = packetNumber - c.hybridSlowStart.OnPacketSent(packetNumber) -} - -func (c *cubicSender) InRecovery() bool { - return c.largestAckedPacketNumber <= c.largestSentAtLastCutback && c.largestAckedPacketNumber != 0 -} - -func (c *cubicSender) InSlowStart() bool { - return c.GetCongestionWindow() < c.GetSlowStartThreshold() -} - -func (c *cubicSender) GetCongestionWindow() protocol.ByteCount { - return c.congestionWindow -} - -func (c *cubicSender) GetSlowStartThreshold() protocol.ByteCount { - return c.slowstartThreshold -} - -func (c *cubicSender) ExitSlowstart() { - c.slowstartThreshold = c.congestionWindow -} - -func (c *cubicSender) SlowstartThreshold() protocol.ByteCount { - return c.slowstartThreshold -} - -func (c *cubicSender) MaybeExitSlowStart() { - if c.InSlowStart() && c.hybridSlowStart.ShouldExitSlowStart(c.rttStats.LatestRTT(), c.rttStats.MinRTT(), c.GetCongestionWindow()/protocol.DefaultTCPMSS) { - c.ExitSlowstart() - } -} - -func (c *cubicSender) OnPacketAcked( - ackedPacketNumber protocol.PacketNumber, - ackedBytes protocol.ByteCount, - priorInFlight protocol.ByteCount, - eventTime time.Time, -) { - c.largestAckedPacketNumber = utils.MaxPacketNumber(ackedPacketNumber, c.largestAckedPacketNumber) - if c.InRecovery() { - // PRR is used when in recovery. - c.prr.OnPacketAcked(ackedBytes) - return - } - c.maybeIncreaseCwnd(ackedPacketNumber, ackedBytes, priorInFlight, eventTime) - if c.InSlowStart() { - c.hybridSlowStart.OnPacketAcked(ackedPacketNumber) - } -} - -func (c *cubicSender) OnPacketLost( - packetNumber protocol.PacketNumber, - lostBytes protocol.ByteCount, - priorInFlight protocol.ByteCount, -) { - // TCP NewReno (RFC6582) says that once a loss occurs, any losses in packets - // already sent should be treated as a single loss event, since it's expected. - if packetNumber <= c.largestSentAtLastCutback { - if c.lastCutbackExitedSlowstart { - c.stats.slowstartPacketsLost++ - c.stats.slowstartBytesLost += lostBytes - if c.slowStartLargeReduction { - // Reduce congestion window by lost_bytes for every loss. - c.congestionWindow = utils.MaxByteCount(c.congestionWindow-lostBytes, c.minSlowStartExitWindow) - c.slowstartThreshold = c.congestionWindow - } - } - return - } - c.lastCutbackExitedSlowstart = c.InSlowStart() - if c.InSlowStart() { - c.stats.slowstartPacketsLost++ - } - - c.prr.OnPacketLost(priorInFlight) - - // TODO(chromium): Separate out all of slow start into a separate class. - if c.slowStartLargeReduction && c.InSlowStart() { - if c.congestionWindow >= 2*c.initialCongestionWindow { - c.minSlowStartExitWindow = c.congestionWindow / 2 - } - c.congestionWindow -= protocol.DefaultTCPMSS - } else if c.reno { - c.congestionWindow = protocol.ByteCount(float32(c.congestionWindow) * c.RenoBeta()) - } else { - c.congestionWindow = c.cubic.CongestionWindowAfterPacketLoss(c.congestionWindow) - } - if c.congestionWindow < c.minCongestionWindow { - c.congestionWindow = c.minCongestionWindow - } - c.slowstartThreshold = c.congestionWindow - c.largestSentAtLastCutback = c.largestSentPacketNumber - // reset packet count from congestion avoidance mode. We start - // counting again when we're out of recovery. - c.numAckedPackets = 0 -} - -func (c *cubicSender) RenoBeta() float32 { - // kNConnectionBeta is the backoff factor after loss for our N-connection - // emulation, which emulates the effective backoff of an ensemble of N - // TCP-Reno connections on a single loss event. The effective multiplier is - // computed as: - return (float32(c.numConnections) - 1. + renoBeta) / float32(c.numConnections) -} - -// Called when we receive an ack. Normal TCP tracks how many packets one ack -// represents, but quic has a separate ack for each packet. -func (c *cubicSender) maybeIncreaseCwnd( - ackedPacketNumber protocol.PacketNumber, - ackedBytes protocol.ByteCount, - priorInFlight protocol.ByteCount, - eventTime time.Time, -) { - // Do not increase the congestion window unless the sender is close to using - // the current window. - if !c.isCwndLimited(priorInFlight) { - c.cubic.OnApplicationLimited() - return - } - if c.congestionWindow >= c.maxCongestionWindow { - return - } - if c.InSlowStart() { - // TCP slow start, exponential growth, increase by one for each ACK. - c.congestionWindow += protocol.DefaultTCPMSS - return - } - // Congestion avoidance - if c.reno { - // Classic Reno congestion avoidance. - c.numAckedPackets++ - // Divide by num_connections to smoothly increase the CWND at a faster - // rate than conventional Reno. - if c.numAckedPackets*uint64(c.numConnections) >= uint64(c.congestionWindow)/uint64(protocol.DefaultTCPMSS) { - c.congestionWindow += protocol.DefaultTCPMSS - c.numAckedPackets = 0 - } - } else { - c.congestionWindow = utils.MinByteCount(c.maxCongestionWindow, c.cubic.CongestionWindowAfterAck(ackedBytes, c.congestionWindow, c.rttStats.MinRTT(), eventTime)) - } -} - -func (c *cubicSender) isCwndLimited(bytesInFlight protocol.ByteCount) bool { - congestionWindow := c.GetCongestionWindow() - if bytesInFlight >= congestionWindow { - return true - } - availableBytes := congestionWindow - bytesInFlight - slowStartLimited := c.InSlowStart() && bytesInFlight > congestionWindow/2 - return slowStartLimited || availableBytes <= maxBurstBytes -} - -// BandwidthEstimate returns the current bandwidth estimate -func (c *cubicSender) BandwidthEstimate() Bandwidth { - srtt := c.rttStats.SmoothedRTT() - if srtt == 0 { - // If we haven't measured an rtt, the bandwidth estimate is unknown. - return 0 - } - return BandwidthFromDelta(c.GetCongestionWindow(), srtt) -} - -// HybridSlowStart returns the hybrid slow start instance for testing -func (c *cubicSender) HybridSlowStart() *HybridSlowStart { - return &c.hybridSlowStart -} - -// SetNumEmulatedConnections sets the number of emulated connections -func (c *cubicSender) SetNumEmulatedConnections(n int) { - c.numConnections = utils.Max(n, 1) - c.cubic.SetNumConnections(c.numConnections) -} - -// OnRetransmissionTimeout is called on an retransmission timeout -func (c *cubicSender) OnRetransmissionTimeout(packetsRetransmitted bool) { - c.largestSentAtLastCutback = 0 - if !packetsRetransmitted { - return - } - c.hybridSlowStart.Restart() - c.cubic.Reset() - c.slowstartThreshold = c.congestionWindow / 2 - c.congestionWindow = c.minCongestionWindow -} - -// OnConnectionMigration is called when the connection is migrated (?) -func (c *cubicSender) OnConnectionMigration() { - c.hybridSlowStart.Restart() - c.prr = PrrSender{} - c.largestSentPacketNumber = 0 - c.largestAckedPacketNumber = 0 - c.largestSentAtLastCutback = 0 - c.lastCutbackExitedSlowstart = false - c.cubic.Reset() - c.numAckedPackets = 0 - c.congestionWindow = c.initialCongestionWindow - c.slowstartThreshold = c.initialMaxCongestionWindow - c.maxCongestionWindow = c.initialMaxCongestionWindow -} - -// SetSlowStartLargeReduction allows enabling the SSLR experiment -func (c *cubicSender) SetSlowStartLargeReduction(enabled bool) { - c.slowStartLargeReduction = enabled -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/hybrid_slow_start.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/hybrid_slow_start.go deleted file mode 100644 index 890ee40698..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/hybrid_slow_start.go +++ /dev/null @@ -1,111 +0,0 @@ -package congestion - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// Note(pwestin): the magic clamping numbers come from the original code in -// tcp_cubic.c. -const hybridStartLowWindow = protocol.ByteCount(16) - -// Number of delay samples for detecting the increase of delay. -const hybridStartMinSamples = uint32(8) - -// Exit slow start if the min rtt has increased by more than 1/8th. -const hybridStartDelayFactorExp = 3 // 2^3 = 8 -// The original paper specifies 2 and 8ms, but those have changed over time. -const hybridStartDelayMinThresholdUs = int64(4000) -const hybridStartDelayMaxThresholdUs = int64(16000) - -// HybridSlowStart implements the TCP hybrid slow start algorithm -type HybridSlowStart struct { - endPacketNumber protocol.PacketNumber - lastSentPacketNumber protocol.PacketNumber - started bool - currentMinRTT time.Duration - rttSampleCount uint32 - hystartFound bool -} - -// StartReceiveRound is called for the start of each receive round (burst) in the slow start phase. -func (s *HybridSlowStart) StartReceiveRound(lastSent protocol.PacketNumber) { - s.endPacketNumber = lastSent - s.currentMinRTT = 0 - s.rttSampleCount = 0 - s.started = true -} - -// IsEndOfRound returns true if this ack is the last packet number of our current slow start round. -func (s *HybridSlowStart) IsEndOfRound(ack protocol.PacketNumber) bool { - return s.endPacketNumber < ack -} - -// ShouldExitSlowStart should be called on every new ack frame, since a new -// RTT measurement can be made then. -// rtt: the RTT for this ack packet. -// minRTT: is the lowest delay (RTT) we have seen during the session. -// congestionWindow: the congestion window in packets. -func (s *HybridSlowStart) ShouldExitSlowStart(latestRTT time.Duration, minRTT time.Duration, congestionWindow protocol.ByteCount) bool { - if !s.started { - // Time to start the hybrid slow start. - s.StartReceiveRound(s.lastSentPacketNumber) - } - if s.hystartFound { - return true - } - // Second detection parameter - delay increase detection. - // Compare the minimum delay (s.currentMinRTT) of the current - // burst of packets relative to the minimum delay during the session. - // Note: we only look at the first few(8) packets in each burst, since we - // only want to compare the lowest RTT of the burst relative to previous - // bursts. - s.rttSampleCount++ - if s.rttSampleCount <= hybridStartMinSamples { - if s.currentMinRTT == 0 || s.currentMinRTT > latestRTT { - s.currentMinRTT = latestRTT - } - } - // We only need to check this once per round. - if s.rttSampleCount == hybridStartMinSamples { - // Divide minRTT by 8 to get a rtt increase threshold for exiting. - minRTTincreaseThresholdUs := int64(minRTT / time.Microsecond >> hybridStartDelayFactorExp) - // Ensure the rtt threshold is never less than 2ms or more than 16ms. - minRTTincreaseThresholdUs = utils.MinInt64(minRTTincreaseThresholdUs, hybridStartDelayMaxThresholdUs) - minRTTincreaseThreshold := time.Duration(utils.MaxInt64(minRTTincreaseThresholdUs, hybridStartDelayMinThresholdUs)) * time.Microsecond - - if s.currentMinRTT > (minRTT + minRTTincreaseThreshold) { - s.hystartFound = true - } - } - // Exit from slow start if the cwnd is greater than 16 and - // increasing delay is found. - return congestionWindow >= hybridStartLowWindow && s.hystartFound -} - -// OnPacketSent is called when a packet was sent -func (s *HybridSlowStart) OnPacketSent(packetNumber protocol.PacketNumber) { - s.lastSentPacketNumber = packetNumber -} - -// OnPacketAcked gets invoked after ShouldExitSlowStart, so it's best to end -// the round when the final packet of the burst is received and start it on -// the next incoming ack. -func (s *HybridSlowStart) OnPacketAcked(ackedPacketNumber protocol.PacketNumber) { - if s.IsEndOfRound(ackedPacketNumber) { - s.started = false - } -} - -// Started returns true if started -func (s *HybridSlowStart) Started() bool { - return s.started -} - -// Restart the slow start phase -func (s *HybridSlowStart) Restart() { - s.started = false - s.hystartFound = false -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/interface.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/interface.go deleted file mode 100644 index e3d80b4251..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/interface.go +++ /dev/null @@ -1,36 +0,0 @@ -package congestion - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A SendAlgorithm performs congestion control and calculates the congestion window -type SendAlgorithm interface { - TimeUntilSend(bytesInFlight protocol.ByteCount) time.Duration - OnPacketSent(sentTime time.Time, bytesInFlight protocol.ByteCount, packetNumber protocol.PacketNumber, bytes protocol.ByteCount, isRetransmittable bool) - GetCongestionWindow() protocol.ByteCount - MaybeExitSlowStart() - OnPacketAcked(number protocol.PacketNumber, ackedBytes protocol.ByteCount, priorInFlight protocol.ByteCount, eventTime time.Time) - OnPacketLost(number protocol.PacketNumber, lostBytes protocol.ByteCount, priorInFlight protocol.ByteCount) - SetNumEmulatedConnections(n int) - OnRetransmissionTimeout(packetsRetransmitted bool) - OnConnectionMigration() - - // Experiments - SetSlowStartLargeReduction(enabled bool) -} - -// SendAlgorithmWithDebugInfo adds some debug functions to SendAlgorithm -type SendAlgorithmWithDebugInfo interface { - SendAlgorithm - BandwidthEstimate() Bandwidth - - // Stuff only used in testing - - HybridSlowStart() *HybridSlowStart - SlowstartThreshold() protocol.ByteCount - RenoBeta() float32 - InRecovery() bool -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/prr_sender.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/prr_sender.go deleted file mode 100644 index 3febd7bac7..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/prr_sender.go +++ /dev/null @@ -1,54 +0,0 @@ -package congestion - -import ( - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// PrrSender implements the Proportional Rate Reduction (PRR) per RFC 6937 -type PrrSender struct { - bytesSentSinceLoss protocol.ByteCount - bytesDeliveredSinceLoss protocol.ByteCount - ackCountSinceLoss protocol.ByteCount - bytesInFlightBeforeLoss protocol.ByteCount -} - -// OnPacketSent should be called after a packet was sent -func (p *PrrSender) OnPacketSent(sentBytes protocol.ByteCount) { - p.bytesSentSinceLoss += sentBytes -} - -// OnPacketLost should be called on the first loss that triggers a recovery -// period and all other methods in this class should only be called when in -// recovery. -func (p *PrrSender) OnPacketLost(priorInFlight protocol.ByteCount) { - p.bytesSentSinceLoss = 0 - p.bytesInFlightBeforeLoss = priorInFlight - p.bytesDeliveredSinceLoss = 0 - p.ackCountSinceLoss = 0 -} - -// OnPacketAcked should be called after a packet was acked -func (p *PrrSender) OnPacketAcked(ackedBytes protocol.ByteCount) { - p.bytesDeliveredSinceLoss += ackedBytes - p.ackCountSinceLoss++ -} - -// CanSend returns if packets can be sent -func (p *PrrSender) CanSend(congestionWindow, bytesInFlight, slowstartThreshold protocol.ByteCount) bool { - // Return QuicTime::Zero In order to ensure limited transmit always works. - if p.bytesSentSinceLoss == 0 || bytesInFlight < protocol.DefaultTCPMSS { - return true - } - if congestionWindow > bytesInFlight { - // During PRR-SSRB, limit outgoing packets to 1 extra MSS per ack, instead - // of sending the entire available window. This prevents burst retransmits - // when more packets are lost than the CWND reduction. - // limit = MAX(prr_delivered - prr_out, DeliveredData) + MSS - return p.bytesDeliveredSinceLoss+p.ackCountSinceLoss*protocol.DefaultTCPMSS > p.bytesSentSinceLoss - } - // Implement Proportional Rate Reduction (RFC6937). - // Checks a simplified version of the PRR formula that doesn't use division: - // AvailableSendWindow = - // CEIL(prr_delivered * ssthresh / BytesInFlightAtLoss) - prr_sent - return p.bytesDeliveredSinceLoss*slowstartThreshold > p.bytesSentSinceLoss*p.bytesInFlightBeforeLoss -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/rtt_stats.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/rtt_stats.go deleted file mode 100644 index 146f03d8e4..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/rtt_stats.go +++ /dev/null @@ -1,101 +0,0 @@ -package congestion - -import ( - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -const ( - rttAlpha float32 = 0.125 - oneMinusAlpha float32 = (1 - rttAlpha) - rttBeta float32 = 0.25 - oneMinusBeta float32 = (1 - rttBeta) - // The default RTT used before an RTT sample is taken. - defaultInitialRTT = 100 * time.Millisecond -) - -// RTTStats provides round-trip statistics -type RTTStats struct { - minRTT time.Duration - latestRTT time.Duration - smoothedRTT time.Duration - meanDeviation time.Duration -} - -// NewRTTStats makes a properly initialized RTTStats object -func NewRTTStats() *RTTStats { - return &RTTStats{} -} - -// MinRTT Returns the minRTT for the entire connection. -// May return Zero if no valid updates have occurred. -func (r *RTTStats) MinRTT() time.Duration { return r.minRTT } - -// LatestRTT returns the most recent rtt measurement. -// May return Zero if no valid updates have occurred. -func (r *RTTStats) LatestRTT() time.Duration { return r.latestRTT } - -// SmoothedRTT returns the EWMA smoothed RTT for the connection. -// May return Zero if no valid updates have occurred. -func (r *RTTStats) SmoothedRTT() time.Duration { return r.smoothedRTT } - -// SmoothedOrInitialRTT returns the EWMA smoothed RTT for the connection. -// If no valid updates have occurred, it returns the initial RTT. -func (r *RTTStats) SmoothedOrInitialRTT() time.Duration { - if r.smoothedRTT != 0 { - return r.smoothedRTT - } - return defaultInitialRTT -} - -// MeanDeviation gets the mean deviation -func (r *RTTStats) MeanDeviation() time.Duration { return r.meanDeviation } - -// UpdateRTT updates the RTT based on a new sample. -func (r *RTTStats) UpdateRTT(sendDelta, ackDelay time.Duration, now time.Time) { - if sendDelta == utils.InfDuration || sendDelta <= 0 { - return - } - - // Update r.minRTT first. r.minRTT does not use an rttSample corrected for - // ackDelay but the raw observed sendDelta, since poor clock granularity at - // the client may cause a high ackDelay to result in underestimation of the - // r.minRTT. - if r.minRTT == 0 || r.minRTT > sendDelta { - r.minRTT = sendDelta - } - - // Correct for ackDelay if information received from the peer results in a - // an RTT sample at least as large as minRTT. Otherwise, only use the - // sendDelta. - sample := sendDelta - if sample-r.minRTT >= ackDelay { - sample -= ackDelay - } - r.latestRTT = sample - // First time call. - if r.smoothedRTT == 0 { - r.smoothedRTT = sample - r.meanDeviation = sample / 2 - } else { - r.meanDeviation = time.Duration(oneMinusBeta*float32(r.meanDeviation/time.Microsecond)+rttBeta*float32(utils.AbsDuration(r.smoothedRTT-sample)/time.Microsecond)) * time.Microsecond - r.smoothedRTT = time.Duration((float32(r.smoothedRTT/time.Microsecond)*oneMinusAlpha)+(float32(sample/time.Microsecond)*rttAlpha)) * time.Microsecond - } -} - -// OnConnectionMigration is called when connection migrates and rtt measurement needs to be reset. -func (r *RTTStats) OnConnectionMigration() { - r.latestRTT = 0 - r.minRTT = 0 - r.smoothedRTT = 0 - r.meanDeviation = 0 -} - -// ExpireSmoothedMetrics causes the smoothed_rtt to be increased to the latest_rtt if the latest_rtt -// is larger. The mean deviation is increased to the most recent deviation if -// it's larger. -func (r *RTTStats) ExpireSmoothedMetrics() { - r.meanDeviation = utils.MaxDuration(r.meanDeviation, utils.AbsDuration(r.smoothedRTT-r.latestRTT)) - r.smoothedRTT = utils.MaxDuration(r.smoothedRTT, r.latestRTT) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/congestion/stats.go b/external/github.com/lucas-clemente/quic-go/internal/congestion/stats.go deleted file mode 100644 index 7bb1942b21..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/congestion/stats.go +++ /dev/null @@ -1,8 +0,0 @@ -package congestion - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -type connectionStats struct { - slowstartPacketsLost protocol.PacketNumber - slowstartBytesLost protocol.ByteCount -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/crypto/AEAD.go b/external/github.com/lucas-clemente/quic-go/internal/crypto/AEAD.go deleted file mode 100644 index 5c2dfd5309..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/crypto/AEAD.go +++ /dev/null @@ -1,10 +0,0 @@ -package crypto - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -// An AEAD implements QUIC's authenticated encryption and associated data -type AEAD interface { - Open(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) ([]byte, error) - Seal(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte - Overhead() int -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/crypto/aesgcm_aead.go b/external/github.com/lucas-clemente/quic-go/internal/crypto/aesgcm_aead.go deleted file mode 100644 index 961df50d99..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/crypto/aesgcm_aead.go +++ /dev/null @@ -1,74 +0,0 @@ -package crypto - -import ( - "crypto/aes" - "crypto/cipher" - "encoding/binary" - "errors" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -type aeadAESGCM struct { - otherIV []byte - myIV []byte - encrypter cipher.AEAD - decrypter cipher.AEAD -} - -var _ AEAD = &aeadAESGCM{} - -const ivLen = 12 - -// NewAEADAESGCM creates a AEAD using AES-GCM -func NewAEADAESGCM(otherKey []byte, myKey []byte, otherIV []byte, myIV []byte) (AEAD, error) { - // the IVs need to be at least 8 bytes long, otherwise we can't compute the nonce - if len(otherIV) != ivLen || len(myIV) != ivLen { - return nil, errors.New("AES-GCM: expected 12 byte IVs") - } - - encrypterCipher, err := aes.NewCipher(myKey) - if err != nil { - return nil, err - } - encrypter, err := cipher.NewGCM(encrypterCipher) - if err != nil { - return nil, err - } - decrypterCipher, err := aes.NewCipher(otherKey) - if err != nil { - return nil, err - } - decrypter, err := cipher.NewGCM(decrypterCipher) - if err != nil { - return nil, err - } - - return &aeadAESGCM{ - otherIV: otherIV, - myIV: myIV, - encrypter: encrypter, - decrypter: decrypter, - }, nil -} - -func (aead *aeadAESGCM) Open(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) ([]byte, error) { - return aead.decrypter.Open(dst, aead.makeNonce(aead.otherIV, packetNumber), src, associatedData) -} - -func (aead *aeadAESGCM) Seal(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte { - return aead.encrypter.Seal(dst, aead.makeNonce(aead.myIV, packetNumber), src, associatedData) -} - -func (aead *aeadAESGCM) makeNonce(iv []byte, packetNumber protocol.PacketNumber) []byte { - nonce := make([]byte, ivLen) - binary.BigEndian.PutUint64(nonce[ivLen-8:], uint64(packetNumber)) - for i := 0; i < ivLen; i++ { - nonce[i] ^= iv[i] - } - return nonce -} - -func (aead *aeadAESGCM) Overhead() int { - return aead.encrypter.Overhead() -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/crypto/hkdf.go b/external/github.com/lucas-clemente/quic-go/internal/crypto/hkdf.go deleted file mode 100644 index d8fea7ddde..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/crypto/hkdf.go +++ /dev/null @@ -1,58 +0,0 @@ -package crypto - -import ( - "crypto" - "crypto/hmac" - "encoding/binary" -) - -// copied from https://v2ray.com/core/external/github.com/cloudflare/tls-tris/blob/master/hkdf.go -func hkdfExtract(hash crypto.Hash, secret, salt []byte) []byte { - if salt == nil { - salt = make([]byte, hash.Size()) - } - if secret == nil { - secret = make([]byte, hash.Size()) - } - extractor := hmac.New(hash.New, salt) - extractor.Write(secret) - return extractor.Sum(nil) -} - -// copied from https://v2ray.com/core/external/github.com/cloudflare/tls-tris/blob/master/hkdf.go -func hkdfExpand(hash crypto.Hash, prk, info []byte, l int) []byte { - var ( - expander = hmac.New(hash.New, prk) - res = make([]byte, l) - counter = byte(1) - prev []byte - ) - - if l > 255*expander.Size() { - panic("hkdf: requested too much output") - } - - p := res - for len(p) > 0 { - expander.Reset() - expander.Write(prev) - expander.Write(info) - expander.Write([]byte{counter}) - prev = expander.Sum(prev[:0]) - counter++ - n := copy(p, prev) - p = p[n:] - } - - return res -} - -// hkdfExpandLabel HKDF expands a label -func HkdfExpandLabel(hash crypto.Hash, secret []byte, label string, length int) []byte { - const prefix = "quic " - qlabel := make([]byte, 2 /* length */ +1 /* length of label */ +len(prefix)+len(label)+1 /* length of context (empty) */) - binary.BigEndian.PutUint16(qlabel[0:2], uint16(length)) - qlabel[2] = uint8(len(prefix) + len(label)) - copy(qlabel[3:], []byte(prefix+label)) - return hkdfExpand(hash, secret, qlabel, length) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/crypto/null_aead_aesgcm.go b/external/github.com/lucas-clemente/quic-go/internal/crypto/null_aead_aesgcm.go deleted file mode 100644 index 33687e3129..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/crypto/null_aead_aesgcm.go +++ /dev/null @@ -1,41 +0,0 @@ -package crypto - -import ( - "crypto" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -var quicVersion1Salt = []byte{0x9c, 0x10, 0x8f, 0x98, 0x52, 0x0a, 0x5c, 0x5c, 0x32, 0x96, 0x8e, 0x95, 0x0e, 0x8a, 0x2c, 0x5f, 0xe0, 0x6d, 0x6c, 0x38} - -// NewNullAEAD creates a NullAEAD -func NewNullAEAD(connectionID protocol.ConnectionID, pers protocol.Perspective) (AEAD, error) { - clientSecret, serverSecret := computeSecrets(connectionID) - - var mySecret, otherSecret []byte - if pers == protocol.PerspectiveClient { - mySecret = clientSecret - otherSecret = serverSecret - } else { - mySecret = serverSecret - otherSecret = clientSecret - } - - myKey, myIV := computeNullAEADKeyAndIV(mySecret) - otherKey, otherIV := computeNullAEADKeyAndIV(otherSecret) - - return NewAEADAESGCM(otherKey, myKey, otherIV, myIV) -} - -func computeSecrets(connID protocol.ConnectionID) (clientSecret, serverSecret []byte) { - initialSecret := hkdfExtract(crypto.SHA256, connID, quicVersion1Salt) - clientSecret = HkdfExpandLabel(crypto.SHA256, initialSecret, "client in", crypto.SHA256.Size()) - serverSecret = HkdfExpandLabel(crypto.SHA256, initialSecret, "server in", crypto.SHA256.Size()) - return -} - -func computeNullAEADKeyAndIV(secret []byte) (key, iv []byte) { - key = HkdfExpandLabel(crypto.SHA256, secret, "key", 16) - iv = HkdfExpandLabel(crypto.SHA256, secret, "iv", 12) - return -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/base_flow_controller.go b/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/base_flow_controller.go deleted file mode 100644 index 0091930b50..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/base_flow_controller.go +++ /dev/null @@ -1,122 +0,0 @@ -package flowcontrol - -import ( - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type baseFlowController struct { - // for sending data - bytesSent protocol.ByteCount - sendWindow protocol.ByteCount - lastBlockedAt protocol.ByteCount - - // for receiving data - mutex sync.RWMutex - bytesRead protocol.ByteCount - highestReceived protocol.ByteCount - receiveWindow protocol.ByteCount - receiveWindowSize protocol.ByteCount - maxReceiveWindowSize protocol.ByteCount - - epochStartTime time.Time - epochStartOffset protocol.ByteCount - rttStats *congestion.RTTStats - - logger utils.Logger -} - -// IsNewlyBlocked says if it is newly blocked by flow control. -// For every offset, it only returns true once. -// If it is blocked, the offset is returned. -func (c *baseFlowController) IsNewlyBlocked() (bool, protocol.ByteCount) { - if c.sendWindowSize() != 0 || c.sendWindow == c.lastBlockedAt { - return false, 0 - } - c.lastBlockedAt = c.sendWindow - return true, c.sendWindow -} - -func (c *baseFlowController) AddBytesSent(n protocol.ByteCount) { - c.bytesSent += n -} - -// UpdateSendWindow should be called after receiving a WindowUpdateFrame -// it returns true if the window was actually updated -func (c *baseFlowController) UpdateSendWindow(offset protocol.ByteCount) { - if offset > c.sendWindow { - c.sendWindow = offset - } -} - -func (c *baseFlowController) sendWindowSize() protocol.ByteCount { - // this only happens during connection establishment, when data is sent before we receive the peer's transport parameters - if c.bytesSent > c.sendWindow { - return 0 - } - return c.sendWindow - c.bytesSent -} - -func (c *baseFlowController) AddBytesRead(n protocol.ByteCount) { - c.mutex.Lock() - defer c.mutex.Unlock() - - // pretend we sent a WindowUpdate when reading the first byte - // this way auto-tuning of the window size already works for the first WindowUpdate - if c.bytesRead == 0 { - c.startNewAutoTuningEpoch() - } - c.bytesRead += n -} - -func (c *baseFlowController) hasWindowUpdate() bool { - bytesRemaining := c.receiveWindow - c.bytesRead - // update the window when more than the threshold was consumed - return bytesRemaining <= protocol.ByteCount((float64(c.receiveWindowSize) * float64((1 - protocol.WindowUpdateThreshold)))) -} - -// getWindowUpdate updates the receive window, if necessary -// it returns the new offset -func (c *baseFlowController) getWindowUpdate() protocol.ByteCount { - if !c.hasWindowUpdate() { - return 0 - } - - c.maybeAdjustWindowSize() - c.receiveWindow = c.bytesRead + c.receiveWindowSize - return c.receiveWindow -} - -// maybeAdjustWindowSize increases the receiveWindowSize if we're sending updates too often. -// For details about auto-tuning, see https://docs.google.com/document/d/1SExkMmGiz8VYzV3s9E35JQlJ73vhzCekKkDi85F1qCE/edit?usp=sharing. -func (c *baseFlowController) maybeAdjustWindowSize() { - bytesReadInEpoch := c.bytesRead - c.epochStartOffset - // don't do anything if less than half the window has been consumed - if bytesReadInEpoch <= c.receiveWindowSize/2 { - return - } - rtt := c.rttStats.SmoothedRTT() - if rtt == 0 { - return - } - - fraction := float64(bytesReadInEpoch) / float64(c.receiveWindowSize) - if time.Since(c.epochStartTime) < time.Duration(4*fraction*float64(rtt)) { - // window is consumed too fast, try to increase the window size - c.receiveWindowSize = utils.MinByteCount(2*c.receiveWindowSize, c.maxReceiveWindowSize) - } - c.startNewAutoTuningEpoch() -} - -func (c *baseFlowController) startNewAutoTuningEpoch() { - c.epochStartTime = time.Now() - c.epochStartOffset = c.bytesRead -} - -func (c *baseFlowController) checkFlowControlViolation() bool { - return c.highestReceived > c.receiveWindow -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/connection_flow_controller.go b/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/connection_flow_controller.go deleted file mode 100644 index 1dd3fb7a3b..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/connection_flow_controller.go +++ /dev/null @@ -1,87 +0,0 @@ -package flowcontrol - -import ( - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type connectionFlowController struct { - baseFlowController - - queueWindowUpdate func() -} - -var _ ConnectionFlowController = &connectionFlowController{} - -// NewConnectionFlowController gets a new flow controller for the connection -// It is created before we receive the peer's transport paramenters, thus it starts with a sendWindow of 0. -func NewConnectionFlowController( - receiveWindow protocol.ByteCount, - maxReceiveWindow protocol.ByteCount, - queueWindowUpdate func(), - rttStats *congestion.RTTStats, - logger utils.Logger, -) ConnectionFlowController { - return &connectionFlowController{ - baseFlowController: baseFlowController{ - rttStats: rttStats, - receiveWindow: receiveWindow, - receiveWindowSize: receiveWindow, - maxReceiveWindowSize: maxReceiveWindow, - logger: logger, - }, - queueWindowUpdate: queueWindowUpdate, - } -} - -func (c *connectionFlowController) SendWindowSize() protocol.ByteCount { - return c.baseFlowController.sendWindowSize() -} - -// IncrementHighestReceived adds an increment to the highestReceived value -func (c *connectionFlowController) IncrementHighestReceived(increment protocol.ByteCount) error { - c.mutex.Lock() - defer c.mutex.Unlock() - - c.highestReceived += increment - if c.checkFlowControlViolation() { - return qerr.Error(qerr.FlowControlReceivedTooMuchData, fmt.Sprintf("Received %d bytes for the connection, allowed %d bytes", c.highestReceived, c.receiveWindow)) - } - return nil -} - -func (c *connectionFlowController) MaybeQueueWindowUpdate() { - c.mutex.Lock() - hasWindowUpdate := c.hasWindowUpdate() - c.mutex.Unlock() - if hasWindowUpdate { - c.queueWindowUpdate() - } -} - -func (c *connectionFlowController) GetWindowUpdate() protocol.ByteCount { - c.mutex.Lock() - oldWindowSize := c.receiveWindowSize - offset := c.baseFlowController.getWindowUpdate() - if oldWindowSize < c.receiveWindowSize { - c.logger.Debugf("Increasing receive flow control window for the connection to %d kB", c.receiveWindowSize/(1<<10)) - } - c.mutex.Unlock() - return offset -} - -// EnsureMinimumWindowSize sets a minimum window size -// it should make sure that the connection-level window is increased when a stream-level window grows -func (c *connectionFlowController) EnsureMinimumWindowSize(inc protocol.ByteCount) { - c.mutex.Lock() - if inc > c.receiveWindowSize { - c.logger.Debugf("Increasing receive flow control window for the connection to %d kB, in response to stream flow control window increase", c.receiveWindowSize/(1<<10)) - c.receiveWindowSize = utils.MinByteCount(inc, c.maxReceiveWindowSize) - c.startNewAutoTuningEpoch() - } - c.mutex.Unlock() -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/interface.go b/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/interface.go deleted file mode 100644 index 5293e8771e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/interface.go +++ /dev/null @@ -1,38 +0,0 @@ -package flowcontrol - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -type flowController interface { - // for sending - SendWindowSize() protocol.ByteCount - UpdateSendWindow(protocol.ByteCount) - AddBytesSent(protocol.ByteCount) - // for receiving - AddBytesRead(protocol.ByteCount) - GetWindowUpdate() protocol.ByteCount // returns 0 if no update is necessary - MaybeQueueWindowUpdate() // queues a window update, if necessary - IsNewlyBlocked() (bool, protocol.ByteCount) -} - -// A StreamFlowController is a flow controller for a QUIC stream. -type StreamFlowController interface { - flowController - // for receiving - // UpdateHighestReceived should be called when a new highest offset is received - // final has to be to true if this is the final offset of the stream, as contained in a STREAM frame with FIN bit, and the RESET_STREAM frame - UpdateHighestReceived(offset protocol.ByteCount, final bool) error -} - -// The ConnectionFlowController is the flow controller for the connection. -type ConnectionFlowController interface { - flowController -} - -type connectionFlowControllerI interface { - ConnectionFlowController - // The following two methods are not supposed to be called from outside this packet, but are needed internally - // for sending - EnsureMinimumWindowSize(protocol.ByteCount) - // for receiving - IncrementHighestReceived(protocol.ByteCount) error -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/stream_flow_controller.go b/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/stream_flow_controller.go deleted file mode 100644 index 7ae61d983e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/flowcontrol/stream_flow_controller.go +++ /dev/null @@ -1,131 +0,0 @@ -package flowcontrol - -import ( - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type streamFlowController struct { - baseFlowController - - streamID protocol.StreamID - - queueWindowUpdate func() - - connection connectionFlowControllerI - - receivedFinalOffset bool -} - -var _ StreamFlowController = &streamFlowController{} - -// NewStreamFlowController gets a new flow controller for a stream -func NewStreamFlowController( - streamID protocol.StreamID, - cfc ConnectionFlowController, - receiveWindow protocol.ByteCount, - maxReceiveWindow protocol.ByteCount, - initialSendWindow protocol.ByteCount, - queueWindowUpdate func(protocol.StreamID), - rttStats *congestion.RTTStats, - logger utils.Logger, -) StreamFlowController { - return &streamFlowController{ - streamID: streamID, - connection: cfc.(connectionFlowControllerI), - queueWindowUpdate: func() { queueWindowUpdate(streamID) }, - baseFlowController: baseFlowController{ - rttStats: rttStats, - receiveWindow: receiveWindow, - receiveWindowSize: receiveWindow, - maxReceiveWindowSize: maxReceiveWindow, - sendWindow: initialSendWindow, - logger: logger, - }, - } -} - -// UpdateHighestReceived updates the highestReceived value, if the byteOffset is higher -// it returns an ErrReceivedSmallerByteOffset if the received byteOffset is smaller than any byteOffset received before -func (c *streamFlowController) UpdateHighestReceived(byteOffset protocol.ByteCount, final bool) error { - c.mutex.Lock() - defer c.mutex.Unlock() - - // when receiving a final offset, check that this final offset is consistent with a final offset we might have received earlier - if final && c.receivedFinalOffset && byteOffset != c.highestReceived { - return qerr.Error(qerr.StreamDataAfterTermination, fmt.Sprintf("Received inconsistent final offset for stream %d (old: %d, new: %d bytes)", c.streamID, c.highestReceived, byteOffset)) - } - // if we already received a final offset, check that the offset in the STREAM frames is below the final offset - if c.receivedFinalOffset && byteOffset > c.highestReceived { - return qerr.StreamDataAfterTermination - } - if final { - c.receivedFinalOffset = true - } - if byteOffset == c.highestReceived { - return nil - } - if byteOffset <= c.highestReceived { - // a STREAM_FRAME with a higher offset was received before. - if final { - // If the current byteOffset is smaller than the offset in that STREAM_FRAME, this STREAM_FRAME contained data after the end of the stream - return qerr.StreamDataAfterTermination - } - // this is a reordered STREAM_FRAME - return nil - } - - increment := byteOffset - c.highestReceived - c.highestReceived = byteOffset - if c.checkFlowControlViolation() { - return qerr.Error(qerr.FlowControlReceivedTooMuchData, fmt.Sprintf("Received %d bytes on stream %d, allowed %d bytes", byteOffset, c.streamID, c.receiveWindow)) - } - return c.connection.IncrementHighestReceived(increment) -} - -func (c *streamFlowController) AddBytesRead(n protocol.ByteCount) { - c.baseFlowController.AddBytesRead(n) - c.connection.AddBytesRead(n) -} - -func (c *streamFlowController) AddBytesSent(n protocol.ByteCount) { - c.baseFlowController.AddBytesSent(n) - c.connection.AddBytesSent(n) -} - -func (c *streamFlowController) SendWindowSize() protocol.ByteCount { - return utils.MinByteCount(c.baseFlowController.sendWindowSize(), c.connection.SendWindowSize()) -} - -func (c *streamFlowController) MaybeQueueWindowUpdate() { - c.mutex.Lock() - hasWindowUpdate := !c.receivedFinalOffset && c.hasWindowUpdate() - c.mutex.Unlock() - if hasWindowUpdate { - c.queueWindowUpdate() - } - c.connection.MaybeQueueWindowUpdate() -} - -func (c *streamFlowController) GetWindowUpdate() protocol.ByteCount { - // don't use defer for unlocking the mutex here, GetWindowUpdate() is called frequently and defer shows up in the profiler - c.mutex.Lock() - // if we already received the final offset for this stream, the peer won't need any additional flow control credit - if c.receivedFinalOffset { - c.mutex.Unlock() - return 0 - } - - oldWindowSize := c.receiveWindowSize - offset := c.baseFlowController.getWindowUpdate() - if c.receiveWindowSize > oldWindowSize { // auto-tuning enlarged the window size - c.logger.Debugf("Increasing receive flow control window for stream %d to %d kB", c.streamID, c.receiveWindowSize/(1<<10)) - c.connection.EnsureMinimumWindowSize(protocol.ByteCount(float64(c.receiveWindowSize) * protocol.ConnectionFlowControlMultiplier)) - } - c.mutex.Unlock() - return offset -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/aead.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/aead.go deleted file mode 100644 index ba8ddbd3e0..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/aead.go +++ /dev/null @@ -1,104 +0,0 @@ -package handshake - -import ( - "crypto/cipher" - "encoding/binary" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -type sealer struct { - aead cipher.AEAD - hpEncrypter cipher.Block - - // use a single slice to avoid allocations - nonceBuf []byte - hpMask []byte - - // short headers protect 5 bits in the first byte, long headers only 4 - is1RTT bool -} - -var _ Sealer = &sealer{} - -func newSealer(aead cipher.AEAD, hpEncrypter cipher.Block, is1RTT bool) Sealer { - return &sealer{ - aead: aead, - nonceBuf: make([]byte, aead.NonceSize()), - is1RTT: is1RTT, - hpEncrypter: hpEncrypter, - hpMask: make([]byte, hpEncrypter.BlockSize()), - } -} - -func (s *sealer) Seal(dst, src []byte, pn protocol.PacketNumber, ad []byte) []byte { - binary.BigEndian.PutUint64(s.nonceBuf[len(s.nonceBuf)-8:], uint64(pn)) - // The AEAD we're using here will be the qtls.aeadAESGCM13. - // It uses the nonce provided here and XOR it with the IV. - return s.aead.Seal(dst, s.nonceBuf, src, ad) -} - -func (s *sealer) EncryptHeader(sample []byte, firstByte *byte, pnBytes []byte) { - if len(sample) != s.hpEncrypter.BlockSize() { - panic("invalid sample size") - } - s.hpEncrypter.Encrypt(s.hpMask, sample) - if s.is1RTT { - *firstByte ^= s.hpMask[0] & 0x1f - } else { - *firstByte ^= s.hpMask[0] & 0xf - } - for i := range pnBytes { - pnBytes[i] ^= s.hpMask[i+1] - } -} - -func (s *sealer) Overhead() int { - return s.aead.Overhead() -} - -type opener struct { - aead cipher.AEAD - pnDecrypter cipher.Block - - // use a single slice to avoid allocations - nonceBuf []byte - hpMask []byte - - // short headers protect 5 bits in the first byte, long headers only 4 - is1RTT bool -} - -var _ Opener = &opener{} - -func newOpener(aead cipher.AEAD, pnDecrypter cipher.Block, is1RTT bool) Opener { - return &opener{ - aead: aead, - nonceBuf: make([]byte, aead.NonceSize()), - is1RTT: is1RTT, - pnDecrypter: pnDecrypter, - hpMask: make([]byte, pnDecrypter.BlockSize()), - } -} - -func (o *opener) Open(dst, src []byte, pn protocol.PacketNumber, ad []byte) ([]byte, error) { - binary.BigEndian.PutUint64(o.nonceBuf[len(o.nonceBuf)-8:], uint64(pn)) - // The AEAD we're using here will be the qtls.aeadAESGCM13. - // It uses the nonce provided here and XOR it with the IV. - return o.aead.Open(dst, o.nonceBuf, src, ad) -} - -func (o *opener) DecryptHeader(sample []byte, firstByte *byte, pnBytes []byte) { - if len(sample) != o.pnDecrypter.BlockSize() { - panic("invalid sample size") - } - o.pnDecrypter.Encrypt(o.hpMask, sample) - if o.is1RTT { - *firstByte ^= o.hpMask[0] & 0x1f - } else { - *firstByte ^= o.hpMask[0] & 0xf - } - for i := range pnBytes { - pnBytes[i] ^= o.hpMask[i+1] - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_generator.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_generator.go deleted file mode 100644 index ae77f35687..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_generator.go +++ /dev/null @@ -1,109 +0,0 @@ -package handshake - -import ( - "encoding/asn1" - "fmt" - "net" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -const ( - cookiePrefixIP byte = iota - cookiePrefixString -) - -// A Cookie is derived from the client address and can be used to verify the ownership of this address. -type Cookie struct { - RemoteAddr string - OriginalDestConnectionID protocol.ConnectionID - // The time that the Cookie was issued (resolution 1 second) - SentTime time.Time -} - -// token is the struct that is used for ASN1 serialization and deserialization -type token struct { - RemoteAddr []byte - OriginalDestConnectionID []byte - - Timestamp int64 -} - -// A CookieGenerator generates Cookies -type CookieGenerator struct { - cookieProtector cookieProtector -} - -// NewCookieGenerator initializes a new CookieGenerator -func NewCookieGenerator() (*CookieGenerator, error) { - cookieProtector, err := newCookieProtector() - if err != nil { - return nil, err - } - return &CookieGenerator{ - cookieProtector: cookieProtector, - }, nil -} - -// NewToken generates a new Cookie for a given source address -func (g *CookieGenerator) NewToken(raddr net.Addr, origConnID protocol.ConnectionID) ([]byte, error) { - data, err := asn1.Marshal(token{ - RemoteAddr: encodeRemoteAddr(raddr), - OriginalDestConnectionID: origConnID, - Timestamp: time.Now().Unix(), - }) - if err != nil { - return nil, err - } - return g.cookieProtector.NewToken(data) -} - -// DecodeToken decodes a Cookie -func (g *CookieGenerator) DecodeToken(encrypted []byte) (*Cookie, error) { - // if the client didn't send any Cookie, DecodeToken will be called with a nil-slice - if len(encrypted) == 0 { - return nil, nil - } - - data, err := g.cookieProtector.DecodeToken(encrypted) - if err != nil { - return nil, err - } - t := &token{} - rest, err := asn1.Unmarshal(data, t) - if err != nil { - return nil, err - } - if len(rest) != 0 { - return nil, fmt.Errorf("rest when unpacking token: %d", len(rest)) - } - cookie := &Cookie{ - RemoteAddr: decodeRemoteAddr(t.RemoteAddr), - SentTime: time.Unix(t.Timestamp, 0), - } - if len(t.OriginalDestConnectionID) > 0 { - cookie.OriginalDestConnectionID = protocol.ConnectionID(t.OriginalDestConnectionID) - } - return cookie, nil -} - -// encodeRemoteAddr encodes a remote address such that it can be saved in the Cookie -func encodeRemoteAddr(remoteAddr net.Addr) []byte { - if udpAddr, ok := remoteAddr.(*net.UDPAddr); ok { - return append([]byte{cookiePrefixIP}, udpAddr.IP...) - } - return append([]byte{cookiePrefixString}, []byte(remoteAddr.String())...) -} - -// decodeRemoteAddr decodes the remote address saved in the Cookie -func decodeRemoteAddr(data []byte) string { - // data will never be empty for a Cookie that we generated. Check it to be on the safe side - if len(data) == 0 { - return "" - } - if data[0] == cookiePrefixIP { - return net.IP(data[1:]).String() - } - return string(data[1:]) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_protector.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_protector.go deleted file mode 100644 index 7ebdfa18cc..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/cookie_protector.go +++ /dev/null @@ -1,86 +0,0 @@ -package handshake - -import ( - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "crypto/sha256" - "fmt" - "io" - - "golang.org/x/crypto/hkdf" -) - -// CookieProtector is used to create and verify a cookie -type cookieProtector interface { - // NewToken creates a new token - NewToken([]byte) ([]byte, error) - // DecodeToken decodes a token - DecodeToken([]byte) ([]byte, error) -} - -const ( - cookieSecretSize = 32 - cookieNonceSize = 32 -) - -// cookieProtector is used to create and verify a cookie -type cookieProtectorImpl struct { - secret []byte -} - -// newCookieProtector creates a source for source address tokens -func newCookieProtector() (cookieProtector, error) { - secret := make([]byte, cookieSecretSize) - if _, err := rand.Read(secret); err != nil { - return nil, err - } - return &cookieProtectorImpl{secret: secret}, nil -} - -// NewToken encodes data into a new token. -func (s *cookieProtectorImpl) NewToken(data []byte) ([]byte, error) { - nonce := make([]byte, cookieNonceSize) - if _, err := rand.Read(nonce); err != nil { - return nil, err - } - aead, aeadNonce, err := s.createAEAD(nonce) - if err != nil { - return nil, err - } - return append(nonce, aead.Seal(nil, aeadNonce, data, nil)...), nil -} - -// DecodeToken decodes a token. -func (s *cookieProtectorImpl) DecodeToken(p []byte) ([]byte, error) { - if len(p) < cookieNonceSize { - return nil, fmt.Errorf("Token too short: %d", len(p)) - } - nonce := p[:cookieNonceSize] - aead, aeadNonce, err := s.createAEAD(nonce) - if err != nil { - return nil, err - } - return aead.Open(nil, aeadNonce, p[cookieNonceSize:], nil) -} - -func (s *cookieProtectorImpl) createAEAD(nonce []byte) (cipher.AEAD, []byte, error) { - h := hkdf.New(sha256.New, s.secret, nonce, []byte("quic-go cookie source")) - key := make([]byte, 32) // use a 32 byte key, in order to select AES-256 - if _, err := io.ReadFull(h, key); err != nil { - return nil, nil, err - } - aeadNonce := make([]byte, 12) - if _, err := io.ReadFull(h, aeadNonce); err != nil { - return nil, nil, err - } - c, err := aes.NewCipher(key) - if err != nil { - return nil, nil, err - } - aead, err := cipher.NewGCM(c) - if err != nil { - return nil, nil, err - } - return aead, aeadNonce, nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/crypto_setup.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/crypto_setup.go deleted file mode 100644 index bd0ef776a8..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/crypto_setup.go +++ /dev/null @@ -1,537 +0,0 @@ -package handshake - -import ( - "crypto/aes" - "crypto/tls" - "errors" - "fmt" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -type messageType uint8 - -// TLS handshake message types. -const ( - typeClientHello messageType = 1 - typeServerHello messageType = 2 - typeEncryptedExtensions messageType = 8 - typeCertificate messageType = 11 - typeCertificateRequest messageType = 13 - typeCertificateVerify messageType = 15 - typeFinished messageType = 20 -) - -func (m messageType) String() string { - switch m { - case typeClientHello: - return "ClientHello" - case typeServerHello: - return "ServerHello" - case typeEncryptedExtensions: - return "EncryptedExtensions" - case typeCertificate: - return "Certificate" - case typeCertificateRequest: - return "CertificateRequest" - case typeCertificateVerify: - return "CertificateVerify" - case typeFinished: - return "Finished" - default: - return fmt.Sprintf("unknown message type: %d", m) - } -} - -// ErrOpenerNotYetAvailable is returned when an opener is requested for an encryption level, -// but the corresponding opener has not yet been initialized -// This can happen when packets arrive out of order. -var ErrOpenerNotYetAvailable = errors.New("CryptoSetup: opener at this encryption level not yet available") - -type cryptoSetup struct { - tlsConf *qtls.Config - conn *qtls.Conn - - messageChan chan []byte - - readEncLevel protocol.EncryptionLevel - writeEncLevel protocol.EncryptionLevel - - handleParamsCallback func(*TransportParameters) - - // There are two ways that an error can occur during the handshake: - // 1. as a return value from qtls.Handshake() - // 2. when new data is passed to the crypto setup via HandleData() - // handshakeErrChan is closed when qtls.Handshake() errors - handshakeErrChan chan struct{} - // HandleData() sends errors on the messageErrChan - messageErrChan chan error - // handshakeDone is closed as soon as the go routine running qtls.Handshake() returns - handshakeDone chan struct{} - // transport parameters are sent on the receivedTransportParams, as soon as they are received - receivedTransportParams <-chan TransportParameters - // is closed when Close() is called - closeChan chan struct{} - - clientHelloWritten bool - clientHelloWrittenChan chan struct{} - - initialStream io.Writer - initialOpener Opener - initialSealer Sealer - - handshakeStream io.Writer - handshakeOpener Opener - handshakeSealer Sealer - - opener Opener - sealer Sealer - // TODO: add a 1-RTT stream (used for session tickets) - - receivedWriteKey chan struct{} - receivedReadKey chan struct{} - - logger utils.Logger - - perspective protocol.Perspective -} - -var _ qtls.RecordLayer = &cryptoSetup{} -var _ CryptoSetup = &cryptoSetup{} - -// NewCryptoSetupClient creates a new crypto setup for the client -func NewCryptoSetupClient( - initialStream io.Writer, - handshakeStream io.Writer, - origConnID protocol.ConnectionID, - connID protocol.ConnectionID, - params *TransportParameters, - handleParams func(*TransportParameters), - tlsConf *tls.Config, - initialVersion protocol.VersionNumber, - supportedVersions []protocol.VersionNumber, - currentVersion protocol.VersionNumber, - logger utils.Logger, - perspective protocol.Perspective, -) (CryptoSetup, <-chan struct{} /* ClientHello written */, error) { - extHandler, receivedTransportParams := newExtensionHandlerClient( - params, - origConnID, - initialVersion, - supportedVersions, - currentVersion, - logger, - ) - cs, clientHelloWritten, err := newCryptoSetup( - initialStream, - handshakeStream, - connID, - extHandler, - receivedTransportParams, - handleParams, - tlsConf, - logger, - perspective, - ) - if err != nil { - return nil, nil, err - } - cs.conn = qtls.Client(nil, cs.tlsConf) - return cs, clientHelloWritten, nil -} - -// NewCryptoSetupServer creates a new crypto setup for the server -func NewCryptoSetupServer( - initialStream io.Writer, - handshakeStream io.Writer, - connID protocol.ConnectionID, - params *TransportParameters, - handleParams func(*TransportParameters), - tlsConf *tls.Config, - supportedVersions []protocol.VersionNumber, - currentVersion protocol.VersionNumber, - logger utils.Logger, - perspective protocol.Perspective, -) (CryptoSetup, error) { - extHandler, receivedTransportParams := newExtensionHandlerServer( - params, - supportedVersions, - currentVersion, - logger, - ) - cs, _, err := newCryptoSetup( - initialStream, - handshakeStream, - connID, - extHandler, - receivedTransportParams, - handleParams, - tlsConf, - logger, - perspective, - ) - if err != nil { - return nil, err - } - cs.conn = qtls.Server(nil, cs.tlsConf) - return cs, nil -} - -func newCryptoSetup( - initialStream io.Writer, - handshakeStream io.Writer, - connID protocol.ConnectionID, - extHandler tlsExtensionHandler, - transportParamChan <-chan TransportParameters, - handleParams func(*TransportParameters), - tlsConf *tls.Config, - logger utils.Logger, - perspective protocol.Perspective, -) (*cryptoSetup, <-chan struct{} /* ClientHello written */, error) { - initialSealer, initialOpener, err := NewInitialAEAD(connID, perspective) - if err != nil { - return nil, nil, err - } - cs := &cryptoSetup{ - initialStream: initialStream, - initialSealer: initialSealer, - initialOpener: initialOpener, - handshakeStream: handshakeStream, - readEncLevel: protocol.EncryptionInitial, - writeEncLevel: protocol.EncryptionInitial, - handleParamsCallback: handleParams, - receivedTransportParams: transportParamChan, - logger: logger, - perspective: perspective, - handshakeDone: make(chan struct{}), - handshakeErrChan: make(chan struct{}), - messageErrChan: make(chan error, 1), - clientHelloWrittenChan: make(chan struct{}), - messageChan: make(chan []byte, 100), - receivedReadKey: make(chan struct{}), - receivedWriteKey: make(chan struct{}), - closeChan: make(chan struct{}), - } - qtlsConf := tlsConfigToQtlsConfig(tlsConf) - qtlsConf.AlternativeRecordLayer = cs - qtlsConf.GetExtensions = extHandler.GetExtensions - qtlsConf.ReceivedExtensions = extHandler.ReceivedExtensions - cs.tlsConf = qtlsConf - return cs, cs.clientHelloWrittenChan, nil -} - -func (h *cryptoSetup) RunHandshake() error { - // Handle errors that might occur when HandleData() is called. - handshakeErrChan := make(chan error, 1) - handshakeComplete := make(chan struct{}) - go func() { - defer close(h.handshakeDone) - if err := h.conn.Handshake(); err != nil { - handshakeErrChan <- err - return - } - close(handshakeComplete) - }() - - select { - case <-h.closeChan: - close(h.messageChan) - // wait until the Handshake() go routine has returned - <-handshakeErrChan - return errors.New("Handshake aborted") - case <-handshakeComplete: // return when the handshake is done - return nil - case err := <-handshakeErrChan: - // if handleMessageFor{server,client} are waiting for some qtls action, make them return - close(h.handshakeErrChan) - return err - case err := <-h.messageErrChan: - // If the handshake errored because of an error that occurred during HandleData(), - // that error message will be more useful than the error message generated by Handshake(). - // Close the message chan that qtls is receiving messages from. - // This will make qtls.Handshake() return. - // Thereby the go routine running qtls.Handshake() will return. - close(h.messageChan) - return err - } -} - -func (h *cryptoSetup) Close() error { - close(h.closeChan) - // wait until qtls.Handshake() actually returned - <-h.handshakeDone - return nil -} - -// handleMessage handles a TLS handshake message. -// It is called by the crypto streams when a new message is available. -// It returns if it is done with messages on the same encryption level. -func (h *cryptoSetup) HandleMessage(data []byte, encLevel protocol.EncryptionLevel) bool /* stream finished */ { - msgType := messageType(data[0]) - h.logger.Debugf("Received %s message (%d bytes, encryption level: %s)", msgType, len(data), encLevel) - if err := h.checkEncryptionLevel(msgType, encLevel); err != nil { - h.messageErrChan <- err - return false - } - h.messageChan <- data - switch h.perspective { - case protocol.PerspectiveClient: - return h.handleMessageForClient(msgType) - case protocol.PerspectiveServer: - return h.handleMessageForServer(msgType) - default: - panic("") - } -} - -func (h *cryptoSetup) checkEncryptionLevel(msgType messageType, encLevel protocol.EncryptionLevel) error { - var expected protocol.EncryptionLevel - switch msgType { - case typeClientHello, - typeServerHello: - expected = protocol.EncryptionInitial - case typeEncryptedExtensions, - typeCertificate, - typeCertificateRequest, - typeCertificateVerify, - typeFinished: - expected = protocol.EncryptionHandshake - default: - return fmt.Errorf("unexpected handshake message: %d", msgType) - } - if encLevel != expected { - return fmt.Errorf("expected handshake message %s to have encryption level %s, has %s", msgType, expected, encLevel) - } - return nil -} - -func (h *cryptoSetup) handleMessageForServer(msgType messageType) bool { - switch msgType { - case typeClientHello: - select { - case params := <-h.receivedTransportParams: - h.handleParamsCallback(¶ms) - case <-h.handshakeErrChan: - return false - } - // get the handshake write key - select { - case <-h.receivedWriteKey: - case <-h.handshakeErrChan: - return false - } - // get the 1-RTT write key - select { - case <-h.receivedWriteKey: - case <-h.handshakeErrChan: - return false - } - // get the handshake read key - select { - case <-h.receivedReadKey: - case <-h.handshakeErrChan: - return false - } - return true - case typeCertificate, typeCertificateVerify: - // nothing to do - return false - case typeFinished: - // get the 1-RTT read key - select { - case <-h.receivedReadKey: - case <-h.handshakeErrChan: - return false - } - return true - default: - panic("unexpected handshake message") - } -} - -func (h *cryptoSetup) handleMessageForClient(msgType messageType) bool { - switch msgType { - case typeServerHello: - // get the handshake read key - select { - case <-h.receivedReadKey: - case <-h.handshakeErrChan: - return false - } - // get the handshake write key - select { - case <-h.receivedWriteKey: - case <-h.handshakeErrChan: - return false - } - return true - case typeEncryptedExtensions: - select { - case params := <-h.receivedTransportParams: - h.handleParamsCallback(¶ms) - case <-h.handshakeErrChan: - return false - } - return false - case typeCertificateRequest, typeCertificate, typeCertificateVerify: - // nothing to do - return false - case typeFinished: - // While the order of these two is not defined by the TLS spec, - // we have to do it on the same order as our TLS library does it. - // get the handshake write key - select { - case <-h.receivedWriteKey: - case <-h.handshakeErrChan: - return false - } - // get the 1-RTT read key - select { - case <-h.receivedReadKey: - case <-h.handshakeErrChan: - return false - } - return true - default: - panic("unexpected handshake message: ") - } -} - -// ReadHandshakeMessage is called by TLS. -// It blocks until a new handshake message is available. -func (h *cryptoSetup) ReadHandshakeMessage() ([]byte, error) { - // TODO: add some error handling here (when the session is closed) - msg, ok := <-h.messageChan - if !ok { - return nil, errors.New("error while handling the handshake message") - } - return msg, nil -} - -func (h *cryptoSetup) SetReadKey(suite *qtls.CipherSuite, trafficSecret []byte) { - key := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic key", suite.KeyLen()) - iv := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic iv", suite.IVLen()) - hpKey := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic hp", suite.KeyLen()) - hpDecrypter, err := aes.NewCipher(hpKey) - if err != nil { - panic(fmt.Sprintf("error creating new AES cipher: %s", err)) - } - - switch h.readEncLevel { - case protocol.EncryptionInitial: - h.readEncLevel = protocol.EncryptionHandshake - h.handshakeOpener = newOpener(suite.AEAD(key, iv), hpDecrypter, false) - h.logger.Debugf("Installed Handshake Read keys") - case protocol.EncryptionHandshake: - h.readEncLevel = protocol.Encryption1RTT - h.opener = newOpener(suite.AEAD(key, iv), hpDecrypter, true) - h.logger.Debugf("Installed 1-RTT Read keys") - default: - panic("unexpected read encryption level") - } - h.receivedReadKey <- struct{}{} -} - -func (h *cryptoSetup) SetWriteKey(suite *qtls.CipherSuite, trafficSecret []byte) { - key := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic key", suite.KeyLen()) - iv := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic iv", suite.IVLen()) - hpKey := qtls.HkdfExpandLabel(suite.Hash(), trafficSecret, []byte{}, "quic hp", suite.KeyLen()) - hpEncrypter, err := aes.NewCipher(hpKey) - if err != nil { - panic(fmt.Sprintf("error creating new AES cipher: %s", err)) - } - - switch h.writeEncLevel { - case protocol.EncryptionInitial: - h.writeEncLevel = protocol.EncryptionHandshake - h.handshakeSealer = newSealer(suite.AEAD(key, iv), hpEncrypter, false) - h.logger.Debugf("Installed Handshake Write keys") - case protocol.EncryptionHandshake: - h.writeEncLevel = protocol.Encryption1RTT - h.sealer = newSealer(suite.AEAD(key, iv), hpEncrypter, true) - h.logger.Debugf("Installed 1-RTT Write keys") - default: - panic("unexpected write encryption level") - } - h.receivedWriteKey <- struct{}{} -} - -// WriteRecord is called when TLS writes data -func (h *cryptoSetup) WriteRecord(p []byte) (int, error) { - switch h.writeEncLevel { - case protocol.EncryptionInitial: - // assume that the first WriteRecord call contains the ClientHello - n, err := h.initialStream.Write(p) - if !h.clientHelloWritten && h.perspective == protocol.PerspectiveClient { - h.clientHelloWritten = true - close(h.clientHelloWrittenChan) - } - return n, err - case protocol.EncryptionHandshake: - return h.handshakeStream.Write(p) - default: - return 0, fmt.Errorf("unexpected write encryption level: %s", h.writeEncLevel) - } -} - -func (h *cryptoSetup) GetSealer() (protocol.EncryptionLevel, Sealer) { - if h.sealer != nil { - return protocol.Encryption1RTT, h.sealer - } - if h.handshakeSealer != nil { - return protocol.EncryptionHandshake, h.handshakeSealer - } - return protocol.EncryptionInitial, h.initialSealer -} - -func (h *cryptoSetup) GetSealerWithEncryptionLevel(level protocol.EncryptionLevel) (Sealer, error) { - errNoSealer := fmt.Errorf("CryptoSetup: no sealer with encryption level %s", level.String()) - - switch level { - case protocol.EncryptionInitial: - return h.initialSealer, nil - case protocol.EncryptionHandshake: - if h.handshakeSealer == nil { - return nil, errNoSealer - } - return h.handshakeSealer, nil - case protocol.Encryption1RTT: - if h.sealer == nil { - return nil, errNoSealer - } - return h.sealer, nil - default: - return nil, errNoSealer - } -} - -func (h *cryptoSetup) GetOpener(level protocol.EncryptionLevel) (Opener, error) { - switch level { - case protocol.EncryptionInitial: - return h.initialOpener, nil - case protocol.EncryptionHandshake: - if h.handshakeOpener == nil { - return nil, ErrOpenerNotYetAvailable - } - return h.handshakeOpener, nil - case protocol.Encryption1RTT: - if h.opener == nil { - return nil, ErrOpenerNotYetAvailable - } - return h.opener, nil - default: - return nil, fmt.Errorf("CryptoSetup: no opener with encryption level %s", level) - } -} - -func (h *cryptoSetup) ConnectionState() ConnectionState { - connState := h.conn.ConnectionState() - return ConnectionState{ - HandshakeComplete: connState.HandshakeComplete, - ServerName: connState.ServerName, - PeerCertificates: connState.PeerCertificates, - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/initial_aead.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/initial_aead.go deleted file mode 100644 index 92cce873c2..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/initial_aead.go +++ /dev/null @@ -1,52 +0,0 @@ -package handshake - -import ( - "crypto" - "crypto/aes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -var quicVersion1Salt = []byte{0xef, 0x4f, 0xb0, 0xab, 0xb4, 0x74, 0x70, 0xc4, 0x1b, 0xef, 0xcf, 0x80, 0x31, 0x33, 0x4f, 0xae, 0x48, 0x5e, 0x09, 0xa0} - -// NewInitialAEAD creates a new AEAD for Initial encryption / decryption. -func NewInitialAEAD(connID protocol.ConnectionID, pers protocol.Perspective) (Sealer, Opener, error) { - clientSecret, serverSecret := computeSecrets(connID) - var mySecret, otherSecret []byte - if pers == protocol.PerspectiveClient { - mySecret = clientSecret - otherSecret = serverSecret - } else { - mySecret = serverSecret - otherSecret = clientSecret - } - myKey, myHPKey, myIV := computeInitialKeyAndIV(mySecret) - otherKey, otherHPKey, otherIV := computeInitialKeyAndIV(otherSecret) - - encrypter := qtls.AEADAESGCM13(myKey, myIV) - hpEncrypter, err := aes.NewCipher(myHPKey) - if err != nil { - return nil, nil, err - } - decrypter := qtls.AEADAESGCM13(otherKey, otherIV) - hpDecrypter, err := aes.NewCipher(otherHPKey) - if err != nil { - return nil, nil, err - } - return newSealer(encrypter, hpEncrypter, false), newOpener(decrypter, hpDecrypter, false), nil -} - -func computeSecrets(connID protocol.ConnectionID) (clientSecret, serverSecret []byte) { - initialSecret := qtls.HkdfExtract(crypto.SHA256, connID, quicVersion1Salt) - clientSecret = qtls.HkdfExpandLabel(crypto.SHA256, initialSecret, []byte{}, "client in", crypto.SHA256.Size()) - serverSecret = qtls.HkdfExpandLabel(crypto.SHA256, initialSecret, []byte{}, "server in", crypto.SHA256.Size()) - return -} - -func computeInitialKeyAndIV(secret []byte) (key, hpKey, iv []byte) { - key = qtls.HkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic key", 16) - hpKey = qtls.HkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic hp", 16) - iv = qtls.HkdfExpandLabel(crypto.SHA256, secret, []byte{}, "quic iv", 12) - return -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/interface.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/interface.go deleted file mode 100644 index 3f6a6f8a01..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/interface.go +++ /dev/null @@ -1,49 +0,0 @@ -package handshake - -import ( - "crypto/x509" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -// Opener opens a packet -type Opener interface { - Open(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) ([]byte, error) - DecryptHeader(sample []byte, firstByte *byte, pnBytes []byte) -} - -// Sealer seals a packet -type Sealer interface { - Seal(dst, src []byte, packetNumber protocol.PacketNumber, associatedData []byte) []byte - EncryptHeader(sample []byte, firstByte *byte, pnBytes []byte) - Overhead() int -} - -// A tlsExtensionHandler sends and received the QUIC TLS extension. -type tlsExtensionHandler interface { - GetExtensions(msgType uint8) []qtls.Extension - ReceivedExtensions(msgType uint8, exts []qtls.Extension) error -} - -// CryptoSetup handles the handshake and protecting / unprotecting packets -type CryptoSetup interface { - RunHandshake() error - io.Closer - - HandleMessage([]byte, protocol.EncryptionLevel) bool - ConnectionState() ConnectionState - - GetSealer() (protocol.EncryptionLevel, Sealer) - GetSealerWithEncryptionLevel(protocol.EncryptionLevel) (Sealer, error) - GetOpener(protocol.EncryptionLevel) (Opener, error) -} - -// ConnectionState records basic details about the QUIC connection. -// Warning: This API should not be considered stable and might change soon. -type ConnectionState struct { - HandshakeComplete bool // handshake is complete - ServerName string // server name requested by client, if any (server side only) - PeerCertificates []*x509.Certificate // certificate chain presented by remote peer -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/qtls.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/qtls.go deleted file mode 100644 index 23543b5c05..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/qtls.go +++ /dev/null @@ -1,50 +0,0 @@ -package handshake - -import ( - "crypto/tls" - - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -func tlsConfigToQtlsConfig(c *tls.Config) *qtls.Config { - if c == nil { - c = &tls.Config{} - } - // QUIC requires TLS 1.3 or newer - minVersion := c.MinVersion - if minVersion < qtls.VersionTLS13 { - minVersion = qtls.VersionTLS13 - } - maxVersion := c.MaxVersion - if maxVersion < qtls.VersionTLS13 { - maxVersion = qtls.VersionTLS13 - } - return &qtls.Config{ - Rand: c.Rand, - Time: c.Time, - Certificates: c.Certificates, - NameToCertificate: c.NameToCertificate, - // TODO: make GetCertificate work - // GetCertificate: c.GetCertificate, - GetClientCertificate: c.GetClientCertificate, - // TODO: make GetConfigForClient work - // GetConfigForClient: c.GetConfigForClient, - VerifyPeerCertificate: c.VerifyPeerCertificate, - RootCAs: c.RootCAs, - NextProtos: c.NextProtos, - ServerName: c.ServerName, - ClientAuth: c.ClientAuth, - ClientCAs: c.ClientCAs, - InsecureSkipVerify: c.InsecureSkipVerify, - CipherSuites: c.CipherSuites, - PreferServerCipherSuites: c.PreferServerCipherSuites, - SessionTicketsDisabled: c.SessionTicketsDisabled, - SessionTicketKey: c.SessionTicketKey, - MinVersion: minVersion, - MaxVersion: maxVersion, - CurvePreferences: c.CurvePreferences, - DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, - Renegotiation: c.Renegotiation, - KeyLogWriter: c.KeyLogWriter, - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension.go deleted file mode 100644 index 894ad7e4db..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension.go +++ /dev/null @@ -1,90 +0,0 @@ -package handshake - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -const quicTLSExtensionType = 0xffa5 - -type clientHelloTransportParameters struct { - InitialVersion protocol.VersionNumber - Parameters TransportParameters -} - -func (p *clientHelloTransportParameters) Marshal() []byte { - const lenOffset = 4 - b := &bytes.Buffer{} - utils.BigEndian.WriteUint32(b, uint32(p.InitialVersion)) - b.Write([]byte{0, 0}) // length. Will be replaced later - p.Parameters.marshal(b) - data := b.Bytes() - binary.BigEndian.PutUint16(data[lenOffset:lenOffset+2], uint16(len(data)-lenOffset-2)) - return data -} - -func (p *clientHelloTransportParameters) Unmarshal(data []byte) error { - if len(data) < 6 { - return errors.New("transport parameter data too short") - } - p.InitialVersion = protocol.VersionNumber(binary.BigEndian.Uint32(data[:4])) - paramsLen := int(binary.BigEndian.Uint16(data[4:6])) - data = data[6:] - if len(data) != paramsLen { - return fmt.Errorf("expected transport parameters to be %d bytes long, have %d", paramsLen, len(data)) - } - return p.Parameters.unmarshal(data, protocol.PerspectiveClient) -} - -type encryptedExtensionsTransportParameters struct { - NegotiatedVersion protocol.VersionNumber - SupportedVersions []protocol.VersionNumber - Parameters TransportParameters -} - -func (p *encryptedExtensionsTransportParameters) Marshal() []byte { - b := &bytes.Buffer{} - utils.BigEndian.WriteUint32(b, uint32(p.NegotiatedVersion)) - b.WriteByte(uint8(4 * len(p.SupportedVersions))) - for _, v := range p.SupportedVersions { - utils.BigEndian.WriteUint32(b, uint32(v)) - } - lenOffset := b.Len() - b.Write([]byte{0, 0}) // length. Will be replaced later - p.Parameters.marshal(b) - data := b.Bytes() - binary.BigEndian.PutUint16(data[lenOffset:lenOffset+2], uint16(len(data)-lenOffset-2)) - return data -} - -func (p *encryptedExtensionsTransportParameters) Unmarshal(data []byte) error { - if len(data) < 5 { - return errors.New("transport parameter data too short") - } - p.NegotiatedVersion = protocol.VersionNumber(binary.BigEndian.Uint32(data[:4])) - numVersions := int(data[4]) - if numVersions%4 != 0 { - return fmt.Errorf("invalid length for version list: %d", numVersions) - } - numVersions /= 4 - data = data[5:] - if len(data) < 4*numVersions+2 /*length field for the parameter list */ { - return errors.New("transport parameter data too short") - } - p.SupportedVersions = make([]protocol.VersionNumber, numVersions) - for i := 0; i < numVersions; i++ { - p.SupportedVersions[i] = protocol.VersionNumber(binary.BigEndian.Uint32(data[:4])) - data = data[4:] - } - paramsLen := int(binary.BigEndian.Uint16(data[:2])) - data = data[2:] - if len(data) != paramsLen { - return fmt.Errorf("expected transport parameters to be %d bytes long, have %d", paramsLen, len(data)) - } - return p.Parameters.unmarshal(data, protocol.PerspectiveServer) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_client.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_client.go deleted file mode 100644 index 8a68695941..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_client.go +++ /dev/null @@ -1,113 +0,0 @@ -package handshake - -import ( - "errors" - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -type extensionHandlerClient struct { - ourParams *TransportParameters - paramsChan chan<- TransportParameters - - origConnID protocol.ConnectionID - initialVersion protocol.VersionNumber - supportedVersions []protocol.VersionNumber - version protocol.VersionNumber - - logger utils.Logger -} - -var _ tlsExtensionHandler = &extensionHandlerClient{} - -// newExtensionHandlerClient creates a new extension handler for the client. -func newExtensionHandlerClient( - params *TransportParameters, - origConnID protocol.ConnectionID, - initialVersion protocol.VersionNumber, - supportedVersions []protocol.VersionNumber, - version protocol.VersionNumber, - logger utils.Logger, -) (tlsExtensionHandler, <-chan TransportParameters) { - // The client reads the transport parameters from the Encrypted Extensions message. - // The paramsChan is used in the session's run loop's select statement. - // We have to use an unbuffered channel here to make sure that the session actually processes the transport parameters immediately. - paramsChan := make(chan TransportParameters) - return &extensionHandlerClient{ - ourParams: params, - paramsChan: paramsChan, - origConnID: origConnID, - initialVersion: initialVersion, - supportedVersions: supportedVersions, - version: version, - logger: logger, - }, paramsChan -} - -func (h *extensionHandlerClient) GetExtensions(msgType uint8) []qtls.Extension { - if messageType(msgType) != typeClientHello { - return nil - } - h.logger.Debugf("Sending Transport Parameters: %s", h.ourParams) - return []qtls.Extension{{ - Type: quicTLSExtensionType, - Data: (&clientHelloTransportParameters{ - InitialVersion: h.initialVersion, - Parameters: *h.ourParams, - }).Marshal(), - }} -} - -func (h *extensionHandlerClient) ReceivedExtensions(msgType uint8, exts []qtls.Extension) error { - if messageType(msgType) != typeEncryptedExtensions { - return nil - } - - var found bool - eetp := &encryptedExtensionsTransportParameters{} - for _, ext := range exts { - if ext.Type != quicTLSExtensionType { - continue - } - if err := eetp.Unmarshal(ext.Data); err != nil { - return err - } - found = true - } - if !found { - return errors.New("EncryptedExtensions message didn't contain a QUIC extension") - } - - // check that the negotiated_version is the current version - if eetp.NegotiatedVersion != h.version { - return qerr.Error(qerr.VersionNegotiationMismatch, "current version doesn't match negotiated_version") - } - // check that the current version is included in the supported versions - if !protocol.IsSupportedVersion(eetp.SupportedVersions, h.version) { - return qerr.Error(qerr.VersionNegotiationMismatch, "current version not included in the supported versions") - } - // if version negotiation was performed, check that we would have selected the current version based on the supported versions sent by the server - if h.version != h.initialVersion { - negotiatedVersion, ok := protocol.ChooseSupportedVersion(h.supportedVersions, eetp.SupportedVersions) - if !ok || h.version != negotiatedVersion { - return qerr.Error(qerr.VersionNegotiationMismatch, "would have picked a different version") - } - } - - params := eetp.Parameters - // check that the server sent a stateless reset token - if len(params.StatelessResetToken) == 0 { - return errors.New("server didn't sent stateless_reset_token") - } - // check the Retry token - if !h.origConnID.Equal(params.OriginalConnectionID) { - return fmt.Errorf("expected original_connection_id to equal %s, is %s", h.origConnID, params.OriginalConnectionID) - } - h.logger.Debugf("Received Transport Parameters: %s", ¶ms) - h.paramsChan <- params - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_server.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_server.go deleted file mode 100644 index 7159a2ff81..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/tls_extension_handler_server.go +++ /dev/null @@ -1,86 +0,0 @@ -package handshake - -import ( - "errors" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/marten-seemann/qtls" -) - -type extensionHandlerServer struct { - ourParams *TransportParameters - paramsChan chan<- TransportParameters - - version protocol.VersionNumber - supportedVersions []protocol.VersionNumber - - logger utils.Logger -} - -var _ tlsExtensionHandler = &extensionHandlerServer{} - -// newExtensionHandlerServer creates a new extension handler for the server -func newExtensionHandlerServer( - params *TransportParameters, - supportedVersions []protocol.VersionNumber, - version protocol.VersionNumber, - logger utils.Logger, -) (tlsExtensionHandler, <-chan TransportParameters) { - // Processing the ClientHello is performed statelessly (and from a single go-routine). - // Therefore, we have to use a buffered chan to pass the transport parameters to that go routine. - paramsChan := make(chan TransportParameters) - return &extensionHandlerServer{ - ourParams: params, - paramsChan: paramsChan, - supportedVersions: supportedVersions, - version: version, - logger: logger, - }, paramsChan -} - -func (h *extensionHandlerServer) GetExtensions(msgType uint8) []qtls.Extension { - if messageType(msgType) != typeEncryptedExtensions { - return nil - } - h.logger.Debugf("Sending Transport Parameters: %s", h.ourParams) - return []qtls.Extension{{ - Type: quicTLSExtensionType, - Data: (&encryptedExtensionsTransportParameters{ - NegotiatedVersion: h.version, - SupportedVersions: protocol.GetGreasedVersions(h.supportedVersions), - Parameters: *h.ourParams, - }).Marshal(), - }} -} - -func (h *extensionHandlerServer) ReceivedExtensions(msgType uint8, exts []qtls.Extension) error { - if messageType(msgType) != typeClientHello { - return nil - } - var found bool - chtp := &clientHelloTransportParameters{} - for _, ext := range exts { - if ext.Type != quicTLSExtensionType { - continue - } - if err := chtp.Unmarshal(ext.Data); err != nil { - return err - } - found = true - } - if !found { - return errors.New("ClientHello didn't contain a QUIC extension") - } - - // perform the stateless version negotiation validation: - // make sure that we would have sent a Version Negotiation Packet if the client offered the initial version - // this is the case if and only if the initial version is not contained in the supported versions - if chtp.InitialVersion != h.version && protocol.IsSupportedVersion(h.supportedVersions, chtp.InitialVersion) { - return qerr.Error(qerr.VersionNegotiationMismatch, "Client should have used the initial version") - } - h.logger.Debugf("Received Transport Parameters: %s", &chtp.Parameters) - h.paramsChan <- chtp.Parameters - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/handshake/transport_parameters.go b/external/github.com/lucas-clemente/quic-go/internal/handshake/transport_parameters.go deleted file mode 100644 index 2477c37a0d..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/handshake/transport_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -package handshake - -import ( - "bytes" - "errors" - "fmt" - "io" - "sort" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type transportParameterID uint16 - -const ( - originalConnectionIDParameterID transportParameterID = 0x0 - idleTimeoutParameterID transportParameterID = 0x1 - statelessResetTokenParameterID transportParameterID = 0x2 - maxPacketSizeParameterID transportParameterID = 0x3 - initialMaxDataParameterID transportParameterID = 0x4 - initialMaxStreamDataBidiLocalParameterID transportParameterID = 0x5 - initialMaxStreamDataBidiRemoteParameterID transportParameterID = 0x6 - initialMaxStreamDataUniParameterID transportParameterID = 0x7 - initialMaxStreamsBidiParameterID transportParameterID = 0x8 - initialMaxStreamsUniParameterID transportParameterID = 0x9 - disableMigrationParameterID transportParameterID = 0xc -) - -// TransportParameters are parameters sent to the peer during the handshake -type TransportParameters struct { - InitialMaxStreamDataBidiLocal protocol.ByteCount - InitialMaxStreamDataBidiRemote protocol.ByteCount - InitialMaxStreamDataUni protocol.ByteCount - InitialMaxData protocol.ByteCount - - MaxPacketSize protocol.ByteCount - - MaxUniStreams uint64 - MaxBidiStreams uint64 - - IdleTimeout time.Duration - DisableMigration bool - - StatelessResetToken []byte - OriginalConnectionID protocol.ConnectionID -} - -func (p *TransportParameters) unmarshal(data []byte, sentBy protocol.Perspective) error { - // needed to check that every parameter is only sent at most once - var parameterIDs []transportParameterID - - r := bytes.NewReader(data) - for r.Len() >= 4 { - paramIDInt, _ := utils.BigEndian.ReadUint16(r) - paramID := transportParameterID(paramIDInt) - paramLen, _ := utils.BigEndian.ReadUint16(r) - parameterIDs = append(parameterIDs, paramID) - switch paramID { - case initialMaxStreamDataBidiLocalParameterID, - initialMaxStreamDataBidiRemoteParameterID, - initialMaxStreamDataUniParameterID, - initialMaxDataParameterID, - initialMaxStreamsBidiParameterID, - initialMaxStreamsUniParameterID, - idleTimeoutParameterID, - maxPacketSizeParameterID: - if err := p.readNumericTransportParameter(r, paramID, int(paramLen)); err != nil { - return err - } - default: - if r.Len() < int(paramLen) { - return fmt.Errorf("remaining length (%d) smaller than parameter length (%d)", r.Len(), paramLen) - } - switch paramID { - case disableMigrationParameterID: - if paramLen != 0 { - return fmt.Errorf("wrong length for disable_migration: %d (expected empty)", paramLen) - } - p.DisableMigration = true - case statelessResetTokenParameterID: - if sentBy == protocol.PerspectiveClient { - return errors.New("client sent a stateless_reset_token") - } - if paramLen != 16 { - return fmt.Errorf("wrong length for stateless_reset_token: %d (expected 16)", paramLen) - } - b := make([]byte, 16) - r.Read(b) - p.StatelessResetToken = b - case originalConnectionIDParameterID: - if sentBy == protocol.PerspectiveClient { - return errors.New("client sent an original_connection_id") - } - p.OriginalConnectionID, _ = protocol.ReadConnectionID(r, int(paramLen)) - default: - r.Seek(int64(paramLen), io.SeekCurrent) - } - } - } - - // check that every transport parameter was sent at most once - sort.Slice(parameterIDs, func(i, j int) bool { return parameterIDs[i] < parameterIDs[j] }) - for i := 0; i < len(parameterIDs)-1; i++ { - if parameterIDs[i] == parameterIDs[i+1] { - return fmt.Errorf("received duplicate transport parameter %#x", parameterIDs[i]) - } - } - - if r.Len() != 0 { - return fmt.Errorf("should have read all data. Still have %d bytes", r.Len()) - } - return nil -} - -func (p *TransportParameters) readNumericTransportParameter( - r *bytes.Reader, - paramID transportParameterID, - expectedLen int, -) error { - remainingLen := r.Len() - val, err := utils.ReadVarInt(r) - if err != nil { - return fmt.Errorf("error while reading transport parameter %d: %s", paramID, err) - } - if remainingLen-r.Len() != expectedLen { - return fmt.Errorf("inconsistent transport parameter length for %d", paramID) - } - switch paramID { - case initialMaxStreamDataBidiLocalParameterID: - p.InitialMaxStreamDataBidiLocal = protocol.ByteCount(val) - case initialMaxStreamDataBidiRemoteParameterID: - p.InitialMaxStreamDataBidiRemote = protocol.ByteCount(val) - case initialMaxStreamDataUniParameterID: - p.InitialMaxStreamDataUni = protocol.ByteCount(val) - case initialMaxDataParameterID: - p.InitialMaxData = protocol.ByteCount(val) - case initialMaxStreamsBidiParameterID: - p.MaxBidiStreams = val - case initialMaxStreamsUniParameterID: - p.MaxUniStreams = val - case idleTimeoutParameterID: - p.IdleTimeout = utils.MaxDuration(protocol.MinRemoteIdleTimeout, time.Duration(val)*time.Second) - case maxPacketSizeParameterID: - if val < 1200 { - return fmt.Errorf("invalid value for max_packet_size: %d (minimum 1200)", val) - } - p.MaxPacketSize = protocol.ByteCount(val) - default: - return fmt.Errorf("TransportParameter BUG: transport parameter %d not found", paramID) - } - return nil -} - -func (p *TransportParameters) marshal(b *bytes.Buffer) { - // initial_max_stream_data_bidi_local - utils.BigEndian.WriteUint16(b, uint16(initialMaxStreamDataBidiLocalParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(p.InitialMaxStreamDataBidiLocal)))) - utils.WriteVarInt(b, uint64(p.InitialMaxStreamDataBidiLocal)) - // initial_max_stream_data_bidi_remote - utils.BigEndian.WriteUint16(b, uint16(initialMaxStreamDataBidiRemoteParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(p.InitialMaxStreamDataBidiRemote)))) - utils.WriteVarInt(b, uint64(p.InitialMaxStreamDataBidiRemote)) - // initial_max_stream_data_uni - utils.BigEndian.WriteUint16(b, uint16(initialMaxStreamDataUniParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(p.InitialMaxStreamDataUni)))) - utils.WriteVarInt(b, uint64(p.InitialMaxStreamDataUni)) - // initial_max_data - utils.BigEndian.WriteUint16(b, uint16(initialMaxDataParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(p.InitialMaxData)))) - utils.WriteVarInt(b, uint64(p.InitialMaxData)) - // initial_max_bidi_streams - utils.BigEndian.WriteUint16(b, uint16(initialMaxStreamsBidiParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(p.MaxBidiStreams))) - utils.WriteVarInt(b, p.MaxBidiStreams) - // initial_max_uni_streams - utils.BigEndian.WriteUint16(b, uint16(initialMaxStreamsUniParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(p.MaxUniStreams))) - utils.WriteVarInt(b, p.MaxUniStreams) - // idle_timeout - utils.BigEndian.WriteUint16(b, uint16(idleTimeoutParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(p.IdleTimeout/time.Second)))) - utils.WriteVarInt(b, uint64(p.IdleTimeout/time.Second)) - // max_packet_size - utils.BigEndian.WriteUint16(b, uint16(maxPacketSizeParameterID)) - utils.BigEndian.WriteUint16(b, uint16(utils.VarIntLen(uint64(protocol.MaxReceivePacketSize)))) - utils.WriteVarInt(b, uint64(protocol.MaxReceivePacketSize)) - // disable_migration - if p.DisableMigration { - utils.BigEndian.WriteUint16(b, uint16(disableMigrationParameterID)) - utils.BigEndian.WriteUint16(b, 0) - } - if len(p.StatelessResetToken) > 0 { - utils.BigEndian.WriteUint16(b, uint16(statelessResetTokenParameterID)) - utils.BigEndian.WriteUint16(b, uint16(len(p.StatelessResetToken))) // should always be 16 bytes - b.Write(p.StatelessResetToken) - } - // original_connection_id - if p.OriginalConnectionID.Len() > 0 { - utils.BigEndian.WriteUint16(b, uint16(originalConnectionIDParameterID)) - utils.BigEndian.WriteUint16(b, uint16(p.OriginalConnectionID.Len())) - b.Write(p.OriginalConnectionID.Bytes()) - } -} - -// String returns a string representation, intended for logging. -func (p *TransportParameters) String() string { - return fmt.Sprintf("&handshake.TransportParameters{OriginalConnectionID: %s, InitialMaxStreamDataBidiLocal: %#x, InitialMaxStreamDataBidiRemote: %#x, InitialMaxStreamDataUni: %#x, InitialMaxData: %#x, MaxBidiStreams: %d, MaxUniStreams: %d, IdleTimeout: %s}", p.OriginalConnectionID, p.InitialMaxStreamDataBidiLocal, p.InitialMaxStreamDataBidiRemote, p.InitialMaxStreamDataUni, p.InitialMaxData, p.MaxBidiStreams, p.MaxUniStreams, p.IdleTimeout) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/mockgen_internal.sh b/external/github.com/lucas-clemente/quic-go/internal/mockgen_internal.sh deleted file mode 100755 index a0f9112b7b..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/mockgen_internal.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# Mockgen refuses to generate mocks for internal packages. -# This script copies the internal directory and renames it to internalpackage. -# It also creages a public alias for private types. -# It then creates a mock for this public (alias) type. -# Afterwards, it corrects the import paths (replaces internalpackage back to internal). - -TEMP_DIR=$(mktemp -d) -mkdir -p $TEMP_DIR/src/github.com/lucas-clemente/quic-go/internalpackage - -# uppercase the name of the interface (only has an effect for private interfaces) -INTERFACE_NAME="$(tr '[:lower:]' '[:upper:]' <<< ${4:0:1})${4:1}" -PACKAGE_NAME=`echo $3 | sed 's/.*\///'` - -cp -r $GOPATH/src/github.com/lucas-clemente/quic-go/internal/* $TEMP_DIR/src/github.com/lucas-clemente/quic-go/internalpackage -find $TEMP_DIR -type f -name "*.go" -exec sed -i '' 's/internal/internalpackage/g' {} \; - -export GOPATH="$TEMP_DIR:$GOPATH" -PACKAGE_PATH=${3/internal/internalpackage} - -# if we're mocking a private interface, we need to add a public alias -if [ "$INTERFACE_NAME" != "$4" ]; then - # create a public alias for the interface, so that mockgen can process it - echo -e "package $PACKAGE_NAME\n" > $TEMP_DIR/src/$PACKAGE_PATH/mockgen_interface.go - echo "type $INTERFACE_NAME = $4" >> $TEMP_DIR/src/$PACKAGE_PATH/mockgen_interface.go -fi - -mockgen -package $1 -self_package $1 -destination $2 $PACKAGE_PATH $INTERFACE_NAME -sed -i '' 's/internalpackage/internal/g' $2 - -# mockgen imports the package we're generating a mock for -sed -i '' "s/$1\.//g" $2 -goimports -w $2 - -rm -r "$TEMP_DIR" diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/connection_id.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/connection_id.go deleted file mode 100644 index f99461b2cf..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/connection_id.go +++ /dev/null @@ -1,69 +0,0 @@ -package protocol - -import ( - "bytes" - "crypto/rand" - "fmt" - "io" -) - -// A ConnectionID in QUIC -type ConnectionID []byte - -const maxConnectionIDLen = 18 - -// GenerateConnectionID generates a connection ID using cryptographic random -func GenerateConnectionID(len int) (ConnectionID, error) { - b := make([]byte, len) - if _, err := rand.Read(b); err != nil { - return nil, err - } - return ConnectionID(b), nil -} - -// GenerateConnectionIDForInitial generates a connection ID for the Initial packet. -// It uses a length randomly chosen between 8 and 18 bytes. -func GenerateConnectionIDForInitial() (ConnectionID, error) { - r := make([]byte, 1) - if _, err := rand.Read(r); err != nil { - return nil, err - } - len := MinConnectionIDLenInitial + int(r[0])%(maxConnectionIDLen-MinConnectionIDLenInitial+1) - return GenerateConnectionID(len) -} - -// ReadConnectionID reads a connection ID of length len from the given io.Reader. -// It returns io.EOF if there are not enough bytes to read. -func ReadConnectionID(r io.Reader, len int) (ConnectionID, error) { - if len == 0 { - return nil, nil - } - c := make(ConnectionID, len) - _, err := io.ReadFull(r, c) - if err == io.ErrUnexpectedEOF { - return nil, io.EOF - } - return c, err -} - -// Equal says if two connection IDs are equal -func (c ConnectionID) Equal(other ConnectionID) bool { - return bytes.Equal(c, other) -} - -// Len returns the length of the connection ID in bytes -func (c ConnectionID) Len() int { - return len(c) -} - -// Bytes returns the byte representation -func (c ConnectionID) Bytes() []byte { - return []byte(c) -} - -func (c ConnectionID) String() string { - if c.Len() == 0 { - return "(empty)" - } - return fmt.Sprintf("%#x", c.Bytes()) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/encryption_level.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/encryption_level.go deleted file mode 100644 index 4b059b3a89..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/encryption_level.go +++ /dev/null @@ -1,28 +0,0 @@ -package protocol - -// EncryptionLevel is the encryption level -// Default value is Unencrypted -type EncryptionLevel int - -const ( - // EncryptionUnspecified is a not specified encryption level - EncryptionUnspecified EncryptionLevel = iota - // EncryptionInitial is the Initial encryption level - EncryptionInitial - // EncryptionHandshake is the Handshake encryption level - EncryptionHandshake - // Encryption1RTT is the 1-RTT encryption level - Encryption1RTT -) - -func (e EncryptionLevel) String() string { - switch e { - case EncryptionInitial: - return "Initial" - case EncryptionHandshake: - return "Handshake" - case Encryption1RTT: - return "1-RTT" - } - return "unknown" -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/packet_number.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/packet_number.go deleted file mode 100644 index 405a07ac70..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/packet_number.go +++ /dev/null @@ -1,85 +0,0 @@ -package protocol - -// PacketNumberLen is the length of the packet number in bytes -type PacketNumberLen uint8 - -const ( - // PacketNumberLenInvalid is the default value and not a valid length for a packet number - PacketNumberLenInvalid PacketNumberLen = 0 - // PacketNumberLen1 is a packet number length of 1 byte - PacketNumberLen1 PacketNumberLen = 1 - // PacketNumberLen2 is a packet number length of 2 bytes - PacketNumberLen2 PacketNumberLen = 2 - // PacketNumberLen3 is a packet number length of 3 bytes - PacketNumberLen3 PacketNumberLen = 3 - // PacketNumberLen4 is a packet number length of 4 bytes - PacketNumberLen4 PacketNumberLen = 4 -) - -// DecodePacketNumber calculates the packet number based on the received packet number, its length and the last seen packet number -func DecodePacketNumber( - packetNumberLength PacketNumberLen, - lastPacketNumber PacketNumber, - wirePacketNumber PacketNumber, -) PacketNumber { - var epochDelta PacketNumber - switch packetNumberLength { - case PacketNumberLen1: - epochDelta = PacketNumber(1) << 8 - case PacketNumberLen2: - epochDelta = PacketNumber(1) << 16 - case PacketNumberLen3: - epochDelta = PacketNumber(1) << 24 - case PacketNumberLen4: - epochDelta = PacketNumber(1) << 32 - } - epoch := lastPacketNumber & ^(epochDelta - 1) - prevEpochBegin := epoch - epochDelta - nextEpochBegin := epoch + epochDelta - return closestTo( - lastPacketNumber+1, - epoch+wirePacketNumber, - closestTo(lastPacketNumber+1, prevEpochBegin+wirePacketNumber, nextEpochBegin+wirePacketNumber), - ) -} - -func closestTo(target, a, b PacketNumber) PacketNumber { - if delta(target, a) < delta(target, b) { - return a - } - return b -} - -func delta(a, b PacketNumber) PacketNumber { - if a < b { - return b - a - } - return a - b -} - -// GetPacketNumberLengthForHeader gets the length of the packet number for the public header -// it never chooses a PacketNumberLen of 1 byte, since this is too short under certain circumstances -func GetPacketNumberLengthForHeader(packetNumber, leastUnacked PacketNumber) PacketNumberLen { - diff := uint64(packetNumber - leastUnacked) - if diff < (1 << (16 - 1)) { - return PacketNumberLen2 - } - if diff < (1 << (24 - 1)) { - return PacketNumberLen3 - } - return PacketNumberLen4 -} - -// GetPacketNumberLength gets the minimum length needed to fully represent the packet number -func GetPacketNumberLength(packetNumber PacketNumber) PacketNumberLen { - if packetNumber < (1 << (uint8(PacketNumberLen1) * 8)) { - return PacketNumberLen1 - } - if packetNumber < (1 << (uint8(PacketNumberLen2) * 8)) { - return PacketNumberLen2 - } - if packetNumber < (1 << (uint8(PacketNumberLen3) * 8)) { - return PacketNumberLen3 - } - return PacketNumberLen4 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/params.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/params.go deleted file mode 100644 index e6f9493faf..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/params.go +++ /dev/null @@ -1,119 +0,0 @@ -package protocol - -import "time" - -// MaxPacketSizeIPv4 is the maximum packet size that we use for sending IPv4 packets. -const MaxPacketSizeIPv4 = 1252 - -// MaxPacketSizeIPv6 is the maximum packet size that we use for sending IPv6 packets. -const MaxPacketSizeIPv6 = 1232 - -const defaultMaxCongestionWindowPackets = 1000 - -// DefaultMaxCongestionWindow is the default for the max congestion window -const DefaultMaxCongestionWindow ByteCount = defaultMaxCongestionWindowPackets * DefaultTCPMSS - -// InitialCongestionWindow is the initial congestion window in QUIC packets -const InitialCongestionWindow ByteCount = 32 * DefaultTCPMSS - -// MaxUndecryptablePackets limits the number of undecryptable packets that are queued in the session. -const MaxUndecryptablePackets = 10 - -// ConnectionFlowControlMultiplier determines how much larger the connection flow control windows needs to be relative to any stream's flow control window -// This is the value that Chromium is using -const ConnectionFlowControlMultiplier = 1.5 - -// InitialMaxStreamData is the stream-level flow control window for receiving data -const InitialMaxStreamData = (1 << 10) * 512 // 512 kb - -// InitialMaxData is the connection-level flow control window for receiving data -const InitialMaxData = ConnectionFlowControlMultiplier * InitialMaxStreamData - -// DefaultMaxReceiveStreamFlowControlWindow is the default maximum stream-level flow control window for receiving data, for the server -const DefaultMaxReceiveStreamFlowControlWindow = 6 * (1 << 20) // 6 MB - -// DefaultMaxReceiveConnectionFlowControlWindow is the default connection-level flow control window for receiving data, for the server -const DefaultMaxReceiveConnectionFlowControlWindow = 15 * (1 << 20) // 12 MB - -// WindowUpdateThreshold is the fraction of the receive window that has to be consumed before an higher offset is advertised to the client -const WindowUpdateThreshold = 0.25 - -// DefaultMaxIncomingStreams is the maximum number of streams that a peer may open -const DefaultMaxIncomingStreams = 100 - -// DefaultMaxIncomingUniStreams is the maximum number of unidirectional streams that a peer may open -const DefaultMaxIncomingUniStreams = 100 - -// MaxSessionUnprocessedPackets is the max number of packets stored in each session that are not yet processed. -const MaxSessionUnprocessedPackets = defaultMaxCongestionWindowPackets - -// SkipPacketAveragePeriodLength is the average period length in which one packet number is skipped to prevent an Optimistic ACK attack -const SkipPacketAveragePeriodLength PacketNumber = 500 - -// MaxTrackedSkippedPackets is the maximum number of skipped packet numbers the SentPacketHandler keep track of for Optimistic ACK attack mitigation -const MaxTrackedSkippedPackets = 10 - -// MaxAcceptQueueSize is the maximum number of sessions that the server queues for accepting. -// If the queue is full, new connection attempts will be rejected. -const MaxAcceptQueueSize = 32 - -// CookieExpiryTime is the valid time of a cookie -const CookieExpiryTime = 24 * time.Hour - -// MaxOutstandingSentPackets is maximum number of packets saved for retransmission. -// When reached, it imposes a soft limit on sending new packets: -// Sending ACKs and retransmission is still allowed, but now new regular packets can be sent. -const MaxOutstandingSentPackets = 2 * defaultMaxCongestionWindowPackets - -// MaxTrackedSentPackets is maximum number of sent packets saved for retransmission. -// When reached, no more packets will be sent. -// This value *must* be larger than MaxOutstandingSentPackets. -const MaxTrackedSentPackets = MaxOutstandingSentPackets * 5 / 4 - -// MaxTrackedReceivedAckRanges is the maximum number of ACK ranges tracked -const MaxTrackedReceivedAckRanges = defaultMaxCongestionWindowPackets - -// MaxNonRetransmittableAcks is the maximum number of packets containing an ACK, but no retransmittable frames, that we send in a row -const MaxNonRetransmittableAcks = 19 - -// MaxStreamFrameSorterGaps is the maximum number of gaps between received StreamFrames -// prevents DoS attacks against the streamFrameSorter -const MaxStreamFrameSorterGaps = 1000 - -// MaxCryptoStreamOffset is the maximum offset allowed on any of the crypto streams. -// This limits the size of the ClientHello and Certificates that can be received. -const MaxCryptoStreamOffset = 16 * (1 << 10) - -// MinRemoteIdleTimeout is the minimum value that we accept for the remote idle timeout -const MinRemoteIdleTimeout = 5 * time.Second - -// DefaultIdleTimeout is the default idle timeout -const DefaultIdleTimeout = 30 * time.Second - -// DefaultHandshakeTimeout is the default timeout for a connection until the crypto handshake succeeds. -const DefaultHandshakeTimeout = 10 * time.Second - -// RetiredConnectionIDDeleteTimeout is the time we keep closed sessions around in order to retransmit the CONNECTION_CLOSE. -// after this time all information about the old connection will be deleted -const RetiredConnectionIDDeleteTimeout = 5 * time.Second - -// MinStreamFrameSize is the minimum size that has to be left in a packet, so that we add another STREAM frame. -// This avoids splitting up STREAM frames into small pieces, which has 2 advantages: -// 1. it reduces the framing overhead -// 2. it reduces the head-of-line blocking, when a packet is lost -const MinStreamFrameSize ByteCount = 128 - -// MaxAckFrameSize is the maximum size for an ACK frame that we write -// Due to the varint encoding, ACK frames can grow (almost) indefinitely large. -// The MaxAckFrameSize should be large enough to encode many ACK range, -// but must ensure that a maximum size ACK frame fits into one packet. -const MaxAckFrameSize ByteCount = 1000 - -// MinPacingDelay is the minimum duration that is used for packet pacing -// If the packet packing frequency is higher, multiple packets might be sent at once. -// Example: For a packet pacing delay of 20 microseconds, we would send 5 packets at once, wait for 100 microseconds, and so forth. -const MinPacingDelay time.Duration = 100 * time.Microsecond - -// DefaultConnectionIDLength is the connection ID length that is used for multiplexed connections -// if no other value is configured. -const DefaultConnectionIDLength = 4 diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/perspective.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/perspective.go deleted file mode 100644 index 43358fecb4..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/perspective.go +++ /dev/null @@ -1,26 +0,0 @@ -package protocol - -// Perspective determines if we're acting as a server or a client -type Perspective int - -// the perspectives -const ( - PerspectiveServer Perspective = 1 - PerspectiveClient Perspective = 2 -) - -// Opposite returns the perspective of the peer -func (p Perspective) Opposite() Perspective { - return 3 - p -} - -func (p Perspective) String() string { - switch p { - case PerspectiveServer: - return "Server" - case PerspectiveClient: - return "Client" - default: - return "invalid perspective" - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/protocol.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/protocol.go deleted file mode 100644 index 26f69fdc6e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/protocol.go +++ /dev/null @@ -1,65 +0,0 @@ -package protocol - -import ( - "fmt" -) - -// A PacketNumber in QUIC -type PacketNumber uint64 - -// The PacketType is the Long Header Type -type PacketType uint8 - -const ( - // PacketTypeInitial is the packet type of an Initial packet - PacketTypeInitial PacketType = 1 + iota - // PacketTypeRetry is the packet type of a Retry packet - PacketTypeRetry - // PacketTypeHandshake is the packet type of a Handshake packet - PacketTypeHandshake - // PacketType0RTT is the packet type of a 0-RTT packet - PacketType0RTT -) - -func (t PacketType) String() string { - switch t { - case PacketTypeInitial: - return "Initial" - case PacketTypeRetry: - return "Retry" - case PacketTypeHandshake: - return "Handshake" - case PacketType0RTT: - return "0-RTT Protected" - default: - return fmt.Sprintf("unknown packet type: %d", t) - } -} - -// A ByteCount in QUIC -type ByteCount uint64 - -// MaxByteCount is the maximum value of a ByteCount -const MaxByteCount = ByteCount(1<<62 - 1) - -// An ApplicationErrorCode is an application-defined error code. -type ApplicationErrorCode uint16 - -// MaxReceivePacketSize maximum packet size of any QUIC packet, based on -// ethernet's max size, minus the IP and UDP headers. IPv6 has a 40 byte header, -// UDP adds an additional 8 bytes. This is a total overhead of 48 bytes. -// Ethernet's max packet size is 1500 bytes, 1500 - 48 = 1452. -const MaxReceivePacketSize ByteCount = 1452 - 64 - -// DefaultTCPMSS is the default maximum packet size used in the Linux TCP implementation. -// Used in QUIC for congestion window computations in bytes. -const DefaultTCPMSS ByteCount = 1460 - -// MinInitialPacketSize is the minimum size an Initial packet is required to have. -const MinInitialPacketSize = 1200 - -// MinStatelessResetSize is the minimum size of a stateless reset packet -const MinStatelessResetSize = 1 /* first byte */ + 22 /* random bytes */ + 16 /* token */ - -// MinConnectionIDLenInitial is the minimum length of the destination connection ID on an Initial packet. -const MinConnectionIDLenInitial = 8 diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/stream_id.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/stream_id.go deleted file mode 100644 index b96e0c2bcb..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/stream_id.go +++ /dev/null @@ -1,67 +0,0 @@ -package protocol - -// A StreamID in QUIC -type StreamID uint64 - -// StreamType encodes if this is a unidirectional or bidirectional stream -type StreamType uint8 - -const ( - // StreamTypeUni is a unidirectional stream - StreamTypeUni StreamType = iota - // StreamTypeBidi is a bidirectional stream - StreamTypeBidi -) - -// InitiatedBy says if the stream was initiated by the client or by the server -func (s StreamID) InitiatedBy() Perspective { - if s%2 == 0 { - return PerspectiveClient - } - return PerspectiveServer -} - -//Type says if this is a unidirectional or bidirectional stream -func (s StreamID) Type() StreamType { - if s%4 >= 2 { - return StreamTypeUni - } - return StreamTypeBidi -} - -// StreamNum returns how many streams in total are below this -// Example: for stream 9 it returns 3 (i.e. streams 1, 5 and 9) -func (s StreamID) StreamNum() uint64 { - return uint64(s/4) + 1 -} - -// MaxStreamID is the highest stream ID that a peer is allowed to open, -// when it is allowed to open numStreams. -func MaxStreamID(stype StreamType, numStreams uint64, pers Perspective) StreamID { - if numStreams == 0 { - return 0 - } - var first StreamID - switch stype { - case StreamTypeBidi: - switch pers { - case PerspectiveClient: - first = 0 - case PerspectiveServer: - first = 1 - } - case StreamTypeUni: - switch pers { - case PerspectiveClient: - first = 2 - case PerspectiveServer: - first = 3 - } - } - return first + 4*StreamID(numStreams-1) -} - -// FirstStream returns the first valid stream ID -func FirstStream(stype StreamType, pers Perspective) StreamID { - return MaxStreamID(stype, 1, pers) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/protocol/version.go b/external/github.com/lucas-clemente/quic-go/internal/protocol/version.go deleted file mode 100644 index 3406cfa465..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/protocol/version.go +++ /dev/null @@ -1,117 +0,0 @@ -package protocol - -import ( - "crypto/rand" - "encoding/binary" - "fmt" - "math" -) - -// VersionNumber is a version number as int -type VersionNumber uint32 - -// gQUIC version range as defined in the wiki: https://github.com/quicwg/base-drafts/wiki/QUIC-Versions -const ( - gquicVersion0 = 0x51303030 - maxGquicVersion = 0x51303439 -) - -// The version numbers, making grepping easier -const ( - VersionTLS VersionNumber = 0x51474fff - VersionWhatever VersionNumber = 1 // for when the version doesn't matter - VersionUnknown VersionNumber = math.MaxUint32 -) - -// SupportedVersions lists the versions that the server supports -// must be in sorted descending order -var SupportedVersions = []VersionNumber{VersionTLS} - -// IsValidVersion says if the version is known to quic-go -func IsValidVersion(v VersionNumber) bool { - return v == VersionTLS || IsSupportedVersion(SupportedVersions, v) -} - -func (vn VersionNumber) String() string { - switch vn { - case VersionWhatever: - return "whatever" - case VersionUnknown: - return "unknown" - case VersionTLS: - return "TLS dev version (WIP)" - default: - if vn.isGQUIC() { - return fmt.Sprintf("gQUIC %d", vn.toGQUICVersion()) - } - return fmt.Sprintf("%#x", uint32(vn)) - } -} - -// ToAltSvc returns the representation of the version for the H2 Alt-Svc parameters -func (vn VersionNumber) ToAltSvc() string { - return fmt.Sprintf("%d", vn) -} - -func (vn VersionNumber) isGQUIC() bool { - return vn > gquicVersion0 && vn <= maxGquicVersion -} - -func (vn VersionNumber) toGQUICVersion() int { - return int(10*(vn-gquicVersion0)/0x100) + int(vn%0x10) -} - -// IsSupportedVersion returns true if the server supports this version -func IsSupportedVersion(supported []VersionNumber, v VersionNumber) bool { - for _, t := range supported { - if t == v { - return true - } - } - return false -} - -// ChooseSupportedVersion finds the best version in the overlap of ours and theirs -// ours is a slice of versions that we support, sorted by our preference (descending) -// theirs is a slice of versions offered by the peer. The order does not matter. -// The bool returned indicates if a matching version was found. -func ChooseSupportedVersion(ours, theirs []VersionNumber) (VersionNumber, bool) { - for _, ourVer := range ours { - for _, theirVer := range theirs { - if ourVer == theirVer { - return ourVer, true - } - } - } - return 0, false -} - -// generateReservedVersion generates a reserved version number (v & 0x0f0f0f0f == 0x0a0a0a0a) -func generateReservedVersion() VersionNumber { - b := make([]byte, 4) - _, _ = rand.Read(b) // ignore the error here. Failure to read random data doesn't break anything - return VersionNumber((binary.BigEndian.Uint32(b) | 0x0a0a0a0a) & 0xfafafafa) -} - -// GetGreasedVersions adds one reserved version number to a slice of version numbers, at a random position -func GetGreasedVersions(supported []VersionNumber) []VersionNumber { - b := make([]byte, 1) - _, _ = rand.Read(b) // ignore the error here. Failure to read random data doesn't break anything - randPos := int(b[0]) % (len(supported) + 1) - greased := make([]VersionNumber, len(supported)+1) - copy(greased, supported[:randPos]) - greased[randPos] = generateReservedVersion() - copy(greased[randPos+1:], supported[randPos:]) - return greased -} - -// StripGreasedVersions strips all greased versions from a slice of versions -func StripGreasedVersions(versions []VersionNumber) []VersionNumber { - realVersions := make([]VersionNumber, 0, len(versions)) - for _, v := range versions { - if v&0x0f0f0f0f != 0x0a0a0a0a { - realVersions = append(realVersions, v) - } - } - return realVersions -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/qerr/error_codes.go b/external/github.com/lucas-clemente/quic-go/internal/qerr/error_codes.go deleted file mode 100644 index f3e6dd9cbc..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/qerr/error_codes.go +++ /dev/null @@ -1,193 +0,0 @@ -package qerr - -// The error codes defined by QUIC -// Remember to run `go generate ./...` whenever the error codes change. -//go:generate stringer -type=ErrorCode -const ( - InternalError ErrorCode = 1 - // There were data frames after the a fin or reset. - StreamDataAfterTermination ErrorCode = 2 - // Control frame is malformed. - InvalidPacketHeader ErrorCode = 3 - // Frame data is malformed. - InvalidFrameData ErrorCode = 4 - // The packet contained no payload. - MissingPayload ErrorCode = 48 - // FEC data is malformed. - InvalidFecData ErrorCode = 5 - // STREAM frame data is malformed. - InvalidStreamData ErrorCode = 46 - // STREAM frame data overlaps with buffered data. - OverlappingStreamData ErrorCode = 87 - // Received STREAM frame data is not encrypted. - UnencryptedStreamData ErrorCode = 61 - // Attempt to send unencrypted STREAM frame. - AttemptToSendUnencryptedStreamData ErrorCode = 88 - // FEC frame data is not encrypted. - UnencryptedFecData ErrorCode = 77 - // RST_STREAM frame data is malformed. - InvalidRstStreamData ErrorCode = 6 - // CONNECTION_CLOSE frame data is malformed. - InvalidConnectionCloseData ErrorCode = 7 - // GOAWAY frame data is malformed. - InvalidGoawayData ErrorCode = 8 - // WINDOW_UPDATE frame data is malformed. - InvalidWindowUpdateData ErrorCode = 57 - // BLOCKED frame data is malformed. - InvalidBlockedData ErrorCode = 58 - // STOP_WAITING frame data is malformed. - InvalidStopWaitingData ErrorCode = 60 - // PATH_CLOSE frame data is malformed. - InvalidPathCloseData ErrorCode = 78 - // ACK frame data is malformed. - InvalidAckData ErrorCode = 9 - - // Version negotiation packet is malformed. - InvalidVersionNegotiationPacket ErrorCode = 10 - // Public RST packet is malformed. - InvalidPublicRstPacket ErrorCode = 11 - // There was an error decrypting. - DecryptionFailure ErrorCode = 12 - // There was an error encrypting. - EncryptionFailure ErrorCode = 13 - // The packet exceeded kMaxPacketSize. - PacketTooLarge ErrorCode = 14 - // The peer is going away. May be a client or server. - PeerGoingAway ErrorCode = 16 - // A stream ID was invalid. - InvalidStreamID ErrorCode = 17 - // A priority was invalid. - InvalidPriority ErrorCode = 49 - // Too many streams already open. - TooManyOpenStreams ErrorCode = 18 - // The peer created too many available streams. - TooManyAvailableStreams ErrorCode = 76 - // Received public reset for this connection. - PublicReset ErrorCode = 19 - // Invalid protocol version. - InvalidVersion ErrorCode = 20 - - // The Header ID for a stream was too far from the previous. - InvalidHeaderID ErrorCode = 22 - // Negotiable parameter received during handshake had invalid value. - InvalidNegotiatedValue ErrorCode = 23 - // There was an error decompressing data. - DecompressionFailure ErrorCode = 24 - // The connection timed out due to no network activity. - NetworkIdleTimeout ErrorCode = 25 - // The connection timed out waiting for the handshake to complete. - HandshakeTimeout ErrorCode = 67 - // There was an error encountered migrating addresses. - ErrorMigratingAddress ErrorCode = 26 - // There was an error encountered migrating port only. - ErrorMigratingPort ErrorCode = 86 - // There was an error while writing to the socket. - PacketWriteError ErrorCode = 27 - // There was an error while reading from the socket. - PacketReadError ErrorCode = 51 - // We received a STREAM_FRAME with no data and no fin flag set. - EmptyStreamFrameNoFin ErrorCode = 50 - // We received invalid data on the headers stream. - InvalidHeadersStreamData ErrorCode = 56 - // Invalid data on the headers stream received because of decompression - // failure. - HeadersStreamDataDecompressFailure ErrorCode = 97 - // The peer received too much data, violating flow control. - FlowControlReceivedTooMuchData ErrorCode = 59 - // The peer sent too much data, violating flow control. - FlowControlSentTooMuchData ErrorCode = 63 - // The peer received an invalid flow control window. - FlowControlInvalidWindow ErrorCode = 64 - // The connection has been IP pooled into an existing connection. - ConnectionIPPooled ErrorCode = 62 - // The connection has too many outstanding sent packets. - TooManyOutstandingSentPackets ErrorCode = 68 - // The connection has too many outstanding received packets. - TooManyOutstandingReceivedPackets ErrorCode = 69 - // The quic connection has been cancelled. - ConnectionCancelled ErrorCode = 70 - // Disabled QUIC because of high packet loss rate. - BadPacketLossRate ErrorCode = 71 - // Disabled QUIC because of too many PUBLIC_RESETs post handshake. - PublicResetsPostHandshake ErrorCode = 73 - // Disabled QUIC because of too many timeouts with streams open. - TimeoutsWithOpenStreams ErrorCode = 74 - // Closed because we failed to serialize a packet. - FailedToSerializePacket ErrorCode = 75 - // QUIC timed out after too many RTOs. - TooManyRtos ErrorCode = 85 - - // Crypto errors. - - // Hanshake failed. - HandshakeFailed ErrorCode = 28 - // Handshake message contained out of order tags. - CryptoTagsOutOfOrder ErrorCode = 29 - // Handshake message contained too many entries. - CryptoTooManyEntries ErrorCode = 30 - // Handshake message contained an invalid value length. - CryptoInvalidValueLength ErrorCode = 31 - // A crypto message was received after the handshake was complete. - CryptoMessageAfterHandshakeComplete ErrorCode = 32 - // A crypto message was received with an illegal message tag. - InvalidCryptoMessageType ErrorCode = 33 - // A crypto message was received with an illegal parameter. - InvalidCryptoMessageParameter ErrorCode = 34 - // An invalid channel id signature was supplied. - InvalidChannelIDSignature ErrorCode = 52 - // A crypto message was received with a mandatory parameter missing. - CryptoMessageParameterNotFound ErrorCode = 35 - // A crypto message was received with a parameter that has no overlap - // with the local parameter. - CryptoMessageParameterNoOverlap ErrorCode = 36 - // A crypto message was received that contained a parameter with too few - // values. - CryptoMessageIndexNotFound ErrorCode = 37 - // An internal error occurred in crypto processing. - CryptoInternalError ErrorCode = 38 - // A crypto handshake message specified an unsupported version. - CryptoVersionNotSupported ErrorCode = 39 - // A crypto handshake message resulted in a stateless reject. - CryptoHandshakeStatelessReject ErrorCode = 72 - // There was no intersection between the crypto primitives supported by the - // peer and ourselves. - CryptoNoSupport ErrorCode = 40 - // The server rejected our client hello messages too many times. - CryptoTooManyRejects ErrorCode = 41 - // The client rejected the server's certificate chain or signature. - ProofInvalid ErrorCode = 42 - // A crypto message was received with a duplicate tag. - CryptoDuplicateTag ErrorCode = 43 - // A crypto message was received with the wrong encryption level (i.e. it - // should have been encrypted but was not.) - CryptoEncryptionLevelIncorrect ErrorCode = 44 - // The server config for a server has expired. - CryptoServerConfigExpired ErrorCode = 45 - // We failed to setup the symmetric keys for a connection. - CryptoSymmetricKeySetupFailed ErrorCode = 53 - // A handshake message arrived, but we are still validating the - // previous handshake message. - CryptoMessageWhileValidatingClientHello ErrorCode = 54 - // A server config update arrived before the handshake is complete. - CryptoUpdateBeforeHandshakeComplete ErrorCode = 65 - // This connection involved a version negotiation which appears to have been - // tampered with. - VersionNegotiationMismatch ErrorCode = 55 - - // Multipath is not enabled, but a packet with multipath flag on is received. - BadMultipathFlag ErrorCode = 79 - - // IP address changed causing connection close. - IPAddressChanged ErrorCode = 80 - - // Connection migration errors. - // Network changed, but connection had no migratable streams. - ConnectionMigrationNoMigratableStreams ErrorCode = 81 - // Connection changed networks too many times. - ConnectionMigrationTooManyChanges ErrorCode = 82 - // Connection migration was attempted, but there was no new network to - // migrate to. - ConnectionMigrationNoNewNetwork ErrorCode = 83 - // Network changed, but connection had one or more non-migratable streams. - ConnectionMigrationNonMigratableStream ErrorCode = 84 -) diff --git a/external/github.com/lucas-clemente/quic-go/internal/qerr/errorcode_string.go b/external/github.com/lucas-clemente/quic-go/internal/qerr/errorcode_string.go deleted file mode 100644 index 22d0c85a74..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/qerr/errorcode_string.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT. - -package qerr - -import "strconv" - -const ( - _ErrorCode_name_0 = "InternalErrorStreamDataAfterTerminationInvalidPacketHeaderInvalidFrameDataInvalidFecDataInvalidRstStreamDataInvalidConnectionCloseDataInvalidGoawayDataInvalidAckDataInvalidVersionNegotiationPacketInvalidPublicRstPacketDecryptionFailureEncryptionFailurePacketTooLarge" - _ErrorCode_name_1 = "PeerGoingAwayInvalidStreamIDTooManyOpenStreamsPublicResetInvalidVersion" - _ErrorCode_name_2 = "InvalidHeaderIDInvalidNegotiatedValueDecompressionFailureNetworkIdleTimeoutErrorMigratingAddressPacketWriteErrorHandshakeFailedCryptoTagsOutOfOrderCryptoTooManyEntriesCryptoInvalidValueLengthCryptoMessageAfterHandshakeCompleteInvalidCryptoMessageTypeInvalidCryptoMessageParameterCryptoMessageParameterNotFoundCryptoMessageParameterNoOverlapCryptoMessageIndexNotFoundCryptoInternalErrorCryptoVersionNotSupportedCryptoNoSupportCryptoTooManyRejectsProofInvalidCryptoDuplicateTagCryptoEncryptionLevelIncorrectCryptoServerConfigExpiredInvalidStreamData" - _ErrorCode_name_3 = "MissingPayloadInvalidPriorityEmptyStreamFrameNoFinPacketReadErrorInvalidChannelIDSignatureCryptoSymmetricKeySetupFailedCryptoMessageWhileValidatingClientHelloVersionNegotiationMismatchInvalidHeadersStreamDataInvalidWindowUpdateDataInvalidBlockedDataFlowControlReceivedTooMuchDataInvalidStopWaitingDataUnencryptedStreamDataConnectionIPPooledFlowControlSentTooMuchDataFlowControlInvalidWindowCryptoUpdateBeforeHandshakeComplete" - _ErrorCode_name_4 = "HandshakeTimeoutTooManyOutstandingSentPacketsTooManyOutstandingReceivedPacketsConnectionCancelledBadPacketLossRateCryptoHandshakeStatelessRejectPublicResetsPostHandshakeTimeoutsWithOpenStreamsFailedToSerializePacketTooManyAvailableStreamsUnencryptedFecDataInvalidPathCloseDataBadMultipathFlagIPAddressChangedConnectionMigrationNoMigratableStreamsConnectionMigrationTooManyChangesConnectionMigrationNoNewNetworkConnectionMigrationNonMigratableStreamTooManyRtosErrorMigratingPortOverlappingStreamDataAttemptToSendUnencryptedStreamData" - _ErrorCode_name_5 = "HeadersStreamDataDecompressFailure" -) - -var ( - _ErrorCode_index_0 = [...]uint16{0, 13, 39, 58, 74, 88, 108, 134, 151, 165, 196, 218, 235, 252, 266} - _ErrorCode_index_1 = [...]uint8{0, 13, 28, 46, 57, 71} - _ErrorCode_index_2 = [...]uint16{0, 15, 37, 57, 75, 96, 112, 127, 147, 167, 191, 226, 250, 279, 309, 340, 366, 385, 410, 425, 445, 457, 475, 505, 530, 547} - _ErrorCode_index_3 = [...]uint16{0, 14, 29, 50, 65, 90, 119, 158, 184, 208, 231, 249, 279, 301, 322, 340, 366, 390, 425} - _ErrorCode_index_4 = [...]uint16{0, 16, 45, 78, 97, 114, 144, 169, 192, 215, 238, 256, 276, 292, 308, 346, 379, 410, 448, 459, 477, 498, 532} -) - -func (i ErrorCode) String() string { - switch { - case 1 <= i && i <= 14: - i -= 1 - return _ErrorCode_name_0[_ErrorCode_index_0[i]:_ErrorCode_index_0[i+1]] - case 16 <= i && i <= 20: - i -= 16 - return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]] - case 22 <= i && i <= 46: - i -= 22 - return _ErrorCode_name_2[_ErrorCode_index_2[i]:_ErrorCode_index_2[i+1]] - case 48 <= i && i <= 65: - i -= 48 - return _ErrorCode_name_3[_ErrorCode_index_3[i]:_ErrorCode_index_3[i+1]] - case 67 <= i && i <= 88: - i -= 67 - return _ErrorCode_name_4[_ErrorCode_index_4[i]:_ErrorCode_index_4[i+1]] - case i == 97: - return _ErrorCode_name_5 - default: - return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/qerr/quic_error.go b/external/github.com/lucas-clemente/quic-go/internal/qerr/quic_error.go deleted file mode 100644 index 4a90b57840..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/qerr/quic_error.go +++ /dev/null @@ -1,53 +0,0 @@ -package qerr - -import ( - "fmt" -) - -// ErrorCode can be used as a normal error without reason. -type ErrorCode uint16 - -func (e ErrorCode) Error() string { - return e.String() -} - -// A QuicError consists of an error code plus a error reason -type QuicError struct { - ErrorCode ErrorCode - ErrorMessage string -} - -// Error creates a new QuicError instance -func Error(errorCode ErrorCode, errorMessage string) *QuicError { - return &QuicError{ - ErrorCode: errorCode, - ErrorMessage: errorMessage, - } -} - -func (e *QuicError) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode.String(), e.ErrorMessage) -} - -// Timeout says if this error is a timeout. -func (e *QuicError) Timeout() bool { - switch e.ErrorCode { - case NetworkIdleTimeout, - HandshakeTimeout, - TimeoutsWithOpenStreams: - return true - } - return false -} - -// ToQuicError converts an arbitrary error to a QuicError. It leaves QuicErrors -// unchanged, and properly handles `ErrorCode`s. -func ToQuicError(err error) *QuicError { - switch e := err.(type) { - case *QuicError: - return e - case ErrorCode: - return Error(e, "") - } - return Error(InternalError, err.Error()) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/testdata/ca.pem b/external/github.com/lucas-clemente/quic-go/internal/testdata/ca.pem deleted file mode 100644 index 1118b05b84..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/testdata/ca.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC0DCCAbgCCQCmiwJpSoekpDANBgkqhkiG9w0BAQsFADAqMRMwEQYDVQQKDApx -dWljLWdvIENBMRMwEQYDVQQLDApxdWljLWdvIENBMB4XDTE4MTIwODA2NDIyMVoX -DTI4MTIwNTA2NDIyMVowKjETMBEGA1UECgwKcXVpYy1nbyBDQTETMBEGA1UECwwK -cXVpYy1nbyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN5MxI09 -i01xRON732BFIuxO2SGjA9jYkvUvNXK886gifp2BfWLcOW1DHkXxBnhWMqfpcIWM -GviF4G2Mp0HEJDMe+4LBxje/1e2WA+nzQlIZD6LaDi98nXJaAcCMM4a64Vm0i8Z3 -+4c+O93+5TekPn507nl7QA1IaEEtoek7w7wDw4ZF3ET+nns2HwVpV/ugfuYOQbTJ -8Np+zO8EfPMTUjEpKdl4bp/yqcouWD+oIhoxmx1V+LxshcpSwtzHIAi6gjHUDCEe -bk5Y2GBT4VR5WKmNGvlfe9L0Gn0ZLJoeXDshrunF0xEmSv8MxlHcKH/u4IHiO+6x -+5sdslqY7uEPEhkCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAhvXUMiatkgsnoRHc -UobKraGttETivxvtKpc48o1TSkR+kCKbMnygmrvc5niEqc9iDg8JI6HjBKJ3/hfA -uKdyiR8cQNcQRgJ/3FVx0n3KGDUbHJSuIQzFvXom2ZPdlAHFqAT+8AVrz42v8gct -gyiGdFCSNisDbevOiRHuJtZ0m8YsGgtfU48wqGOaSSsRz4mYD6kqBFd0+Ja3/EGv -vl24L5xMCy1zGGl6wKPa7TT7ok4TfD1YmIXOfmWYop6cTLwePLj1nHrLi0AlsSn1 -2pFlosc9/qEbO5drqNoxUZfeF0L9RUSuArHRSO779dW/AmOtFdK3yaBGqflg0r7p -lYombA== ------END CERTIFICATE----- diff --git a/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.go b/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.go deleted file mode 100644 index 0f67e0759c..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.go +++ /dev/null @@ -1,57 +0,0 @@ -package testdata - -import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" - "io/ioutil" - "path" - "runtime" -) - -var certPath string - -func init() { - _, filename, _, ok := runtime.Caller(0) - if !ok { - panic("Failed to get current frame") - } - - certPath = path.Dir(filename) -} - -// GetCertificatePaths returns the paths to certificate and key -func GetCertificatePaths() (string, string) { - return path.Join(certPath, "cert.pem"), path.Join(certPath, "priv.key") -} - -// GetTLSConfig returns a tls config for quic.clemente.io -func GetTLSConfig() *tls.Config { - cert, err := tls.LoadX509KeyPair(GetCertificatePaths()) - if err != nil { - panic(err) - } - return &tls.Config{ - Certificates: []tls.Certificate{cert}, - } -} - -// GetRootCA returns an x509.CertPool containing the CA certificate -func GetRootCA() *x509.CertPool { - caCertPath := path.Join(certPath, "ca.pem") - caCertRaw, err := ioutil.ReadFile(caCertPath) - if err != nil { - panic(err) - } - p, _ := pem.Decode(caCertRaw) - if p.Type != "CERTIFICATE" { - panic("expected a certificate") - } - caCert, err := x509.ParseCertificate(p.Bytes) - if err != nil { - panic(err) - } - certPool := x509.NewCertPool() - certPool.AddCert(caCert) - return certPool -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.pem b/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.pem deleted file mode 100644 index 28e66b7076..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/testdata/cert.pem +++ /dev/null @@ -1,18 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIC3jCCAcYCCQCV4BOv+SRo4zANBgkqhkiG9w0BAQUFADAqMRMwEQYDVQQKDApx -dWljLWdvIENBMRMwEQYDVQQLDApxdWljLWdvIENBMB4XDTE4MTIwODA2NDMwMloX -DTI4MTIwNTA2NDMwMlowODEQMA4GA1UECgwHcXVpYy1nbzEQMA4GA1UECwwHcXVp -Yy1nbzESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAyc/hS8XHkOJaLrdPOSTZFUBVyHNSfQUX/3dEpmccPlLQLgopYZZO -W/cVhkxAfQ3e68xKkuZKfZN5Hytn5V/AOSk281BqxFxpfCcKVYqVpDZH99+jaVfG -ImPp5Y22qCnbSEwYrMTcLiK8PVa4MkpKf1KNacVlqawU+ZWI5fevAFGTtmrMJ4S+ -qZY7tAaVkax+OiKWWfhLQjJCsN3IIDysTfbWao6cYKgtTfqVChEddzS7LRJVRaB+ -+huUbB87tRBJbCuJX65yB7Fw77YiKoFjc5r2845fcS2Ew4+w29mbXoj7M7g6eup5 -SnCydsCvyNy6VkgaSlWS0DXvxuzWshwUrwIDAQABMA0GCSqGSIb3DQEBBQUAA4IB -AQBWgmFunf44X3/NIjNvVLeQsfGW+4L/lCi2F5tqa70Hkda+xhKACnQQGB2qCSCF -Jfxj4iKrFJ7+JB8GnribWthLuDq49PQrTI+1wKFd9c2b8DXzJLz4Onw+mPX97pZm -TflQSIxXRaFAIQuUWNTArZZEe1ESSlnaBuE5w77LMf4GMFD3P3jzSHKUyM1sF97j -gRbIt8Jw7Uyd8vlXk6m2wvO5H3hZrrhJUJH3WW13a7wLJRnff2meKU90hkLQwuxO -kyh0k/h158/r2ibiahTmQEgHs9vQaCM+HXuk5P+Tzq5Zl/n0dMFZMfkqNkD4nym/ -nu7zfdwMlcBjKt9g3BGw+KE3 ------END CERTIFICATE----- diff --git a/external/github.com/lucas-clemente/quic-go/internal/testdata/priv.key b/external/github.com/lucas-clemente/quic-go/internal/testdata/priv.key deleted file mode 100644 index cd3dd0cfce..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/testdata/priv.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEogIBAAKCAQEAyc/hS8XHkOJaLrdPOSTZFUBVyHNSfQUX/3dEpmccPlLQLgop -YZZOW/cVhkxAfQ3e68xKkuZKfZN5Hytn5V/AOSk281BqxFxpfCcKVYqVpDZH99+j -aVfGImPp5Y22qCnbSEwYrMTcLiK8PVa4MkpKf1KNacVlqawU+ZWI5fevAFGTtmrM -J4S+qZY7tAaVkax+OiKWWfhLQjJCsN3IIDysTfbWao6cYKgtTfqVChEddzS7LRJV -RaB++huUbB87tRBJbCuJX65yB7Fw77YiKoFjc5r2845fcS2Ew4+w29mbXoj7M7g6 -eup5SnCydsCvyNy6VkgaSlWS0DXvxuzWshwUrwIDAQABAoIBADunQwVO1Qqync2p -SbWueqyZc8HotL1XwBw3eQdm+yZA/GBfiJPcBhWRF7+20mkkrHwuyuxZPjOYX/ki -r3dRslQzJpcNckHQvy1/rMJUUJ9VnDhc1sTQuTR5LC46kX9rv/HC7JhFKIBKrDHF -bHURGKxCDqLxQnfA8gJEfU7cw9HnxMxmKv7qJ3O7EHYMuTQstkYsGOr60zX/C+Zm -7YA+d7nx1LpL0m2lKs70iz5MzGg+KgKyrkMWQ30gpxILBxNzzuQr7Kv/+63/3+G9 -nfCGeLmwGakPFpm6/GwiABE0yGa71YNAQs18iUTZwP/ZEDw3KB2SoG8wcqWjNAd+ -cUF2PgECgYEA5Xe/OZouw9h0NBo0Zut+HC0YOuUfY72Ug9Fm8bAS6wDuPiO3jIvK -J40d+ZHNp4AakfTuugiqEDJRlV7T/F2K/KHDWvXTg5ZpAC8dsZKJMxyyAp8EniYQ -vsoFWeHBfsD83rCVKLcjDB3hbQH+MSoT3lsqjZRNiNUMK13gyuX7k28CgYEA4SWF -ySRXUqUezX5D8kV5rQVYLcw6WVB3czYd7cKf8zHy4xJX0ZicyZjohknMmKCkdx+M -1mrxlqUO7EBGokM8vs87m/4rz6bjgZffpWzUmP/x1+3f3j/wIZeqNilW8NqY5nLi -tj3JxMwaesU86rOekSy27BlX4sjQ8NRs7Z2d8sECgYBKAD8kBWwVbqWy88x4cHOA -BK7ut1tTIB1YEVzgjobbULaERaJ46c/sx16mUHYBEZf///xI9Ghbxs52nFlC5qve -4xAMMoDey8/a5lbuIDKs0BE8NSoZEm+OB7qIDP0IspYZ/tprgfwEeVJshBsEoew8 -Ziwn8m66tPIyvhizdk2WcwKBgH2M8RgDffaGQbESEk3N1FZZvpx7YKZhqtrCeNoX -SB7T4cAigHpPAk+hRzlref46xrvvChiftmztSm8QQNNHb15wLauFh2Taic/Ao2Sa -VcukHnbtHYPQX9Y7vx1I3ESfgdgwhKBfwF5P+wwvZRL0ax5FsxPh5hJ/LZS+wKeY -13WBAoGAXSqG3ANmCyvSLVmAXGIbr0Tuixf/a25sPrlq7Im1H1OnqLrcyxWCLV3E -6gprhG5An0Zlr/FFRxVojf0TKmtJZs9B70/6WPwVvFtBduCM1zuUuCQYU9opTJQL -ElMIP4VfjABm4tm1fqGIy1PQP0Osb6/qb2DPPJqsFiW0oRByyMA= ------END RSA PRIVATE KEY----- diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/atomic_bool.go b/external/github.com/lucas-clemente/quic-go/internal/utils/atomic_bool.go deleted file mode 100644 index cf4642504e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/atomic_bool.go +++ /dev/null @@ -1,22 +0,0 @@ -package utils - -import "sync/atomic" - -// An AtomicBool is an atomic bool -type AtomicBool struct { - v int32 -} - -// Set sets the value -func (a *AtomicBool) Set(value bool) { - var n int32 - if value { - n = 1 - } - atomic.StoreInt32(&a.v, n) -} - -// Get gets the value -func (a *AtomicBool) Get() bool { - return atomic.LoadInt32(&a.v) != 0 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/byteinterval_linkedlist.go b/external/github.com/lucas-clemente/quic-go/internal/utils/byteinterval_linkedlist.go deleted file mode 100644 index 096023ef28..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/byteinterval_linkedlist.go +++ /dev/null @@ -1,217 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package utils - -// Linked list implementation from the Go standard library. - -// ByteIntervalElement is an element of a linked list. -type ByteIntervalElement struct { - // Next and previous pointers in the doubly-linked list of elements. - // To simplify the implementation, internally a list l is implemented - // as a ring, such that &l.root is both the next element of the last - // list element (l.Back()) and the previous element of the first list - // element (l.Front()). - next, prev *ByteIntervalElement - - // The list to which this element belongs. - list *ByteIntervalList - - // The value stored with this element. - Value ByteInterval -} - -// Next returns the next list element or nil. -func (e *ByteIntervalElement) Next() *ByteIntervalElement { - if p := e.next; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// Prev returns the previous list element or nil. -func (e *ByteIntervalElement) Prev() *ByteIntervalElement { - if p := e.prev; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// ByteIntervalList is a linked list of ByteIntervals. -type ByteIntervalList struct { - root ByteIntervalElement // sentinel list element, only &root, root.prev, and root.next are used - len int // current list length excluding (this) sentinel element -} - -// Init initializes or clears list l. -func (l *ByteIntervalList) Init() *ByteIntervalList { - l.root.next = &l.root - l.root.prev = &l.root - l.len = 0 - return l -} - -// NewByteIntervalList returns an initialized list. -func NewByteIntervalList() *ByteIntervalList { return new(ByteIntervalList).Init() } - -// Len returns the number of elements of list l. -// The complexity is O(1). -func (l *ByteIntervalList) Len() int { return l.len } - -// Front returns the first element of list l or nil if the list is empty. -func (l *ByteIntervalList) Front() *ByteIntervalElement { - if l.len == 0 { - return nil - } - return l.root.next -} - -// Back returns the last element of list l or nil if the list is empty. -func (l *ByteIntervalList) Back() *ByteIntervalElement { - if l.len == 0 { - return nil - } - return l.root.prev -} - -// lazyInit lazily initializes a zero List value. -func (l *ByteIntervalList) lazyInit() { - if l.root.next == nil { - l.Init() - } -} - -// insert inserts e after at, increments l.len, and returns e. -func (l *ByteIntervalList) insert(e, at *ByteIntervalElement) *ByteIntervalElement { - n := at.next - at.next = e - e.prev = at - e.next = n - n.prev = e - e.list = l - l.len++ - return e -} - -// insertValue is a convenience wrapper for insert(&Element{Value: v}, at). -func (l *ByteIntervalList) insertValue(v ByteInterval, at *ByteIntervalElement) *ByteIntervalElement { - return l.insert(&ByteIntervalElement{Value: v}, at) -} - -// remove removes e from its list, decrements l.len, and returns e. -func (l *ByteIntervalList) remove(e *ByteIntervalElement) *ByteIntervalElement { - e.prev.next = e.next - e.next.prev = e.prev - e.next = nil // avoid memory leaks - e.prev = nil // avoid memory leaks - e.list = nil - l.len-- - return e -} - -// Remove removes e from l if e is an element of list l. -// It returns the element value e.Value. -// The element must not be nil. -func (l *ByteIntervalList) Remove(e *ByteIntervalElement) ByteInterval { - if e.list == l { - // if e.list == l, l must have been initialized when e was inserted - // in l or l == nil (e is a zero Element) and l.remove will crash - l.remove(e) - } - return e.Value -} - -// PushFront inserts a new element e with value v at the front of list l and returns e. -func (l *ByteIntervalList) PushFront(v ByteInterval) *ByteIntervalElement { - l.lazyInit() - return l.insertValue(v, &l.root) -} - -// PushBack inserts a new element e with value v at the back of list l and returns e. -func (l *ByteIntervalList) PushBack(v ByteInterval) *ByteIntervalElement { - l.lazyInit() - return l.insertValue(v, l.root.prev) -} - -// InsertBefore inserts a new element e with value v immediately before mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *ByteIntervalList) InsertBefore(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark.prev) -} - -// InsertAfter inserts a new element e with value v immediately after mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *ByteIntervalList) InsertAfter(v ByteInterval, mark *ByteIntervalElement) *ByteIntervalElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark) -} - -// MoveToFront moves element e to the front of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *ByteIntervalList) MoveToFront(e *ByteIntervalElement) { - if e.list != l || l.root.next == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), &l.root) -} - -// MoveToBack moves element e to the back of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *ByteIntervalList) MoveToBack(e *ByteIntervalElement) { - if e.list != l || l.root.prev == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), l.root.prev) -} - -// MoveBefore moves element e to its new position before mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *ByteIntervalList) MoveBefore(e, mark *ByteIntervalElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark.prev) -} - -// MoveAfter moves element e to its new position after mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *ByteIntervalList) MoveAfter(e, mark *ByteIntervalElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark) -} - -// PushBackList inserts a copy of an other list at the back of list l. -// The lists l and other may be the same. They must not be nil. -func (l *ByteIntervalList) PushBackList(other *ByteIntervalList) { - l.lazyInit() - for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() { - l.insertValue(e.Value, l.root.prev) - } -} - -// PushFrontList inserts a copy of an other list at the front of list l. -// The lists l and other may be the same. They must not be nil. -func (l *ByteIntervalList) PushFrontList(other *ByteIntervalList) { - l.lazyInit() - for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() { - l.insertValue(e.Value, &l.root) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder.go b/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder.go deleted file mode 100644 index 6b92cfa262..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder.go +++ /dev/null @@ -1,17 +0,0 @@ -package utils - -import ( - "bytes" - "io" -) - -// A ByteOrder specifies how to convert byte sequences into 16-, 32-, or 64-bit unsigned integers. -type ByteOrder interface { - ReadUintN(b io.ByteReader, length uint8) (uint64, error) - ReadUint32(io.ByteReader) (uint32, error) - ReadUint16(io.ByteReader) (uint16, error) - - WriteUintN(b *bytes.Buffer, length uint8, value uint64) - WriteUint32(*bytes.Buffer, uint32) - WriteUint16(*bytes.Buffer, uint16) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder_big_endian.go b/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder_big_endian.go deleted file mode 100644 index eede9cd72e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/byteorder_big_endian.go +++ /dev/null @@ -1,74 +0,0 @@ -package utils - -import ( - "bytes" - "io" -) - -// BigEndian is the big-endian implementation of ByteOrder. -var BigEndian ByteOrder = bigEndian{} - -type bigEndian struct{} - -var _ ByteOrder = &bigEndian{} - -// ReadUintN reads N bytes -func (bigEndian) ReadUintN(b io.ByteReader, length uint8) (uint64, error) { - var res uint64 - for i := uint8(0); i < length; i++ { - bt, err := b.ReadByte() - if err != nil { - return 0, err - } - res ^= uint64(bt) << ((length - 1 - i) * 8) - } - return res, nil -} - -// ReadUint32 reads a uint32 -func (bigEndian) ReadUint32(b io.ByteReader) (uint32, error) { - var b1, b2, b3, b4 uint8 - var err error - if b4, err = b.ReadByte(); err != nil { - return 0, err - } - if b3, err = b.ReadByte(); err != nil { - return 0, err - } - if b2, err = b.ReadByte(); err != nil { - return 0, err - } - if b1, err = b.ReadByte(); err != nil { - return 0, err - } - return uint32(b1) + uint32(b2)<<8 + uint32(b3)<<16 + uint32(b4)<<24, nil -} - -// ReadUint16 reads a uint16 -func (bigEndian) ReadUint16(b io.ByteReader) (uint16, error) { - var b1, b2 uint8 - var err error - if b2, err = b.ReadByte(); err != nil { - return 0, err - } - if b1, err = b.ReadByte(); err != nil { - return 0, err - } - return uint16(b1) + uint16(b2)<<8, nil -} - -func (bigEndian) WriteUintN(b *bytes.Buffer, length uint8, i uint64) { - for j := length; j > 0; j-- { - b.WriteByte(uint8(i >> (8 * (j - 1)))) - } -} - -// WriteUint32 writes a uint32 -func (bigEndian) WriteUint32(b *bytes.Buffer, i uint32) { - b.Write([]byte{uint8(i >> 24), uint8(i >> 16), uint8(i >> 8), uint8(i)}) -} - -// WriteUint16 writes a uint16 -func (bigEndian) WriteUint16(b *bytes.Buffer, i uint16) { - b.Write([]byte{uint8(i >> 8), uint8(i)}) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/gen.go b/external/github.com/lucas-clemente/quic-go/internal/utils/gen.go deleted file mode 100644 index bb839be66e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/gen.go +++ /dev/null @@ -1,4 +0,0 @@ -package utils - -//go:generate genny -pkg utils -in linkedlist/linkedlist.go -out byteinterval_linkedlist.go gen Item=ByteInterval -//go:generate genny -pkg utils -in linkedlist/linkedlist.go -out packetinterval_linkedlist.go gen Item=PacketInterval diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/host.go b/external/github.com/lucas-clemente/quic-go/internal/utils/host.go deleted file mode 100644 index a1d6453b0c..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/host.go +++ /dev/null @@ -1,27 +0,0 @@ -package utils - -import ( - "net/url" - "strings" -) - -// HostnameFromAddr determines the hostname in an address string -func HostnameFromAddr(addr string) (string, error) { - p, err := url.Parse(addr) - if err != nil { - return "", err - } - h := p.Host - - // copied from https://golang.org/src/net/http/transport.go - if hasPort(h) { - h = h[:strings.LastIndex(h, ":")] - } - - return h, nil -} - -// copied from https://golang.org/src/net/http/http.go -func hasPort(s string) bool { - return strings.LastIndex(s, ":") > strings.LastIndex(s, "]") -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/README.md b/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/README.md deleted file mode 100644 index 15b46dce5d..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Usage - -This is the Go standard library implementation of a linked list -(https://golang.org/src/container/list/list.go), modified such that genny -(https://github.com/cheekybits/genny) can be used to generate a typed linked -list. - -To generate, run -``` -genny -pkg $PACKAGE -in linkedlist.go -out $OUTFILE gen Item=$TYPE -``` diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/linkedlist.go b/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/linkedlist.go deleted file mode 100644 index 06d32959cf..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/linkedlist/linkedlist.go +++ /dev/null @@ -1,218 +0,0 @@ -package linkedlist - -import "v2ray.com/core/external/github.com/cheekybits/genny/generic" - -// Linked list implementation from the Go standard library. - -// Item is a generic type. -type Item generic.Type - -// ItemElement is an element of a linked list. -type ItemElement struct { - // Next and previous pointers in the doubly-linked list of elements. - // To simplify the implementation, internally a list l is implemented - // as a ring, such that &l.root is both the next element of the last - // list element (l.Back()) and the previous element of the first list - // element (l.Front()). - next, prev *ItemElement - - // The list to which this element belongs. - list *ItemList - - // The value stored with this element. - Value Item -} - -// Next returns the next list element or nil. -func (e *ItemElement) Next() *ItemElement { - if p := e.next; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// Prev returns the previous list element or nil. -func (e *ItemElement) Prev() *ItemElement { - if p := e.prev; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// ItemList is a linked list of Items. -type ItemList struct { - root ItemElement // sentinel list element, only &root, root.prev, and root.next are used - len int // current list length excluding (this) sentinel element -} - -// Init initializes or clears list l. -func (l *ItemList) Init() *ItemList { - l.root.next = &l.root - l.root.prev = &l.root - l.len = 0 - return l -} - -// NewItemList returns an initialized list. -func NewItemList() *ItemList { return new(ItemList).Init() } - -// Len returns the number of elements of list l. -// The complexity is O(1). -func (l *ItemList) Len() int { return l.len } - -// Front returns the first element of list l or nil if the list is empty. -func (l *ItemList) Front() *ItemElement { - if l.len == 0 { - return nil - } - return l.root.next -} - -// Back returns the last element of list l or nil if the list is empty. -func (l *ItemList) Back() *ItemElement { - if l.len == 0 { - return nil - } - return l.root.prev -} - -// lazyInit lazily initializes a zero List value. -func (l *ItemList) lazyInit() { - if l.root.next == nil { - l.Init() - } -} - -// insert inserts e after at, increments l.len, and returns e. -func (l *ItemList) insert(e, at *ItemElement) *ItemElement { - n := at.next - at.next = e - e.prev = at - e.next = n - n.prev = e - e.list = l - l.len++ - return e -} - -// insertValue is a convenience wrapper for insert(&Element{Value: v}, at). -func (l *ItemList) insertValue(v Item, at *ItemElement) *ItemElement { - return l.insert(&ItemElement{Value: v}, at) -} - -// remove removes e from its list, decrements l.len, and returns e. -func (l *ItemList) remove(e *ItemElement) *ItemElement { - e.prev.next = e.next - e.next.prev = e.prev - e.next = nil // avoid memory leaks - e.prev = nil // avoid memory leaks - e.list = nil - l.len-- - return e -} - -// Remove removes e from l if e is an element of list l. -// It returns the element value e.Value. -// The element must not be nil. -func (l *ItemList) Remove(e *ItemElement) Item { - if e.list == l { - // if e.list == l, l must have been initialized when e was inserted - // in l or l == nil (e is a zero Element) and l.remove will crash - l.remove(e) - } - return e.Value -} - -// PushFront inserts a new element e with value v at the front of list l and returns e. -func (l *ItemList) PushFront(v Item) *ItemElement { - l.lazyInit() - return l.insertValue(v, &l.root) -} - -// PushBack inserts a new element e with value v at the back of list l and returns e. -func (l *ItemList) PushBack(v Item) *ItemElement { - l.lazyInit() - return l.insertValue(v, l.root.prev) -} - -// InsertBefore inserts a new element e with value v immediately before mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *ItemList) InsertBefore(v Item, mark *ItemElement) *ItemElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark.prev) -} - -// InsertAfter inserts a new element e with value v immediately after mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *ItemList) InsertAfter(v Item, mark *ItemElement) *ItemElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark) -} - -// MoveToFront moves element e to the front of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *ItemList) MoveToFront(e *ItemElement) { - if e.list != l || l.root.next == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), &l.root) -} - -// MoveToBack moves element e to the back of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *ItemList) MoveToBack(e *ItemElement) { - if e.list != l || l.root.prev == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), l.root.prev) -} - -// MoveBefore moves element e to its new position before mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *ItemList) MoveBefore(e, mark *ItemElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark.prev) -} - -// MoveAfter moves element e to its new position after mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *ItemList) MoveAfter(e, mark *ItemElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark) -} - -// PushBackList inserts a copy of an other list at the back of list l. -// The lists l and other may be the same. They must not be nil. -func (l *ItemList) PushBackList(other *ItemList) { - l.lazyInit() - for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() { - l.insertValue(e.Value, l.root.prev) - } -} - -// PushFrontList inserts a copy of an other list at the front of list l. -// The lists l and other may be the same. They must not be nil. -func (l *ItemList) PushFrontList(other *ItemList) { - l.lazyInit() - for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() { - l.insertValue(e.Value, &l.root) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/log.go b/external/github.com/lucas-clemente/quic-go/internal/utils/log.go deleted file mode 100644 index 63d5e23d7a..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/log.go +++ /dev/null @@ -1,64 +0,0 @@ -package utils - -// LogLevel of quic-go -type LogLevel uint8 - -const ( - // LogLevelNothing disables - LogLevelNothing LogLevel = iota - // LogLevelError enables err logs - LogLevelError - // LogLevelInfo enables info logs (e.g. packets) - LogLevelInfo - // LogLevelDebug enables debug logs (e.g. packet contents) - LogLevelDebug -) - -// A Logger logs. -type Logger interface { - SetLogLevel(LogLevel) - SetLogTimeFormat(format string) - WithPrefix(prefix string) Logger - Debug() bool - - Errorf(format string, args ...interface{}) - Infof(format string, args ...interface{}) - Debugf(format string, args ...interface{}) -} - -// DefaultLogger is used by quic-go for logging. -var DefaultLogger Logger - -type defaultLogger struct{} - -var _ Logger = &defaultLogger{} - -// SetLogLevel sets the log level -func (l *defaultLogger) SetLogLevel(level LogLevel) { -} - -// SetLogTimeFormat sets the format of the timestamp -// an empty string disables the logging of timestamps -func (l *defaultLogger) SetLogTimeFormat(format string) {} - -// Debugf logs something -func (l *defaultLogger) Debugf(format string, args ...interface{}) {} - -// Infof logs something -func (l *defaultLogger) Infof(format string, args ...interface{}) {} - -// Errorf logs something -func (l *defaultLogger) Errorf(format string, args ...interface{}) {} - -func (l *defaultLogger) WithPrefix(prefix string) Logger { - return l -} - -// Debug returns true if the log level is LogLevelDebug -func (l *defaultLogger) Debug() bool { - return false -} - -func init() { - DefaultLogger = &defaultLogger{} -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/minmax.go b/external/github.com/lucas-clemente/quic-go/internal/utils/minmax.go deleted file mode 100644 index d245ea7d37..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/minmax.go +++ /dev/null @@ -1,159 +0,0 @@ -package utils - -import ( - "math" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// InfDuration is a duration of infinite length -const InfDuration = time.Duration(math.MaxInt64) - -// Max returns the maximum of two Ints -func Max(a, b int) int { - if a < b { - return b - } - return a -} - -// MaxUint32 returns the maximum of two uint32 -func MaxUint32(a, b uint32) uint32 { - if a < b { - return b - } - return a -} - -// MaxUint64 returns the maximum of two uint64 -func MaxUint64(a, b uint64) uint64 { - if a < b { - return b - } - return a -} - -// MinUint64 returns the maximum of two uint64 -func MinUint64(a, b uint64) uint64 { - if a < b { - return a - } - return b -} - -// Min returns the minimum of two Ints -func Min(a, b int) int { - if a < b { - return a - } - return b -} - -// MinUint32 returns the maximum of two uint32 -func MinUint32(a, b uint32) uint32 { - if a < b { - return a - } - return b -} - -// MinInt64 returns the minimum of two int64 -func MinInt64(a, b int64) int64 { - if a < b { - return a - } - return b -} - -// MaxInt64 returns the minimum of two int64 -func MaxInt64(a, b int64) int64 { - if a > b { - return a - } - return b -} - -// MinByteCount returns the minimum of two ByteCounts -func MinByteCount(a, b protocol.ByteCount) protocol.ByteCount { - if a < b { - return a - } - return b -} - -// MaxByteCount returns the maximum of two ByteCounts -func MaxByteCount(a, b protocol.ByteCount) protocol.ByteCount { - if a < b { - return b - } - return a -} - -// MaxDuration returns the max duration -func MaxDuration(a, b time.Duration) time.Duration { - if a > b { - return a - } - return b -} - -// MinDuration returns the minimum duration -func MinDuration(a, b time.Duration) time.Duration { - if a > b { - return b - } - return a -} - -// AbsDuration returns the absolute value of a time duration -func AbsDuration(d time.Duration) time.Duration { - if d >= 0 { - return d - } - return -d -} - -// MinTime returns the earlier time -func MinTime(a, b time.Time) time.Time { - if a.After(b) { - return b - } - return a -} - -// MinNonZeroTime returns the earlist time that is not time.Time{} -// If both a and b are time.Time{}, it returns time.Time{} -func MinNonZeroTime(a, b time.Time) time.Time { - if a.IsZero() { - return b - } - if b.IsZero() { - return a - } - return MinTime(a, b) -} - -// MaxTime returns the later time -func MaxTime(a, b time.Time) time.Time { - if a.After(b) { - return a - } - return b -} - -// MaxPacketNumber returns the max packet number -func MaxPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber { - if a > b { - return a - } - return b -} - -// MinPacketNumber returns the min packet number -func MinPacketNumber(a, b protocol.PacketNumber) protocol.PacketNumber { - if a < b { - return a - } - return b -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/packet_interval.go b/external/github.com/lucas-clemente/quic-go/internal/utils/packet_interval.go deleted file mode 100644 index 7e5707dcf0..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/packet_interval.go +++ /dev/null @@ -1,9 +0,0 @@ -package utils - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -// PacketInterval is an interval from one PacketNumber to the other -type PacketInterval struct { - Start protocol.PacketNumber - End protocol.PacketNumber -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/packetinterval_linkedlist.go b/external/github.com/lucas-clemente/quic-go/internal/utils/packetinterval_linkedlist.go deleted file mode 100644 index b461e85a96..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/packetinterval_linkedlist.go +++ /dev/null @@ -1,217 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package utils - -// Linked list implementation from the Go standard library. - -// PacketIntervalElement is an element of a linked list. -type PacketIntervalElement struct { - // Next and previous pointers in the doubly-linked list of elements. - // To simplify the implementation, internally a list l is implemented - // as a ring, such that &l.root is both the next element of the last - // list element (l.Back()) and the previous element of the first list - // element (l.Front()). - next, prev *PacketIntervalElement - - // The list to which this element belongs. - list *PacketIntervalList - - // The value stored with this element. - Value PacketInterval -} - -// Next returns the next list element or nil. -func (e *PacketIntervalElement) Next() *PacketIntervalElement { - if p := e.next; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// Prev returns the previous list element or nil. -func (e *PacketIntervalElement) Prev() *PacketIntervalElement { - if p := e.prev; e.list != nil && p != &e.list.root { - return p - } - return nil -} - -// PacketIntervalList is a linked list of PacketIntervals. -type PacketIntervalList struct { - root PacketIntervalElement // sentinel list element, only &root, root.prev, and root.next are used - len int // current list length excluding (this) sentinel element -} - -// Init initializes or clears list l. -func (l *PacketIntervalList) Init() *PacketIntervalList { - l.root.next = &l.root - l.root.prev = &l.root - l.len = 0 - return l -} - -// NewPacketIntervalList returns an initialized list. -func NewPacketIntervalList() *PacketIntervalList { return new(PacketIntervalList).Init() } - -// Len returns the number of elements of list l. -// The complexity is O(1). -func (l *PacketIntervalList) Len() int { return l.len } - -// Front returns the first element of list l or nil if the list is empty. -func (l *PacketIntervalList) Front() *PacketIntervalElement { - if l.len == 0 { - return nil - } - return l.root.next -} - -// Back returns the last element of list l or nil if the list is empty. -func (l *PacketIntervalList) Back() *PacketIntervalElement { - if l.len == 0 { - return nil - } - return l.root.prev -} - -// lazyInit lazily initializes a zero List value. -func (l *PacketIntervalList) lazyInit() { - if l.root.next == nil { - l.Init() - } -} - -// insert inserts e after at, increments l.len, and returns e. -func (l *PacketIntervalList) insert(e, at *PacketIntervalElement) *PacketIntervalElement { - n := at.next - at.next = e - e.prev = at - e.next = n - n.prev = e - e.list = l - l.len++ - return e -} - -// insertValue is a convenience wrapper for insert(&Element{Value: v}, at). -func (l *PacketIntervalList) insertValue(v PacketInterval, at *PacketIntervalElement) *PacketIntervalElement { - return l.insert(&PacketIntervalElement{Value: v}, at) -} - -// remove removes e from its list, decrements l.len, and returns e. -func (l *PacketIntervalList) remove(e *PacketIntervalElement) *PacketIntervalElement { - e.prev.next = e.next - e.next.prev = e.prev - e.next = nil // avoid memory leaks - e.prev = nil // avoid memory leaks - e.list = nil - l.len-- - return e -} - -// Remove removes e from l if e is an element of list l. -// It returns the element value e.Value. -// The element must not be nil. -func (l *PacketIntervalList) Remove(e *PacketIntervalElement) PacketInterval { - if e.list == l { - // if e.list == l, l must have been initialized when e was inserted - // in l or l == nil (e is a zero Element) and l.remove will crash - l.remove(e) - } - return e.Value -} - -// PushFront inserts a new element e with value v at the front of list l and returns e. -func (l *PacketIntervalList) PushFront(v PacketInterval) *PacketIntervalElement { - l.lazyInit() - return l.insertValue(v, &l.root) -} - -// PushBack inserts a new element e with value v at the back of list l and returns e. -func (l *PacketIntervalList) PushBack(v PacketInterval) *PacketIntervalElement { - l.lazyInit() - return l.insertValue(v, l.root.prev) -} - -// InsertBefore inserts a new element e with value v immediately before mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *PacketIntervalList) InsertBefore(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark.prev) -} - -// InsertAfter inserts a new element e with value v immediately after mark and returns e. -// If mark is not an element of l, the list is not modified. -// The mark must not be nil. -func (l *PacketIntervalList) InsertAfter(v PacketInterval, mark *PacketIntervalElement) *PacketIntervalElement { - if mark.list != l { - return nil - } - // see comment in List.Remove about initialization of l - return l.insertValue(v, mark) -} - -// MoveToFront moves element e to the front of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *PacketIntervalList) MoveToFront(e *PacketIntervalElement) { - if e.list != l || l.root.next == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), &l.root) -} - -// MoveToBack moves element e to the back of list l. -// If e is not an element of l, the list is not modified. -// The element must not be nil. -func (l *PacketIntervalList) MoveToBack(e *PacketIntervalElement) { - if e.list != l || l.root.prev == e { - return - } - // see comment in List.Remove about initialization of l - l.insert(l.remove(e), l.root.prev) -} - -// MoveBefore moves element e to its new position before mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *PacketIntervalList) MoveBefore(e, mark *PacketIntervalElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark.prev) -} - -// MoveAfter moves element e to its new position after mark. -// If e or mark is not an element of l, or e == mark, the list is not modified. -// The element and mark must not be nil. -func (l *PacketIntervalList) MoveAfter(e, mark *PacketIntervalElement) { - if e.list != l || e == mark || mark.list != l { - return - } - l.insert(l.remove(e), mark) -} - -// PushBackList inserts a copy of an other list at the back of list l. -// The lists l and other may be the same. They must not be nil. -func (l *PacketIntervalList) PushBackList(other *PacketIntervalList) { - l.lazyInit() - for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() { - l.insertValue(e.Value, l.root.prev) - } -} - -// PushFrontList inserts a copy of an other list at the front of list l. -// The lists l and other may be the same. They must not be nil. -func (l *PacketIntervalList) PushFrontList(other *PacketIntervalList) { - l.lazyInit() - for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() { - l.insertValue(e.Value, &l.root) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/streamframe_interval.go b/external/github.com/lucas-clemente/quic-go/internal/utils/streamframe_interval.go deleted file mode 100644 index b1bc82b5fc..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/streamframe_interval.go +++ /dev/null @@ -1,9 +0,0 @@ -package utils - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -// ByteInterval is an interval from one ByteCount to the other -type ByteInterval struct { - Start protocol.ByteCount - End protocol.ByteCount -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/timer.go b/external/github.com/lucas-clemente/quic-go/internal/utils/timer.go deleted file mode 100644 index 1fefc6ec8e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/timer.go +++ /dev/null @@ -1,48 +0,0 @@ -package utils - -import ( - "math" - "time" -) - -// A Timer wrapper that behaves correctly when resetting -type Timer struct { - t *time.Timer - read bool - deadline time.Time -} - -// NewTimer creates a new timer that is not set -func NewTimer() *Timer { - return &Timer{t: time.NewTimer(time.Duration(math.MaxInt64))} -} - -// Chan returns the channel of the wrapped timer -func (t *Timer) Chan() <-chan time.Time { - return t.t.C -} - -// Reset the timer, no matter whether the value was read or not -func (t *Timer) Reset(deadline time.Time) { - if deadline.Equal(t.deadline) && !t.read { - // No need to reset the timer - return - } - - // We need to drain the timer if the value from its channel was not read yet. - // See https://groups.google.com/forum/#!topic/golang-dev/c9UUfASVPoU - if !t.t.Stop() && !t.read { - <-t.t.C - } - if !deadline.IsZero() { - t.t.Reset(time.Until(deadline)) - } - - t.read = false - t.deadline = deadline -} - -// SetRead should be called after the value from the chan was read -func (t *Timer) SetRead() { - t.read = true -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/varint.go b/external/github.com/lucas-clemente/quic-go/internal/utils/varint.go deleted file mode 100644 index 2cf8392986..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/varint.go +++ /dev/null @@ -1,101 +0,0 @@ -package utils - -import ( - "bytes" - "fmt" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// taken from the QUIC draft -const ( - maxVarInt1 = 63 - maxVarInt2 = 16383 - maxVarInt4 = 1073741823 - maxVarInt8 = 4611686018427387903 -) - -// ReadVarInt reads a number in the QUIC varint format -func ReadVarInt(b io.ByteReader) (uint64, error) { - firstByte, err := b.ReadByte() - if err != nil { - return 0, err - } - // the first two bits of the first byte encode the length - len := 1 << ((firstByte & 0xc0) >> 6) - b1 := firstByte & (0xff - 0xc0) - if len == 1 { - return uint64(b1), nil - } - b2, err := b.ReadByte() - if err != nil { - return 0, err - } - if len == 2 { - return uint64(b2) + uint64(b1)<<8, nil - } - b3, err := b.ReadByte() - if err != nil { - return 0, err - } - b4, err := b.ReadByte() - if err != nil { - return 0, err - } - if len == 4 { - return uint64(b4) + uint64(b3)<<8 + uint64(b2)<<16 + uint64(b1)<<24, nil - } - b5, err := b.ReadByte() - if err != nil { - return 0, err - } - b6, err := b.ReadByte() - if err != nil { - return 0, err - } - b7, err := b.ReadByte() - if err != nil { - return 0, err - } - b8, err := b.ReadByte() - if err != nil { - return 0, err - } - return uint64(b8) + uint64(b7)<<8 + uint64(b6)<<16 + uint64(b5)<<24 + uint64(b4)<<32 + uint64(b3)<<40 + uint64(b2)<<48 + uint64(b1)<<56, nil -} - -// WriteVarInt writes a number in the QUIC varint format -func WriteVarInt(b *bytes.Buffer, i uint64) { - if i <= maxVarInt1 { - b.WriteByte(uint8(i)) - } else if i <= maxVarInt2 { - b.Write([]byte{uint8(i>>8) | 0x40, uint8(i)}) - } else if i <= maxVarInt4 { - b.Write([]byte{uint8(i>>24) | 0x80, uint8(i >> 16), uint8(i >> 8), uint8(i)}) - } else if i <= maxVarInt8 { - b.Write([]byte{ - uint8(i>>56) | 0xc0, uint8(i >> 48), uint8(i >> 40), uint8(i >> 32), - uint8(i >> 24), uint8(i >> 16), uint8(i >> 8), uint8(i), - }) - } else { - panic(fmt.Sprintf("%#x doesn't fit into 62 bits", i)) - } -} - -// VarIntLen determines the number of bytes that will be needed to write a number -func VarIntLen(i uint64) protocol.ByteCount { - if i <= maxVarInt1 { - return 1 - } - if i <= maxVarInt2 { - return 2 - } - if i <= maxVarInt4 { - return 4 - } - if i <= maxVarInt8 { - return 8 - } - panic(fmt.Sprintf("%#x doesn't fit into 62 bits", i)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/utils/varint_packetnumber.go b/external/github.com/lucas-clemente/quic-go/internal/utils/varint_packetnumber.go deleted file mode 100644 index b220b4a244..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/utils/varint_packetnumber.go +++ /dev/null @@ -1,50 +0,0 @@ -package utils - -import ( - "bytes" - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// ReadVarIntPacketNumber reads a number in the QUIC varint packet number format -func ReadVarIntPacketNumber(b *bytes.Reader) (protocol.PacketNumber, protocol.PacketNumberLen, error) { - b1, err := b.ReadByte() - if err != nil { - return 0, 0, err - } - if b1&0x80 == 0 { - return protocol.PacketNumber(b1), protocol.PacketNumberLen1, nil - } - b2, err := b.ReadByte() - if err != nil { - return 0, 0, err - } - if b1&0x40 == 0 { - return protocol.PacketNumber(uint64(b1&0x3f)<<8 + uint64(b2)), protocol.PacketNumberLen2, nil - } - b3, err := b.ReadByte() - if err != nil { - return 0, 0, err - } - b4, err := b.ReadByte() - if err != nil { - return 0, 0, err - } - return protocol.PacketNumber(uint64(b1&0x3f)<<24 + uint64(b2)<<16 + uint64(b3)<<8 + uint64(b4)), protocol.PacketNumberLen4, nil -} - -// WriteVarIntPacketNumber writes a packet number in the QUIC varint packet number format -func WriteVarIntPacketNumber(b *bytes.Buffer, i protocol.PacketNumber, len protocol.PacketNumberLen) error { - switch len { - case protocol.PacketNumberLen1: - b.WriteByte(uint8(i & 0x7f)) - case protocol.PacketNumberLen2: - b.Write([]byte{(uint8(i>>8) & 0x3f) | 0x80, uint8(i)}) - case protocol.PacketNumberLen4: - b.Write([]byte{(uint8(i>>24) & 0x3f) | 0xc0, uint8(i >> 16), uint8(i >> 8), uint8(i)}) - default: - return fmt.Errorf("invalid packet number length: %d", len) - } - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/ack_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/ack_frame.go deleted file mode 100644 index 4af3de98ef..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/ack_frame.go +++ /dev/null @@ -1,229 +0,0 @@ -package wire - -import ( - "bytes" - "errors" - "sort" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// TODO: use the value sent in the transport parameters -const ackDelayExponent = 3 - -var errInvalidAckRanges = errors.New("AckFrame: ACK frame contains invalid ACK ranges") - -// An AckFrame is an ACK frame -type AckFrame struct { - AckRanges []AckRange // has to be ordered. The highest ACK range goes first, the lowest ACK range goes last - DelayTime time.Duration -} - -// parseAckFrame reads an ACK frame -func parseAckFrame(r *bytes.Reader, version protocol.VersionNumber) (*AckFrame, error) { - typeByte, err := r.ReadByte() - if err != nil { - return nil, err - } - ecn := typeByte&0x1 > 0 - - frame := &AckFrame{} - - la, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - largestAcked := protocol.PacketNumber(la) - delay, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - frame.DelayTime = time.Duration(delay*1< largestAcked { - return nil, errors.New("invalid first ACK range") - } - smallest := largestAcked - ackBlock - - // read all the other ACK ranges - frame.AckRanges = append(frame.AckRanges, AckRange{Smallest: smallest, Largest: largestAcked}) - for i := uint64(0); i < numBlocks; i++ { - g, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - gap := protocol.PacketNumber(g) - if smallest < gap+2 { - return nil, errInvalidAckRanges - } - largest := smallest - gap - 2 - - ab, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - ackBlock := protocol.PacketNumber(ab) - - if ackBlock > largest { - return nil, errInvalidAckRanges - } - smallest = largest - ackBlock - frame.AckRanges = append(frame.AckRanges, AckRange{Smallest: smallest, Largest: largest}) - } - - if !frame.validateAckRanges() { - return nil, errInvalidAckRanges - } - - // parse (and skip) the ECN section - if ecn { - for i := 0; i < 3; i++ { - if _, err := utils.ReadVarInt(r); err != nil { - return nil, err - } - } - } - - return frame, nil -} - -// Write writes an ACK frame. -func (f *AckFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x2) - utils.WriteVarInt(b, uint64(f.LargestAcked())) - utils.WriteVarInt(b, encodeAckDelay(f.DelayTime)) - - numRanges := f.numEncodableAckRanges() - utils.WriteVarInt(b, uint64(numRanges-1)) - - // write the first range - _, firstRange := f.encodeAckRange(0) - utils.WriteVarInt(b, firstRange) - - // write all the other range - for i := 1; i < numRanges; i++ { - gap, len := f.encodeAckRange(i) - utils.WriteVarInt(b, gap) - utils.WriteVarInt(b, len) - } - return nil -} - -// Length of a written frame -func (f *AckFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - largestAcked := f.AckRanges[0].Largest - numRanges := f.numEncodableAckRanges() - - length := 1 + utils.VarIntLen(uint64(largestAcked)) + utils.VarIntLen(encodeAckDelay(f.DelayTime)) - - length += utils.VarIntLen(uint64(numRanges - 1)) - lowestInFirstRange := f.AckRanges[0].Smallest - length += utils.VarIntLen(uint64(largestAcked - lowestInFirstRange)) - - for i := 1; i < numRanges; i++ { - gap, len := f.encodeAckRange(i) - length += utils.VarIntLen(gap) - length += utils.VarIntLen(len) - } - return length -} - -// gets the number of ACK ranges that can be encoded -// such that the resulting frame is smaller than the maximum ACK frame size -func (f *AckFrame) numEncodableAckRanges() int { - length := 1 + utils.VarIntLen(uint64(f.LargestAcked())) + utils.VarIntLen(encodeAckDelay(f.DelayTime)) - length += 2 // assume that the number of ranges will consume 2 bytes - for i := 1; i < len(f.AckRanges); i++ { - gap, len := f.encodeAckRange(i) - rangeLen := utils.VarIntLen(gap) + utils.VarIntLen(len) - if length+rangeLen > protocol.MaxAckFrameSize { - // Writing range i would exceed the MaxAckFrameSize. - // So encode one range less than that. - return i - 1 - } - length += rangeLen - } - return len(f.AckRanges) -} - -func (f *AckFrame) encodeAckRange(i int) (uint64 /* gap */, uint64 /* length */) { - if i == 0 { - return 0, uint64(f.AckRanges[0].Largest - f.AckRanges[0].Smallest) - } - return uint64(f.AckRanges[i-1].Smallest - f.AckRanges[i].Largest - 2), - uint64(f.AckRanges[i].Largest - f.AckRanges[i].Smallest) -} - -// HasMissingRanges returns if this frame reports any missing packets -func (f *AckFrame) HasMissingRanges() bool { - return len(f.AckRanges) > 1 -} - -func (f *AckFrame) validateAckRanges() bool { - if len(f.AckRanges) == 0 { - return false - } - - // check the validity of every single ACK range - for _, ackRange := range f.AckRanges { - if ackRange.Smallest > ackRange.Largest { - return false - } - } - - // check the consistency for ACK with multiple NACK ranges - for i, ackRange := range f.AckRanges { - if i == 0 { - continue - } - lastAckRange := f.AckRanges[i-1] - if lastAckRange.Smallest <= ackRange.Smallest { - return false - } - if lastAckRange.Smallest <= ackRange.Largest+1 { - return false - } - } - - return true -} - -// LargestAcked is the largest acked packet number -func (f *AckFrame) LargestAcked() protocol.PacketNumber { - return f.AckRanges[0].Largest -} - -// LowestAcked is the lowest acked packet number -func (f *AckFrame) LowestAcked() protocol.PacketNumber { - return f.AckRanges[len(f.AckRanges)-1].Smallest -} - -// AcksPacket determines if this ACK frame acks a certain packet number -func (f *AckFrame) AcksPacket(p protocol.PacketNumber) bool { - if p < f.LowestAcked() || p > f.LargestAcked() { - return false - } - - i := sort.Search(len(f.AckRanges), func(i int) bool { - return p >= f.AckRanges[i].Smallest - }) - // i will always be < len(f.AckRanges), since we checked above that p is not bigger than the largest acked - return p <= f.AckRanges[i].Largest -} - -func encodeAckDelay(delay time.Duration) uint64 { - return uint64(delay.Nanoseconds() / (1000 * (1 << ackDelayExponent))) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/ack_range.go b/external/github.com/lucas-clemente/quic-go/internal/wire/ack_range.go deleted file mode 100644 index a4d3dff6bb..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/ack_range.go +++ /dev/null @@ -1,14 +0,0 @@ -package wire - -import "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - -// AckRange is an ACK range -type AckRange struct { - Smallest protocol.PacketNumber - Largest protocol.PacketNumber -} - -// Len returns the number of packets contained in this ACK range -func (r AckRange) Len() protocol.PacketNumber { - return r.Largest - r.Smallest + 1 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/connection_close_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/connection_close_frame.go deleted file mode 100644 index 624f066d5a..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/connection_close_frame.go +++ /dev/null @@ -1,81 +0,0 @@ -package wire - -import ( - "bytes" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A ConnectionCloseFrame is a CONNECTION_CLOSE frame -type ConnectionCloseFrame struct { - IsApplicationError bool - ErrorCode qerr.ErrorCode - ReasonPhrase string -} - -func parseConnectionCloseFrame(r *bytes.Reader, version protocol.VersionNumber) (*ConnectionCloseFrame, error) { - typeByte, err := r.ReadByte() - if err != nil { - return nil, err - } - - f := &ConnectionCloseFrame{IsApplicationError: typeByte == 0x1d} - ec, err := utils.BigEndian.ReadUint16(r) - if err != nil { - return nil, err - } - f.ErrorCode = qerr.ErrorCode(ec) - // read the Frame Type, if this is not an application error - if !f.IsApplicationError { - if _, err := utils.ReadVarInt(r); err != nil { - return nil, err - } - } - var reasonPhraseLen uint64 - reasonPhraseLen, err = utils.ReadVarInt(r) - if err != nil { - return nil, err - } - // shortcut to prevent the unnecessary allocation of dataLen bytes - // if the dataLen is larger than the remaining length of the packet - // reading the whole reason phrase would result in EOF when attempting to READ - if int(reasonPhraseLen) > r.Len() { - return nil, io.EOF - } - - reasonPhrase := make([]byte, reasonPhraseLen) - if _, err := io.ReadFull(r, reasonPhrase); err != nil { - // this should never happen, since we already checked the reasonPhraseLen earlier - return nil, err - } - f.ReasonPhrase = string(reasonPhrase) - return f, nil -} - -// Length of a written frame -func (f *ConnectionCloseFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - length := 1 + 2 + utils.VarIntLen(uint64(len(f.ReasonPhrase))) + protocol.ByteCount(len(f.ReasonPhrase)) - if !f.IsApplicationError { - length++ // for the frame type - } - return length -} - -func (f *ConnectionCloseFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - if f.IsApplicationError { - b.WriteByte(0x1d) - } else { - b.WriteByte(0x1c) - } - - utils.BigEndian.WriteUint16(b, uint16(f.ErrorCode)) - if !f.IsApplicationError { - utils.WriteVarInt(b, 0) - } - utils.WriteVarInt(b, uint64(len(f.ReasonPhrase))) - b.WriteString(f.ReasonPhrase) - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/crypto_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/crypto_frame.go deleted file mode 100644 index c3aacb7285..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/crypto_frame.go +++ /dev/null @@ -1,71 +0,0 @@ -package wire - -import ( - "bytes" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A CryptoFrame is a CRYPTO frame -type CryptoFrame struct { - Offset protocol.ByteCount - Data []byte -} - -func parseCryptoFrame(r *bytes.Reader, _ protocol.VersionNumber) (*CryptoFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - frame := &CryptoFrame{} - offset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - frame.Offset = protocol.ByteCount(offset) - dataLen, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - if dataLen > uint64(r.Len()) { - return nil, io.EOF - } - if dataLen != 0 { - frame.Data = make([]byte, dataLen) - if _, err := io.ReadFull(r, frame.Data); err != nil { - // this should never happen, since we already checked the dataLen earlier - return nil, err - } - } - return frame, nil -} - -func (f *CryptoFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x6) - utils.WriteVarInt(b, uint64(f.Offset)) - utils.WriteVarInt(b, uint64(len(f.Data))) - b.Write(f.Data) - return nil -} - -// Length of a written frame -func (f *CryptoFrame) Length(_ protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.Offset)) + utils.VarIntLen(uint64(len(f.Data))) + protocol.ByteCount(len(f.Data)) -} - -// MaxDataLen returns the maximum data length -func (f *CryptoFrame) MaxDataLen(maxSize protocol.ByteCount) protocol.ByteCount { - // pretend that the data size will be 1 bytes - // if it turns out that varint encoding the length will consume 2 bytes, we need to adjust the data length afterwards - headerLen := 1 + utils.VarIntLen(uint64(f.Offset)) + 1 - if headerLen > maxSize { - return 0 - } - maxDataLen := maxSize - headerLen - if utils.VarIntLen(uint64(maxDataLen)) != 1 { - maxDataLen-- - } - return maxDataLen -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/data_blocked_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/data_blocked_frame.go deleted file mode 100644 index 66b7760c63..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/data_blocked_frame.go +++ /dev/null @@ -1,38 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A DataBlockedFrame is a DATA_BLOCKED frame -type DataBlockedFrame struct { - DataLimit protocol.ByteCount -} - -func parseDataBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*DataBlockedFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - offset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - return &DataBlockedFrame{ - DataLimit: protocol.ByteCount(offset), - }, nil -} - -func (f *DataBlockedFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - typeByte := uint8(0x14) - b.WriteByte(typeByte) - utils.WriteVarInt(b, uint64(f.DataLimit)) - return nil -} - -// Length of a written frame -func (f *DataBlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.DataLimit)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/extended_header.go b/external/github.com/lucas-clemente/quic-go/internal/wire/extended_header.go deleted file mode 100644 index 814ddd280f..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/extended_header.go +++ /dev/null @@ -1,204 +0,0 @@ -package wire - -import ( - "bytes" - "errors" - "fmt" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// ExtendedHeader is the header of a QUIC packet. -type ExtendedHeader struct { - Header - - typeByte byte - - PacketNumberLen protocol.PacketNumberLen - PacketNumber protocol.PacketNumber - - KeyPhase int -} - -func (h *ExtendedHeader) parse(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) { - // read the (now unencrypted) first byte - var err error - h.typeByte, err = b.ReadByte() - if err != nil { - return nil, err - } - if _, err := b.Seek(int64(h.ParsedLen())-1, io.SeekCurrent); err != nil { - return nil, err - } - if h.IsLongHeader { - return h.parseLongHeader(b, v) - } - return h.parseShortHeader(b, v) -} - -func (h *ExtendedHeader) parseLongHeader(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) { - if h.typeByte&0xc != 0 { - return nil, errors.New("5th and 6th bit must be 0") - } - if err := h.readPacketNumber(b); err != nil { - return nil, err - } - return h, nil -} - -func (h *ExtendedHeader) parseShortHeader(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) { - if h.typeByte&0x18 != 0 { - return nil, errors.New("4th and 5th bit must be 0") - } - - h.KeyPhase = int(h.typeByte&0x4) >> 2 - - if err := h.readPacketNumber(b); err != nil { - return nil, err - } - return h, nil -} - -func (h *ExtendedHeader) readPacketNumber(b *bytes.Reader) error { - h.PacketNumberLen = protocol.PacketNumberLen(h.typeByte&0x3) + 1 - pn, err := utils.BigEndian.ReadUintN(b, uint8(h.PacketNumberLen)) - if err != nil { - return err - } - h.PacketNumber = protocol.PacketNumber(pn) - return nil -} - -// Write writes the Header. -func (h *ExtendedHeader) Write(b *bytes.Buffer, ver protocol.VersionNumber) error { - if h.IsLongHeader { - return h.writeLongHeader(b, ver) - } - return h.writeShortHeader(b, ver) -} - -func (h *ExtendedHeader) writeLongHeader(b *bytes.Buffer, v protocol.VersionNumber) error { - var packetType uint8 - switch h.Type { - case protocol.PacketTypeInitial: - packetType = 0x0 - case protocol.PacketType0RTT: - packetType = 0x1 - case protocol.PacketTypeHandshake: - packetType = 0x2 - case protocol.PacketTypeRetry: - packetType = 0x3 - } - firstByte := 0xc0 | packetType<<4 - if h.Type == protocol.PacketTypeRetry { - odcil, err := encodeSingleConnIDLen(h.OrigDestConnectionID) - if err != nil { - return err - } - firstByte |= odcil - } else { // Retry packets don't have a packet number - firstByte |= uint8(h.PacketNumberLen - 1) - } - - b.WriteByte(firstByte) - utils.BigEndian.WriteUint32(b, uint32(h.Version)) - connIDLen, err := encodeConnIDLen(h.DestConnectionID, h.SrcConnectionID) - if err != nil { - return err - } - b.WriteByte(connIDLen) - b.Write(h.DestConnectionID.Bytes()) - b.Write(h.SrcConnectionID.Bytes()) - - switch h.Type { - case protocol.PacketTypeRetry: - b.Write(h.OrigDestConnectionID.Bytes()) - b.Write(h.Token) - return nil - case protocol.PacketTypeInitial: - utils.WriteVarInt(b, uint64(len(h.Token))) - b.Write(h.Token) - } - - utils.WriteVarInt(b, uint64(h.Length)) - return h.writePacketNumber(b) -} - -// TODO: add support for the key phase -func (h *ExtendedHeader) writeShortHeader(b *bytes.Buffer, v protocol.VersionNumber) error { - typeByte := 0x40 | uint8(h.PacketNumberLen-1) - typeByte |= byte(h.KeyPhase << 2) - - b.WriteByte(typeByte) - b.Write(h.DestConnectionID.Bytes()) - return h.writePacketNumber(b) -} - -func (h *ExtendedHeader) writePacketNumber(b *bytes.Buffer) error { - if h.PacketNumberLen == protocol.PacketNumberLenInvalid || h.PacketNumberLen > protocol.PacketNumberLen4 { - return fmt.Errorf("invalid packet number length: %d", h.PacketNumberLen) - } - utils.BigEndian.WriteUintN(b, uint8(h.PacketNumberLen), uint64(h.PacketNumber)) - return nil -} - -// GetLength determines the length of the Header. -func (h *ExtendedHeader) GetLength(v protocol.VersionNumber) protocol.ByteCount { - if h.IsLongHeader { - length := 1 /* type byte */ + 4 /* version */ + 1 /* conn id len byte */ + protocol.ByteCount(h.DestConnectionID.Len()+h.SrcConnectionID.Len()) + protocol.ByteCount(h.PacketNumberLen) + utils.VarIntLen(uint64(h.Length)) - if h.Type == protocol.PacketTypeInitial { - length += utils.VarIntLen(uint64(len(h.Token))) + protocol.ByteCount(len(h.Token)) - } - return length - } - - length := protocol.ByteCount(1 /* type byte */ + h.DestConnectionID.Len()) - length += protocol.ByteCount(h.PacketNumberLen) - return length -} - -// Log logs the Header -func (h *ExtendedHeader) Log(logger utils.Logger) { - if h.IsLongHeader { - var token string - if h.Type == protocol.PacketTypeInitial || h.Type == protocol.PacketTypeRetry { - if len(h.Token) == 0 { - token = "Token: (empty), " - } else { - token = fmt.Sprintf("Token: %#x, ", h.Token) - } - if h.Type == protocol.PacketTypeRetry { - logger.Debugf("\tLong Header{Type: %s, DestConnectionID: %s, SrcConnectionID: %s, %sOrigDestConnectionID: %s, Version: %s}", h.Type, h.DestConnectionID, h.SrcConnectionID, token, h.OrigDestConnectionID, h.Version) - return - } - } - logger.Debugf("\tLong Header{Type: %s, DestConnectionID: %s, SrcConnectionID: %s, %sPacketNumber: %#x, PacketNumberLen: %d, Length: %d, Version: %s}", h.Type, h.DestConnectionID, h.SrcConnectionID, token, h.PacketNumber, h.PacketNumberLen, h.Length, h.Version) - } else { - logger.Debugf("\tShort Header{DestConnectionID: %s, PacketNumber: %#x, PacketNumberLen: %d, KeyPhase: %d}", h.DestConnectionID, h.PacketNumber, h.PacketNumberLen, h.KeyPhase) - } -} - -func encodeConnIDLen(dest, src protocol.ConnectionID) (byte, error) { - dcil, err := encodeSingleConnIDLen(dest) - if err != nil { - return 0, err - } - scil, err := encodeSingleConnIDLen(src) - if err != nil { - return 0, err - } - return scil | dcil<<4, nil -} - -func encodeSingleConnIDLen(id protocol.ConnectionID) (byte, error) { - len := id.Len() - if len == 0 { - return 0, nil - } - if len < 4 || len > 18 { - return 0, fmt.Errorf("invalid connection ID length: %d bytes", len) - } - return byte(len - 3), nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/frame.go deleted file mode 100644 index 4e2050071b..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/frame.go +++ /dev/null @@ -1,13 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A Frame in QUIC -type Frame interface { - Write(b *bytes.Buffer, version protocol.VersionNumber) error - Length(version protocol.VersionNumber) protocol.ByteCount -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/frame_parser.go b/external/github.com/lucas-clemente/quic-go/internal/wire/frame_parser.go deleted file mode 100644 index 3762a3392f..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/frame_parser.go +++ /dev/null @@ -1,78 +0,0 @@ -package wire - -import ( - "bytes" - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" -) - -// ParseNextFrame parses the next frame -// It skips PADDING frames. -func ParseNextFrame(r *bytes.Reader, v protocol.VersionNumber) (Frame, error) { - for r.Len() != 0 { - typeByte, _ := r.ReadByte() - if typeByte == 0x0 { // PADDING frame - continue - } - r.UnreadByte() - - return parseFrame(r, typeByte, v) - } - return nil, nil -} - -func parseFrame(r *bytes.Reader, typeByte byte, v protocol.VersionNumber) (Frame, error) { - var frame Frame - var err error - if typeByte&0xf8 == 0x8 { - frame, err = parseStreamFrame(r, v) - if err != nil { - return nil, qerr.Error(qerr.InvalidFrameData, err.Error()) - } - return frame, nil - } - switch typeByte { - case 0x1: - frame, err = parsePingFrame(r, v) - case 0x2, 0x3: - frame, err = parseAckFrame(r, v) - case 0x4: - frame, err = parseResetStreamFrame(r, v) - case 0x5: - frame, err = parseStopSendingFrame(r, v) - case 0x6: - frame, err = parseCryptoFrame(r, v) - case 0x7: - frame, err = parseNewTokenFrame(r, v) - case 0x10: - frame, err = parseMaxDataFrame(r, v) - case 0x11: - frame, err = parseMaxStreamDataFrame(r, v) - case 0x12, 0x13: - frame, err = parseMaxStreamsFrame(r, v) - case 0x14: - frame, err = parseDataBlockedFrame(r, v) - case 0x15: - frame, err = parseStreamDataBlockedFrame(r, v) - case 0x16, 0x17: - frame, err = parseStreamsBlockedFrame(r, v) - case 0x18: - frame, err = parseNewConnectionIDFrame(r, v) - case 0x19: - frame, err = parseRetireConnectionIDFrame(r, v) - case 0x1a: - frame, err = parsePathChallengeFrame(r, v) - case 0x1b: - frame, err = parsePathResponseFrame(r, v) - case 0x1c, 0x1d: - frame, err = parseConnectionCloseFrame(r, v) - default: - err = fmt.Errorf("unknown type byte 0x%x", typeByte) - } - if err != nil { - return nil, qerr.Error(qerr.InvalidFrameData, err.Error()) - } - return frame, nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/header.go b/external/github.com/lucas-clemente/quic-go/internal/wire/header.go deleted file mode 100644 index 68f652ab84..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/header.go +++ /dev/null @@ -1,198 +0,0 @@ -package wire - -import ( - "bytes" - "errors" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// The Header is the version independent part of the header -type Header struct { - Version protocol.VersionNumber - SrcConnectionID protocol.ConnectionID - DestConnectionID protocol.ConnectionID - - IsLongHeader bool - Type protocol.PacketType - Length protocol.ByteCount - - Token []byte - SupportedVersions []protocol.VersionNumber // sent in a Version Negotiation Packet - OrigDestConnectionID protocol.ConnectionID // sent in the Retry packet - - typeByte byte - parsedLen protocol.ByteCount // how many bytes were read while parsing this header -} - -// ParseHeader parses the header. -// For short header packets: up to the packet number. -// For long header packets: -// * if we understand the version: up to the packet number -// * if not, only the invariant part of the header -func ParseHeader(b *bytes.Reader, shortHeaderConnIDLen int) (*Header, error) { - startLen := b.Len() - h, err := parseHeaderImpl(b, shortHeaderConnIDLen) - if err != nil { - return nil, err - } - h.parsedLen = protocol.ByteCount(startLen - b.Len()) - return h, nil -} - -func parseHeaderImpl(b *bytes.Reader, shortHeaderConnIDLen int) (*Header, error) { - typeByte, err := b.ReadByte() - if err != nil { - return nil, err - } - - h := &Header{ - typeByte: typeByte, - IsLongHeader: typeByte&0x80 > 0, - } - - if !h.IsLongHeader { - if h.typeByte&0x40 == 0 { - return nil, errors.New("not a QUIC packet") - } - if err := h.parseShortHeader(b, shortHeaderConnIDLen); err != nil { - return nil, err - } - return h, nil - } - if err := h.parseLongHeader(b); err != nil { - return nil, err - } - return h, nil -} - -func (h *Header) parseShortHeader(b *bytes.Reader, shortHeaderConnIDLen int) error { - var err error - h.DestConnectionID, err = protocol.ReadConnectionID(b, shortHeaderConnIDLen) - return err -} - -func (h *Header) parseLongHeader(b *bytes.Reader) error { - v, err := utils.BigEndian.ReadUint32(b) - if err != nil { - return err - } - h.Version = protocol.VersionNumber(v) - if !h.IsVersionNegotiation() && h.typeByte&0x40 == 0 { - return errors.New("not a QUIC packet") - } - connIDLenByte, err := b.ReadByte() - if err != nil { - return err - } - dcil, scil := decodeConnIDLen(connIDLenByte) - h.DestConnectionID, err = protocol.ReadConnectionID(b, dcil) - if err != nil { - return err - } - h.SrcConnectionID, err = protocol.ReadConnectionID(b, scil) - if err != nil { - return err - } - if h.Version == 0 { - return h.parseVersionNegotiationPacket(b) - } - // If we don't understand the version, we have no idea how to interpret the rest of the bytes - if !protocol.IsSupportedVersion(protocol.SupportedVersions, h.Version) { - return nil - } - - switch (h.typeByte & 0x30) >> 4 { - case 0x0: - h.Type = protocol.PacketTypeInitial - case 0x1: - h.Type = protocol.PacketType0RTT - case 0x2: - h.Type = protocol.PacketTypeHandshake - case 0x3: - h.Type = protocol.PacketTypeRetry - } - - if h.Type == protocol.PacketTypeRetry { - odcil := decodeSingleConnIDLen(h.typeByte & 0xf) - h.OrigDestConnectionID, err = protocol.ReadConnectionID(b, odcil) - if err != nil { - return err - } - h.Token = make([]byte, b.Len()) - if _, err := io.ReadFull(b, h.Token); err != nil { - return err - } - return nil - } - - if h.Type == protocol.PacketTypeInitial { - tokenLen, err := utils.ReadVarInt(b) - if err != nil { - return err - } - if tokenLen > uint64(b.Len()) { - return io.EOF - } - h.Token = make([]byte, tokenLen) - if _, err := io.ReadFull(b, h.Token); err != nil { - return err - } - } - - pl, err := utils.ReadVarInt(b) - if err != nil { - return err - } - h.Length = protocol.ByteCount(pl) - return nil -} - -func (h *Header) parseVersionNegotiationPacket(b *bytes.Reader) error { - if b.Len() == 0 { - return qerr.Error(qerr.InvalidVersionNegotiationPacket, "empty version list") - } - h.SupportedVersions = make([]protocol.VersionNumber, b.Len()/4) - for i := 0; b.Len() > 0; i++ { - v, err := utils.BigEndian.ReadUint32(b) - if err != nil { - return qerr.InvalidVersionNegotiationPacket - } - h.SupportedVersions[i] = protocol.VersionNumber(v) - } - return nil -} - -// IsVersionNegotiation says if this a version negotiation packet -func (h *Header) IsVersionNegotiation() bool { - return h.IsLongHeader && h.Version == 0 -} - -// ParsedLen returns the number of bytes that were consumed when parsing the header -func (h *Header) ParsedLen() protocol.ByteCount { - return h.parsedLen -} - -// ParseExtended parses the version dependent part of the header. -// The Reader has to be set such that it points to the first byte of the header. -func (h *Header) ParseExtended(b *bytes.Reader, ver protocol.VersionNumber) (*ExtendedHeader, error) { - return h.toExtendedHeader().parse(b, ver) -} - -func (h *Header) toExtendedHeader() *ExtendedHeader { - return &ExtendedHeader{Header: *h} -} - -func decodeConnIDLen(enc byte) (int /*dest conn id len*/, int /*src conn id len*/) { - return decodeSingleConnIDLen(enc >> 4), decodeSingleConnIDLen(enc & 0xf) -} - -func decodeSingleConnIDLen(enc uint8) int { - if enc == 0 { - return 0 - } - return int(enc) + 3 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/log.go b/external/github.com/lucas-clemente/quic-go/internal/wire/log.go deleted file mode 100644 index 8a72410bda..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/log.go +++ /dev/null @@ -1,39 +0,0 @@ -package wire - -import ( - "fmt" - "strings" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// LogFrame logs a frame, either sent or received -func LogFrame(logger utils.Logger, frame Frame, sent bool) { - if !logger.Debug() { - return - } - dir := "<-" - if sent { - dir = "->" - } - switch f := frame.(type) { - case *CryptoFrame: - dataLen := protocol.ByteCount(len(f.Data)) - logger.Debugf("\t%s &wire.CryptoFrame{Offset: 0x%x, Data length: 0x%x, Offset + Data length: 0x%x}", dir, f.Offset, dataLen, f.Offset+dataLen) - case *StreamFrame: - logger.Debugf("\t%s &wire.StreamFrame{StreamID: %d, FinBit: %t, Offset: 0x%x, Data length: 0x%x, Offset + Data length: 0x%x}", dir, f.StreamID, f.FinBit, f.Offset, f.DataLen(), f.Offset+f.DataLen()) - case *AckFrame: - if len(f.AckRanges) > 1 { - ackRanges := make([]string, len(f.AckRanges)) - for i, r := range f.AckRanges { - ackRanges[i] = fmt.Sprintf("{Largest: %#x, Smallest: %#x}", r.Largest, r.Smallest) - } - logger.Debugf("\t%s &wire.AckFrame{LargestAcked: %#x, LowestAcked: %#x, AckRanges: {%s}, DelayTime: %s}", dir, f.LargestAcked(), f.LowestAcked(), strings.Join(ackRanges, ", "), f.DelayTime.String()) - } else { - logger.Debugf("\t%s &wire.AckFrame{LargestAcked: %#x, LowestAcked: %#x, DelayTime: %s}", dir, f.LargestAcked(), f.LowestAcked(), f.DelayTime.String()) - } - default: - logger.Debugf("\t%s %#v", dir, frame) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/max_data_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/max_data_frame.go deleted file mode 100644 index ba0a3a25fd..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/max_data_frame.go +++ /dev/null @@ -1,40 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A MaxDataFrame carries flow control information for the connection -type MaxDataFrame struct { - ByteOffset protocol.ByteCount -} - -// parseMaxDataFrame parses a MAX_DATA frame -func parseMaxDataFrame(r *bytes.Reader, version protocol.VersionNumber) (*MaxDataFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - frame := &MaxDataFrame{} - byteOffset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - frame.ByteOffset = protocol.ByteCount(byteOffset) - return frame, nil -} - -//Write writes a MAX_STREAM_DATA frame -func (f *MaxDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x10) - utils.WriteVarInt(b, uint64(f.ByteOffset)) - return nil -} - -// Length of a written frame -func (f *MaxDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.ByteOffset)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/max_stream_data_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/max_stream_data_frame.go deleted file mode 100644 index b13944e45f..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/max_stream_data_frame.go +++ /dev/null @@ -1,46 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A MaxStreamDataFrame is a MAX_STREAM_DATA frame -type MaxStreamDataFrame struct { - StreamID protocol.StreamID - ByteOffset protocol.ByteCount -} - -func parseMaxStreamDataFrame(r *bytes.Reader, version protocol.VersionNumber) (*MaxStreamDataFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - sid, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - offset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - - return &MaxStreamDataFrame{ - StreamID: protocol.StreamID(sid), - ByteOffset: protocol.ByteCount(offset), - }, nil -} - -func (f *MaxStreamDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x11) - utils.WriteVarInt(b, uint64(f.StreamID)) - utils.WriteVarInt(b, uint64(f.ByteOffset)) - return nil -} - -// Length of a written frame -func (f *MaxStreamDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.ByteOffset)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/max_streams_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/max_streams_frame.go deleted file mode 100644 index 63cfae257e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/max_streams_frame.go +++ /dev/null @@ -1,51 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A MaxStreamsFrame is a MAX_STREAMS frame -type MaxStreamsFrame struct { - Type protocol.StreamType - MaxStreams uint64 -} - -func parseMaxStreamsFrame(r *bytes.Reader, _ protocol.VersionNumber) (*MaxStreamsFrame, error) { - typeByte, err := r.ReadByte() - if err != nil { - return nil, err - } - - f := &MaxStreamsFrame{} - switch typeByte { - case 0x12: - f.Type = protocol.StreamTypeBidi - case 0x13: - f.Type = protocol.StreamTypeUni - } - streamID, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - f.MaxStreams = streamID - return f, nil -} - -func (f *MaxStreamsFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - switch f.Type { - case protocol.StreamTypeBidi: - b.WriteByte(0x12) - case protocol.StreamTypeUni: - b.WriteByte(0x13) - } - utils.WriteVarInt(b, f.MaxStreams) - return nil -} - -// Length of a written frame -func (f *MaxStreamsFrame) Length(protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(f.MaxStreams) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/new_connection_id_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/new_connection_id_frame.go deleted file mode 100644 index 73893438ca..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/new_connection_id_frame.go +++ /dev/null @@ -1,70 +0,0 @@ -package wire - -import ( - "bytes" - "fmt" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A NewConnectionIDFrame is a NEW_CONNECTION_ID frame -type NewConnectionIDFrame struct { - SequenceNumber uint64 - ConnectionID protocol.ConnectionID - StatelessResetToken [16]byte -} - -func parseNewConnectionIDFrame(r *bytes.Reader, _ protocol.VersionNumber) (*NewConnectionIDFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - seq, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - connIDLen, err := r.ReadByte() - if err != nil { - return nil, err - } - if connIDLen < 4 || connIDLen > 18 { - return nil, fmt.Errorf("invalid connection ID length: %d", connIDLen) - } - connID, err := protocol.ReadConnectionID(r, int(connIDLen)) - if err != nil { - return nil, err - } - frame := &NewConnectionIDFrame{ - SequenceNumber: seq, - ConnectionID: connID, - } - if _, err := io.ReadFull(r, frame.StatelessResetToken[:]); err != nil { - if err == io.ErrUnexpectedEOF { - return nil, io.EOF - } - return nil, err - } - - return frame, nil -} - -func (f *NewConnectionIDFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x18) - utils.WriteVarInt(b, f.SequenceNumber) - connIDLen := f.ConnectionID.Len() - if connIDLen < 4 || connIDLen > 18 { - return fmt.Errorf("invalid connection ID length: %d", connIDLen) - } - b.WriteByte(uint8(connIDLen)) - b.Write(f.ConnectionID.Bytes()) - b.Write(f.StatelessResetToken[:]) - return nil -} - -// Length of a written frame -func (f *NewConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(f.SequenceNumber) + 1 /* connection ID length */ + protocol.ByteCount(f.ConnectionID.Len()) + 16 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/new_token_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/new_token_frame.go deleted file mode 100644 index 2cf4db636e..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/new_token_frame.go +++ /dev/null @@ -1,44 +0,0 @@ -package wire - -import ( - "bytes" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A NewTokenFrame is a NEW_TOKEN frame -type NewTokenFrame struct { - Token []byte -} - -func parseNewTokenFrame(r *bytes.Reader, _ protocol.VersionNumber) (*NewTokenFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - tokenLen, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - if uint64(r.Len()) < tokenLen { - return nil, io.EOF - } - token := make([]byte, int(tokenLen)) - if _, err := io.ReadFull(r, token); err != nil { - return nil, err - } - return &NewTokenFrame{Token: token}, nil -} - -func (f *NewTokenFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x7) - utils.WriteVarInt(b, uint64(len(f.Token))) - b.Write(f.Token) - return nil -} - -// Length of a written frame -func (f *NewTokenFrame) Length(protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(len(f.Token))) + protocol.ByteCount(len(f.Token)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/path_challenge_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/path_challenge_frame.go deleted file mode 100644 index 074cc053c2..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/path_challenge_frame.go +++ /dev/null @@ -1,38 +0,0 @@ -package wire - -import ( - "bytes" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A PathChallengeFrame is a PATH_CHALLENGE frame -type PathChallengeFrame struct { - Data [8]byte -} - -func parsePathChallengeFrame(r *bytes.Reader, version protocol.VersionNumber) (*PathChallengeFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - frame := &PathChallengeFrame{} - if _, err := io.ReadFull(r, frame.Data[:]); err != nil { - if err == io.ErrUnexpectedEOF { - return nil, io.EOF - } - return nil, err - } - return frame, nil -} - -func (f *PathChallengeFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x1a) - b.Write(f.Data[:]) - return nil -} - -// Length of a written frame -func (f *PathChallengeFrame) Length(_ protocol.VersionNumber) protocol.ByteCount { - return 1 + 8 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/path_response_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/path_response_frame.go deleted file mode 100644 index 2b385bc7d5..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/path_response_frame.go +++ /dev/null @@ -1,38 +0,0 @@ -package wire - -import ( - "bytes" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A PathResponseFrame is a PATH_RESPONSE frame -type PathResponseFrame struct { - Data [8]byte -} - -func parsePathResponseFrame(r *bytes.Reader, version protocol.VersionNumber) (*PathResponseFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - frame := &PathResponseFrame{} - if _, err := io.ReadFull(r, frame.Data[:]); err != nil { - if err == io.ErrUnexpectedEOF { - return nil, io.EOF - } - return nil, err - } - return frame, nil -} - -func (f *PathResponseFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x1b) - b.Write(f.Data[:]) - return nil -} - -// Length of a written frame -func (f *PathResponseFrame) Length(_ protocol.VersionNumber) protocol.ByteCount { - return 1 + 8 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/ping_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/ping_frame.go deleted file mode 100644 index f9b0bfcd11..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/ping_frame.go +++ /dev/null @@ -1,27 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// A PingFrame is a PING frame -type PingFrame struct{} - -func parsePingFrame(r *bytes.Reader, version protocol.VersionNumber) (*PingFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - return &PingFrame{}, nil -} - -func (f *PingFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x1) - return nil -} - -// Length of a written frame -func (f *PingFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/reset_stream_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/reset_stream_frame.go deleted file mode 100644 index b1ed65e051..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/reset_stream_frame.go +++ /dev/null @@ -1,58 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A ResetStreamFrame is a RESET_STREAM frame in QUIC -type ResetStreamFrame struct { - StreamID protocol.StreamID - ErrorCode protocol.ApplicationErrorCode - ByteOffset protocol.ByteCount -} - -func parseResetStreamFrame(r *bytes.Reader, version protocol.VersionNumber) (*ResetStreamFrame, error) { - if _, err := r.ReadByte(); err != nil { // read the TypeByte - return nil, err - } - - var streamID protocol.StreamID - var errorCode uint16 - var byteOffset protocol.ByteCount - sid, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - streamID = protocol.StreamID(sid) - errorCode, err = utils.BigEndian.ReadUint16(r) - if err != nil { - return nil, err - } - bo, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - byteOffset = protocol.ByteCount(bo) - - return &ResetStreamFrame{ - StreamID: streamID, - ErrorCode: protocol.ApplicationErrorCode(errorCode), - ByteOffset: byteOffset, - }, nil -} - -func (f *ResetStreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x4) - utils.WriteVarInt(b, uint64(f.StreamID)) - utils.BigEndian.WriteUint16(b, uint16(f.ErrorCode)) - utils.WriteVarInt(b, uint64(f.ByteOffset)) - return nil -} - -// Length of a written frame -func (f *ResetStreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.StreamID)) + 2 + utils.VarIntLen(uint64(f.ByteOffset)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/retire_connection_id_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/retire_connection_id_frame.go deleted file mode 100644 index 50230f6d76..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/retire_connection_id_frame.go +++ /dev/null @@ -1,36 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A RetireConnectionIDFrame is a RETIRE_CONNECTION_ID frame -type RetireConnectionIDFrame struct { - SequenceNumber uint64 -} - -func parseRetireConnectionIDFrame(r *bytes.Reader, _ protocol.VersionNumber) (*RetireConnectionIDFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - seq, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - return &RetireConnectionIDFrame{SequenceNumber: seq}, nil -} - -func (f *RetireConnectionIDFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x19) - utils.WriteVarInt(b, f.SequenceNumber) - return nil -} - -// Length of a written frame -func (f *RetireConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(f.SequenceNumber) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/stop_sending_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/stop_sending_frame.go deleted file mode 100644 index f71a476c16..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/stop_sending_frame.go +++ /dev/null @@ -1,47 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A StopSendingFrame is a STOP_SENDING frame -type StopSendingFrame struct { - StreamID protocol.StreamID - ErrorCode protocol.ApplicationErrorCode -} - -// parseStopSendingFrame parses a STOP_SENDING frame -func parseStopSendingFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StopSendingFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - streamID, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - errorCode, err := utils.BigEndian.ReadUint16(r) - if err != nil { - return nil, err - } - - return &StopSendingFrame{ - StreamID: protocol.StreamID(streamID), - ErrorCode: protocol.ApplicationErrorCode(errorCode), - }, nil -} - -// Length of a written frame -func (f *StopSendingFrame) Length(_ protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.StreamID)) + 2 -} - -func (f *StopSendingFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - b.WriteByte(0x5) - utils.WriteVarInt(b, uint64(f.StreamID)) - utils.BigEndian.WriteUint16(b, uint16(f.ErrorCode)) - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/stream_data_blocked_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/stream_data_blocked_frame.go deleted file mode 100644 index 4c6e580583..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/stream_data_blocked_frame.go +++ /dev/null @@ -1,46 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A StreamDataBlockedFrame is a STREAM_DATA_BLOCKED frame -type StreamDataBlockedFrame struct { - StreamID protocol.StreamID - DataLimit protocol.ByteCount -} - -func parseStreamDataBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StreamDataBlockedFrame, error) { - if _, err := r.ReadByte(); err != nil { - return nil, err - } - - sid, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - offset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - - return &StreamDataBlockedFrame{ - StreamID: protocol.StreamID(sid), - DataLimit: protocol.ByteCount(offset), - }, nil -} - -func (f *StreamDataBlockedFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - b.WriteByte(0x15) - utils.WriteVarInt(b, uint64(f.StreamID)) - utils.WriteVarInt(b, uint64(f.DataLimit)) - return nil -} - -// Length of a written frame -func (f *StreamDataBlockedFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(uint64(f.StreamID)) + utils.VarIntLen(uint64(f.DataLimit)) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/stream_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/stream_frame.go deleted file mode 100644 index 2f5900ce83..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/stream_frame.go +++ /dev/null @@ -1,168 +0,0 @@ -package wire - -import ( - "bytes" - "errors" - "io" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A StreamFrame of QUIC -type StreamFrame struct { - StreamID protocol.StreamID - FinBit bool - DataLenPresent bool - Offset protocol.ByteCount - Data []byte -} - -func parseStreamFrame(r *bytes.Reader, version protocol.VersionNumber) (*StreamFrame, error) { - typeByte, err := r.ReadByte() - if err != nil { - return nil, err - } - - hasOffset := typeByte&0x4 > 0 - frame := &StreamFrame{ - FinBit: typeByte&0x1 > 0, - DataLenPresent: typeByte&0x2 > 0, - } - - streamID, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - frame.StreamID = protocol.StreamID(streamID) - if hasOffset { - offset, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - frame.Offset = protocol.ByteCount(offset) - } - - var dataLen uint64 - if frame.DataLenPresent { - var err error - dataLen, err = utils.ReadVarInt(r) - if err != nil { - return nil, err - } - // shortcut to prevent the unnecessary allocation of dataLen bytes - // if the dataLen is larger than the remaining length of the packet - // reading the packet contents would result in EOF when attempting to READ - if dataLen > uint64(r.Len()) { - return nil, io.EOF - } - } else { - // The rest of the packet is data - dataLen = uint64(r.Len()) - } - if dataLen != 0 { - frame.Data = make([]byte, dataLen) - if _, err := io.ReadFull(r, frame.Data); err != nil { - // this should never happen, since we already checked the dataLen earlier - return nil, err - } - } - if frame.Offset+frame.DataLen() > protocol.MaxByteCount { - return nil, qerr.Error(qerr.InvalidStreamData, "data overflows maximum offset") - } - return frame, nil -} - -// Write writes a STREAM frame -func (f *StreamFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error { - if len(f.Data) == 0 && !f.FinBit { - return errors.New("StreamFrame: attempting to write empty frame without FIN") - } - - typeByte := byte(0x8) - if f.FinBit { - typeByte ^= 0x1 - } - hasOffset := f.Offset != 0 - if f.DataLenPresent { - typeByte ^= 0x2 - } - if hasOffset { - typeByte ^= 0x4 - } - b.WriteByte(typeByte) - utils.WriteVarInt(b, uint64(f.StreamID)) - if hasOffset { - utils.WriteVarInt(b, uint64(f.Offset)) - } - if f.DataLenPresent { - utils.WriteVarInt(b, uint64(f.DataLen())) - } - b.Write(f.Data) - return nil -} - -// Length returns the total length of the STREAM frame -func (f *StreamFrame) Length(version protocol.VersionNumber) protocol.ByteCount { - length := 1 + utils.VarIntLen(uint64(f.StreamID)) - if f.Offset != 0 { - length += utils.VarIntLen(uint64(f.Offset)) - } - if f.DataLenPresent { - length += utils.VarIntLen(uint64(f.DataLen())) - } - return length + f.DataLen() -} - -// DataLen gives the length of data in bytes -func (f *StreamFrame) DataLen() protocol.ByteCount { - return protocol.ByteCount(len(f.Data)) -} - -// MaxDataLen returns the maximum data length -// If 0 is returned, writing will fail (a STREAM frame must contain at least 1 byte of data). -func (f *StreamFrame) MaxDataLen(maxSize protocol.ByteCount, version protocol.VersionNumber) protocol.ByteCount { - headerLen := 1 + utils.VarIntLen(uint64(f.StreamID)) - if f.Offset != 0 { - headerLen += utils.VarIntLen(uint64(f.Offset)) - } - if f.DataLenPresent { - // pretend that the data size will be 1 bytes - // if it turns out that varint encoding the length will consume 2 bytes, we need to adjust the data length afterwards - headerLen++ - } - if headerLen > maxSize { - return 0 - } - maxDataLen := maxSize - headerLen - if f.DataLenPresent && utils.VarIntLen(uint64(maxDataLen)) != 1 { - maxDataLen-- - } - return maxDataLen -} - -// MaybeSplitOffFrame splits a frame such that it is not bigger than n bytes. -// If n >= len(frame), nil is returned and nothing is modified. -func (f *StreamFrame) MaybeSplitOffFrame(maxSize protocol.ByteCount, version protocol.VersionNumber) (*StreamFrame, error) { - if maxSize >= f.Length(version) { - return nil, nil - } - - n := f.MaxDataLen(maxSize, version) - if n == 0 { - return nil, errors.New("too small") - } - newFrame := &StreamFrame{ - FinBit: false, - StreamID: f.StreamID, - Offset: f.Offset, - Data: f.Data[:n], - DataLenPresent: f.DataLenPresent, - } - - f.Data = f.Data[n:] - f.Offset += n - - return newFrame, nil -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/streams_blocked_frame.go b/external/github.com/lucas-clemente/quic-go/internal/wire/streams_blocked_frame.go deleted file mode 100644 index 516706af36..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/streams_blocked_frame.go +++ /dev/null @@ -1,52 +0,0 @@ -package wire - -import ( - "bytes" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// A StreamsBlockedFrame is a STREAMS_BLOCKED frame -type StreamsBlockedFrame struct { - Type protocol.StreamType - StreamLimit uint64 -} - -func parseStreamsBlockedFrame(r *bytes.Reader, _ protocol.VersionNumber) (*StreamsBlockedFrame, error) { - typeByte, err := r.ReadByte() - if err != nil { - return nil, err - } - - f := &StreamsBlockedFrame{} - switch typeByte { - case 0x16: - f.Type = protocol.StreamTypeBidi - case 0x17: - f.Type = protocol.StreamTypeUni - } - streamLimit, err := utils.ReadVarInt(r) - if err != nil { - return nil, err - } - f.StreamLimit = streamLimit - - return f, nil -} - -func (f *StreamsBlockedFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error { - switch f.Type { - case protocol.StreamTypeBidi: - b.WriteByte(0x16) - case protocol.StreamTypeUni: - b.WriteByte(0x17) - } - utils.WriteVarInt(b, f.StreamLimit) - return nil -} - -// Length of a written frame -func (f *StreamsBlockedFrame) Length(_ protocol.VersionNumber) protocol.ByteCount { - return 1 + utils.VarIntLen(f.StreamLimit) -} diff --git a/external/github.com/lucas-clemente/quic-go/internal/wire/version_negotiation.go b/external/github.com/lucas-clemente/quic-go/internal/wire/version_negotiation.go deleted file mode 100644 index e09ebf7589..0000000000 --- a/external/github.com/lucas-clemente/quic-go/internal/wire/version_negotiation.go +++ /dev/null @@ -1,31 +0,0 @@ -package wire - -import ( - "bytes" - "crypto/rand" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -// ComposeVersionNegotiation composes a Version Negotiation -func ComposeVersionNegotiation(destConnID, srcConnID protocol.ConnectionID, versions []protocol.VersionNumber) ([]byte, error) { - greasedVersions := protocol.GetGreasedVersions(versions) - expectedLen := 1 /* type byte */ + 4 /* version field */ + 1 /* connection ID length field */ + destConnID.Len() + srcConnID.Len() + len(greasedVersions)*4 - buf := bytes.NewBuffer(make([]byte, 0, expectedLen)) - r := make([]byte, 1) - _, _ = rand.Read(r) // ignore the error here. It is not critical to have perfect random here. - buf.WriteByte(r[0] | 0x80) - utils.BigEndian.WriteUint32(buf, 0) // version 0 - connIDLen, err := encodeConnIDLen(destConnID, srcConnID) - if err != nil { - return nil, err - } - buf.WriteByte(connIDLen) - buf.Write(destConnID) - buf.Write(srcConnID) - for _, v := range greasedVersions { - utils.BigEndian.WriteUint32(buf, uint32(v)) - } - return buf.Bytes(), nil -} diff --git a/external/github.com/lucas-clemente/quic-go/mockgen.go b/external/github.com/lucas-clemente/quic-go/mockgen.go deleted file mode 100644 index 1a882c3581..0000000000 --- a/external/github.com/lucas-clemente/quic-go/mockgen.go +++ /dev/null @@ -1,21 +0,0 @@ -package quic - -//go:generate sh -c "./mockgen_private.sh quic mock_stream_internal_test.go github.com/lucas-clemente/quic-go streamI" -//go:generate sh -c "./mockgen_private.sh quic mock_crypto_stream_test.go github.com/lucas-clemente/quic-go cryptoStream" -//go:generate sh -c "./mockgen_private.sh quic mock_receive_stream_internal_test.go github.com/lucas-clemente/quic-go receiveStreamI" -//go:generate sh -c "./mockgen_private.sh quic mock_send_stream_internal_test.go github.com/lucas-clemente/quic-go sendStreamI" -//go:generate sh -c "./mockgen_private.sh quic mock_stream_sender_test.go github.com/lucas-clemente/quic-go streamSender" -//go:generate sh -c "./mockgen_private.sh quic mock_stream_getter_test.go github.com/lucas-clemente/quic-go streamGetter" -//go:generate sh -c "./mockgen_private.sh quic mock_crypto_data_handler_test.go github.com/lucas-clemente/quic-go cryptoDataHandler" -//go:generate sh -c "./mockgen_private.sh quic mock_frame_source_test.go github.com/lucas-clemente/quic-go frameSource" -//go:generate sh -c "./mockgen_private.sh quic mock_ack_frame_source_test.go github.com/lucas-clemente/quic-go ackFrameSource" -//go:generate sh -c "./mockgen_private.sh quic mock_stream_manager_test.go github.com/lucas-clemente/quic-go streamManager" -//go:generate sh -c "./mockgen_private.sh quic mock_sealing_manager_test.go github.com/lucas-clemente/quic-go sealingManager" -//go:generate sh -c "./mockgen_private.sh quic mock_unpacker_test.go github.com/lucas-clemente/quic-go unpacker" -//go:generate sh -c "./mockgen_private.sh quic mock_packer_test.go github.com/lucas-clemente/quic-go packer" -//go:generate sh -c "./mockgen_private.sh quic mock_session_runner_test.go github.com/lucas-clemente/quic-go sessionRunner" -//go:generate sh -c "./mockgen_private.sh quic mock_quic_session_test.go github.com/lucas-clemente/quic-go quicSession" -//go:generate sh -c "./mockgen_private.sh quic mock_packet_handler_test.go github.com/lucas-clemente/quic-go packetHandler" -//go:generate sh -c "./mockgen_private.sh quic mock_unknown_packet_handler_test.go github.com/lucas-clemente/quic-go unknownPacketHandler" -//go:generate sh -c "./mockgen_private.sh quic mock_packet_handler_manager_test.go github.com/lucas-clemente/quic-go packetHandlerManager" -//go:generate sh -c "./mockgen_private.sh quic mock_multiplexer_test.go github.com/lucas-clemente/quic-go multiplexer" diff --git a/external/github.com/lucas-clemente/quic-go/mockgen_private.sh b/external/github.com/lucas-clemente/quic-go/mockgen_private.sh deleted file mode 100755 index 0ba5f64ef8..0000000000 --- a/external/github.com/lucas-clemente/quic-go/mockgen_private.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Mockgen refuses to generate mocks private types. -# This script copies the quic package to a temporary directory, and adds an public alias for the private type. -# It then creates a mock for this public (alias) type. - -TEMP_DIR=$(mktemp -d) -mkdir -p $TEMP_DIR/src/github.com/lucas-clemente/quic-go/ - -# uppercase the name of the interface -INTERFACE_NAME="$(tr '[:lower:]' '[:upper:]' <<< ${4:0:1})${4:1}" - -# copy all .go files to a temporary directory -rsync -r --exclude 'vendor' --include='*.go' --include '*/' --exclude '*' $GOPATH/src/github.com/lucas-clemente/quic-go/ $TEMP_DIR/src/github.com/lucas-clemente/quic-go/ - -# create a public alias for the interface, so that mockgen can process it -echo -e "package $1\n" > $TEMP_DIR/src/github.com/lucas-clemente/quic-go/mockgen_interface.go -echo "type $INTERFACE_NAME = $4" >> $TEMP_DIR/src/github.com/lucas-clemente/quic-go/mockgen_interface.go - -export GOPATH="$TEMP_DIR:$GOPATH" - -mockgen -package $1 -self_package $1 -destination $2 $3 $INTERFACE_NAME - -# mockgen imports quic-go as 'import quic_go github.com/lucas_clemente/quic-go' -sed -i '' 's/quic_go.//g' $2 -goimports -w $2 - -rm -r "$TEMP_DIR" diff --git a/external/github.com/lucas-clemente/quic-go/multiplexer.go b/external/github.com/lucas-clemente/quic-go/multiplexer.go deleted file mode 100644 index 3d5e2372e8..0000000000 --- a/external/github.com/lucas-clemente/quic-go/multiplexer.go +++ /dev/null @@ -1,76 +0,0 @@ -package quic - -import ( - "fmt" - "net" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -var ( - connMuxerOnce sync.Once - connMuxer multiplexer -) - -type multiplexer interface { - AddConn(net.PacketConn, int) (packetHandlerManager, error) - RemoveConn(net.PacketConn) error -} - -type connManager struct { - connIDLen int - manager packetHandlerManager -} - -// The connMultiplexer listens on multiple net.PacketConns and dispatches -// incoming packets to the session handler. -type connMultiplexer struct { - mutex sync.Mutex - - conns map[net.PacketConn]connManager - newPacketHandlerManager func(net.PacketConn, int, utils.Logger) packetHandlerManager // so it can be replaced in the tests - - logger utils.Logger -} - -var _ multiplexer = &connMultiplexer{} - -func getMultiplexer() multiplexer { - connMuxerOnce.Do(func() { - connMuxer = &connMultiplexer{ - conns: make(map[net.PacketConn]connManager), - logger: utils.DefaultLogger.WithPrefix("muxer"), - newPacketHandlerManager: newPacketHandlerMap, - } - }) - return connMuxer -} - -func (m *connMultiplexer) AddConn(c net.PacketConn, connIDLen int) (packetHandlerManager, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - p, ok := m.conns[c] - if !ok { - manager := m.newPacketHandlerManager(c, connIDLen, m.logger) - p = connManager{connIDLen: connIDLen, manager: manager} - m.conns[c] = p - } - if p.connIDLen != connIDLen { - return nil, fmt.Errorf("cannot use %d byte connection IDs on a connection that is already using %d byte connction IDs", connIDLen, p.connIDLen) - } - return p.manager, nil -} - -func (m *connMultiplexer) RemoveConn(c net.PacketConn) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.conns[c]; !ok { - return fmt.Errorf("cannote remove connection, connection is unknown") - } - - delete(m.conns, c) - return nil -} diff --git a/external/github.com/lucas-clemente/quic-go/packet_handler_map.go b/external/github.com/lucas-clemente/quic-go/packet_handler_map.go deleted file mode 100644 index 3ea76d6ed6..0000000000 --- a/external/github.com/lucas-clemente/quic-go/packet_handler_map.go +++ /dev/null @@ -1,264 +0,0 @@ -package quic - -import ( - "bytes" - "errors" - "fmt" - "net" - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type packetHandlerEntry struct { - handler packetHandler - resetToken *[16]byte -} - -// The packetHandlerMap stores packetHandlers, identified by connection ID. -// It is used: -// * by the server to store sessions -// * when multiplexing outgoing connections to store clients -type packetHandlerMap struct { - mutex sync.RWMutex - - conn net.PacketConn - connIDLen int - - handlers map[string] /* string(ConnectionID)*/ packetHandlerEntry - resetTokens map[[16]byte] /* stateless reset token */ packetHandler - server unknownPacketHandler - closed bool - - deleteRetiredSessionsAfter time.Duration - - logger utils.Logger -} - -var _ packetHandlerManager = &packetHandlerMap{} - -func newPacketHandlerMap(conn net.PacketConn, connIDLen int, logger utils.Logger) packetHandlerManager { - m := &packetHandlerMap{ - conn: conn, - connIDLen: connIDLen, - handlers: make(map[string]packetHandlerEntry), - resetTokens: make(map[[16]byte]packetHandler), - deleteRetiredSessionsAfter: protocol.RetiredConnectionIDDeleteTimeout, - logger: logger, - } - go m.listen() - return m -} - -func (h *packetHandlerMap) Add(id protocol.ConnectionID, handler packetHandler) { - h.mutex.Lock() - h.handlers[string(id)] = packetHandlerEntry{handler: handler} - h.mutex.Unlock() -} - -func (h *packetHandlerMap) AddWithResetToken(id protocol.ConnectionID, handler packetHandler, token [16]byte) { - h.mutex.Lock() - h.handlers[string(id)] = packetHandlerEntry{handler: handler, resetToken: &token} - h.resetTokens[token] = handler - h.mutex.Unlock() -} - -func (h *packetHandlerMap) Remove(id protocol.ConnectionID) { - h.removeByConnectionIDAsString(string(id)) -} - -func (h *packetHandlerMap) removeByConnectionIDAsString(id string) { - h.mutex.Lock() - if handlerEntry, ok := h.handlers[id]; ok { - if token := handlerEntry.resetToken; token != nil { - delete(h.resetTokens, *token) - } - delete(h.handlers, id) - } - h.mutex.Unlock() -} - -func (h *packetHandlerMap) Retire(id protocol.ConnectionID) { - h.retireByConnectionIDAsString(string(id)) -} - -func (h *packetHandlerMap) retireByConnectionIDAsString(id string) { - time.AfterFunc(h.deleteRetiredSessionsAfter, func() { - h.removeByConnectionIDAsString(id) - }) -} - -func (h *packetHandlerMap) SetServer(s unknownPacketHandler) { - h.mutex.Lock() - h.server = s - h.mutex.Unlock() -} - -func (h *packetHandlerMap) CloseServer() { - h.mutex.Lock() - h.server = nil - var wg sync.WaitGroup - for id, handlerEntry := range h.handlers { - handler := handlerEntry.handler - if handler.GetPerspective() == protocol.PerspectiveServer { - wg.Add(1) - go func(id string, handler packetHandler) { - // session.Close() blocks until the CONNECTION_CLOSE has been sent and the run-loop has stopped - _ = handler.Close() - h.retireByConnectionIDAsString(id) - wg.Done() - }(id, handler) - } - } - h.mutex.Unlock() - wg.Wait() -} - -func (h *packetHandlerMap) close(e error) error { - h.mutex.Lock() - if h.closed { - h.mutex.Unlock() - return nil - } - h.closed = true - - var wg sync.WaitGroup - for _, handlerEntry := range h.handlers { - wg.Add(1) - go func(handlerEntry packetHandlerEntry) { - handlerEntry.handler.destroy(e) - wg.Done() - }(handlerEntry) - } - - if h.server != nil { - h.server.closeWithError(e) - } - h.mutex.Unlock() - wg.Wait() - return getMultiplexer().RemoveConn(h.conn) -} - -func (h *packetHandlerMap) listen() { - for { - buffer := getPacketBuffer() - data := buffer.Slice - // The packet size should not exceed protocol.MaxReceivePacketSize bytes - // If it does, we only read a truncated packet, which will then end up undecryptable - n, addr, err := h.conn.ReadFrom(data) - if err != nil { - h.close(err) - return - } - h.handlePacket(addr, buffer, data[:n]) - } -} - -func (h *packetHandlerMap) handlePacket( - addr net.Addr, - buffer *packetBuffer, - data []byte, -) { - packets, err := h.parsePacket(addr, buffer, data) - if err != nil { - h.logger.Debugf("error parsing packets from %s: %s", addr, err) - // This is just the error from parsing the last packet. - // We still need to process the packets that were successfully parsed before. - } - if len(packets) == 0 { - buffer.Release() - return - } - h.handleParsedPackets(packets) -} - -func (h *packetHandlerMap) parsePacket( - addr net.Addr, - buffer *packetBuffer, - data []byte, -) ([]*receivedPacket, error) { - rcvTime := time.Now() - packets := make([]*receivedPacket, 0, 1) - - var counter int - var lastConnID protocol.ConnectionID - for len(data) > 0 { - hdr, err := wire.ParseHeader(bytes.NewReader(data), h.connIDLen) - // drop the packet if we can't parse the header - if err != nil { - return packets, fmt.Errorf("error parsing header: %s", err) - } - if counter > 0 && !hdr.DestConnectionID.Equal(lastConnID) { - return packets, fmt.Errorf("coalesced packet has different destination connection ID: %s, expected %s", hdr.DestConnectionID, lastConnID) - } - lastConnID = hdr.DestConnectionID - - var rest []byte - if hdr.IsLongHeader { - if protocol.ByteCount(len(data)) < hdr.ParsedLen()+hdr.Length { - return packets, fmt.Errorf("packet length (%d bytes) is smaller than the expected length (%d bytes)", len(data)-int(hdr.ParsedLen()), hdr.Length) - } - packetLen := int(hdr.ParsedLen() + hdr.Length) - rest = data[packetLen:] - data = data[:packetLen] - } - - if counter > 0 { - buffer.Split() - } - counter++ - packets = append(packets, &receivedPacket{ - remoteAddr: addr, - hdr: hdr, - rcvTime: rcvTime, - data: data, - buffer: buffer, - }) - - // only log if this actually a coalesced packet - if h.logger.Debug() && (counter > 1 || len(rest) > 0) { - h.logger.Debugf("Parsed a coalesced packet. Part %d: %d bytes. Remaining: %d bytes.", counter, len(packets[counter-1].data), len(rest)) - } - - data = rest - } - return packets, nil -} - -func (h *packetHandlerMap) handleParsedPackets(packets []*receivedPacket) { - h.mutex.RLock() - defer h.mutex.RUnlock() - - // coalesced packets all have the same destination connection ID - handlerEntry, handlerFound := h.handlers[string(packets[0].hdr.DestConnectionID)] - - for _, p := range packets { - if handlerFound { // existing session - handlerEntry.handler.handlePacket(p) - continue - } - // No session found. - // This might be a stateless reset. - if !p.hdr.IsLongHeader { - if len(p.data) >= protocol.MinStatelessResetSize { - var token [16]byte - copy(token[:], p.data[len(p.data)-16:]) - if sess, ok := h.resetTokens[token]; ok { - sess.destroy(errors.New("received a stateless reset")) - continue - } - } - // TODO(#943): send a stateless reset - h.logger.Debugf("received a short header packet with an unexpected connection ID %s", p.hdr.DestConnectionID) - break // a short header packet is always the last in a coalesced packet - } - if h.server == nil { // no server set - h.logger.Debugf("received a packet with an unexpected connection ID %s", p.hdr.DestConnectionID) - continue - } - h.server.handlePacket(p) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/packet_packer.go b/external/github.com/lucas-clemente/quic-go/packet_packer.go deleted file mode 100644 index 406f54871c..0000000000 --- a/external/github.com/lucas-clemente/quic-go/packet_packer.go +++ /dev/null @@ -1,483 +0,0 @@ -package quic - -import ( - "bytes" - "errors" - "fmt" - "net" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/ackhandler" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type packer interface { - PackPacket() (*packedPacket, error) - MaybePackAckPacket() (*packedPacket, error) - PackRetransmission(packet *ackhandler.Packet) ([]*packedPacket, error) - PackConnectionClose(*wire.ConnectionCloseFrame) (*packedPacket, error) - - HandleTransportParameters(*handshake.TransportParameters) - ChangeDestConnectionID(protocol.ConnectionID) -} - -type packedPacket struct { - header *wire.ExtendedHeader - raw []byte - frames []wire.Frame - - buffer *packetBuffer -} - -func (p *packedPacket) EncryptionLevel() protocol.EncryptionLevel { - if !p.header.IsLongHeader { - return protocol.Encryption1RTT - } - switch p.header.Type { - case protocol.PacketTypeInitial: - return protocol.EncryptionInitial - case protocol.PacketTypeHandshake: - return protocol.EncryptionHandshake - default: - return protocol.EncryptionUnspecified - } -} - -func (p *packedPacket) ToAckHandlerPacket() *ackhandler.Packet { - return &ackhandler.Packet{ - PacketNumber: p.header.PacketNumber, - PacketType: p.header.Type, - Frames: p.frames, - Length: protocol.ByteCount(len(p.raw)), - EncryptionLevel: p.EncryptionLevel(), - SendTime: time.Now(), - } -} - -func getMaxPacketSize(addr net.Addr) protocol.ByteCount { - maxSize := protocol.ByteCount(protocol.MinInitialPacketSize) - // If this is not a UDP address, we don't know anything about the MTU. - // Use the minimum size of an Initial packet as the max packet size. - if udpAddr, ok := addr.(*net.UDPAddr); ok { - // If ip is not an IPv4 address, To4 returns nil. - // Note that there might be some corner cases, where this is not correct. - // See https://stackoverflow.com/questions/22751035/golang-distinguish-ipv4-ipv6. - if udpAddr.IP.To4() == nil { - maxSize = protocol.MaxPacketSizeIPv6 - } else { - maxSize = protocol.MaxPacketSizeIPv4 - } - } - return maxSize -} - -type packetNumberManager interface { - PeekPacketNumber() (protocol.PacketNumber, protocol.PacketNumberLen) - PopPacketNumber() protocol.PacketNumber -} - -type sealingManager interface { - GetSealer() (protocol.EncryptionLevel, handshake.Sealer) - GetSealerWithEncryptionLevel(protocol.EncryptionLevel) (handshake.Sealer, error) -} - -type frameSource interface { - AppendStreamFrames([]wire.Frame, protocol.ByteCount) []wire.Frame - AppendControlFrames([]wire.Frame, protocol.ByteCount) ([]wire.Frame, protocol.ByteCount) -} - -type ackFrameSource interface { - GetAckFrame(protocol.EncryptionLevel) *wire.AckFrame -} - -type packetPacker struct { - destConnID protocol.ConnectionID - srcConnID protocol.ConnectionID - - perspective protocol.Perspective - version protocol.VersionNumber - cryptoSetup sealingManager - - initialStream cryptoStream - handshakeStream cryptoStream - - token []byte - - pnManager packetNumberManager - framer frameSource - acks ackFrameSource - - maxPacketSize protocol.ByteCount - numNonRetransmittableAcks int -} - -var _ packer = &packetPacker{} - -func newPacketPacker( - destConnID protocol.ConnectionID, - srcConnID protocol.ConnectionID, - initialStream cryptoStream, - handshakeStream cryptoStream, - packetNumberManager packetNumberManager, - remoteAddr net.Addr, // only used for determining the max packet size - token []byte, - cryptoSetup sealingManager, - framer frameSource, - acks ackFrameSource, - perspective protocol.Perspective, - version protocol.VersionNumber, -) *packetPacker { - return &packetPacker{ - cryptoSetup: cryptoSetup, - token: token, - destConnID: destConnID, - srcConnID: srcConnID, - initialStream: initialStream, - handshakeStream: handshakeStream, - perspective: perspective, - version: version, - framer: framer, - acks: acks, - pnManager: packetNumberManager, - maxPacketSize: getMaxPacketSize(remoteAddr), - } -} - -// PackConnectionClose packs a packet that ONLY contains a ConnectionCloseFrame -func (p *packetPacker) PackConnectionClose(ccf *wire.ConnectionCloseFrame) (*packedPacket, error) { - frames := []wire.Frame{ccf} - encLevel, sealer := p.cryptoSetup.GetSealer() - header := p.getHeader(encLevel) - return p.writeAndSealPacket(header, frames, sealer) -} - -func (p *packetPacker) MaybePackAckPacket() (*packedPacket, error) { - ack := p.acks.GetAckFrame(protocol.Encryption1RTT) - if ack == nil { - return nil, nil - } - // TODO(#1534): only pack ACKs with the right encryption level - encLevel, sealer := p.cryptoSetup.GetSealer() - header := p.getHeader(encLevel) - frames := []wire.Frame{ack} - return p.writeAndSealPacket(header, frames, sealer) -} - -// PackRetransmission packs a retransmission -// For packets sent after completion of the handshake, it might happen that 2 packets have to be sent. -// This can happen e.g. when a longer packet number is used in the header. -func (p *packetPacker) PackRetransmission(packet *ackhandler.Packet) ([]*packedPacket, error) { - var controlFrames []wire.Frame - var streamFrames []*wire.StreamFrame - for _, f := range packet.Frames { - // CRYPTO frames are treated as control frames here. - // Since we're making sure that the header can never be larger for a retransmission, - // we never have to split CRYPTO frames. - if sf, ok := f.(*wire.StreamFrame); ok { - sf.DataLenPresent = true - streamFrames = append(streamFrames, sf) - } else { - controlFrames = append(controlFrames, f) - } - } - - var packets []*packedPacket - encLevel := packet.EncryptionLevel - sealer, err := p.cryptoSetup.GetSealerWithEncryptionLevel(encLevel) - if err != nil { - return nil, err - } - for len(controlFrames) > 0 || len(streamFrames) > 0 { - var frames []wire.Frame - var length protocol.ByteCount - - header := p.getHeader(encLevel) - headerLen := header.GetLength(p.version) - maxSize := p.maxPacketSize - protocol.ByteCount(sealer.Overhead()) - headerLen - - for len(controlFrames) > 0 { - frame := controlFrames[0] - frameLen := frame.Length(p.version) - if length+frameLen > maxSize { - break - } - length += frameLen - frames = append(frames, frame) - controlFrames = controlFrames[1:] - } - - for len(streamFrames) > 0 && length+protocol.MinStreamFrameSize < maxSize { - frame := streamFrames[0] - frame.DataLenPresent = false - frameToAdd := frame - - sf, err := frame.MaybeSplitOffFrame(maxSize-length, p.version) - if err != nil { - return nil, err - } - if sf != nil { - frameToAdd = sf - } else { - streamFrames = streamFrames[1:] - } - frame.DataLenPresent = true - length += frameToAdd.Length(p.version) - frames = append(frames, frameToAdd) - } - if sf, ok := frames[len(frames)-1].(*wire.StreamFrame); ok { - sf.DataLenPresent = false - } - p, err := p.writeAndSealPacket(header, frames, sealer) - if err != nil { - return nil, err - } - packets = append(packets, p) - } - return packets, nil -} - -// PackPacket packs a new packet -// the other controlFrames are sent in the next packet, but might be queued and sent in the next packet if the packet would overflow MaxPacketSize otherwise -func (p *packetPacker) PackPacket() (*packedPacket, error) { - packet, err := p.maybePackCryptoPacket() - if err != nil { - return nil, err - } - if packet != nil { - return packet, nil - } - - encLevel, sealer := p.cryptoSetup.GetSealer() - header := p.getHeader(encLevel) - headerLen := header.GetLength(p.version) - if err != nil { - return nil, err - } - - maxSize := p.maxPacketSize - protocol.ByteCount(sealer.Overhead()) - headerLen - frames, err := p.composeNextPacket(maxSize) - if err != nil { - return nil, err - } - - // Check if we have enough frames to send - if len(frames) == 0 { - return nil, nil - } - // check if this packet only contains an ACK - if !ackhandler.HasRetransmittableFrames(frames) { - if p.numNonRetransmittableAcks >= protocol.MaxNonRetransmittableAcks { - frames = append(frames, &wire.PingFrame{}) - p.numNonRetransmittableAcks = 0 - } else { - p.numNonRetransmittableAcks++ - } - } else { - p.numNonRetransmittableAcks = 0 - } - - return p.writeAndSealPacket(header, frames, sealer) -} - -func (p *packetPacker) maybePackCryptoPacket() (*packedPacket, error) { - var s cryptoStream - var encLevel protocol.EncryptionLevel - - hasData := p.initialStream.HasData() - ack := p.acks.GetAckFrame(protocol.EncryptionInitial) - if hasData || ack != nil { - s = p.initialStream - encLevel = protocol.EncryptionInitial - } else { - hasData = p.handshakeStream.HasData() - ack = p.acks.GetAckFrame(protocol.EncryptionHandshake) - if hasData || ack != nil { - s = p.handshakeStream - encLevel = protocol.EncryptionHandshake - } - } - if s == nil { - return nil, nil - } - sealer, err := p.cryptoSetup.GetSealerWithEncryptionLevel(encLevel) - if err != nil { - // The sealer - return nil, err - } - - hdr := p.getHeader(encLevel) - hdrLen := hdr.GetLength(p.version) - var length protocol.ByteCount - frames := make([]wire.Frame, 0, 2) - if ack != nil { - frames = append(frames, ack) - length += ack.Length(p.version) - } - if hasData { - cf := s.PopCryptoFrame(p.maxPacketSize - hdrLen - protocol.ByteCount(sealer.Overhead()) - length) - frames = append(frames, cf) - } - return p.writeAndSealPacket(hdr, frames, sealer) -} - -func (p *packetPacker) composeNextPacket(maxFrameSize protocol.ByteCount) ([]wire.Frame, error) { - var length protocol.ByteCount - var frames []wire.Frame - - // ACKs need to go first, so that the sentPacketHandler will recognize them - if ack := p.acks.GetAckFrame(protocol.Encryption1RTT); ack != nil { - frames = append(frames, ack) - length += ack.Length(p.version) - } - - var lengthAdded protocol.ByteCount - frames, lengthAdded = p.framer.AppendControlFrames(frames, maxFrameSize-length) - length += lengthAdded - - // temporarily increase the maxFrameSize by the (minimum) length of the DataLen field - // this leads to a properly sized packet in all cases, since we do all the packet length calculations with STREAM frames that have the DataLen set - // however, for the last STREAM frame in the packet, we can omit the DataLen, thus yielding a packet of exactly the correct size - // the length is encoded to either 1 or 2 bytes - maxFrameSize++ - - frames = p.framer.AppendStreamFrames(frames, maxFrameSize-length) - if len(frames) > 0 { - lastFrame := frames[len(frames)-1] - if sf, ok := lastFrame.(*wire.StreamFrame); ok { - sf.DataLenPresent = false - } - } - return frames, nil -} - -func (p *packetPacker) getHeader(encLevel protocol.EncryptionLevel) *wire.ExtendedHeader { - pn, pnLen := p.pnManager.PeekPacketNumber() - header := &wire.ExtendedHeader{} - header.PacketNumber = pn - header.PacketNumberLen = pnLen - header.Version = p.version - header.DestConnectionID = p.destConnID - - if encLevel != protocol.Encryption1RTT { - header.IsLongHeader = true - // Always send Initial and Handshake packets with the maximum packet number length. - // This simplifies retransmissions: Since the header can't get any larger, - // we don't need to split CRYPTO frames. - header.PacketNumberLen = protocol.PacketNumberLen4 - header.SrcConnectionID = p.srcConnID - // Set the length to the maximum packet size. - // Since it is encoded as a varint, this guarantees us that the header will end up at most as big as GetLength() returns. - header.Length = p.maxPacketSize - switch encLevel { - case protocol.EncryptionInitial: - header.Type = protocol.PacketTypeInitial - case protocol.EncryptionHandshake: - header.Type = protocol.PacketTypeHandshake - } - } - - return header -} - -func (p *packetPacker) writeAndSealPacket( - header *wire.ExtendedHeader, - frames []wire.Frame, - sealer handshake.Sealer, -) (*packedPacket, error) { - packetBuffer := getPacketBuffer() - buffer := bytes.NewBuffer(packetBuffer.Slice[:0]) - - addPaddingForInitial := p.perspective == protocol.PerspectiveClient && header.Type == protocol.PacketTypeInitial - - if header.IsLongHeader { - if p.perspective == protocol.PerspectiveClient && header.Type == protocol.PacketTypeInitial { - header.Token = p.token - } - if addPaddingForInitial { - headerLen := header.GetLength(p.version) - header.Length = protocol.ByteCount(header.PacketNumberLen) + protocol.MinInitialPacketSize - headerLen - } else { - // long header packets always use 4 byte packet number, so we never need to pad short payloads - length := protocol.ByteCount(sealer.Overhead()) + protocol.ByteCount(header.PacketNumberLen) - for _, frame := range frames { - length += frame.Length(p.version) - } - header.Length = length - } - } - - if err := header.Write(buffer, p.version); err != nil { - return nil, err - } - payloadOffset := buffer.Len() - - // write all frames but the last one - for _, frame := range frames[:len(frames)-1] { - if err := frame.Write(buffer, p.version); err != nil { - return nil, err - } - } - lastFrame := frames[len(frames)-1] - if addPaddingForInitial { - // when appending padding, we need to make sure that the last STREAM frames has the data length set - if sf, ok := lastFrame.(*wire.StreamFrame); ok { - sf.DataLenPresent = true - } - } else { - payloadLen := buffer.Len() - payloadOffset + int(lastFrame.Length(p.version)) - if paddingLen := 4 - int(header.PacketNumberLen) - payloadLen; paddingLen > 0 { - // Pad the packet such that packet number length + payload length is 4 bytes. - // This is needed to enable the peer to get a 16 byte sample for header protection. - buffer.Write(bytes.Repeat([]byte{0}, paddingLen)) - } - } - if err := lastFrame.Write(buffer, p.version); err != nil { - return nil, err - } - - if addPaddingForInitial { - paddingLen := protocol.MinInitialPacketSize - sealer.Overhead() - buffer.Len() - if paddingLen > 0 { - buffer.Write(bytes.Repeat([]byte{0}, paddingLen)) - } - } - - if size := protocol.ByteCount(buffer.Len() + sealer.Overhead()); size > p.maxPacketSize { - return nil, fmt.Errorf("PacketPacker BUG: packet too large (%d bytes, allowed %d bytes)", size, p.maxPacketSize) - } - - raw := buffer.Bytes() - _ = sealer.Seal(raw[payloadOffset:payloadOffset], raw[payloadOffset:], header.PacketNumber, raw[:payloadOffset]) - raw = raw[0 : buffer.Len()+sealer.Overhead()] - - pnOffset := payloadOffset - int(header.PacketNumberLen) - sealer.EncryptHeader( - raw[pnOffset+4:pnOffset+4+16], - &raw[0], - raw[pnOffset:payloadOffset], - ) - - num := p.pnManager.PopPacketNumber() - if num != header.PacketNumber { - return nil, errors.New("packetPacker BUG: Peeked and Popped packet numbers do not match") - } - return &packedPacket{ - header: header, - raw: raw, - frames: frames, - buffer: packetBuffer, - }, nil -} - -func (p *packetPacker) ChangeDestConnectionID(connID protocol.ConnectionID) { - p.destConnID = connID -} - -func (p *packetPacker) HandleTransportParameters(params *handshake.TransportParameters) { - if params.MaxPacketSize != 0 { - p.maxPacketSize = utils.MinByteCount(p.maxPacketSize, params.MaxPacketSize) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/packet_unpacker.go b/external/github.com/lucas-clemente/quic-go/packet_unpacker.go deleted file mode 100644 index 2257503aa1..0000000000 --- a/external/github.com/lucas-clemente/quic-go/packet_unpacker.go +++ /dev/null @@ -1,102 +0,0 @@ -package quic - -import ( - "bytes" - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type unpackedPacket struct { - packetNumber protocol.PacketNumber // the decoded packet number - hdr *wire.ExtendedHeader - encryptionLevel protocol.EncryptionLevel - data []byte -} - -// The packetUnpacker unpacks QUIC packets. -type packetUnpacker struct { - cs handshake.CryptoSetup - - largestRcvdPacketNumber protocol.PacketNumber - - version protocol.VersionNumber -} - -var _ unpacker = &packetUnpacker{} - -func newPacketUnpacker(cs handshake.CryptoSetup, version protocol.VersionNumber) unpacker { - return &packetUnpacker{ - cs: cs, - version: version, - } -} - -func (u *packetUnpacker) Unpack(hdr *wire.Header, data []byte) (*unpackedPacket, error) { - r := bytes.NewReader(data) - - var encLevel protocol.EncryptionLevel - switch hdr.Type { - case protocol.PacketTypeInitial: - encLevel = protocol.EncryptionInitial - case protocol.PacketTypeHandshake: - encLevel = protocol.EncryptionHandshake - default: - if hdr.IsLongHeader { - return nil, fmt.Errorf("unknown packet type: %s", hdr.Type) - } - encLevel = protocol.Encryption1RTT - } - opener, err := u.cs.GetOpener(encLevel) - if err != nil { - return nil, err - } - hdrLen := int(hdr.ParsedLen()) - if len(data) < hdrLen+4+16 { - return nil, fmt.Errorf("Packet too small. Expected at least 20 bytes after the header, got %d", len(data)-hdrLen) - } - // The packet number can be up to 4 bytes long, but we won't know the length until we decrypt it. - // 1. save a copy of the 4 bytes - origPNBytes := make([]byte, 4) - copy(origPNBytes, data[hdrLen:hdrLen+4]) - // 2. decrypt the header, assuming a 4 byte packet number - opener.DecryptHeader( - data[hdrLen+4:hdrLen+4+16], - &data[0], - data[hdrLen:hdrLen+4], - ) - // 3. parse the header (and learn the actual length of the packet number) - extHdr, err := hdr.ParseExtended(r, u.version) - if err != nil { - return nil, fmt.Errorf("error parsing extended header: %s", err) - } - extHdrLen := hdrLen + int(extHdr.PacketNumberLen) - // 4. if the packet number is shorter than 4 bytes, replace the remaining bytes with the copy we saved earlier - if extHdr.PacketNumberLen != protocol.PacketNumberLen4 { - copy(data[extHdrLen:hdrLen+4], origPNBytes[int(extHdr.PacketNumberLen):]) - } - - pn := protocol.DecodePacketNumber( - extHdr.PacketNumberLen, - u.largestRcvdPacketNumber, - extHdr.PacketNumber, - ) - - decrypted, err := opener.Open(data[extHdrLen:extHdrLen], data[extHdrLen:], pn, data[:extHdrLen]) - if err != nil { - return nil, err - } - - // Only do this after decrypting, so we are sure the packet is not attacker-controlled - u.largestRcvdPacketNumber = utils.MaxPacketNumber(u.largestRcvdPacketNumber, pn) - - return &unpackedPacket{ - hdr: extHdr, - packetNumber: pn, - encryptionLevel: encLevel, - data: decrypted, - }, nil -} diff --git a/external/github.com/lucas-clemente/quic-go/receive_stream.go b/external/github.com/lucas-clemente/quic-go/receive_stream.go deleted file mode 100644 index 5d1999c91d..0000000000 --- a/external/github.com/lucas-clemente/quic-go/receive_stream.go +++ /dev/null @@ -1,298 +0,0 @@ -package quic - -import ( - "fmt" - "io" - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type receiveStreamI interface { - ReceiveStream - - handleStreamFrame(*wire.StreamFrame) error - handleResetStreamFrame(*wire.ResetStreamFrame) error - closeForShutdown(error) - getWindowUpdate() protocol.ByteCount -} - -type receiveStream struct { - mutex sync.Mutex - - streamID protocol.StreamID - - sender streamSender - - frameQueue *frameSorter - readOffset protocol.ByteCount - - currentFrame []byte - currentFrameIsLast bool // is the currentFrame the last frame on this stream - readPosInFrame int - - closeForShutdownErr error - cancelReadErr error - resetRemotelyErr StreamError - - closedForShutdown bool // set when CloseForShutdown() is called - finRead bool // set once we read a frame with a FinBit - canceledRead bool // set when CancelRead() is called - resetRemotely bool // set when HandleResetStreamFrame() is called - - readChan chan struct{} - deadline time.Time - - flowController flowcontrol.StreamFlowController - version protocol.VersionNumber -} - -var _ ReceiveStream = &receiveStream{} -var _ receiveStreamI = &receiveStream{} - -func newReceiveStream( - streamID protocol.StreamID, - sender streamSender, - flowController flowcontrol.StreamFlowController, - version protocol.VersionNumber, -) *receiveStream { - return &receiveStream{ - streamID: streamID, - sender: sender, - flowController: flowController, - frameQueue: newFrameSorter(), - readChan: make(chan struct{}, 1), - version: version, - } -} - -func (s *receiveStream) StreamID() protocol.StreamID { - return s.streamID -} - -// Read implements io.Reader. It is not thread safe! -func (s *receiveStream) Read(p []byte) (int, error) { - completed, n, err := s.readImpl(p) - if completed { - s.sender.onStreamCompleted(s.streamID) - } - return n, err -} - -func (s *receiveStream) HasMoreData() bool { - s.mutex.Lock() - defer s.mutex.Unlock() - - return s.currentFrame != nil -} - -func (s *receiveStream) readImpl(p []byte) (bool /*stream completed */, int, error) { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.finRead { - return false, 0, io.EOF - } - if s.canceledRead { - return false, 0, s.cancelReadErr - } - if s.resetRemotely { - return false, 0, s.resetRemotelyErr - } - if s.closedForShutdown { - return false, 0, s.closeForShutdownErr - } - - bytesRead := 0 - for bytesRead < len(p) { - if s.currentFrame == nil || s.readPosInFrame >= len(s.currentFrame) { - s.dequeueNextFrame() - } - if s.currentFrame == nil && bytesRead > 0 { - return false, bytesRead, s.closeForShutdownErr - } - - var deadlineTimer *utils.Timer - for { - // Stop waiting on errors - if s.closedForShutdown { - return false, bytesRead, s.closeForShutdownErr - } - if s.canceledRead { - return false, bytesRead, s.cancelReadErr - } - if s.resetRemotely { - return false, bytesRead, s.resetRemotelyErr - } - - deadline := s.deadline - if !deadline.IsZero() { - if !time.Now().Before(deadline) { - return false, bytesRead, errDeadline - } - if deadlineTimer == nil { - deadlineTimer = utils.NewTimer() - } - deadlineTimer.Reset(deadline) - } - - if s.currentFrame != nil || s.currentFrameIsLast { - break - } - - s.mutex.Unlock() - if deadline.IsZero() { - <-s.readChan - } else { - select { - case <-s.readChan: - case <-deadlineTimer.Chan(): - deadlineTimer.SetRead() - } - } - s.mutex.Lock() - if s.currentFrame == nil { - s.dequeueNextFrame() - } - } - - if bytesRead > len(p) { - return false, bytesRead, fmt.Errorf("BUG: bytesRead (%d) > len(p) (%d) in stream.Read", bytesRead, len(p)) - } - if s.readPosInFrame > len(s.currentFrame) { - return false, bytesRead, fmt.Errorf("BUG: readPosInFrame (%d) > frame.DataLen (%d) in stream.Read", s.readPosInFrame, len(s.currentFrame)) - } - - s.mutex.Unlock() - - m := copy(p[bytesRead:], s.currentFrame[s.readPosInFrame:]) - s.readPosInFrame += m - bytesRead += m - s.readOffset += protocol.ByteCount(m) - - s.mutex.Lock() - // when a RESET_STREAM was received, the was already informed about the final byteOffset for this stream - if !s.resetRemotely { - s.flowController.AddBytesRead(protocol.ByteCount(m)) - } - // increase the flow control window, if necessary - s.flowController.MaybeQueueWindowUpdate() - - if s.readPosInFrame >= len(s.currentFrame) && s.currentFrameIsLast { - s.finRead = true - return true, bytesRead, io.EOF - } - } - return false, bytesRead, nil -} - -func (s *receiveStream) dequeueNextFrame() { - s.currentFrame, s.currentFrameIsLast = s.frameQueue.Pop() - s.readPosInFrame = 0 -} - -func (s *receiveStream) CancelRead(errorCode protocol.ApplicationErrorCode) error { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.finRead { - return nil - } - if s.canceledRead { - return nil - } - s.canceledRead = true - s.cancelReadErr = fmt.Errorf("Read on stream %d canceled with error code %d", s.streamID, errorCode) - s.signalRead() - s.sender.queueControlFrame(&wire.StopSendingFrame{ - StreamID: s.streamID, - ErrorCode: errorCode, - }) - return nil -} - -func (s *receiveStream) handleStreamFrame(frame *wire.StreamFrame) error { - maxOffset := frame.Offset + frame.DataLen() - if err := s.flowController.UpdateHighestReceived(maxOffset, frame.FinBit); err != nil { - return err - } - - s.mutex.Lock() - defer s.mutex.Unlock() - if err := s.frameQueue.Push(frame.Data, frame.Offset, frame.FinBit); err != nil { - return err - } - s.signalRead() - return nil -} - -func (s *receiveStream) handleResetStreamFrame(frame *wire.ResetStreamFrame) error { - completed, err := s.handleResetStreamFrameImpl(frame) - if completed { - s.sender.onStreamCompleted(s.streamID) - } - return err -} - -func (s *receiveStream) handleResetStreamFrameImpl(frame *wire.ResetStreamFrame) (bool /*completed */, error) { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.closedForShutdown { - return false, nil - } - if err := s.flowController.UpdateHighestReceived(frame.ByteOffset, true); err != nil { - return false, err - } - - // ignore duplicate RESET_STREAM frames for this stream (after checking their final offset) - if s.resetRemotely { - return false, nil - } - s.resetRemotely = true - s.resetRemotelyErr = streamCanceledError{ - errorCode: frame.ErrorCode, - error: fmt.Errorf("Stream %d was reset with error code %d", s.streamID, frame.ErrorCode), - } - s.signalRead() - return true, nil -} - -func (s *receiveStream) CloseRemote(offset protocol.ByteCount) { - s.handleStreamFrame(&wire.StreamFrame{FinBit: true, Offset: offset}) -} - -func (s *receiveStream) SetReadDeadline(t time.Time) error { - s.mutex.Lock() - s.deadline = t - s.mutex.Unlock() - s.signalRead() - return nil -} - -// CloseForShutdown closes a stream abruptly. -// It makes Read unblock (and return the error) immediately. -// The peer will NOT be informed about this: the stream is closed without sending a FIN or RESET. -func (s *receiveStream) closeForShutdown(err error) { - s.mutex.Lock() - s.closedForShutdown = true - s.closeForShutdownErr = err - s.mutex.Unlock() - s.signalRead() -} - -func (s *receiveStream) getWindowUpdate() protocol.ByteCount { - return s.flowController.GetWindowUpdate() -} - -// signalRead performs a non-blocking send on the readChan -func (s *receiveStream) signalRead() { - select { - case s.readChan <- struct{}{}: - default: - } -} diff --git a/external/github.com/lucas-clemente/quic-go/send_stream.go b/external/github.com/lucas-clemente/quic-go/send_stream.go deleted file mode 100644 index 97849b1cf3..0000000000 --- a/external/github.com/lucas-clemente/quic-go/send_stream.go +++ /dev/null @@ -1,340 +0,0 @@ -package quic - -import ( - "context" - "fmt" - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type sendStreamI interface { - SendStream - handleStopSendingFrame(*wire.StopSendingFrame) - hasData() bool - popStreamFrame(maxBytes protocol.ByteCount) (*wire.StreamFrame, bool) - closeForShutdown(error) - handleMaxStreamDataFrame(*wire.MaxStreamDataFrame) -} - -type sendStream struct { - mutex sync.Mutex - - ctx context.Context - ctxCancel context.CancelFunc - - streamID protocol.StreamID - sender streamSender - - writeOffset protocol.ByteCount - - cancelWriteErr error - closeForShutdownErr error - - closedForShutdown bool // set when CloseForShutdown() is called - finishedWriting bool // set once Close() is called - canceledWrite bool // set when CancelWrite() is called, or a STOP_SENDING frame is received - finSent bool // set when a STREAM_FRAME with FIN bit has b - - dataForWriting []byte - - writeChan chan struct{} - deadline time.Time - - flowController flowcontrol.StreamFlowController - - version protocol.VersionNumber -} - -var _ SendStream = &sendStream{} -var _ sendStreamI = &sendStream{} - -func newSendStream( - streamID protocol.StreamID, - sender streamSender, - flowController flowcontrol.StreamFlowController, - version protocol.VersionNumber, -) *sendStream { - s := &sendStream{ - streamID: streamID, - sender: sender, - flowController: flowController, - writeChan: make(chan struct{}, 1), - version: version, - } - s.ctx, s.ctxCancel = context.WithCancel(context.Background()) - return s -} - -func (s *sendStream) StreamID() protocol.StreamID { - return s.streamID // same for receiveStream and sendStream -} - -func (s *sendStream) Write(p []byte) (int, error) { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.finishedWriting { - return 0, fmt.Errorf("write on closed stream %d", s.streamID) - } - if s.canceledWrite { - return 0, s.cancelWriteErr - } - if s.closeForShutdownErr != nil { - return 0, s.closeForShutdownErr - } - if !s.deadline.IsZero() && !time.Now().Before(s.deadline) { - return 0, errDeadline - } - if len(p) == 0 { - return 0, nil - } - - s.dataForWriting = p - - var ( - deadlineTimer *utils.Timer - bytesWritten int - notifiedSender bool - ) - for { - bytesWritten = len(p) - len(s.dataForWriting) - deadline := s.deadline - if !deadline.IsZero() { - if !time.Now().Before(deadline) { - s.dataForWriting = nil - return bytesWritten, errDeadline - } - if deadlineTimer == nil { - deadlineTimer = utils.NewTimer() - } - deadlineTimer.Reset(deadline) - } - if s.dataForWriting == nil || s.canceledWrite || s.closedForShutdown { - break - } - - s.mutex.Unlock() - if !notifiedSender { - s.sender.onHasStreamData(s.streamID) // must be called without holding the mutex - notifiedSender = true - } - if deadline.IsZero() { - <-s.writeChan - } else { - select { - case <-s.writeChan: - case <-deadlineTimer.Chan(): - deadlineTimer.SetRead() - } - } - s.mutex.Lock() - } - - if s.closeForShutdownErr != nil { - return bytesWritten, s.closeForShutdownErr - } else if s.cancelWriteErr != nil { - return bytesWritten, s.cancelWriteErr - } - return bytesWritten, nil -} - -// popStreamFrame returns the next STREAM frame that is supposed to be sent on this stream -// maxBytes is the maximum length this frame (including frame header) will have. -func (s *sendStream) popStreamFrame(maxBytes protocol.ByteCount) (*wire.StreamFrame, bool /* has more data to send */) { - completed, frame, hasMoreData := s.popStreamFrameImpl(maxBytes) - if completed { - s.sender.onStreamCompleted(s.streamID) - } - return frame, hasMoreData -} - -func (s *sendStream) popStreamFrameImpl(maxBytes protocol.ByteCount) (bool /* completed */, *wire.StreamFrame, bool /* has more data to send */) { - s.mutex.Lock() - defer s.mutex.Unlock() - - if s.closeForShutdownErr != nil { - return false, nil, false - } - - frame := &wire.StreamFrame{ - StreamID: s.streamID, - Offset: s.writeOffset, - DataLenPresent: true, - } - maxDataLen := frame.MaxDataLen(maxBytes, s.version) - if maxDataLen == 0 { // a STREAM frame must have at least one byte of data - return false, nil, s.dataForWriting != nil - } - frame.Data, frame.FinBit = s.getDataForWriting(maxDataLen) - if len(frame.Data) == 0 && !frame.FinBit { - // this can happen if: - // - popStreamFrame is called but there's no data for writing - // - there's data for writing, but the stream is stream-level flow control blocked - // - there's data for writing, but the stream is connection-level flow control blocked - if s.dataForWriting == nil { - return false, nil, false - } - if isBlocked, offset := s.flowController.IsNewlyBlocked(); isBlocked { - s.sender.queueControlFrame(&wire.StreamDataBlockedFrame{ - StreamID: s.streamID, - DataLimit: offset, - }) - return false, nil, false - } - return false, nil, true - } - if frame.FinBit { - s.finSent = true - } - return frame.FinBit, frame, s.dataForWriting != nil -} - -func (s *sendStream) hasData() bool { - s.mutex.Lock() - hasData := len(s.dataForWriting) > 0 - s.mutex.Unlock() - return hasData -} - -func (s *sendStream) getDataForWriting(maxBytes protocol.ByteCount) ([]byte, bool /* should send FIN */) { - if s.dataForWriting == nil { - return nil, s.finishedWriting && !s.finSent - } - - maxBytes = utils.MinByteCount(maxBytes, s.flowController.SendWindowSize()) - if maxBytes == 0 { - return nil, false - } - - var ret []byte - if protocol.ByteCount(len(s.dataForWriting)) > maxBytes { - ret = make([]byte, int(maxBytes)) - copy(ret, s.dataForWriting[:maxBytes]) - s.dataForWriting = s.dataForWriting[maxBytes:] - } else { - ret = make([]byte, len(s.dataForWriting)) - copy(ret, s.dataForWriting) - s.dataForWriting = nil - s.signalWrite() - } - s.writeOffset += protocol.ByteCount(len(ret)) - s.flowController.AddBytesSent(protocol.ByteCount(len(ret))) - return ret, s.finishedWriting && s.dataForWriting == nil && !s.finSent -} - -func (s *sendStream) Close() error { - s.mutex.Lock() - if s.canceledWrite { - s.mutex.Unlock() - return fmt.Errorf("Close called for canceled stream %d", s.streamID) - } - s.finishedWriting = true - s.mutex.Unlock() - - s.sender.onHasStreamData(s.streamID) // need to send the FIN, must be called without holding the mutex - s.ctxCancel() - return nil -} - -func (s *sendStream) CancelWrite(errorCode protocol.ApplicationErrorCode) error { - s.mutex.Lock() - completed, err := s.cancelWriteImpl(errorCode, fmt.Errorf("Write on stream %d canceled with error code %d", s.streamID, errorCode)) - s.mutex.Unlock() - - if completed { - s.sender.onStreamCompleted(s.streamID) // must be called without holding the mutex - } - return err -} - -// must be called after locking the mutex -func (s *sendStream) cancelWriteImpl(errorCode protocol.ApplicationErrorCode, writeErr error) (bool /*completed */, error) { - if s.canceledWrite { - return false, nil - } - if s.finishedWriting { - return false, fmt.Errorf("CancelWrite for closed stream %d", s.streamID) - } - s.canceledWrite = true - s.cancelWriteErr = writeErr - s.signalWrite() - s.sender.queueControlFrame(&wire.ResetStreamFrame{ - StreamID: s.streamID, - ByteOffset: s.writeOffset, - ErrorCode: errorCode, - }) - // TODO(#991): cancel retransmissions for this stream - s.ctxCancel() - return true, nil -} - -func (s *sendStream) handleStopSendingFrame(frame *wire.StopSendingFrame) { - if completed := s.handleStopSendingFrameImpl(frame); completed { - s.sender.onStreamCompleted(s.streamID) - } -} - -func (s *sendStream) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) { - s.mutex.Lock() - hasStreamData := s.dataForWriting != nil - s.mutex.Unlock() - s.flowController.UpdateSendWindow(frame.ByteOffset) - if hasStreamData { - s.sender.onHasStreamData(s.streamID) - } -} - -// must be called after locking the mutex -func (s *sendStream) handleStopSendingFrameImpl(frame *wire.StopSendingFrame) bool /*completed*/ { - s.mutex.Lock() - defer s.mutex.Unlock() - - writeErr := streamCanceledError{ - errorCode: frame.ErrorCode, - error: fmt.Errorf("Stream %d was reset with error code %d", s.streamID, frame.ErrorCode), - } - errorCode := errorCodeStopping - completed, _ := s.cancelWriteImpl(errorCode, writeErr) - return completed -} - -func (s *sendStream) Context() context.Context { - return s.ctx -} - -func (s *sendStream) SetWriteDeadline(t time.Time) error { - s.mutex.Lock() - s.deadline = t - s.mutex.Unlock() - s.signalWrite() - return nil -} - -// CloseForShutdown closes a stream abruptly. -// It makes Write unblock (and return the error) immediately. -// The peer will NOT be informed about this: the stream is closed without sending a FIN or RST. -func (s *sendStream) closeForShutdown(err error) { - s.mutex.Lock() - s.closedForShutdown = true - s.closeForShutdownErr = err - s.mutex.Unlock() - s.signalWrite() - s.ctxCancel() -} - -func (s *sendStream) getWriteOffset() protocol.ByteCount { - return s.writeOffset -} - -// signalWrite performs a non-blocking send on the writeChan -func (s *sendStream) signalWrite() { - select { - case s.writeChan <- struct{}{}: - default: - } -} diff --git a/external/github.com/lucas-clemente/quic-go/server.go b/external/github.com/lucas-clemente/quic-go/server.go deleted file mode 100644 index 8ee5001458..0000000000 --- a/external/github.com/lucas-clemente/quic-go/server.go +++ /dev/null @@ -1,542 +0,0 @@ -package quic - -import ( - "bytes" - "crypto/tls" - "errors" - "fmt" - "io" - "net" - "sync" - "sync/atomic" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -// packetHandler handles packets -type packetHandler interface { - handlePacket(*receivedPacket) - io.Closer - destroy(error) - GetPerspective() protocol.Perspective -} - -type unknownPacketHandler interface { - handlePacket(*receivedPacket) - closeWithError(error) error -} - -type packetHandlerManager interface { - Add(protocol.ConnectionID, packetHandler) - Retire(protocol.ConnectionID) - Remove(protocol.ConnectionID) - SetServer(unknownPacketHandler) - CloseServer() -} - -type quicSession interface { - Session - handlePacket(*receivedPacket) - GetVersion() protocol.VersionNumber - run() error - destroy(error) - closeForRecreating() protocol.PacketNumber - closeRemote(error) -} - -type sessionRunner interface { - onHandshakeComplete(Session) - retireConnectionID(protocol.ConnectionID) - removeConnectionID(protocol.ConnectionID) -} - -type runner struct { - onHandshakeCompleteImpl func(Session) - retireConnectionIDImpl func(protocol.ConnectionID) - removeConnectionIDImpl func(protocol.ConnectionID) -} - -func (r *runner) onHandshakeComplete(s Session) { r.onHandshakeCompleteImpl(s) } -func (r *runner) retireConnectionID(c protocol.ConnectionID) { r.retireConnectionIDImpl(c) } -func (r *runner) removeConnectionID(c protocol.ConnectionID) { r.removeConnectionIDImpl(c) } - -var _ sessionRunner = &runner{} - -// A Listener of QUIC -type server struct { - mutex sync.Mutex - - tlsConf *tls.Config - config *Config - - conn net.PacketConn - // If the server is started with ListenAddr, we create a packet conn. - // If it is started with Listen, we take a packet conn as a parameter. - createdPacketConn bool - - cookieGenerator *handshake.CookieGenerator - - sessionHandler packetHandlerManager - - // set as a member, so they can be set in the tests - newSession func(connection, sessionRunner, protocol.ConnectionID /* original connection ID */, protocol.ConnectionID /* destination connection ID */, protocol.ConnectionID /* source connection ID */, *Config, *tls.Config, *handshake.TransportParameters, utils.Logger, protocol.VersionNumber) (quicSession, error) - - serverError error - errorChan chan struct{} - closed bool - - sessionQueue chan Session - sessionQueueLen int32 // to be used as an atomic - - sessionRunner sessionRunner - - logger utils.Logger -} - -var _ Listener = &server{} -var _ unknownPacketHandler = &server{} - -// ListenAddr creates a QUIC server listening on a given address. -// The tls.Config must not be nil and must contain a certificate configuration. -// The quic.Config may be nil, in that case the default values will be used. -func ListenAddr(addr string, tlsConf *tls.Config, config *Config) (Listener, error) { - udpAddr, err := net.ResolveUDPAddr("udp", addr) - if err != nil { - return nil, err - } - conn, err := net.ListenUDP("udp", udpAddr) - if err != nil { - return nil, err - } - serv, err := listen(conn, tlsConf, config) - if err != nil { - return nil, err - } - serv.createdPacketConn = true - return serv, nil -} - -// Listen listens for QUIC connections on a given net.PacketConn. -// A single PacketConn only be used for a single call to Listen. -// The PacketConn can be used for simultaneous calls to Dial. -// QUIC connection IDs are used for demultiplexing the different connections. -// The tls.Config must not be nil and must contain a certificate configuration. -// The quic.Config may be nil, in that case the default values will be used. -func Listen(conn net.PacketConn, tlsConf *tls.Config, config *Config) (Listener, error) { - return listen(conn, tlsConf, config) -} - -func listen(conn net.PacketConn, tlsConf *tls.Config, config *Config) (*server, error) { - // TODO(#1655): only require that tls.Config.Certificates or tls.Config.GetCertificate is set - if tlsConf == nil || len(tlsConf.Certificates) == 0 { - return nil, errors.New("quic: Certificates not set in tls.Config") - } - config = populateServerConfig(config) - for _, v := range config.Versions { - if !protocol.IsValidVersion(v) { - return nil, fmt.Errorf("%s is not a valid QUIC version", v) - } - } - - sessionHandler, err := getMultiplexer().AddConn(conn, config.ConnectionIDLength) - if err != nil { - return nil, err - } - s := &server{ - conn: conn, - tlsConf: tlsConf, - config: config, - sessionHandler: sessionHandler, - sessionQueue: make(chan Session), - errorChan: make(chan struct{}), - newSession: newSession, - logger: utils.DefaultLogger.WithPrefix("server"), - } - if err := s.setup(); err != nil { - return nil, err - } - sessionHandler.SetServer(s) - s.logger.Debugf("Listening for %s connections on %s", conn.LocalAddr().Network(), conn.LocalAddr().String()) - return s, nil -} - -func (s *server) setup() error { - s.sessionRunner = &runner{ - onHandshakeCompleteImpl: func(sess Session) { - go func() { - atomic.AddInt32(&s.sessionQueueLen, 1) - defer atomic.AddInt32(&s.sessionQueueLen, -1) - select { - case s.sessionQueue <- sess: - // blocks until the session is accepted - case <-sess.Context().Done(): - // don't pass sessions that were already closed to Accept() - } - }() - }, - retireConnectionIDImpl: s.sessionHandler.Retire, - removeConnectionIDImpl: s.sessionHandler.Remove, - } - cookieGenerator, err := handshake.NewCookieGenerator() - if err != nil { - return err - } - s.cookieGenerator = cookieGenerator - return nil -} - -var defaultAcceptCookie = func(clientAddr net.Addr, cookie *Cookie) bool { - if cookie == nil { - return false - } - if time.Now().After(cookie.SentTime.Add(protocol.CookieExpiryTime)) { - return false - } - var sourceAddr string - if udpAddr, ok := clientAddr.(*net.UDPAddr); ok { - sourceAddr = udpAddr.IP.String() - } else { - sourceAddr = clientAddr.String() - } - return sourceAddr == cookie.RemoteAddr -} - -// populateServerConfig populates fields in the quic.Config with their default values, if none are set -// it may be called with nil -func populateServerConfig(config *Config) *Config { - if config == nil { - config = &Config{} - } - versions := config.Versions - if len(versions) == 0 { - versions = protocol.SupportedVersions - } - - vsa := defaultAcceptCookie - if config.AcceptCookie != nil { - vsa = config.AcceptCookie - } - - handshakeTimeout := protocol.DefaultHandshakeTimeout - if config.HandshakeTimeout != 0 { - handshakeTimeout = config.HandshakeTimeout - } - idleTimeout := protocol.DefaultIdleTimeout - if config.IdleTimeout != 0 { - idleTimeout = config.IdleTimeout - } - - maxReceiveStreamFlowControlWindow := config.MaxReceiveStreamFlowControlWindow - if maxReceiveStreamFlowControlWindow == 0 { - maxReceiveStreamFlowControlWindow = protocol.DefaultMaxReceiveStreamFlowControlWindow - } - maxReceiveConnectionFlowControlWindow := config.MaxReceiveConnectionFlowControlWindow - if maxReceiveConnectionFlowControlWindow == 0 { - maxReceiveConnectionFlowControlWindow = protocol.DefaultMaxReceiveConnectionFlowControlWindow - } - maxIncomingStreams := config.MaxIncomingStreams - if maxIncomingStreams == 0 { - maxIncomingStreams = protocol.DefaultMaxIncomingStreams - } else if maxIncomingStreams < 0 { - maxIncomingStreams = 0 - } - maxIncomingUniStreams := config.MaxIncomingUniStreams - if maxIncomingUniStreams == 0 { - maxIncomingUniStreams = protocol.DefaultMaxIncomingUniStreams - } else if maxIncomingUniStreams < 0 { - maxIncomingUniStreams = 0 - } - connIDLen := config.ConnectionIDLength - if connIDLen == 0 { - connIDLen = protocol.DefaultConnectionIDLength - } - - return &Config{ - Versions: versions, - HandshakeTimeout: handshakeTimeout, - IdleTimeout: idleTimeout, - AcceptCookie: vsa, - KeepAlive: config.KeepAlive, - MaxReceiveStreamFlowControlWindow: maxReceiveStreamFlowControlWindow, - MaxReceiveConnectionFlowControlWindow: maxReceiveConnectionFlowControlWindow, - MaxIncomingStreams: maxIncomingStreams, - MaxIncomingUniStreams: maxIncomingUniStreams, - ConnectionIDLength: connIDLen, - } -} - -// Accept returns newly openend sessions -func (s *server) Accept() (Session, error) { - var sess Session - select { - case sess = <-s.sessionQueue: - return sess, nil - case <-s.errorChan: - return nil, s.serverError - } -} - -// Close the server -func (s *server) Close() error { - s.mutex.Lock() - defer s.mutex.Unlock() - if s.closed { - return nil - } - return s.closeWithMutex() -} - -func (s *server) closeWithMutex() error { - s.sessionHandler.CloseServer() - if s.serverError == nil { - s.serverError = errors.New("server closed") - } - var err error - // If the server was started with ListenAddr, we created the packet conn. - // We need to close it in order to make the go routine reading from that conn return. - if s.createdPacketConn { - err = s.conn.Close() - } - s.closed = true - close(s.errorChan) - return err -} - -func (s *server) closeWithError(e error) error { - s.mutex.Lock() - defer s.mutex.Unlock() - if s.closed { - return nil - } - s.serverError = e - return s.closeWithMutex() -} - -// Addr returns the server's network address -func (s *server) Addr() net.Addr { - return s.conn.LocalAddr() -} - -func (s *server) handlePacket(p *receivedPacket) { - hdr := p.hdr - - // send a Version Negotiation Packet if the client is speaking a different protocol version - if !protocol.IsSupportedVersion(s.config.Versions, hdr.Version) { - go s.sendVersionNegotiationPacket(p) - return - } - if hdr.Type == protocol.PacketTypeInitial { - go s.handleInitial(p) - return - } - - // TODO(#943): send Stateless Reset - p.buffer.Release() -} - -func (s *server) handleInitial(p *receivedPacket) { - s.logger.Debugf("<- Received Initial packet.") - sess, connID, err := s.handleInitialImpl(p) - if err != nil { - p.buffer.Release() - s.logger.Errorf("Error occurred handling initial packet: %s", err) - return - } - if sess == nil { // a retry was done, or the connection attempt was rejected - p.buffer.Release() - return - } - // Don't put the packet buffer back if a new session was created. - // The session will handle the packet and take of that. - serverSession := newServerSession(sess, s.config, s.logger) - s.sessionHandler.Add(connID, serverSession) -} - -func (s *server) handleInitialImpl(p *receivedPacket) (quicSession, protocol.ConnectionID, error) { - hdr := p.hdr - if len(hdr.Token) == 0 && hdr.DestConnectionID.Len() < protocol.MinConnectionIDLenInitial { - return nil, nil, errors.New("dropping Initial packet with too short connection ID") - } - if len(p.data) < protocol.MinInitialPacketSize { - return nil, nil, errors.New("dropping too small Initial packet") - } - - var cookie *Cookie - var origDestConnectionID protocol.ConnectionID - if len(hdr.Token) > 0 { - c, err := s.cookieGenerator.DecodeToken(hdr.Token) - if err == nil { - cookie = &Cookie{ - RemoteAddr: c.RemoteAddr, - SentTime: c.SentTime, - } - origDestConnectionID = c.OriginalDestConnectionID - } - } - if !s.config.AcceptCookie(p.remoteAddr, cookie) { - // Log the Initial packet now. - // If no Retry is sent, the packet will be logged by the session. - (&wire.ExtendedHeader{Header: *p.hdr}).Log(s.logger) - return nil, nil, s.sendRetry(p.remoteAddr, hdr) - } - - if queueLen := atomic.LoadInt32(&s.sessionQueueLen); queueLen >= protocol.MaxAcceptQueueSize { - s.logger.Debugf("Rejecting new connection. Server currently busy. Accept queue length: %d (max %d)", queueLen, protocol.MaxAcceptQueueSize) - return nil, nil, s.sendServerBusy(p.remoteAddr, hdr) - } - - connID, err := protocol.GenerateConnectionID(s.config.ConnectionIDLength) - if err != nil { - return nil, nil, err - } - s.logger.Debugf("Changing connection ID to %s.", connID) - sess, err := s.createNewSession( - p.remoteAddr, - origDestConnectionID, - hdr.DestConnectionID, - hdr.SrcConnectionID, - connID, - hdr.Version, - ) - if err != nil { - return nil, nil, err - } - sess.handlePacket(p) - return sess, connID, nil -} - -func (s *server) createNewSession( - remoteAddr net.Addr, - origDestConnID protocol.ConnectionID, - clientDestConnID protocol.ConnectionID, - destConnID protocol.ConnectionID, - srcConnID protocol.ConnectionID, - version protocol.VersionNumber, -) (quicSession, error) { - params := &handshake.TransportParameters{ - InitialMaxStreamDataBidiLocal: protocol.InitialMaxStreamData, - InitialMaxStreamDataBidiRemote: protocol.InitialMaxStreamData, - InitialMaxStreamDataUni: protocol.InitialMaxStreamData, - InitialMaxData: protocol.InitialMaxData, - IdleTimeout: s.config.IdleTimeout, - MaxBidiStreams: uint64(s.config.MaxIncomingStreams), - MaxUniStreams: uint64(s.config.MaxIncomingUniStreams), - DisableMigration: true, - // TODO(#855): generate a real token - StatelessResetToken: bytes.Repeat([]byte{42}, 16), - OriginalConnectionID: origDestConnID, - } - sess, err := s.newSession( - &conn{pconn: s.conn, currentAddr: remoteAddr}, - s.sessionRunner, - clientDestConnID, - destConnID, - srcConnID, - s.config, - s.tlsConf, - params, - s.logger, - version, - ) - if err != nil { - return nil, err - } - go sess.run() - return sess, nil -} - -func (s *server) sendRetry(remoteAddr net.Addr, hdr *wire.Header) error { - token, err := s.cookieGenerator.NewToken(remoteAddr, hdr.DestConnectionID) - if err != nil { - return err - } - connID, err := protocol.GenerateConnectionID(s.config.ConnectionIDLength) - if err != nil { - return err - } - replyHdr := &wire.ExtendedHeader{} - replyHdr.IsLongHeader = true - replyHdr.Type = protocol.PacketTypeRetry - replyHdr.Version = hdr.Version - replyHdr.SrcConnectionID = connID - replyHdr.DestConnectionID = hdr.SrcConnectionID - replyHdr.OrigDestConnectionID = hdr.DestConnectionID - replyHdr.Token = token - s.logger.Debugf("Changing connection ID to %s.\n-> Sending Retry", connID) - replyHdr.Log(s.logger) - buf := &bytes.Buffer{} - if err := replyHdr.Write(buf, hdr.Version); err != nil { - return err - } - if _, err := s.conn.WriteTo(buf.Bytes(), remoteAddr); err != nil { - s.logger.Debugf("Error sending Retry: %s", err) - } - return nil -} - -func (s *server) sendServerBusy(remoteAddr net.Addr, hdr *wire.Header) error { - sealer, _, err := handshake.NewInitialAEAD(hdr.DestConnectionID, protocol.PerspectiveServer) - if err != nil { - return err - } - packetBuffer := getPacketBuffer() - defer packetBuffer.Release() - buf := bytes.NewBuffer(packetBuffer.Slice[:0]) - - // TODO(#1567): use the SERVER_BUSY error code - ccf := &wire.ConnectionCloseFrame{ErrorCode: qerr.PeerGoingAway} - - replyHdr := &wire.ExtendedHeader{} - replyHdr.IsLongHeader = true - replyHdr.Type = protocol.PacketTypeInitial - replyHdr.Version = hdr.Version - replyHdr.SrcConnectionID = hdr.DestConnectionID - replyHdr.DestConnectionID = hdr.SrcConnectionID - replyHdr.PacketNumberLen = protocol.PacketNumberLen4 - replyHdr.Length = 4 /* packet number len */ + ccf.Length(hdr.Version) + protocol.ByteCount(sealer.Overhead()) - if err := replyHdr.Write(buf, hdr.Version); err != nil { - return err - } - payloadOffset := buf.Len() - - if err := ccf.Write(buf, hdr.Version); err != nil { - return err - } - - raw := buf.Bytes() - _ = sealer.Seal(raw[payloadOffset:payloadOffset], raw[payloadOffset:], replyHdr.PacketNumber, raw[:payloadOffset]) - raw = raw[0 : buf.Len()+sealer.Overhead()] - - pnOffset := payloadOffset - int(replyHdr.PacketNumberLen) - sealer.EncryptHeader( - raw[pnOffset+4:pnOffset+4+16], - &raw[0], - raw[pnOffset:payloadOffset], - ) - - replyHdr.Log(s.logger) - wire.LogFrame(s.logger, ccf, true) - if _, err := s.conn.WriteTo(raw, remoteAddr); err != nil { - s.logger.Debugf("Error rejecting connection: %s", err) - } - return nil -} - -func (s *server) sendVersionNegotiationPacket(p *receivedPacket) { - defer p.buffer.Release() - hdr := p.hdr - s.logger.Debugf("Client offered version %s, sending Version Negotiation", hdr.Version) - data, err := wire.ComposeVersionNegotiation(hdr.SrcConnectionID, hdr.DestConnectionID, s.config.Versions) - if err != nil { - s.logger.Debugf("Error composing Version Negotiation: %s", err) - return - } - if _, err := s.conn.WriteTo(data, p.remoteAddr); err != nil { - s.logger.Debugf("Error sending Version Negotiation: %s", err) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/server_session.go b/external/github.com/lucas-clemente/quic-go/server_session.go deleted file mode 100644 index 2c1fd40280..0000000000 --- a/external/github.com/lucas-clemente/quic-go/server_session.go +++ /dev/null @@ -1,59 +0,0 @@ -package quic - -import ( - "fmt" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" -) - -type serverSession struct { - quicSession - - config *Config - - logger utils.Logger -} - -var _ packetHandler = &serverSession{} - -func newServerSession(sess quicSession, config *Config, logger utils.Logger) packetHandler { - return &serverSession{ - quicSession: sess, - config: config, - logger: logger, - } -} - -func (s *serverSession) handlePacket(p *receivedPacket) { - if err := s.handlePacketImpl(p); err != nil { - s.logger.Debugf("error handling packet from %s: %s", p.remoteAddr, err) - } -} - -func (s *serverSession) handlePacketImpl(p *receivedPacket) error { - hdr := p.hdr - - // Probably an old packet that was sent by the client before the version was negotiated. - // It is safe to drop it. - if hdr.IsLongHeader && hdr.Version != s.quicSession.GetVersion() { - return nil - } - - if hdr.IsLongHeader { - switch hdr.Type { - case protocol.PacketTypeInitial, protocol.PacketTypeHandshake: - // nothing to do here. Packet will be passed to the session. - default: - // Note that this also drops 0-RTT packets. - return fmt.Errorf("Received unsupported packet type: %s", hdr.Type) - } - } - - s.quicSession.handlePacket(p) - return nil -} - -func (s *serverSession) GetPerspective() protocol.Perspective { - return protocol.PerspectiveServer -} diff --git a/external/github.com/lucas-clemente/quic-go/session.go b/external/github.com/lucas-clemente/quic-go/session.go deleted file mode 100644 index dc75628ef4..0000000000 --- a/external/github.com/lucas-clemente/quic-go/session.go +++ /dev/null @@ -1,1143 +0,0 @@ -package quic - -import ( - "bytes" - "context" - "crypto/tls" - "errors" - "fmt" - "io" - "net" - "reflect" - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/ackhandler" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/congestion" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/utils" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type unpacker interface { - Unpack(hdr *wire.Header, data []byte) (*unpackedPacket, error) -} - -type streamGetter interface { - GetOrOpenReceiveStream(protocol.StreamID) (receiveStreamI, error) - GetOrOpenSendStream(protocol.StreamID) (sendStreamI, error) -} - -type streamManager interface { - GetOrOpenSendStream(protocol.StreamID) (sendStreamI, error) - GetOrOpenReceiveStream(protocol.StreamID) (receiveStreamI, error) - OpenStream() (Stream, error) - OpenUniStream() (SendStream, error) - OpenStreamSync() (Stream, error) - OpenUniStreamSync() (SendStream, error) - AcceptStream() (Stream, error) - AcceptUniStream() (ReceiveStream, error) - DeleteStream(protocol.StreamID) error - UpdateLimits(*handshake.TransportParameters) - HandleMaxStreamsFrame(*wire.MaxStreamsFrame) error - CloseWithError(error) -} - -type cryptoStreamHandler interface { - RunHandshake() error - io.Closer - ConnectionState() handshake.ConnectionState -} - -type receivedPacket struct { - remoteAddr net.Addr - hdr *wire.Header - rcvTime time.Time - data []byte - - buffer *packetBuffer -} - -type closeError struct { - err error - remote bool - sendClose bool -} - -var errCloseForRecreating = errors.New("closing session in order to recreate it") - -// A Session is a QUIC session -type session struct { - sessionRunner sessionRunner - - destConnID protocol.ConnectionID - srcConnID protocol.ConnectionID - - perspective protocol.Perspective - version protocol.VersionNumber - config *Config - - conn connection - - streamsMap streamManager - - rttStats *congestion.RTTStats - - cryptoStreamManager *cryptoStreamManager - sentPacketHandler ackhandler.SentPacketHandler - receivedPacketHandler ackhandler.ReceivedPacketHandler - framer framer - windowUpdateQueue *windowUpdateQueue - connFlowController flowcontrol.ConnectionFlowController - - unpacker unpacker - packer packer - - cryptoStreamHandler cryptoStreamHandler - - receivedPackets chan *receivedPacket - sendingScheduled chan struct{} - - closeOnce sync.Once - closed utils.AtomicBool - // closeChan is used to notify the run loop that it should terminate - closeChan chan closeError - connectionClosePacket *packedPacket - packetsReceivedAfterClose int - - ctx context.Context - ctxCancel context.CancelFunc - - undecryptablePackets []*receivedPacket - - clientHelloWritten <-chan struct{} - handshakeCompleteChan chan struct{} // is closed when the handshake completes - handshakeComplete bool - - receivedFirstPacket bool - receivedFirstForwardSecurePacket bool - - sessionCreationTime time.Time - lastNetworkActivityTime time.Time - // pacingDeadline is the time when the next packet should be sent - pacingDeadline time.Time - - peerParams *handshake.TransportParameters - - timer *utils.Timer - // keepAlivePingSent stores whether a Ping frame was sent to the peer or not - // it is reset as soon as we receive a packet from the peer - keepAlivePingSent bool - - logger utils.Logger -} - -var _ Session = &session{} -var _ streamSender = &session{} - -var newSession = func( - conn connection, - runner sessionRunner, - clientDestConnID protocol.ConnectionID, - destConnID protocol.ConnectionID, - srcConnID protocol.ConnectionID, - conf *Config, - tlsConf *tls.Config, - params *handshake.TransportParameters, - logger utils.Logger, - v protocol.VersionNumber, -) (quicSession, error) { - s := &session{ - conn: conn, - sessionRunner: runner, - config: conf, - srcConnID: srcConnID, - destConnID: destConnID, - perspective: protocol.PerspectiveServer, - handshakeCompleteChan: make(chan struct{}), - logger: logger, - version: v, - } - s.preSetup() - s.sentPacketHandler = ackhandler.NewSentPacketHandler(0, s.rttStats, s.logger) - initialStream := newCryptoStream() - handshakeStream := newCryptoStream() - s.streamsMap = newStreamsMap( - s, - s.newFlowController, - uint64(s.config.MaxIncomingStreams), - uint64(s.config.MaxIncomingUniStreams), - s.perspective, - s.version, - ) - s.framer = newFramer(s.streamsMap, s.version) - cs, err := handshake.NewCryptoSetupServer( - initialStream, - handshakeStream, - clientDestConnID, - params, - s.processTransportParameters, - tlsConf, - conf.Versions, - v, - logger, - protocol.PerspectiveServer, - ) - if err != nil { - return nil, err - } - s.cryptoStreamHandler = cs - s.packer = newPacketPacker( - s.destConnID, - s.srcConnID, - initialStream, - handshakeStream, - s.sentPacketHandler, - s.RemoteAddr(), - nil, // no token - cs, - s.framer, - s.receivedPacketHandler, - s.perspective, - s.version, - ) - s.cryptoStreamManager = newCryptoStreamManager(cs, initialStream, handshakeStream) - - if err := s.postSetup(); err != nil { - return nil, err - } - s.unpacker = newPacketUnpacker(cs, s.version) - return s, nil -} - -// declare this as a variable, such that we can it mock it in the tests -var newClientSession = func( - conn connection, - runner sessionRunner, - token []byte, - origDestConnID protocol.ConnectionID, - destConnID protocol.ConnectionID, - srcConnID protocol.ConnectionID, - conf *Config, - tlsConf *tls.Config, - initialPacketNumber protocol.PacketNumber, - params *handshake.TransportParameters, - initialVersion protocol.VersionNumber, - logger utils.Logger, - v protocol.VersionNumber, -) (quicSession, error) { - s := &session{ - conn: conn, - sessionRunner: runner, - config: conf, - srcConnID: srcConnID, - destConnID: destConnID, - perspective: protocol.PerspectiveClient, - handshakeCompleteChan: make(chan struct{}), - logger: logger, - version: v, - } - s.preSetup() - s.sentPacketHandler = ackhandler.NewSentPacketHandler(initialPacketNumber, s.rttStats, s.logger) - initialStream := newCryptoStream() - handshakeStream := newCryptoStream() - cs, clientHelloWritten, err := handshake.NewCryptoSetupClient( - initialStream, - handshakeStream, - origDestConnID, - s.destConnID, - params, - s.processTransportParameters, - tlsConf, - initialVersion, - conf.Versions, - v, - logger, - protocol.PerspectiveClient, - ) - if err != nil { - return nil, err - } - s.clientHelloWritten = clientHelloWritten - s.cryptoStreamHandler = cs - s.cryptoStreamManager = newCryptoStreamManager(cs, initialStream, handshakeStream) - s.unpacker = newPacketUnpacker(cs, s.version) - s.streamsMap = newStreamsMap( - s, - s.newFlowController, - uint64(s.config.MaxIncomingStreams), - uint64(s.config.MaxIncomingUniStreams), - s.perspective, - s.version, - ) - s.framer = newFramer(s.streamsMap, s.version) - s.packer = newPacketPacker( - s.destConnID, - s.srcConnID, - initialStream, - handshakeStream, - s.sentPacketHandler, - s.RemoteAddr(), - token, - cs, - s.framer, - s.receivedPacketHandler, - s.perspective, - s.version, - ) - return s, s.postSetup() -} - -func (s *session) preSetup() { - s.rttStats = &congestion.RTTStats{} - s.receivedPacketHandler = ackhandler.NewReceivedPacketHandler(s.rttStats, s.logger, s.version) - s.connFlowController = flowcontrol.NewConnectionFlowController( - protocol.InitialMaxData, - protocol.ByteCount(s.config.MaxReceiveConnectionFlowControlWindow), - s.onHasConnectionWindowUpdate, - s.rttStats, - s.logger, - ) -} - -func (s *session) postSetup() error { - s.receivedPackets = make(chan *receivedPacket, protocol.MaxSessionUnprocessedPackets) - s.closeChan = make(chan closeError, 1) - s.sendingScheduled = make(chan struct{}, 1) - s.undecryptablePackets = make([]*receivedPacket, 0, protocol.MaxUndecryptablePackets) - s.ctx, s.ctxCancel = context.WithCancel(context.Background()) - - s.timer = utils.NewTimer() - now := time.Now() - s.lastNetworkActivityTime = now - s.sessionCreationTime = now - - s.windowUpdateQueue = newWindowUpdateQueue(s.streamsMap, s.connFlowController, s.framer.QueueControlFrame) - return nil -} - -// run the session main loop -func (s *session) run() error { - defer s.ctxCancel() - - go func() { - if err := s.cryptoStreamHandler.RunHandshake(); err != nil { - s.closeLocal(err) - return - } - close(s.handshakeCompleteChan) - }() - if s.perspective == protocol.PerspectiveClient { - select { - case <-s.clientHelloWritten: - s.scheduleSending() - case closeErr := <-s.closeChan: - // put the close error back into the channel, so that the run loop can receive it - s.closeChan <- closeErr - } - } - - var closeErr closeError - -runLoop: - for { - // Close immediately if requested - select { - case closeErr = <-s.closeChan: - break runLoop - case <-s.handshakeCompleteChan: - s.handleHandshakeComplete() - default: - } - - s.maybeResetTimer() - - select { - case closeErr = <-s.closeChan: - break runLoop - case <-s.timer.Chan(): - s.timer.SetRead() - // We do all the interesting stuff after the switch statement, so - // nothing to see here. - case <-s.sendingScheduled: - // We do all the interesting stuff after the switch statement, so - // nothing to see here. - case p := <-s.receivedPackets: - // Only reset the timers if this packet was actually processed. - // This avoids modifying any state when handling undecryptable packets, - // which could be injected by an attacker. - if wasProcessed := s.handlePacketImpl(p); !wasProcessed { - continue - } - case <-s.handshakeCompleteChan: - s.handleHandshakeComplete() - } - - now := time.Now() - if timeout := s.sentPacketHandler.GetAlarmTimeout(); !timeout.IsZero() && timeout.Before(now) { - // This could cause packets to be retransmitted. - // Check it before trying to send packets. - if err := s.sentPacketHandler.OnAlarm(); err != nil { - s.closeLocal(err) - } - } - - var pacingDeadline time.Time - if s.pacingDeadline.IsZero() { // the timer didn't have a pacing deadline set - pacingDeadline = s.sentPacketHandler.TimeUntilSend() - } - if s.config.KeepAlive && !s.keepAlivePingSent && s.handshakeComplete && time.Since(s.lastNetworkActivityTime) >= s.peerParams.IdleTimeout/2 { - // send a PING frame since there is no activity in the session - s.logger.Debugf("Sending a keep-alive ping to keep the connection alive.") - s.framer.QueueControlFrame(&wire.PingFrame{}) - s.keepAlivePingSent = true - } else if !pacingDeadline.IsZero() && now.Before(pacingDeadline) { - // If we get to this point before the pacing deadline, we should wait until that deadline. - // This can happen when scheduleSending is called, or a packet is received. - // Set the timer and restart the run loop. - s.pacingDeadline = pacingDeadline - continue - } - - if !s.handshakeComplete && now.Sub(s.sessionCreationTime) >= s.config.HandshakeTimeout { - s.closeLocal(qerr.Error(qerr.HandshakeTimeout, "Crypto handshake did not complete in time.")) - continue - } - if s.handshakeComplete && now.Sub(s.lastNetworkActivityTime) >= s.config.IdleTimeout { - s.closeLocal(qerr.Error(qerr.NetworkIdleTimeout, "No recent network activity.")) - continue - } - - if err := s.sendPackets(); err != nil { - s.closeLocal(err) - } - } - - if err := s.handleCloseError(closeErr); err != nil { - s.logger.Infof("Handling close error failed: %s", err) - } - s.closed.Set(true) - s.logger.Infof("Connection %s closed.", s.srcConnID) - s.cryptoStreamHandler.Close() - return closeErr.err -} - -func (s *session) Context() context.Context { - return s.ctx -} - -func (s *session) ConnectionState() ConnectionState { - return s.cryptoStreamHandler.ConnectionState() -} - -func (s *session) maybeResetTimer() { - var deadline time.Time - if s.config.KeepAlive && s.handshakeComplete && !s.keepAlivePingSent { - deadline = s.lastNetworkActivityTime.Add(s.peerParams.IdleTimeout / 2) - } else { - deadline = s.lastNetworkActivityTime.Add(s.config.IdleTimeout) - } - - if ackAlarm := s.receivedPacketHandler.GetAlarmTimeout(); !ackAlarm.IsZero() { - deadline = utils.MinTime(deadline, ackAlarm) - } - if lossTime := s.sentPacketHandler.GetAlarmTimeout(); !lossTime.IsZero() { - deadline = utils.MinTime(deadline, lossTime) - } - if !s.handshakeComplete { - handshakeDeadline := s.sessionCreationTime.Add(s.config.HandshakeTimeout) - deadline = utils.MinTime(deadline, handshakeDeadline) - } - if !s.pacingDeadline.IsZero() { - deadline = utils.MinTime(deadline, s.pacingDeadline) - } - - s.timer.Reset(deadline) -} - -func (s *session) handleHandshakeComplete() { - s.handshakeComplete = true - s.handshakeCompleteChan = nil // prevent this case from ever being selected again - s.sessionRunner.onHandshakeComplete(s) - - // The client completes the handshake first (after sending the CFIN). - // We need to make sure they learn about the peer completing the handshake, - // in order to stop retransmitting handshake packets. - // They will stop retransmitting handshake packets when receiving the first forward-secure packet. - // We need to make sure that a retransmittable forward-secure packet is sent, - // independent from the application protocol. - if s.perspective == protocol.PerspectiveServer { - s.queueControlFrame(&wire.PingFrame{}) - s.sentPacketHandler.SetHandshakeComplete() - } -} - -func (s *session) handlePacketImpl(p *receivedPacket) bool /* was the packet successfully processed */ { - var wasQueued bool - - defer func() { - // Put back the packet buffer if the packet wasn't queued for later decryption. - if !wasQueued { - p.buffer.Release() - } - }() - - // The server can change the source connection ID with the first Handshake packet. - // After this, all packets with a different source connection have to be ignored. - if s.receivedFirstPacket && p.hdr.IsLongHeader && !p.hdr.SrcConnectionID.Equal(s.destConnID) { - s.logger.Debugf("Dropping packet with unexpected source connection ID: %s (expected %s)", p.hdr.SrcConnectionID, s.destConnID) - return false - } - // drop 0-RTT packets - if p.hdr.Type == protocol.PacketType0RTT { - return false - } - - packet, err := s.unpacker.Unpack(p.hdr, p.data) - if err != nil { - if err == handshake.ErrOpenerNotYetAvailable { - // Sealer for this encryption level not yet available. - // Try again later. - wasQueued = true - s.tryQueueingUndecryptablePacket(p) - return false - } - // This might be a packet injected by an attacker. - // Drop it. - s.logger.Debugf("Dropping packet that could not be unpacked. Unpack error: %s", err) - return false - } - - if s.logger.Debug() { - s.logger.Debugf("<- Reading packet %#x (%d bytes) for connection %s, %s", packet.packetNumber, len(p.data), p.hdr.DestConnectionID, packet.encryptionLevel) - packet.hdr.Log(s.logger) - } - - if err := s.handleUnpackedPacket(packet, p.rcvTime); err != nil { - s.closeLocal(err) - return false - } - return true -} - -func (s *session) handleUnpackedPacket(packet *unpackedPacket, rcvTime time.Time) error { - if len(packet.data) == 0 { - return qerr.MissingPayload - } - - // The server can change the source connection ID with the first Handshake packet. - if s.perspective == protocol.PerspectiveClient && !s.receivedFirstPacket && packet.hdr.IsLongHeader && !packet.hdr.SrcConnectionID.Equal(s.destConnID) { - s.logger.Debugf("Received first packet. Switching destination connection ID to: %s", packet.hdr.SrcConnectionID) - s.destConnID = packet.hdr.SrcConnectionID - s.packer.ChangeDestConnectionID(s.destConnID) - } - - s.receivedFirstPacket = true - s.lastNetworkActivityTime = rcvTime - s.keepAlivePingSent = false - - // The client completes the handshake first (after sending the CFIN). - // We know that the server completed the handshake as soon as we receive a forward-secure packet. - if s.perspective == protocol.PerspectiveClient { - if !s.receivedFirstForwardSecurePacket && packet.encryptionLevel == protocol.Encryption1RTT { - s.receivedFirstForwardSecurePacket = true - s.sentPacketHandler.SetHandshakeComplete() - } - } - - r := bytes.NewReader(packet.data) - var isRetransmittable bool - for { - frame, err := wire.ParseNextFrame(r, s.version) - if err != nil { - return err - } - if frame == nil { - break - } - if ackhandler.IsFrameRetransmittable(frame) { - isRetransmittable = true - } - if err := s.handleFrame(frame, packet.packetNumber, packet.encryptionLevel); err != nil { - return err - } - } - - if err := s.receivedPacketHandler.ReceivedPacket(packet.packetNumber, packet.encryptionLevel, rcvTime, isRetransmittable); err != nil { - return err - } - return nil -} - -func (s *session) handleFrame(f wire.Frame, pn protocol.PacketNumber, encLevel protocol.EncryptionLevel) error { - var err error - wire.LogFrame(s.logger, f, false) - switch frame := f.(type) { - case *wire.CryptoFrame: - err = s.handleCryptoFrame(frame, encLevel) - case *wire.StreamFrame: - err = s.handleStreamFrame(frame, encLevel) - case *wire.AckFrame: - err = s.handleAckFrame(frame, pn, encLevel) - case *wire.ConnectionCloseFrame: - s.closeRemote(qerr.Error(frame.ErrorCode, frame.ReasonPhrase)) - case *wire.ResetStreamFrame: - err = s.handleResetStreamFrame(frame) - case *wire.MaxDataFrame: - s.handleMaxDataFrame(frame) - case *wire.MaxStreamDataFrame: - err = s.handleMaxStreamDataFrame(frame) - case *wire.MaxStreamsFrame: - err = s.handleMaxStreamsFrame(frame) - case *wire.DataBlockedFrame: - case *wire.StreamDataBlockedFrame: - case *wire.StreamsBlockedFrame: - case *wire.StopSendingFrame: - err = s.handleStopSendingFrame(frame) - case *wire.PingFrame: - case *wire.PathChallengeFrame: - s.handlePathChallengeFrame(frame) - case *wire.PathResponseFrame: - // since we don't send PATH_CHALLENGEs, we don't expect PATH_RESPONSEs - err = errors.New("unexpected PATH_RESPONSE frame") - case *wire.NewTokenFrame: - case *wire.NewConnectionIDFrame: - case *wire.RetireConnectionIDFrame: - // since we don't send new connection IDs, we don't expect retirements - err = errors.New("unexpected RETIRE_CONNECTION_ID frame") - default: - err = fmt.Errorf("unexpected frame type: %s", reflect.ValueOf(&frame).Elem().Type().Name()) - } - return err -} - -// handlePacket is called by the server with a new packet -func (s *session) handlePacket(p *receivedPacket) { - if s.closed.Get() { - s.handlePacketAfterClosed(p) - } - // Discard packets once the amount of queued packets is larger than - // the channel size, protocol.MaxSessionUnprocessedPackets - select { - case s.receivedPackets <- p: - default: - } -} - -func (s *session) handlePacketAfterClosed(p *receivedPacket) { - s.packetsReceivedAfterClose++ - if s.connectionClosePacket == nil { - return - } - // exponential backoff - // only send a CONNECTION_CLOSE for the 1st, 2nd, 4th, 8th, 16th, ... packet arriving - for n := s.packetsReceivedAfterClose; n > 1; n = n / 2 { - if n%2 != 0 { - return - } - } - s.logger.Debugf("Received %d packets after sending CONNECTION_CLOSE. Retransmitting.", s.packetsReceivedAfterClose) - if err := s.conn.Write(s.connectionClosePacket.raw); err != nil { - s.logger.Debugf("Error retransmitting CONNECTION_CLOSE: %s", err) - } -} - -func (s *session) handleCryptoFrame(frame *wire.CryptoFrame, encLevel protocol.EncryptionLevel) error { - encLevelChanged, err := s.cryptoStreamManager.HandleCryptoFrame(frame, encLevel) - if err != nil { - return err - } - if encLevelChanged { - s.tryDecryptingQueuedPackets() - } - return nil -} - -func (s *session) handleStreamFrame(frame *wire.StreamFrame, encLevel protocol.EncryptionLevel) error { - if encLevel < protocol.Encryption1RTT { - return qerr.Error(qerr.UnencryptedStreamData, fmt.Sprintf("received unencrypted stream data on stream %d", frame.StreamID)) - } - str, err := s.streamsMap.GetOrOpenReceiveStream(frame.StreamID) - if err != nil { - return err - } - if str == nil { - // Stream is closed and already garbage collected - // ignore this StreamFrame - return nil - } - return str.handleStreamFrame(frame) -} - -func (s *session) handleMaxDataFrame(frame *wire.MaxDataFrame) { - s.connFlowController.UpdateSendWindow(frame.ByteOffset) -} - -func (s *session) handleMaxStreamDataFrame(frame *wire.MaxStreamDataFrame) error { - str, err := s.streamsMap.GetOrOpenSendStream(frame.StreamID) - if err != nil { - return err - } - if str == nil { - // stream is closed and already garbage collected - return nil - } - str.handleMaxStreamDataFrame(frame) - return nil -} - -func (s *session) handleMaxStreamsFrame(frame *wire.MaxStreamsFrame) error { - return s.streamsMap.HandleMaxStreamsFrame(frame) -} - -func (s *session) handleResetStreamFrame(frame *wire.ResetStreamFrame) error { - str, err := s.streamsMap.GetOrOpenReceiveStream(frame.StreamID) - if err != nil { - return err - } - if str == nil { - // stream is closed and already garbage collected - return nil - } - return str.handleResetStreamFrame(frame) -} - -func (s *session) handleStopSendingFrame(frame *wire.StopSendingFrame) error { - str, err := s.streamsMap.GetOrOpenSendStream(frame.StreamID) - if err != nil { - return err - } - if str == nil { - // stream is closed and already garbage collected - return nil - } - str.handleStopSendingFrame(frame) - return nil -} - -func (s *session) handlePathChallengeFrame(frame *wire.PathChallengeFrame) { - s.queueControlFrame(&wire.PathResponseFrame{Data: frame.Data}) -} - -func (s *session) handleAckFrame(frame *wire.AckFrame, pn protocol.PacketNumber, encLevel protocol.EncryptionLevel) error { - if err := s.sentPacketHandler.ReceivedAck(frame, pn, encLevel, s.lastNetworkActivityTime); err != nil { - return err - } - if encLevel == protocol.Encryption1RTT { - s.receivedPacketHandler.IgnoreBelow(s.sentPacketHandler.GetLowestPacketNotConfirmedAcked()) - } - return nil -} - -// closeLocal closes the session and send a CONNECTION_CLOSE containing the error -func (s *session) closeLocal(e error) { - s.closeOnce.Do(func() { - s.sessionRunner.retireConnectionID(s.srcConnID) - s.closeChan <- closeError{err: e, sendClose: true, remote: false} - }) -} - -// destroy closes the session without sending the error on the wire -func (s *session) destroy(e error) { - s.closeOnce.Do(func() { - s.sessionRunner.removeConnectionID(s.srcConnID) - s.closeChan <- closeError{err: e, sendClose: false, remote: false} - }) -} - -// closeForRecreating closes the session in order to recreate it immediately afterwards -// It returns the first packet number that should be used in the new session. -func (s *session) closeForRecreating() protocol.PacketNumber { - s.destroy(errCloseForRecreating) - nextPN, _ := s.sentPacketHandler.PeekPacketNumber() - return nextPN -} - -func (s *session) closeRemote(e error) { - s.closeOnce.Do(func() { - s.sessionRunner.removeConnectionID(s.srcConnID) - s.closeChan <- closeError{err: e, remote: true} - }) -} - -// Close the connection. It sends a qerr.PeerGoingAway. -// It waits until the run loop has stopped before returning -func (s *session) Close() error { - s.closeLocal(nil) - <-s.ctx.Done() - return nil -} - -func (s *session) CloseWithError(code protocol.ApplicationErrorCode, e error) error { - s.closeLocal(qerr.Error(qerr.ErrorCode(code), e.Error())) - <-s.ctx.Done() - return nil -} - -func (s *session) handleCloseError(closeErr closeError) error { - if closeErr.err == nil { - closeErr.err = qerr.PeerGoingAway - } - - var quicErr *qerr.QuicError - var ok bool - if quicErr, ok = closeErr.err.(*qerr.QuicError); !ok { - quicErr = qerr.ToQuicError(closeErr.err) - } - // Don't log 'normal' reasons - if quicErr.ErrorCode == qerr.PeerGoingAway || quicErr.ErrorCode == qerr.NetworkIdleTimeout { - s.logger.Infof("Closing connection %s.", s.srcConnID) - } else { - s.logger.Errorf("Closing session with error: %s", closeErr.err.Error()) - } - - s.streamsMap.CloseWithError(quicErr) - - if !closeErr.sendClose { - return nil - } - - // If this is a remote close we're done here - if closeErr.remote { - return nil - } - // otherwise send a CONNECTION_CLOSE - return s.sendConnectionClose(quicErr) -} - -func (s *session) processTransportParameters(params *handshake.TransportParameters) { - s.peerParams = params - s.streamsMap.UpdateLimits(params) - s.packer.HandleTransportParameters(params) - s.connFlowController.UpdateSendWindow(params.InitialMaxData) - // the crypto stream is the only open stream at this moment - // so we don't need to update stream flow control windows -} - -func (s *session) sendPackets() error { - s.pacingDeadline = time.Time{} - - sendMode := s.sentPacketHandler.SendMode() - if sendMode == ackhandler.SendNone { // shortcut: return immediately if there's nothing to send - return nil - } - - numPackets := s.sentPacketHandler.ShouldSendNumPackets() - var numPacketsSent int -sendLoop: - for { - switch sendMode { - case ackhandler.SendNone: - break sendLoop - case ackhandler.SendAck: - // If we already sent packets, and the send mode switches to SendAck, - // we've just become congestion limited. - // There's no need to try to send an ACK at this moment. - if numPacketsSent > 0 { - return nil - } - // We can at most send a single ACK only packet. - // There will only be a new ACK after receiving new packets. - // SendAck is only returned when we're congestion limited, so we don't need to set the pacingt timer. - return s.maybeSendAckOnlyPacket() - case ackhandler.SendPTO: - if err := s.sendProbePacket(); err != nil { - return err - } - numPacketsSent++ - case ackhandler.SendRetransmission: - sentPacket, err := s.maybeSendRetransmission() - if err != nil { - return err - } - if sentPacket { - numPacketsSent++ - // This can happen if a retransmission queued, but it wasn't necessary to send it. - // e.g. when an Initial is queued, but we already received a packet from the server. - } - case ackhandler.SendAny: - sentPacket, err := s.sendPacket() - if err != nil { - return err - } - if !sentPacket { - break sendLoop - } - numPacketsSent++ - default: - return fmt.Errorf("BUG: invalid send mode %d", sendMode) - } - if numPacketsSent >= numPackets { - break - } - sendMode = s.sentPacketHandler.SendMode() - } - // Only start the pacing timer if we sent as many packets as we were allowed. - // There will probably be more to send when calling sendPacket again. - if numPacketsSent == numPackets { - s.pacingDeadline = s.sentPacketHandler.TimeUntilSend() - } - return nil -} - -func (s *session) maybeSendAckOnlyPacket() error { - packet, err := s.packer.MaybePackAckPacket() - if err != nil { - return err - } - if packet == nil { - return nil - } - s.sentPacketHandler.SentPacket(packet.ToAckHandlerPacket()) - return s.sendPackedPacket(packet) -} - -// maybeSendRetransmission sends retransmissions for at most one packet. -// It takes care that Initials aren't retransmitted, if a packet from the server was already received. -func (s *session) maybeSendRetransmission() (bool, error) { - var retransmitPacket *ackhandler.Packet - for { - retransmitPacket = s.sentPacketHandler.DequeuePacketForRetransmission() - if retransmitPacket == nil { - return false, nil - } - - // Don't retransmit Initial packets if we already received a response. - // An Initial might have been retransmitted multiple times before we receive a response. - // As soon as we receive one response, we don't need to send any more Initials. - if s.perspective == protocol.PerspectiveClient && s.receivedFirstPacket && retransmitPacket.PacketType == protocol.PacketTypeInitial { - s.logger.Debugf("Skipping retransmission of packet %d. Already received a response to an Initial.", retransmitPacket.PacketNumber) - continue - } - break - } - - s.logger.Debugf("Dequeueing retransmission for packet 0x%x", retransmitPacket.PacketNumber) - packets, err := s.packer.PackRetransmission(retransmitPacket) - if err != nil { - return false, err - } - ackhandlerPackets := make([]*ackhandler.Packet, len(packets)) - for i, packet := range packets { - ackhandlerPackets[i] = packet.ToAckHandlerPacket() - } - s.sentPacketHandler.SentPacketsAsRetransmission(ackhandlerPackets, retransmitPacket.PacketNumber) - for _, packet := range packets { - if err := s.sendPackedPacket(packet); err != nil { - return false, err - } - } - return true, nil -} - -func (s *session) sendProbePacket() error { - p, err := s.sentPacketHandler.DequeueProbePacket() - if err != nil { - return err - } - s.logger.Debugf("Sending a retransmission for %#x as a probe packet.", p.PacketNumber) - - packets, err := s.packer.PackRetransmission(p) - if err != nil { - return err - } - ackhandlerPackets := make([]*ackhandler.Packet, len(packets)) - for i, packet := range packets { - ackhandlerPackets[i] = packet.ToAckHandlerPacket() - } - s.sentPacketHandler.SentPacketsAsRetransmission(ackhandlerPackets, p.PacketNumber) - for _, packet := range packets { - if err := s.sendPackedPacket(packet); err != nil { - return err - } - } - return nil -} - -func (s *session) sendPacket() (bool, error) { - if isBlocked, offset := s.connFlowController.IsNewlyBlocked(); isBlocked { - s.framer.QueueControlFrame(&wire.DataBlockedFrame{DataLimit: offset}) - } - s.windowUpdateQueue.QueueAll() - - packet, err := s.packer.PackPacket() - if err != nil || packet == nil { - return false, err - } - s.sentPacketHandler.SentPacket(packet.ToAckHandlerPacket()) - if err := s.sendPackedPacket(packet); err != nil { - return false, err - } - return true, nil -} - -func (s *session) sendPackedPacket(packet *packedPacket) error { - defer packet.buffer.Release() - s.logPacket(packet) - return s.conn.Write(packet.raw) -} - -func (s *session) sendConnectionClose(quicErr *qerr.QuicError) error { - packet, err := s.packer.PackConnectionClose(&wire.ConnectionCloseFrame{ - ErrorCode: quicErr.ErrorCode, - ReasonPhrase: quicErr.ErrorMessage, - }) - if err != nil { - return err - } - s.connectionClosePacket = packet - s.logPacket(packet) - return s.conn.Write(packet.raw) -} - -func (s *session) logPacket(packet *packedPacket) { - if !s.logger.Debug() { - // We don't need to allocate the slices for calling the format functions - return - } - s.logger.Debugf("-> Sending packet 0x%x (%d bytes) for connection %s, %s", packet.header.PacketNumber, len(packet.raw), s.srcConnID, packet.EncryptionLevel()) - packet.header.Log(s.logger) - for _, frame := range packet.frames { - wire.LogFrame(s.logger, frame, true) - } -} - -// GetOrOpenStream either returns an existing stream, a newly opened stream, or nil if a stream with the provided ID is already closed. -// It is *only* needed for gQUIC's H2. -// It will be removed as soon as gQUIC moves towards the IETF H2/QUIC stream mapping. -func (s *session) GetOrOpenStream(id protocol.StreamID) (Stream, error) { - str, err := s.streamsMap.GetOrOpenSendStream(id) - if str != nil { - if bstr, ok := str.(Stream); ok { - return bstr, err - } - return nil, fmt.Errorf("Stream %d is not a bidirectional stream", id) - } - // make sure to return an actual nil value here, not an Stream with value nil - return nil, err -} - -// AcceptStream returns the next stream openend by the peer -func (s *session) AcceptStream() (Stream, error) { - return s.streamsMap.AcceptStream() -} - -func (s *session) AcceptUniStream() (ReceiveStream, error) { - return s.streamsMap.AcceptUniStream() -} - -// OpenStream opens a stream -func (s *session) OpenStream() (Stream, error) { - return s.streamsMap.OpenStream() -} - -func (s *session) OpenStreamSync() (Stream, error) { - return s.streamsMap.OpenStreamSync() -} - -func (s *session) OpenUniStream() (SendStream, error) { - return s.streamsMap.OpenUniStream() -} - -func (s *session) OpenUniStreamSync() (SendStream, error) { - return s.streamsMap.OpenUniStreamSync() -} - -func (s *session) newStream(id protocol.StreamID) streamI { - flowController := s.newFlowController(id) - return newStream(id, s, flowController, s.version) -} - -func (s *session) newFlowController(id protocol.StreamID) flowcontrol.StreamFlowController { - var initialSendWindow protocol.ByteCount - if s.peerParams != nil { - if id.Type() == protocol.StreamTypeUni { - initialSendWindow = s.peerParams.InitialMaxStreamDataUni - } else { - if id.InitiatedBy() == s.perspective { - initialSendWindow = s.peerParams.InitialMaxStreamDataBidiLocal - } else { - initialSendWindow = s.peerParams.InitialMaxStreamDataBidiRemote - } - } - } - return flowcontrol.NewStreamFlowController( - id, - s.connFlowController, - protocol.InitialMaxStreamData, - protocol.ByteCount(s.config.MaxReceiveStreamFlowControlWindow), - initialSendWindow, - s.onHasStreamWindowUpdate, - s.rttStats, - s.logger, - ) -} - -// scheduleSending signals that we have data for sending -func (s *session) scheduleSending() { - select { - case s.sendingScheduled <- struct{}{}: - default: - } -} - -func (s *session) tryQueueingUndecryptablePacket(p *receivedPacket) { - if s.handshakeComplete { - s.logger.Debugf("Received undecryptable packet from %s after the handshake (%d bytes)", p.remoteAddr.String(), len(p.data)) - return - } - if len(s.undecryptablePackets)+1 > protocol.MaxUndecryptablePackets { - s.logger.Infof("Dropping undecrytable packet (%d bytes). Undecryptable packet queue full.", len(p.data)) - return - } - s.logger.Infof("Queueing packet (%d bytes) for later decryption", len(p.data)) - s.undecryptablePackets = append(s.undecryptablePackets, p) -} - -func (s *session) tryDecryptingQueuedPackets() { - for _, p := range s.undecryptablePackets { - s.handlePacket(p) - } - s.undecryptablePackets = s.undecryptablePackets[:0] -} - -func (s *session) queueControlFrame(f wire.Frame) { - s.framer.QueueControlFrame(f) - s.scheduleSending() -} - -func (s *session) onHasStreamWindowUpdate(id protocol.StreamID) { - s.windowUpdateQueue.AddStream(id) - s.scheduleSending() -} - -func (s *session) onHasConnectionWindowUpdate() { - s.windowUpdateQueue.AddConnection() - s.scheduleSending() -} - -func (s *session) onHasStreamData(id protocol.StreamID) { - s.framer.AddActiveStream(id) - s.scheduleSending() -} - -func (s *session) onStreamCompleted(id protocol.StreamID) { - if err := s.streamsMap.DeleteStream(id); err != nil { - s.closeLocal(err) - } -} - -func (s *session) LocalAddr() net.Addr { - return s.conn.LocalAddr() -} - -func (s *session) RemoteAddr() net.Addr { - return s.conn.RemoteAddr() -} - -func (s *session) GetVersion() protocol.VersionNumber { - return s.version -} diff --git a/external/github.com/lucas-clemente/quic-go/stream.go b/external/github.com/lucas-clemente/quic-go/stream.go deleted file mode 100644 index 80d2d9b394..0000000000 --- a/external/github.com/lucas-clemente/quic-go/stream.go +++ /dev/null @@ -1,163 +0,0 @@ -package quic - -import ( - "net" - "sync" - "time" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -const errorCodeStopping protocol.ApplicationErrorCode = 0 - -// The streamSender is notified by the stream about various events. -type streamSender interface { - queueControlFrame(wire.Frame) - onHasStreamData(protocol.StreamID) - // must be called without holding the mutex that is acquired by closeForShutdown - onStreamCompleted(protocol.StreamID) -} - -// Each of the both stream halves gets its own uniStreamSender. -// This is necessary in order to keep track when both halves have been completed. -type uniStreamSender struct { - streamSender - onStreamCompletedImpl func() -} - -func (s *uniStreamSender) queueControlFrame(f wire.Frame) { - s.streamSender.queueControlFrame(f) -} - -func (s *uniStreamSender) onHasStreamData(id protocol.StreamID) { - s.streamSender.onHasStreamData(id) -} - -func (s *uniStreamSender) onStreamCompleted(protocol.StreamID) { - s.onStreamCompletedImpl() -} - -var _ streamSender = &uniStreamSender{} - -type streamI interface { - Stream - closeForShutdown(error) - // for receiving - handleStreamFrame(*wire.StreamFrame) error - handleResetStreamFrame(*wire.ResetStreamFrame) error - getWindowUpdate() protocol.ByteCount - // for sending - hasData() bool - handleStopSendingFrame(*wire.StopSendingFrame) - popStreamFrame(maxBytes protocol.ByteCount) (*wire.StreamFrame, bool) - handleMaxStreamDataFrame(*wire.MaxStreamDataFrame) -} - -var _ receiveStreamI = (streamI)(nil) -var _ sendStreamI = (streamI)(nil) - -// A Stream assembles the data from StreamFrames and provides a super-convenient Read-Interface -// -// Read() and Write() may be called concurrently, but multiple calls to Read() or Write() individually must be synchronized manually. -type stream struct { - receiveStream - sendStream - - completedMutex sync.Mutex - sender streamSender - receiveStreamCompleted bool - sendStreamCompleted bool - - version protocol.VersionNumber -} - -var _ Stream = &stream{} - -type deadlineError struct{} - -func (deadlineError) Error() string { return "deadline exceeded" } -func (deadlineError) Temporary() bool { return true } -func (deadlineError) Timeout() bool { return true } - -var errDeadline net.Error = &deadlineError{} - -type streamCanceledError struct { - error - errorCode protocol.ApplicationErrorCode -} - -func (streamCanceledError) Canceled() bool { return true } -func (e streamCanceledError) ErrorCode() protocol.ApplicationErrorCode { return e.errorCode } - -var _ StreamError = &streamCanceledError{} - -// newStream creates a new Stream -func newStream(streamID protocol.StreamID, - sender streamSender, - flowController flowcontrol.StreamFlowController, - version protocol.VersionNumber, -) *stream { - s := &stream{sender: sender, version: version} - senderForSendStream := &uniStreamSender{ - streamSender: sender, - onStreamCompletedImpl: func() { - s.completedMutex.Lock() - s.sendStreamCompleted = true - s.checkIfCompleted() - s.completedMutex.Unlock() - }, - } - s.sendStream = *newSendStream(streamID, senderForSendStream, flowController, version) - senderForReceiveStream := &uniStreamSender{ - streamSender: sender, - onStreamCompletedImpl: func() { - s.completedMutex.Lock() - s.receiveStreamCompleted = true - s.checkIfCompleted() - s.completedMutex.Unlock() - }, - } - s.receiveStream = *newReceiveStream(streamID, senderForReceiveStream, flowController, version) - return s -} - -// need to define StreamID() here, since both receiveStream and readStream have a StreamID() -func (s *stream) StreamID() protocol.StreamID { - // the result is same for receiveStream and sendStream - return s.sendStream.StreamID() -} - -func (s *stream) Close() error { - if err := s.sendStream.Close(); err != nil { - return err - } - return nil -} - -func (s *stream) SetDeadline(t time.Time) error { - _ = s.SetReadDeadline(t) // SetReadDeadline never errors - _ = s.SetWriteDeadline(t) // SetWriteDeadline never errors - return nil -} - -// CloseForShutdown closes a stream abruptly. -// It makes Read and Write unblock (and return the error) immediately. -// The peer will NOT be informed about this: the stream is closed without sending a FIN or RST. -func (s *stream) closeForShutdown(err error) { - s.sendStream.closeForShutdown(err) - s.receiveStream.closeForShutdown(err) -} - -func (s *stream) handleResetStreamFrame(frame *wire.ResetStreamFrame) error { - return s.receiveStream.handleResetStreamFrame(frame) -} - -// checkIfCompleted is called from the uniStreamSender, when one of the stream halves is completed. -// It makes sure that the onStreamCompleted callback is only called if both receive and send side have completed. -func (s *stream) checkIfCompleted() { - if s.sendStreamCompleted && s.receiveStreamCompleted { - s.sender.onStreamCompleted(s.StreamID()) - } -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map.go b/external/github.com/lucas-clemente/quic-go/streams_map.go deleted file mode 100644 index ceffbd17b7..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map.go +++ /dev/null @@ -1,184 +0,0 @@ -package quic - -import ( - "errors" - "fmt" - "net" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/handshake" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type streamOpenErr struct{ error } - -var _ net.Error = &streamOpenErr{} - -func (e streamOpenErr) Temporary() bool { return e.error == errTooManyOpenStreams } -func (streamOpenErr) Timeout() bool { return false } - -// errTooManyOpenStreams is used internally by the outgoing streams maps. -var errTooManyOpenStreams = errors.New("too many open streams") - -type streamsMap struct { - perspective protocol.Perspective - - sender streamSender - newFlowController func(protocol.StreamID) flowcontrol.StreamFlowController - - outgoingBidiStreams *outgoingBidiStreamsMap - outgoingUniStreams *outgoingUniStreamsMap - incomingBidiStreams *incomingBidiStreamsMap - incomingUniStreams *incomingUniStreamsMap -} - -var _ streamManager = &streamsMap{} - -func newStreamsMap( - sender streamSender, - newFlowController func(protocol.StreamID) flowcontrol.StreamFlowController, - maxIncomingStreams uint64, - maxIncomingUniStreams uint64, - perspective protocol.Perspective, - version protocol.VersionNumber, -) streamManager { - m := &streamsMap{ - perspective: perspective, - newFlowController: newFlowController, - sender: sender, - } - newBidiStream := func(id protocol.StreamID) streamI { - return newStream(id, m.sender, m.newFlowController(id), version) - } - newUniSendStream := func(id protocol.StreamID) sendStreamI { - return newSendStream(id, m.sender, m.newFlowController(id), version) - } - newUniReceiveStream := func(id protocol.StreamID) receiveStreamI { - return newReceiveStream(id, m.sender, m.newFlowController(id), version) - } - m.outgoingBidiStreams = newOutgoingBidiStreamsMap( - protocol.FirstStream(protocol.StreamTypeBidi, perspective), - newBidiStream, - sender.queueControlFrame, - ) - m.incomingBidiStreams = newIncomingBidiStreamsMap( - protocol.FirstStream(protocol.StreamTypeBidi, perspective.Opposite()), - protocol.MaxStreamID(protocol.StreamTypeBidi, maxIncomingStreams, perspective.Opposite()), - maxIncomingStreams, - sender.queueControlFrame, - newBidiStream, - ) - m.outgoingUniStreams = newOutgoingUniStreamsMap( - protocol.FirstStream(protocol.StreamTypeUni, perspective), - newUniSendStream, - sender.queueControlFrame, - ) - m.incomingUniStreams = newIncomingUniStreamsMap( - protocol.FirstStream(protocol.StreamTypeUni, perspective.Opposite()), - protocol.MaxStreamID(protocol.StreamTypeUni, maxIncomingUniStreams, perspective.Opposite()), - maxIncomingUniStreams, - sender.queueControlFrame, - newUniReceiveStream, - ) - return m -} - -func (m *streamsMap) OpenStream() (Stream, error) { - return m.outgoingBidiStreams.OpenStream() -} - -func (m *streamsMap) OpenStreamSync() (Stream, error) { - return m.outgoingBidiStreams.OpenStreamSync() -} - -func (m *streamsMap) OpenUniStream() (SendStream, error) { - return m.outgoingUniStreams.OpenStream() -} - -func (m *streamsMap) OpenUniStreamSync() (SendStream, error) { - return m.outgoingUniStreams.OpenStreamSync() -} - -func (m *streamsMap) AcceptStream() (Stream, error) { - return m.incomingBidiStreams.AcceptStream() -} - -func (m *streamsMap) AcceptUniStream() (ReceiveStream, error) { - return m.incomingUniStreams.AcceptStream() -} - -func (m *streamsMap) DeleteStream(id protocol.StreamID) error { - switch id.Type() { - case protocol.StreamTypeUni: - if id.InitiatedBy() == m.perspective { - return m.outgoingUniStreams.DeleteStream(id) - } - return m.incomingUniStreams.DeleteStream(id) - case protocol.StreamTypeBidi: - if id.InitiatedBy() == m.perspective { - return m.outgoingBidiStreams.DeleteStream(id) - } - return m.incomingBidiStreams.DeleteStream(id) - } - panic("") -} - -func (m *streamsMap) GetOrOpenReceiveStream(id protocol.StreamID) (receiveStreamI, error) { - switch id.Type() { - case protocol.StreamTypeUni: - if id.InitiatedBy() == m.perspective { - // an outgoing unidirectional stream is a send stream, not a receive stream - return nil, fmt.Errorf("peer attempted to open receive stream %d", id) - } - return m.incomingUniStreams.GetOrOpenStream(id) - case protocol.StreamTypeBidi: - if id.InitiatedBy() == m.perspective { - return m.outgoingBidiStreams.GetStream(id) - } - return m.incomingBidiStreams.GetOrOpenStream(id) - } - panic("") -} - -func (m *streamsMap) GetOrOpenSendStream(id protocol.StreamID) (sendStreamI, error) { - switch id.Type() { - case protocol.StreamTypeUni: - if id.InitiatedBy() == m.perspective { - return m.outgoingUniStreams.GetStream(id) - } - // an incoming unidirectional stream is a receive stream, not a send stream - return nil, fmt.Errorf("peer attempted to open send stream %d", id) - case protocol.StreamTypeBidi: - if id.InitiatedBy() == m.perspective { - return m.outgoingBidiStreams.GetStream(id) - } - return m.incomingBidiStreams.GetOrOpenStream(id) - } - panic("") -} - -func (m *streamsMap) HandleMaxStreamsFrame(f *wire.MaxStreamsFrame) error { - id := protocol.MaxStreamID(f.Type, f.MaxStreams, m.perspective) - switch id.Type() { - case protocol.StreamTypeUni: - m.outgoingUniStreams.SetMaxStream(id) - case protocol.StreamTypeBidi: - fmt.Printf("") - m.outgoingBidiStreams.SetMaxStream(id) - } - return nil -} - -func (m *streamsMap) UpdateLimits(p *handshake.TransportParameters) { - // Max{Uni,Bidi}StreamID returns the highest stream ID that the peer is allowed to open. - m.outgoingBidiStreams.SetMaxStream(protocol.MaxStreamID(protocol.StreamTypeBidi, p.MaxBidiStreams, m.perspective)) - m.outgoingUniStreams.SetMaxStream(protocol.MaxStreamID(protocol.StreamTypeUni, p.MaxUniStreams, m.perspective)) -} - -func (m *streamsMap) CloseWithError(err error) { - m.outgoingBidiStreams.CloseWithError(err) - m.outgoingUniStreams.CloseWithError(err) - m.incomingBidiStreams.CloseWithError(err) - m.incomingUniStreams.CloseWithError(err) -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_generic_helper.go b/external/github.com/lucas-clemente/quic-go/streams_map_generic_helper.go deleted file mode 100644 index b7235022cf..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_generic_helper.go +++ /dev/null @@ -1,17 +0,0 @@ -package quic - -import ( - "v2ray.com/core/external/github.com/cheekybits/genny/generic" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" -) - -// In the auto-generated streams maps, we need to be able to close the streams. -// Therefore, extend the generic.Type with the stream close method. -// This definition must be in a file that Genny doesn't process. -type item interface { - generic.Type - closeForShutdown(error) -} - -const streamTypeGeneric protocol.StreamType = protocol.StreamTypeUni diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_bidi.go b/external/github.com/lucas-clemente/quic-go/streams_map_incoming_bidi.go deleted file mode 100644 index 74880798db..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_bidi.go +++ /dev/null @@ -1,130 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type incomingBidiStreamsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]streamI - - nextStreamToAccept protocol.StreamID // the next stream that will be returned by AcceptStream() - nextStreamToOpen protocol.StreamID // the highest stream that the peer openend - maxStream protocol.StreamID // the highest stream that the peer is allowed to open - maxNumStreams uint64 // maximum number of streams - - newStream func(protocol.StreamID) streamI - queueMaxStreamID func(*wire.MaxStreamsFrame) - - closeErr error -} - -func newIncomingBidiStreamsMap( - nextStreamToAccept protocol.StreamID, - initialMaxStreamID protocol.StreamID, - maxNumStreams uint64, - queueControlFrame func(wire.Frame), - newStream func(protocol.StreamID) streamI, -) *incomingBidiStreamsMap { - m := &incomingBidiStreamsMap{ - streams: make(map[protocol.StreamID]streamI), - nextStreamToAccept: nextStreamToAccept, - nextStreamToOpen: nextStreamToAccept, - maxStream: initialMaxStreamID, - maxNumStreams: maxNumStreams, - newStream: newStream, - queueMaxStreamID: func(f *wire.MaxStreamsFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *incomingBidiStreamsMap) AcceptStream() (streamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - var str streamI - for { - var ok bool - if m.closeErr != nil { - return nil, m.closeErr - } - str, ok = m.streams[m.nextStreamToAccept] - if ok { - break - } - m.cond.Wait() - } - m.nextStreamToAccept += 4 - return str, nil -} - -func (m *incomingBidiStreamsMap) GetOrOpenStream(id protocol.StreamID) (streamI, error) { - m.mutex.RLock() - if id > m.maxStream { - m.mutex.RUnlock() - return nil, fmt.Errorf("peer tried to open stream %d (current limit: %d)", id, m.maxStream) - } - // if the id is smaller than the highest we accepted - // * this stream exists in the map, and we can return it, or - // * this stream was already closed, then we can return the nil - if id < m.nextStreamToOpen { - s := m.streams[id] - m.mutex.RUnlock() - return s, nil - } - m.mutex.RUnlock() - - m.mutex.Lock() - // no need to check the two error conditions from above again - // * maxStream can only increase, so if the id was valid before, it definitely is valid now - // * highestStream is only modified by this function - for newID := m.nextStreamToOpen; newID <= id; newID += 4 { - m.streams[newID] = m.newStream(newID) - m.cond.Signal() - } - m.nextStreamToOpen = id + 4 - s := m.streams[id] - m.mutex.Unlock() - return s, nil -} - -func (m *incomingBidiStreamsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - // queue a MAX_STREAM_ID frame, giving the peer the option to open a new stream - if m.maxNumStreams > uint64(len(m.streams)) { - numNewStreams := m.maxNumStreams - uint64(len(m.streams)) - m.maxStream = m.nextStreamToOpen + protocol.StreamID((numNewStreams-1)*4) - m.queueMaxStreamID(&wire.MaxStreamsFrame{ - Type: protocol.StreamTypeBidi, - MaxStreams: m.maxStream.StreamNum(), - }) - } - return nil -} - -func (m *incomingBidiStreamsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.mutex.Unlock() - m.cond.Broadcast() -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_generic.go b/external/github.com/lucas-clemente/quic-go/streams_map_incoming_generic.go deleted file mode 100644 index 3ab5a6cf89..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_generic.go +++ /dev/null @@ -1,128 +0,0 @@ -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -//go:generate genny -in $GOFILE -out streams_map_incoming_bidi.go gen "item=streamI Item=BidiStream streamTypeGeneric=protocol.StreamTypeBidi" -//go:generate genny -in $GOFILE -out streams_map_incoming_uni.go gen "item=receiveStreamI Item=UniStream streamTypeGeneric=protocol.StreamTypeUni" -type incomingItemsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]item - - nextStreamToAccept protocol.StreamID // the next stream that will be returned by AcceptStream() - nextStreamToOpen protocol.StreamID // the highest stream that the peer openend - maxStream protocol.StreamID // the highest stream that the peer is allowed to open - maxNumStreams uint64 // maximum number of streams - - newStream func(protocol.StreamID) item - queueMaxStreamID func(*wire.MaxStreamsFrame) - - closeErr error -} - -func newIncomingItemsMap( - nextStreamToAccept protocol.StreamID, - initialMaxStreamID protocol.StreamID, - maxNumStreams uint64, - queueControlFrame func(wire.Frame), - newStream func(protocol.StreamID) item, -) *incomingItemsMap { - m := &incomingItemsMap{ - streams: make(map[protocol.StreamID]item), - nextStreamToAccept: nextStreamToAccept, - nextStreamToOpen: nextStreamToAccept, - maxStream: initialMaxStreamID, - maxNumStreams: maxNumStreams, - newStream: newStream, - queueMaxStreamID: func(f *wire.MaxStreamsFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *incomingItemsMap) AcceptStream() (item, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - var str item - for { - var ok bool - if m.closeErr != nil { - return nil, m.closeErr - } - str, ok = m.streams[m.nextStreamToAccept] - if ok { - break - } - m.cond.Wait() - } - m.nextStreamToAccept += 4 - return str, nil -} - -func (m *incomingItemsMap) GetOrOpenStream(id protocol.StreamID) (item, error) { - m.mutex.RLock() - if id > m.maxStream { - m.mutex.RUnlock() - return nil, fmt.Errorf("peer tried to open stream %d (current limit: %d)", id, m.maxStream) - } - // if the id is smaller than the highest we accepted - // * this stream exists in the map, and we can return it, or - // * this stream was already closed, then we can return the nil - if id < m.nextStreamToOpen { - s := m.streams[id] - m.mutex.RUnlock() - return s, nil - } - m.mutex.RUnlock() - - m.mutex.Lock() - // no need to check the two error conditions from above again - // * maxStream can only increase, so if the id was valid before, it definitely is valid now - // * highestStream is only modified by this function - for newID := m.nextStreamToOpen; newID <= id; newID += 4 { - m.streams[newID] = m.newStream(newID) - m.cond.Signal() - } - m.nextStreamToOpen = id + 4 - s := m.streams[id] - m.mutex.Unlock() - return s, nil -} - -func (m *incomingItemsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - // queue a MAX_STREAM_ID frame, giving the peer the option to open a new stream - if m.maxNumStreams > uint64(len(m.streams)) { - numNewStreams := m.maxNumStreams - uint64(len(m.streams)) - m.maxStream = m.nextStreamToOpen + protocol.StreamID((numNewStreams-1)*4) - m.queueMaxStreamID(&wire.MaxStreamsFrame{ - Type: streamTypeGeneric, - MaxStreams: m.maxStream.StreamNum(), - }) - } - return nil -} - -func (m *incomingItemsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.mutex.Unlock() - m.cond.Broadcast() -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_uni.go b/external/github.com/lucas-clemente/quic-go/streams_map_incoming_uni.go deleted file mode 100644 index 28a0b0ddc6..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_incoming_uni.go +++ /dev/null @@ -1,130 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type incomingUniStreamsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]receiveStreamI - - nextStreamToAccept protocol.StreamID // the next stream that will be returned by AcceptStream() - nextStreamToOpen protocol.StreamID // the highest stream that the peer openend - maxStream protocol.StreamID // the highest stream that the peer is allowed to open - maxNumStreams uint64 // maximum number of streams - - newStream func(protocol.StreamID) receiveStreamI - queueMaxStreamID func(*wire.MaxStreamsFrame) - - closeErr error -} - -func newIncomingUniStreamsMap( - nextStreamToAccept protocol.StreamID, - initialMaxStreamID protocol.StreamID, - maxNumStreams uint64, - queueControlFrame func(wire.Frame), - newStream func(protocol.StreamID) receiveStreamI, -) *incomingUniStreamsMap { - m := &incomingUniStreamsMap{ - streams: make(map[protocol.StreamID]receiveStreamI), - nextStreamToAccept: nextStreamToAccept, - nextStreamToOpen: nextStreamToAccept, - maxStream: initialMaxStreamID, - maxNumStreams: maxNumStreams, - newStream: newStream, - queueMaxStreamID: func(f *wire.MaxStreamsFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *incomingUniStreamsMap) AcceptStream() (receiveStreamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - var str receiveStreamI - for { - var ok bool - if m.closeErr != nil { - return nil, m.closeErr - } - str, ok = m.streams[m.nextStreamToAccept] - if ok { - break - } - m.cond.Wait() - } - m.nextStreamToAccept += 4 - return str, nil -} - -func (m *incomingUniStreamsMap) GetOrOpenStream(id protocol.StreamID) (receiveStreamI, error) { - m.mutex.RLock() - if id > m.maxStream { - m.mutex.RUnlock() - return nil, fmt.Errorf("peer tried to open stream %d (current limit: %d)", id, m.maxStream) - } - // if the id is smaller than the highest we accepted - // * this stream exists in the map, and we can return it, or - // * this stream was already closed, then we can return the nil - if id < m.nextStreamToOpen { - s := m.streams[id] - m.mutex.RUnlock() - return s, nil - } - m.mutex.RUnlock() - - m.mutex.Lock() - // no need to check the two error conditions from above again - // * maxStream can only increase, so if the id was valid before, it definitely is valid now - // * highestStream is only modified by this function - for newID := m.nextStreamToOpen; newID <= id; newID += 4 { - m.streams[newID] = m.newStream(newID) - m.cond.Signal() - } - m.nextStreamToOpen = id + 4 - s := m.streams[id] - m.mutex.Unlock() - return s, nil -} - -func (m *incomingUniStreamsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - // queue a MAX_STREAM_ID frame, giving the peer the option to open a new stream - if m.maxNumStreams > uint64(len(m.streams)) { - numNewStreams := m.maxNumStreams - uint64(len(m.streams)) - m.maxStream = m.nextStreamToOpen + protocol.StreamID((numNewStreams-1)*4) - m.queueMaxStreamID(&wire.MaxStreamsFrame{ - Type: protocol.StreamTypeUni, - MaxStreams: m.maxStream.StreamNum(), - }) - } - return nil -} - -func (m *incomingUniStreamsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.mutex.Unlock() - m.cond.Broadcast() -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_bidi.go b/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_bidi.go deleted file mode 100644 index ac602190aa..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_bidi.go +++ /dev/null @@ -1,143 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type outgoingBidiStreamsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]streamI - - nextStream protocol.StreamID // stream ID of the stream returned by OpenStream(Sync) - maxStream protocol.StreamID // the maximum stream ID we're allowed to open - maxStreamSet bool // was maxStream set. If not, it's not possible to any stream (also works for stream 0) - blockedSent bool // was a STREAMS_BLOCKED sent for the current maxStream - - newStream func(protocol.StreamID) streamI - queueStreamIDBlocked func(*wire.StreamsBlockedFrame) - - closeErr error -} - -func newOutgoingBidiStreamsMap( - nextStream protocol.StreamID, - newStream func(protocol.StreamID) streamI, - queueControlFrame func(wire.Frame), -) *outgoingBidiStreamsMap { - m := &outgoingBidiStreamsMap{ - streams: make(map[protocol.StreamID]streamI), - nextStream: nextStream, - newStream: newStream, - queueStreamIDBlocked: func(f *wire.StreamsBlockedFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *outgoingBidiStreamsMap) OpenStream() (streamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - str, err := m.openStreamImpl() - if err != nil { - return nil, streamOpenErr{err} - } - return str, nil -} - -func (m *outgoingBidiStreamsMap) OpenStreamSync() (streamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - for { - str, err := m.openStreamImpl() - if err == nil { - return str, nil - } - if err != nil && err != errTooManyOpenStreams { - return nil, streamOpenErr{err} - } - m.cond.Wait() - } -} - -func (m *outgoingBidiStreamsMap) openStreamImpl() (streamI, error) { - if m.closeErr != nil { - return nil, m.closeErr - } - if !m.maxStreamSet || m.nextStream > m.maxStream { - if !m.blockedSent { - if m.maxStreamSet { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: protocol.StreamTypeBidi, - StreamLimit: m.maxStream.StreamNum(), - }) - } else { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: protocol.StreamTypeBidi, - StreamLimit: 0, - }) - } - m.blockedSent = true - } - return nil, errTooManyOpenStreams - } - s := m.newStream(m.nextStream) - m.streams[m.nextStream] = s - m.nextStream += 4 - return s, nil -} - -func (m *outgoingBidiStreamsMap) GetStream(id protocol.StreamID) (streamI, error) { - m.mutex.RLock() - if id >= m.nextStream { - m.mutex.RUnlock() - return nil, qerr.Error(qerr.InvalidStreamID, fmt.Sprintf("peer attempted to open stream %d", id)) - } - s := m.streams[id] - m.mutex.RUnlock() - return s, nil -} - -func (m *outgoingBidiStreamsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - return nil -} - -func (m *outgoingBidiStreamsMap) SetMaxStream(id protocol.StreamID) { - m.mutex.Lock() - if !m.maxStreamSet || id > m.maxStream { - m.maxStream = id - m.maxStreamSet = true - m.blockedSent = false - m.cond.Broadcast() - } - m.mutex.Unlock() -} - -func (m *outgoingBidiStreamsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.cond.Broadcast() - m.mutex.Unlock() -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_generic.go b/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_generic.go deleted file mode 100644 index 0ac5547939..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_generic.go +++ /dev/null @@ -1,141 +0,0 @@ -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -//go:generate genny -in $GOFILE -out streams_map_outgoing_bidi.go gen "item=streamI Item=BidiStream streamTypeGeneric=protocol.StreamTypeBidi" -//go:generate genny -in $GOFILE -out streams_map_outgoing_uni.go gen "item=sendStreamI Item=UniStream streamTypeGeneric=protocol.StreamTypeUni" -type outgoingItemsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]item - - nextStream protocol.StreamID // stream ID of the stream returned by OpenStream(Sync) - maxStream protocol.StreamID // the maximum stream ID we're allowed to open - maxStreamSet bool // was maxStream set. If not, it's not possible to any stream (also works for stream 0) - blockedSent bool // was a STREAMS_BLOCKED sent for the current maxStream - - newStream func(protocol.StreamID) item - queueStreamIDBlocked func(*wire.StreamsBlockedFrame) - - closeErr error -} - -func newOutgoingItemsMap( - nextStream protocol.StreamID, - newStream func(protocol.StreamID) item, - queueControlFrame func(wire.Frame), -) *outgoingItemsMap { - m := &outgoingItemsMap{ - streams: make(map[protocol.StreamID]item), - nextStream: nextStream, - newStream: newStream, - queueStreamIDBlocked: func(f *wire.StreamsBlockedFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *outgoingItemsMap) OpenStream() (item, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - str, err := m.openStreamImpl() - if err != nil { - return nil, streamOpenErr{err} - } - return str, nil -} - -func (m *outgoingItemsMap) OpenStreamSync() (item, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - for { - str, err := m.openStreamImpl() - if err == nil { - return str, nil - } - if err != nil && err != errTooManyOpenStreams { - return nil, streamOpenErr{err} - } - m.cond.Wait() - } -} - -func (m *outgoingItemsMap) openStreamImpl() (item, error) { - if m.closeErr != nil { - return nil, m.closeErr - } - if !m.maxStreamSet || m.nextStream > m.maxStream { - if !m.blockedSent { - if m.maxStreamSet { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: streamTypeGeneric, - StreamLimit: m.maxStream.StreamNum(), - }) - } else { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: streamTypeGeneric, - StreamLimit: 0, - }) - } - m.blockedSent = true - } - return nil, errTooManyOpenStreams - } - s := m.newStream(m.nextStream) - m.streams[m.nextStream] = s - m.nextStream += 4 - return s, nil -} - -func (m *outgoingItemsMap) GetStream(id protocol.StreamID) (item, error) { - m.mutex.RLock() - if id >= m.nextStream { - m.mutex.RUnlock() - return nil, qerr.Error(qerr.InvalidStreamID, fmt.Sprintf("peer attempted to open stream %d", id)) - } - s := m.streams[id] - m.mutex.RUnlock() - return s, nil -} - -func (m *outgoingItemsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - return nil -} - -func (m *outgoingItemsMap) SetMaxStream(id protocol.StreamID) { - m.mutex.Lock() - if !m.maxStreamSet || id > m.maxStream { - m.maxStream = id - m.maxStreamSet = true - m.blockedSent = false - m.cond.Broadcast() - } - m.mutex.Unlock() -} - -func (m *outgoingItemsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.cond.Broadcast() - m.mutex.Unlock() -} diff --git a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_uni.go b/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_uni.go deleted file mode 100644 index a6f1feb404..0000000000 --- a/external/github.com/lucas-clemente/quic-go/streams_map_outgoing_uni.go +++ /dev/null @@ -1,143 +0,0 @@ -// This file was automatically generated by genny. -// Any changes will be lost if this file is regenerated. -// see https://github.com/cheekybits/genny - -package quic - -import ( - "fmt" - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/qerr" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type outgoingUniStreamsMap struct { - mutex sync.RWMutex - cond sync.Cond - - streams map[protocol.StreamID]sendStreamI - - nextStream protocol.StreamID // stream ID of the stream returned by OpenStream(Sync) - maxStream protocol.StreamID // the maximum stream ID we're allowed to open - maxStreamSet bool // was maxStream set. If not, it's not possible to any stream (also works for stream 0) - blockedSent bool // was a STREAMS_BLOCKED sent for the current maxStream - - newStream func(protocol.StreamID) sendStreamI - queueStreamIDBlocked func(*wire.StreamsBlockedFrame) - - closeErr error -} - -func newOutgoingUniStreamsMap( - nextStream protocol.StreamID, - newStream func(protocol.StreamID) sendStreamI, - queueControlFrame func(wire.Frame), -) *outgoingUniStreamsMap { - m := &outgoingUniStreamsMap{ - streams: make(map[protocol.StreamID]sendStreamI), - nextStream: nextStream, - newStream: newStream, - queueStreamIDBlocked: func(f *wire.StreamsBlockedFrame) { queueControlFrame(f) }, - } - m.cond.L = &m.mutex - return m -} - -func (m *outgoingUniStreamsMap) OpenStream() (sendStreamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - str, err := m.openStreamImpl() - if err != nil { - return nil, streamOpenErr{err} - } - return str, nil -} - -func (m *outgoingUniStreamsMap) OpenStreamSync() (sendStreamI, error) { - m.mutex.Lock() - defer m.mutex.Unlock() - - for { - str, err := m.openStreamImpl() - if err == nil { - return str, nil - } - if err != nil && err != errTooManyOpenStreams { - return nil, streamOpenErr{err} - } - m.cond.Wait() - } -} - -func (m *outgoingUniStreamsMap) openStreamImpl() (sendStreamI, error) { - if m.closeErr != nil { - return nil, m.closeErr - } - if !m.maxStreamSet || m.nextStream > m.maxStream { - if !m.blockedSent { - if m.maxStreamSet { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: protocol.StreamTypeUni, - StreamLimit: m.maxStream.StreamNum(), - }) - } else { - m.queueStreamIDBlocked(&wire.StreamsBlockedFrame{ - Type: protocol.StreamTypeUni, - StreamLimit: 0, - }) - } - m.blockedSent = true - } - return nil, errTooManyOpenStreams - } - s := m.newStream(m.nextStream) - m.streams[m.nextStream] = s - m.nextStream += 4 - return s, nil -} - -func (m *outgoingUniStreamsMap) GetStream(id protocol.StreamID) (sendStreamI, error) { - m.mutex.RLock() - if id >= m.nextStream { - m.mutex.RUnlock() - return nil, qerr.Error(qerr.InvalidStreamID, fmt.Sprintf("peer attempted to open stream %d", id)) - } - s := m.streams[id] - m.mutex.RUnlock() - return s, nil -} - -func (m *outgoingUniStreamsMap) DeleteStream(id protocol.StreamID) error { - m.mutex.Lock() - defer m.mutex.Unlock() - - if _, ok := m.streams[id]; !ok { - return fmt.Errorf("Tried to delete unknown stream %d", id) - } - delete(m.streams, id) - return nil -} - -func (m *outgoingUniStreamsMap) SetMaxStream(id protocol.StreamID) { - m.mutex.Lock() - if !m.maxStreamSet || id > m.maxStream { - m.maxStream = id - m.maxStreamSet = true - m.blockedSent = false - m.cond.Broadcast() - } - m.mutex.Unlock() -} - -func (m *outgoingUniStreamsMap) CloseWithError(err error) { - m.mutex.Lock() - m.closeErr = err - for _, str := range m.streams { - str.closeForShutdown(err) - } - m.cond.Broadcast() - m.mutex.Unlock() -} diff --git a/external/github.com/lucas-clemente/quic-go/window_update_queue.go b/external/github.com/lucas-clemente/quic-go/window_update_queue.go deleted file mode 100644 index 808d6048fa..0000000000 --- a/external/github.com/lucas-clemente/quic-go/window_update_queue.go +++ /dev/null @@ -1,71 +0,0 @@ -package quic - -import ( - "sync" - - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/flowcontrol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/protocol" - "v2ray.com/core/external/github.com/lucas-clemente/quic-go/internal/wire" -) - -type windowUpdateQueue struct { - mutex sync.Mutex - - queue map[protocol.StreamID]bool // used as a set - queuedConn bool // connection-level window update - - streamGetter streamGetter - connFlowController flowcontrol.ConnectionFlowController - callback func(wire.Frame) -} - -func newWindowUpdateQueue( - streamGetter streamGetter, - connFC flowcontrol.ConnectionFlowController, - cb func(wire.Frame), -) *windowUpdateQueue { - return &windowUpdateQueue{ - queue: make(map[protocol.StreamID]bool), - streamGetter: streamGetter, - connFlowController: connFC, - callback: cb, - } -} - -func (q *windowUpdateQueue) AddStream(id protocol.StreamID) { - q.mutex.Lock() - q.queue[id] = true - q.mutex.Unlock() -} - -func (q *windowUpdateQueue) AddConnection() { - q.mutex.Lock() - q.queuedConn = true - q.mutex.Unlock() -} - -func (q *windowUpdateQueue) QueueAll() { - q.mutex.Lock() - // queue a connection-level window update - if q.queuedConn { - q.callback(&wire.MaxDataFrame{ByteOffset: q.connFlowController.GetWindowUpdate()}) - q.queuedConn = false - } - // queue all stream-level window updates - for id := range q.queue { - str, err := q.streamGetter.GetOrOpenReceiveStream(id) - if err != nil || str == nil { // the stream can be nil if it was completed before dequeing the window update - continue - } - offset := str.getWindowUpdate() - if offset == 0 { // can happen if we received a final offset, right after queueing the window update - continue - } - q.callback(&wire.MaxStreamDataFrame{ - StreamID: id, - ByteOffset: offset, - }) - delete(q.queue, id) - } - q.mutex.Unlock() -} diff --git a/external/github.com/marten-seemann/qtls/13.go b/external/github.com/marten-seemann/qtls/13.go deleted file mode 100644 index 715dc6157a..0000000000 --- a/external/github.com/marten-seemann/qtls/13.go +++ /dev/null @@ -1,1328 +0,0 @@ -package qtls - -import ( - "bytes" - "crypto" - "crypto/cipher" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/hmac" - "crypto/rsa" - "crypto/subtle" - "encoding/hex" - "errors" - "fmt" - "hash" - "io" - "log" - "os" - "runtime" - "runtime/debug" - "strings" - "sync/atomic" - "time" - - "v2ray.com/core/external/github.com/cloudflare/sidh/sidh" - "golang.org/x/crypto/curve25519" -) - -// numSessionTickets is the number of different session tickets the -// server sends to a TLS 1.3 client, who will use each only once. -const numSessionTickets = 2 - -type secretLabel int - -const ( - x25519SharedSecretSz = 32 - - P503PubKeySz = 378 - P503PrvKeySz = 32 - P503SharedSecretSz = 126 - SIDHp503Curve25519PubKeySz = x25519SharedSecretSz + P503PubKeySz - SIDHp503Curve25519PrvKeySz = x25519SharedSecretSz + P503PrvKeySz - SIDHp503Curve25519SharedKeySz = x25519SharedSecretSz + P503SharedSecretSz -) - -const ( - secretResumptionPskBinder secretLabel = iota - secretEarlyClient - secretHandshakeClient - secretHandshakeServer - secretApplicationClient - secretApplicationServer - secretResumption -) - -type keySchedule13 struct { - suite *cipherSuite - transcriptHash hash.Hash // uses the cipher suite hash algo - secret []byte // Current secret as used for Derive-Secret - handshakeCtx []byte // cached handshake context, invalidated on updates. - clientRandom []byte // Used for keylogging, nil if keylogging is disabled. - config *Config // Used for KeyLogWriter callback, nil if keylogging is disabled. -} - -// Interface implemented by DH key exchange strategies -type dhKex interface { - // c - context of current TLS handshake, groupId - ID of an algorithm - // (curve/field) being chosen for key agreement. Methods implmenting an - // interface always assume that provided groupId is correct. - // - // In case of success, function returns secret key and ephemeral key. Otherwise - // error is set. - generate(c *Conn, groupId CurveID) ([]byte, keyShare, error) - // c - context of current TLS handshake, ks - public key received - // from the other side of the connection, secretKey - is a private key - // used for DH key agreement. Function returns shared secret in case - // of success or empty slice otherwise. - derive(c *Conn, ks keyShare, secretKey []byte) []byte -} - -// Key Exchange strategies per curve type -type kexNist struct{} // Used by NIST curves; P-256, P-384, P-512 -type kexX25519 struct{} // Used by X25519 -type kexSIDHp503 struct{} // Used by SIDH/P503 -type kexHybridSIDHp503X25519 struct { - classicKEX kexX25519 - pqKEX kexSIDHp503 -} // Used by SIDH-ECDH hybrid scheme - -// Routing map for key exchange strategies -var dhKexStrat = map[CurveID]dhKex{ - CurveP256: &kexNist{}, - CurveP384: &kexNist{}, - CurveP521: &kexNist{}, - X25519: &kexX25519{}, - HybridSIDHp503Curve25519: &kexHybridSIDHp503X25519{}, -} - -func newKeySchedule13(suite *cipherSuite, config *Config, clientRandom []byte) *keySchedule13 { - if config.KeyLogWriter == nil { - clientRandom = nil - config = nil - } - return &keySchedule13{ - suite: suite, - transcriptHash: hashForSuite(suite).New(), - clientRandom: clientRandom, - config: config, - } -} - -// setSecret sets the early/handshake/master secret based on the given secret -// (IKM). The salt is based on previous secrets (nil for the early secret). -func (ks *keySchedule13) setSecret(secret []byte) { - hash := hashForSuite(ks.suite) - salt := ks.secret - if salt != nil { - h0 := hash.New().Sum(nil) - salt = hkdfExpandLabel(hash, salt, h0, "derived", hash.Size()) - } - ks.secret = hkdfExtract(hash, secret, salt) -} - -// Depending on role returns pair of key variant to be used by -// local and remote process. -func getSidhKeyVariant(isClient bool) (sidh.KeyVariant, sidh.KeyVariant) { - if isClient { - return sidh.KeyVariant_SIDH_A, sidh.KeyVariant_SIDH_B - } - return sidh.KeyVariant_SIDH_B, sidh.KeyVariant_SIDH_A -} - -// write appends the data to the transcript hash context. -func (ks *keySchedule13) write(data []byte) { - ks.handshakeCtx = nil - ks.transcriptHash.Write(data) -} - -func (ks *keySchedule13) getLabel(secretLabel secretLabel) (label, keylogType string) { - switch secretLabel { - case secretResumptionPskBinder: - label = "res binder" - case secretEarlyClient: - label = "c e traffic" - keylogType = "CLIENT_EARLY_TRAFFIC_SECRET" - case secretHandshakeClient: - label = "c hs traffic" - keylogType = "CLIENT_HANDSHAKE_TRAFFIC_SECRET" - case secretHandshakeServer: - label = "s hs traffic" - keylogType = "SERVER_HANDSHAKE_TRAFFIC_SECRET" - case secretApplicationClient: - label = "c ap traffic" - keylogType = "CLIENT_TRAFFIC_SECRET_0" - case secretApplicationServer: - label = "s ap traffic" - keylogType = "SERVER_TRAFFIC_SECRET_0" - case secretResumption: - label = "res master" - } - return -} - -// deriveSecret returns the secret derived from the handshake context and label. -func (ks *keySchedule13) deriveSecret(secretLabel secretLabel) []byte { - label, keylogType := ks.getLabel(secretLabel) - if ks.handshakeCtx == nil { - ks.handshakeCtx = ks.transcriptHash.Sum(nil) - } - hash := hashForSuite(ks.suite) - secret := hkdfExpandLabel(hash, ks.secret, ks.handshakeCtx, label, hash.Size()) - if keylogType != "" && ks.config != nil { - ks.config.writeKeyLog(keylogType, ks.clientRandom, secret) - } - return secret -} - -func (ks *keySchedule13) prepareCipher(trafficSecret []byte) cipher.AEAD { - hash := hashForSuite(ks.suite) - key := hkdfExpandLabel(hash, trafficSecret, nil, "key", ks.suite.keyLen) - iv := hkdfExpandLabel(hash, trafficSecret, nil, "iv", ks.suite.ivLen) - return ks.suite.aead(key, iv) -} - -func (hs *serverHandshakeState) doTLS13Handshake() error { - config := hs.c.config - c := hs.c - - hs.c.cipherSuite, hs.hello.cipherSuite = hs.suite.id, hs.suite.id - hs.c.clientHello = hs.clientHello.marshal() - - // When picking the group for the handshake, priority is given to groups - // that the client provided a keyShare for, so to avoid a round-trip. - // After that the order of CurvePreferences is respected. - var ks keyShare -CurvePreferenceLoop: - for _, curveID := range config.curvePreferences() { - for _, keyShare := range hs.clientHello.keyShares { - if curveID == keyShare.group { - ks = keyShare - break CurvePreferenceLoop - } - } - } - if ks.group == 0 { - c.sendAlert(alertInternalError) - return errors.New("tls: HelloRetryRequest not implemented") // TODO(filippo) - } - - privateKey, serverKS, err := c.generateKeyShare(ks.group) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - hs.hello.keyShare = serverKS - - hash := hashForSuite(hs.suite) - hashSize := hash.Size() - hs.keySchedule = newKeySchedule13(hs.suite, config, hs.clientHello.random) - - // Check for PSK and update key schedule with new early secret key - isResumed, pskAlert := hs.checkPSK() - switch { - case pskAlert != alertSuccess: - c.sendAlert(pskAlert) - return errors.New("tls: invalid client PSK") - case !isResumed: - // apply an empty PSK if not resumed. - hs.keySchedule.setSecret(nil) - case isResumed: - c.didResume = true - } - - hs.keySchedule.write(hs.clientHello.marshal()) - - earlyClientTrafficSecret := hs.keySchedule.deriveSecret(secretEarlyClient) - - ecdheSecret := c.deriveDHESecret(ks, privateKey) - if ecdheSecret == nil { - c.sendAlert(alertIllegalParameter) - return errors.New("tls: bad ECDHE client share") - } - - hs.keySchedule.write(hs.hello.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, hs.hello.marshal()); err != nil { - return err - } - - // middlebox compatibility mode: send CCS after first handshake message - if _, err := c.writeRecord(recordTypeChangeCipherSpec, []byte{1}); err != nil { - return err - } - - hs.keySchedule.setSecret(ecdheSecret) - hs.hsClientTrafficSecret = hs.keySchedule.deriveSecret(secretHandshakeClient) - hsServerTrafficSecret := hs.keySchedule.deriveSecret(secretHandshakeServer) - c.out.exportKey(hs.keySchedule.suite, hsServerTrafficSecret) - c.out.setKey(c.vers, hs.keySchedule.suite, hsServerTrafficSecret) - - serverFinishedKey := hkdfExpandLabel(hash, hsServerTrafficSecret, nil, "finished", hashSize) - hs.clientFinishedKey = hkdfExpandLabel(hash, hs.hsClientTrafficSecret, nil, "finished", hashSize) - - // EncryptedExtensions - hs.keySchedule.write(hs.hello13Enc.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, hs.hello13Enc.marshal()); err != nil { - return err - } - - // TODO: we should have 2 separated methods - one for full-handshake and the other for PSK-handshake - if !c.didResume { - // Server MUST NOT send CertificateRequest if authenticating with PSK - if c.config.ClientAuth >= RequestClientCert { - - certReq := new(certificateRequestMsg13) - // extension 'signature_algorithms' MUST be specified - certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms13 - certReq.supportedSignatureAlgorithmsCert = supportedSigAlgorithmsCert(supportedSignatureAlgorithms13) - hs.keySchedule.write(certReq.marshal()) - if _, err := hs.c.writeRecord(recordTypeHandshake, certReq.marshal()); err != nil { - return err - } - } - - if err := hs.sendCertificate13(); err != nil { - return err - } - } - - verifyData := hmacOfSum(hash, hs.keySchedule.transcriptHash, serverFinishedKey) - serverFinished := &finishedMsg{ - verifyData: verifyData, - } - hs.keySchedule.write(serverFinished.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, serverFinished.marshal()); err != nil { - return err - } - - hs.keySchedule.setSecret(nil) // derive master secret - serverAppTrafficSecret := hs.keySchedule.deriveSecret(secretApplicationServer) - c.out.exportKey(hs.keySchedule.suite, serverAppTrafficSecret) - c.out.setKey(c.vers, hs.keySchedule.suite, serverAppTrafficSecret) - - if c.hand.Len() > 0 { - return c.sendAlert(alertUnexpectedMessage) - } - hs.appClientTrafficSecret = hs.keySchedule.deriveSecret(secretApplicationClient) - if hs.hello13Enc.earlyData { - c.in.exportKey(hs.keySchedule.suite, earlyClientTrafficSecret) - c.in.setKey(c.vers, hs.keySchedule.suite, earlyClientTrafficSecret) - c.phase = readingEarlyData - } else { - c.in.exportKey(hs.keySchedule.suite, hs.hsClientTrafficSecret) - c.in.setKey(c.vers, hs.keySchedule.suite, hs.hsClientTrafficSecret) - if hs.clientHello.earlyData { - c.phase = discardingEarlyData - } else { - c.phase = waitingClientFinished - } - } - - return nil -} - -// readClientFinished13 is called during the server handshake (when no early -// data it available) or after reading all early data. It discards early data if -// the server did not accept it and then verifies the Finished message. Once -// done it sends the session tickets. Under c.in lock. -func (hs *serverHandshakeState) readClientFinished13(hasConfirmLock bool) error { - c := hs.c - - // If the client advertised and sends early data while the server does - // not accept it, it must be fully skipped until the Finished message. - for c.phase == discardingEarlyData { - if err := c.readRecord(recordTypeApplicationData); err != nil { - return err - } - // Assume receipt of Finished message (will be checked below). - if c.hand.Len() > 0 { - c.phase = waitingClientFinished - break - } - } - - // If the client sends early data followed by a Finished message (but - // no end_of_early_data), the server MUST terminate the connection. - if c.phase != waitingClientFinished { - c.sendAlert(alertUnexpectedMessage) - return errors.New("tls: did not expect Client Finished yet") - } - - c.phase = readingClientFinished - msg, err := c.readHandshake() - if err != nil { - return err - } - - // client authentication - // (4.4.2) Client MUST send certificate msg if requested by server - if c.config.ClientAuth >= RequestClientCert && !c.didResume { - certMsg, ok := msg.(*certificateMsg13) - if !ok { - c.sendAlert(alertCertificateRequired) - return unexpectedMessageError(certMsg, msg) - } - - hs.keySchedule.write(certMsg.marshal()) - certs := getCertsFromEntries(certMsg.certificates) - pubKey, err := hs.processCertsFromClient(certs) - if err != nil { - return err - } - - if len(certs) > 0 { - // 4.4.3: CertificateVerify MUST appear immediately after Certificate msg - msg, err = c.readHandshake() - if err != nil { - return err - } - - certVerify, ok := msg.(*certificateVerifyMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certVerify, msg) - } - - err, alertCode := verifyPeerHandshakeSignature( - certVerify, - pubKey, - supportedSignatureAlgorithms13, - hs.keySchedule.transcriptHash.Sum(nil), - "TLS 1.3, client CertificateVerify") - if err != nil { - c.sendAlert(alertCode) - return err - } - hs.keySchedule.write(certVerify.marshal()) - } - - // Read next chunk - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - clientFinished, ok := msg.(*finishedMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(clientFinished, msg) - } - - hash := hashForSuite(hs.suite) - expectedVerifyData := hmacOfSum(hash, hs.keySchedule.transcriptHash, hs.clientFinishedKey) - if len(expectedVerifyData) != len(clientFinished.verifyData) || - subtle.ConstantTimeCompare(expectedVerifyData, clientFinished.verifyData) != 1 { - c.sendAlert(alertDecryptError) - return errors.New("tls: client's Finished message is incorrect") - } - hs.keySchedule.write(clientFinished.marshal()) - - c.hs = nil // Discard the server handshake state - if c.hand.Len() > 0 { - return c.sendAlert(alertUnexpectedMessage) - } - c.in.exportKey(hs.keySchedule.suite, hs.appClientTrafficSecret) - c.in.setKey(c.vers, hs.keySchedule.suite, hs.appClientTrafficSecret) - c.in.traceErr, c.out.traceErr = nil, nil - c.phase = handshakeConfirmed - atomic.StoreInt32(&c.handshakeConfirmed, 1) - - // Any read operation after handshakeRunning and before handshakeConfirmed - // will be holding this lock, which we release as soon as the confirmation - // happens, even if the Read call might do more work. - // If a Handshake is pending, c.confirmMutex will never be locked as - // ConfirmHandshake will wait for the handshake to complete. If a - // handshake was complete, and this was a confirmation, unlock - // c.confirmMutex now to allow readers to proceed. - if hasConfirmLock { - c.confirmMutex.Unlock() - } - - return hs.sendSessionTicket13() // TODO: do in a goroutine -} - -func (hs *serverHandshakeState) sendCertificate13() error { - c := hs.c - - certEntries := []certificateEntry{} - for _, cert := range hs.cert.Certificate { - certEntries = append(certEntries, certificateEntry{data: cert}) - } - if len(certEntries) > 0 && hs.clientHello.ocspStapling { - certEntries[0].ocspStaple = hs.cert.OCSPStaple - } - if len(certEntries) > 0 && hs.clientHello.scts { - certEntries[0].sctList = hs.cert.SignedCertificateTimestamps - } - - // If hs.delegatedCredential is set (see hs.readClientHello()) then the - // server is using the delegated credential extension. The DC is added as an - // extension to the end-entity certificate, i.e., the last CertificateEntry - // of Certificate.certficate_list. (For details, see - // https://tools.ietf.org/html/draft-ietf-tls-subcerts-02.) - if len(certEntries) > 0 && hs.clientHello.delegatedCredential && hs.delegatedCredential != nil { - certEntries[0].delegatedCredential = hs.delegatedCredential - } - - certMsg := &certificateMsg13{certificates: certEntries} - - hs.keySchedule.write(certMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certMsg.marshal()); err != nil { - return err - } - - sigScheme, err := hs.selectTLS13SignatureScheme() - if err != nil { - c.sendAlert(alertInternalError) - return err - } - - sigHash := hashForSignatureScheme(sigScheme) - opts := crypto.SignerOpts(sigHash) - if signatureSchemeIsPSS(sigScheme) { - opts = &rsa.PSSOptions{SaltLength: rsa.PSSSaltLengthEqualsHash, Hash: sigHash} - } - - toSign := prepareDigitallySigned(sigHash, "TLS 1.3, server CertificateVerify", hs.keySchedule.transcriptHash.Sum(nil)) - signature, err := hs.privateKey.(crypto.Signer).Sign(c.config.rand(), toSign[:], opts) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - - verifyMsg := &certificateVerifyMsg{ - hasSignatureAndHash: true, - signatureAlgorithm: sigScheme, - signature: signature, - } - hs.keySchedule.write(verifyMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, verifyMsg.marshal()); err != nil { - return err - } - - return nil -} - -func (c *Conn) handleEndOfEarlyData() error { - if c.phase != readingEarlyData || c.vers < VersionTLS13 { - return c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - msg, err := c.readHandshake() - if err != nil { - return err - } - endOfEarlyData, ok := msg.(*endOfEarlyDataMsg) - // No handshake messages are allowed after EOD. - if !ok || c.hand.Len() > 0 { - return c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - c.hs.keySchedule.write(endOfEarlyData.marshal()) - c.phase = waitingClientFinished - c.in.exportKey(c.hs.keySchedule.suite, c.hs.hsClientTrafficSecret) - c.in.setKey(c.vers, c.hs.keySchedule.suite, c.hs.hsClientTrafficSecret) - return nil -} - -// selectTLS13SignatureScheme chooses the SignatureScheme for the CertificateVerify -// based on the certificate type and client supported schemes. If no overlap is found, -// a fallback is selected. -// -// See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.4.1.2 -func (hs *serverHandshakeState) selectTLS13SignatureScheme() (sigScheme SignatureScheme, err error) { - var supportedSchemes []SignatureScheme - signer, ok := hs.privateKey.(crypto.Signer) - if !ok { - return 0, errors.New("tls: private key does not implement crypto.Signer") - } - pk := signer.Public() - if _, ok := pk.(*rsa.PublicKey); ok { - sigScheme = PSSWithSHA256 - supportedSchemes = []SignatureScheme{PSSWithSHA256, PSSWithSHA384, PSSWithSHA512} - } else if pk, ok := pk.(*ecdsa.PublicKey); ok { - switch pk.Curve { - case elliptic.P256(): - sigScheme = ECDSAWithP256AndSHA256 - supportedSchemes = []SignatureScheme{ECDSAWithP256AndSHA256} - case elliptic.P384(): - sigScheme = ECDSAWithP384AndSHA384 - supportedSchemes = []SignatureScheme{ECDSAWithP384AndSHA384} - case elliptic.P521(): - sigScheme = ECDSAWithP521AndSHA512 - supportedSchemes = []SignatureScheme{ECDSAWithP521AndSHA512} - default: - return 0, errors.New("tls: unknown ECDSA certificate curve") - } - } else { - return 0, errors.New("tls: unknown certificate key type") - } - - for _, ss := range supportedSchemes { - for _, cs := range hs.clientHello.supportedSignatureAlgorithms { - if ss == cs { - return ss, nil - } - } - } - - return sigScheme, nil -} - -func signatureSchemeIsPSS(s SignatureScheme) bool { - return s == PSSWithSHA256 || s == PSSWithSHA384 || s == PSSWithSHA512 -} - -// hashForSignatureScheme returns the Hash used by a SignatureScheme which is -// supported by selectTLS13SignatureScheme. -func hashForSignatureScheme(ss SignatureScheme) crypto.Hash { - switch ss { - case PSSWithSHA256, ECDSAWithP256AndSHA256: - return crypto.SHA256 - case PSSWithSHA384, ECDSAWithP384AndSHA384: - return crypto.SHA384 - case PSSWithSHA512, ECDSAWithP521AndSHA512: - return crypto.SHA512 - default: - panic("unsupported SignatureScheme passed to hashForSignatureScheme") - } -} - -func hashForSuite(suite *cipherSuite) crypto.Hash { - if suite.flags&suiteSHA384 != 0 { - return crypto.SHA384 - } - return crypto.SHA256 -} - -func prepareDigitallySigned(hash crypto.Hash, context string, data []byte) []byte { - message := bytes.Repeat([]byte{32}, 64) - message = append(message, context...) - message = append(message, 0) - message = append(message, data...) - h := hash.New() - h.Write(message) - return h.Sum(nil) -} - -// generateKeyShare generates keypair. Private key is returned as first argument, public key -// is returned in keyShare.data. keyshare.curveID stores ID of the scheme used. -func (c *Conn) generateKeyShare(curveID CurveID) ([]byte, keyShare, error) { - if val, ok := dhKexStrat[curveID]; ok { - return val.generate(c, curveID) - } - return nil, keyShare{}, errors.New("tls: preferredCurves includes unsupported curve") -} - -// DH key agreement. ks stores public key, secretKey stores private key used for ephemeral -// key agreement. Function returns shared secret in case of success or empty slice otherwise. -func (c *Conn) deriveDHESecret(ks keyShare, secretKey []byte) []byte { - if val, ok := dhKexStrat[ks.group]; ok { - return val.derive(c, ks, secretKey) - } - return nil -} - -// HkdfExpandLabel HKDF expands a label -func HkdfExpandLabel(hash crypto.Hash, secret, hashValue []byte, label string, L int) []byte { - return hkdfExpandLabel(hash, secret, hashValue, label, L) -} - -func hkdfExpandLabel(hash crypto.Hash, secret, hashValue []byte, label string, L int) []byte { - prefix := "tls13 " - hkdfLabel := make([]byte, 4+len(prefix)+len(label)+len(hashValue)) - hkdfLabel[0] = byte(L >> 8) - hkdfLabel[1] = byte(L) - hkdfLabel[2] = byte(len(prefix) + len(label)) - copy(hkdfLabel[3:], prefix) - z := hkdfLabel[3+len(prefix):] - copy(z, label) - z = z[len(label):] - z[0] = byte(len(hashValue)) - copy(z[1:], hashValue) - - return hkdfExpand(hash, secret, hkdfLabel, L) -} - -func hmacOfSum(f crypto.Hash, hash hash.Hash, key []byte) []byte { - h := hmac.New(f.New, key) - h.Write(hash.Sum(nil)) - return h.Sum(nil) -} - -// Maximum allowed mismatch between the stated age of a ticket -// and the server-observed one. See -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.8.2. -const ticketAgeSkewAllowance = 10 * time.Second - -// checkPSK tries to resume using a PSK, returning true (and updating the -// early secret in the key schedule) if the PSK was used and false otherwise. -func (hs *serverHandshakeState) checkPSK() (isResumed bool, alert alert) { - if hs.c.config.SessionTicketsDisabled { - return false, alertSuccess - } - - foundDHE := false - for _, mode := range hs.clientHello.pskKeyExchangeModes { - if mode == pskDHEKeyExchange { - foundDHE = true - break - } - } - if !foundDHE { - return false, alertSuccess - } - - hash := hashForSuite(hs.suite) - hashSize := hash.Size() - for i := range hs.clientHello.psks { - sessionTicket := append([]uint8{}, hs.clientHello.psks[i].identity...) - if hs.c.config.SessionTicketSealer != nil { - var ok bool - sessionTicket, ok = hs.c.config.SessionTicketSealer.Unseal(hs.clientHelloInfo(), sessionTicket) - if !ok { - continue - } - } else { - sessionTicket, _ = hs.c.decryptTicket(sessionTicket) - if sessionTicket == nil { - continue - } - } - s := &sessionState13{} - if s.unmarshal(sessionTicket) != alertSuccess { - continue - } - if s.vers != hs.c.vers { - continue - } - clientAge := time.Duration(hs.clientHello.psks[i].obfTicketAge-s.ageAdd) * time.Millisecond - serverAge := time.Since(time.Unix(int64(s.createdAt), 0)) - if clientAge-serverAge > ticketAgeSkewAllowance || clientAge-serverAge < -ticketAgeSkewAllowance { - // XXX: NSS is off spec and sends obfuscated_ticket_age as seconds - clientAge = time.Duration(hs.clientHello.psks[i].obfTicketAge-s.ageAdd) * time.Second - if clientAge-serverAge > ticketAgeSkewAllowance || clientAge-serverAge < -ticketAgeSkewAllowance { - continue - } - } - - // This enforces the stricter 0-RTT requirements on all ticket uses. - // The benefit of using PSK+ECDHE without 0-RTT are small enough that - // we can give them up in the edge case of changed suite or ALPN or SNI. - if s.suite != hs.suite.id { - continue - } - if s.alpnProtocol != hs.c.clientProtocol { - continue - } - if s.SNI != hs.c.serverName { - continue - } - - hs.keySchedule.setSecret(s.pskSecret) - binderKey := hs.keySchedule.deriveSecret(secretResumptionPskBinder) - binderFinishedKey := hkdfExpandLabel(hash, binderKey, nil, "finished", hashSize) - chHash := hash.New() - chHash.Write(hs.clientHello.rawTruncated) - expectedBinder := hmacOfSum(hash, chHash, binderFinishedKey) - - if subtle.ConstantTimeCompare(expectedBinder, hs.clientHello.psks[i].binder) != 1 { - return false, alertDecryptError - } - - if i == 0 && hs.clientHello.earlyData { - // This is a ticket intended to be used for 0-RTT - if s.maxEarlyDataLen == 0 { - // But we had not tagged it as such. - return false, alertIllegalParameter - } - if hs.c.config.Accept0RTTData { - hs.c.binder = expectedBinder - hs.c.ticketMaxEarlyData = int64(s.maxEarlyDataLen) - hs.hello13Enc.earlyData = true - } - } - hs.hello.psk = true - hs.hello.pskIdentity = uint16(i) - return true, alertSuccess - } - - return false, alertSuccess -} - -func (hs *serverHandshakeState) sendSessionTicket13() error { - c := hs.c - if c.config.SessionTicketsDisabled { - return nil - } - - foundDHE := false - for _, mode := range hs.clientHello.pskKeyExchangeModes { - if mode == pskDHEKeyExchange { - foundDHE = true - break - } - } - if !foundDHE { - return nil - } - - resumptionMasterSecret := hs.keySchedule.deriveSecret(secretResumption) - - ageAddBuf := make([]byte, 4) - sessionState := &sessionState13{ - vers: c.vers, - suite: hs.suite.id, - createdAt: uint64(time.Now().Unix()), - alpnProtocol: c.clientProtocol, - SNI: c.serverName, - maxEarlyDataLen: c.config.Max0RTTDataSize, - } - hash := hashForSuite(hs.suite) - - for i := 0; i < numSessionTickets; i++ { - if _, err := io.ReadFull(c.config.rand(), ageAddBuf); err != nil { - c.sendAlert(alertInternalError) - return err - } - sessionState.ageAdd = uint32(ageAddBuf[0])<<24 | uint32(ageAddBuf[1])<<16 | - uint32(ageAddBuf[2])<<8 | uint32(ageAddBuf[3]) - // ticketNonce must be a unique value for this connection. - // Assume there are no more than 255 tickets, otherwise two - // tickets might have the same PSK which could be a problem if - // one of them is compromised. - ticketNonce := []byte{byte(i)} - sessionState.pskSecret = hkdfExpandLabel(hash, resumptionMasterSecret, ticketNonce, "resumption", hash.Size()) - ticket := sessionState.marshal() - var err error - if c.config.SessionTicketSealer != nil { - cs := c.ConnectionState() - ticket, err = c.config.SessionTicketSealer.Seal(&cs, ticket) - } else { - ticket, err = c.encryptTicket(ticket) - } - if err != nil { - c.sendAlert(alertInternalError) - return err - } - if ticket == nil { - continue - } - ticketMsg := &newSessionTicketMsg13{ - lifetime: 24 * 3600, // TODO(filippo) - maxEarlyDataLength: c.config.Max0RTTDataSize, - withEarlyDataInfo: c.config.Max0RTTDataSize > 0, - ageAdd: sessionState.ageAdd, - nonce: ticketNonce, - ticket: ticket, - } - if _, err := c.writeRecord(recordTypeHandshake, ticketMsg.marshal()); err != nil { - return err - } - } - - return nil -} - -func (hs *serverHandshakeState) traceErr(err error) { - if err == nil { - return - } - if os.Getenv("TLSDEBUG") == "error" { - if hs != nil && hs.clientHello != nil { - os.Stderr.WriteString(hex.Dump(hs.clientHello.marshal())) - } else if err == io.EOF { - return // don't stack trace on EOF before CH - } - fmt.Fprintf(os.Stderr, "\n%s\n", debug.Stack()) - } - if os.Getenv("TLSDEBUG") == "short" { - var pcs [4]uintptr - frames := runtime.CallersFrames(pcs[0:runtime.Callers(3, pcs[:])]) - for { - frame, more := frames.Next() - if frame.Function != "crypto/tls.(*halfConn).setErrorLocked" && - frame.Function != "crypto/tls.(*Conn).sendAlertLocked" && - frame.Function != "crypto/tls.(*Conn).sendAlert" { - file := frame.File[strings.LastIndex(frame.File, "/")+1:] - log.Printf("%s:%d (%s): %v", file, frame.Line, frame.Function, err) - return - } - if !more { - break - } - } - } -} - -func getCertsFromEntries(certEntries []certificateEntry) [][]byte { - certs := make([][]byte, len(certEntries)) - for i, cert := range certEntries { - certs[i] = cert.data - } - return certs -} - -func (hs *clientHandshakeState) processEncryptedExtensions(ee *encryptedExtensionsMsg) error { - c := hs.c - if ee.alpnProtocol != "" { - c.clientProtocol = ee.alpnProtocol - c.clientProtocolFallback = false - } - if hs.c.config.ReceivedExtensions != nil { - return hs.c.config.ReceivedExtensions(typeEncryptedExtensions, ee.additionalExtensions) - } - return nil -} - -func verifyPeerHandshakeSignature( - certVerify *certificateVerifyMsg, - pubKey crypto.PublicKey, - signAlgosKnown []SignatureScheme, - transHash []byte, - contextString string) (error, alert) { - - _, sigType, hashFunc, err := pickSignatureAlgorithm( - pubKey, - []SignatureScheme{certVerify.signatureAlgorithm}, - signAlgosKnown, - VersionTLS13) - if err != nil { - return err, alertHandshakeFailure - } - - digest := prepareDigitallySigned(hashFunc, contextString, transHash) - err = verifyHandshakeSignature(sigType, pubKey, hashFunc, digest, certVerify.signature) - - if err != nil { - return err, alertDecryptError - } - - return nil, alertSuccess -} - -func (hs *clientHandshakeState) getCertificate13(certReq *certificateRequestMsg13) (*Certificate, error) { - certReq12 := &certificateRequestMsg{ - hasSignatureAndHash: true, - supportedSignatureAlgorithms: certReq.supportedSignatureAlgorithms, - certificateAuthorities: certReq.certificateAuthorities, - } - - var rsaAvail, ecdsaAvail bool - for _, sigAlg := range certReq.supportedSignatureAlgorithms { - switch signatureFromSignatureScheme(sigAlg) { - case signaturePKCS1v15, signatureRSAPSS: - rsaAvail = true - case signatureECDSA: - ecdsaAvail = true - } - } - if rsaAvail { - certReq12.certificateTypes = append(certReq12.certificateTypes, certTypeRSASign) - } - if ecdsaAvail { - certReq12.certificateTypes = append(certReq12.certificateTypes, certTypeECDSASign) - } - - return hs.getCertificate(certReq12) -} - -func (hs *clientHandshakeState) sendCertificate13(chainToSend *Certificate, certReq *certificateRequestMsg13) error { - c := hs.c - - certEntries := []certificateEntry{} - for _, cert := range chainToSend.Certificate { - certEntries = append(certEntries, certificateEntry{data: cert}) - } - certMsg := &certificateMsg13{certificates: certEntries} - - hs.keySchedule.write(certMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certMsg.marshal()); err != nil { - return err - } - - if len(certEntries) == 0 { - // No client cert available, nothing to sign. - return nil - } - - key, ok := chainToSend.PrivateKey.(crypto.Signer) - if !ok { - c.sendAlert(alertInternalError) - return fmt.Errorf("tls: client certificate private key of type %T does not implement crypto.Signer", chainToSend.PrivateKey) - } - - signatureAlgorithm, sigType, hashFunc, err := pickSignatureAlgorithm(key.Public(), certReq.supportedSignatureAlgorithms, hs.hello.supportedSignatureAlgorithms, c.vers) - if err != nil { - hs.c.sendAlert(alertHandshakeFailure) - return err - } - - digest := prepareDigitallySigned(hashFunc, "TLS 1.3, client CertificateVerify", hs.keySchedule.transcriptHash.Sum(nil)) - signOpts := crypto.SignerOpts(hashFunc) - if sigType == signatureRSAPSS { - signOpts = &rsa.PSSOptions{SaltLength: rsa.PSSSaltLengthEqualsHash, Hash: hashFunc} - } - signature, err := key.Sign(c.config.rand(), digest, signOpts) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - - verifyMsg := &certificateVerifyMsg{ - hasSignatureAndHash: true, - signatureAlgorithm: signatureAlgorithm, - signature: signature, - } - hs.keySchedule.write(verifyMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, verifyMsg.marshal()); err != nil { - return err - } - - return nil -} - -func (hs *clientHandshakeState) doTLS13Handshake() error { - c := hs.c - hash := hashForSuite(hs.suite) - hashSize := hash.Size() - serverHello := hs.serverHello - c.scts = serverHello.scts - - // middlebox compatibility mode, send CCS before second flight. - if _, err := c.writeRecord(recordTypeChangeCipherSpec, []byte{1}); err != nil { - return err - } - - // TODO check if keyshare is unacceptable, raise HRR. - - clientKS := hs.hello.keyShares[0] - if serverHello.keyShare.group != clientKS.group { - c.sendAlert(alertIllegalParameter) - return errors.New("bad or missing key share from server") - } - - // 0-RTT is not supported yet, so use an empty PSK. - hs.keySchedule.setSecret(nil) - ecdheSecret := c.deriveDHESecret(serverHello.keyShare, hs.privateKey) - if ecdheSecret == nil { - c.sendAlert(alertIllegalParameter) - return errors.New("tls: bad ECDHE server share") - } - - // Calculate handshake secrets. - hs.keySchedule.setSecret(ecdheSecret) - clientHandshakeSecret := hs.keySchedule.deriveSecret(secretHandshakeClient) - if c.hand.Len() > 0 { - c.sendAlert(alertUnexpectedMessage) - return errors.New("tls: unexpected data after Server Hello") - } - serverHandshakeSecret := hs.keySchedule.deriveSecret(secretHandshakeServer) - c.in.exportKey(hs.keySchedule.suite, serverHandshakeSecret) - // Already the sender key yet, when using an alternative record layer. - // QUIC needs the handshake write key in order to acknowlege Handshake packets. - c.out.exportKey(hs.keySchedule.suite, clientHandshakeSecret) - // Do not change the sender key yet, the server must authenticate first. - c.in.setKey(c.vers, hs.keySchedule.suite, serverHandshakeSecret) - - // Calculate MAC key for Finished messages. - serverFinishedKey := hkdfExpandLabel(hash, serverHandshakeSecret, nil, "finished", hashSize) - clientFinishedKey := hkdfExpandLabel(hash, clientHandshakeSecret, nil, "finished", hashSize) - - msg, err := c.readHandshake() - if err != nil { - return err - } - encryptedExtensions, ok := msg.(*encryptedExtensionsMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(encryptedExtensions, msg) - } - if err := hs.processEncryptedExtensions(encryptedExtensions); err != nil { - return err - } - hs.keySchedule.write(encryptedExtensions.marshal()) - - // PSKs are not supported, so receive Certificate message. - msg, err = c.readHandshake() - if err != nil { - return err - } - - var chainToSend *Certificate - certReq, isCertRequested := msg.(*certificateRequestMsg13) - if isCertRequested { - hs.keySchedule.write(certReq.marshal()) - - if chainToSend, err = hs.getCertificate13(certReq); err != nil { - c.sendAlert(alertInternalError) - return err - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - certMsg, ok := msg.(*certificateMsg13) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certMsg, msg) - } - hs.keySchedule.write(certMsg.marshal()) - - // Validate certificates. - certs := getCertsFromEntries(certMsg.certificates) - if err := hs.processCertsFromServer(certs); err != nil { - return err - } - - // Receive CertificateVerify message. - msg, err = c.readHandshake() - if err != nil { - return err - } - certVerifyMsg, ok := msg.(*certificateVerifyMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certVerifyMsg, msg) - } - - // Validate the DC if present. The DC is only processed if the extension was - // indicated by the ClientHello; otherwise this call will result in an - // "illegal_parameter" alert. - if len(certMsg.certificates) > 0 { - if err := hs.processDelegatedCredentialFromServer( - certMsg.certificates[0].delegatedCredential, - certVerifyMsg.signatureAlgorithm); err != nil { - return err - } - } - - // Set the public key used to verify the handshake. - pk := hs.c.peerCertificates[0].PublicKey - - // If the delegated credential extension has successfully been negotiated, - // then the CertificateVerify signature will have been produced with the - // DelegatedCredential's private key. - if hs.c.verifiedDc != nil { - pk = hs.c.verifiedDc.cred.publicKey - } - - // Verify the handshake signature. - err, alertCode := verifyPeerHandshakeSignature( - certVerifyMsg, - pk, - hs.hello.supportedSignatureAlgorithms, - hs.keySchedule.transcriptHash.Sum(nil), - "TLS 1.3, server CertificateVerify") - if err != nil { - c.sendAlert(alertCode) - return err - } - hs.keySchedule.write(certVerifyMsg.marshal()) - - // Receive Finished message. - msg, err = c.readHandshake() - if err != nil { - return err - } - serverFinished, ok := msg.(*finishedMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(serverFinished, msg) - } - // Validate server Finished hash. - expectedVerifyData := hmacOfSum(hash, hs.keySchedule.transcriptHash, serverFinishedKey) - if subtle.ConstantTimeCompare(expectedVerifyData, serverFinished.verifyData) != 1 { - c.sendAlert(alertDecryptError) - return errors.New("tls: server's Finished message is incorrect") - } - hs.keySchedule.write(serverFinished.marshal()) - - // Server has authenticated itself. Calculate application traffic secrets. - hs.keySchedule.setSecret(nil) // derive master secret - - // Change outbound handshake cipher for final step - c.out.setKey(c.vers, hs.keySchedule.suite, clientHandshakeSecret) - - clientAppTrafficSecret := hs.keySchedule.deriveSecret(secretApplicationClient) - serverAppTrafficSecret := hs.keySchedule.deriveSecret(secretApplicationServer) - // TODO store initial traffic secret key for KeyUpdate GH #85 - - // Client auth requires sending a (possibly empty) Certificate followed - // by a CertificateVerify message (if there was an actual certificate). - if isCertRequested { - if err := hs.sendCertificate13(chainToSend, certReq); err != nil { - return err - } - } - - // Send Finished - verifyData := hmacOfSum(hash, hs.keySchedule.transcriptHash, clientFinishedKey) - clientFinished := &finishedMsg{ - verifyData: verifyData, - } - if _, err := c.writeRecord(recordTypeHandshake, clientFinished.marshal()); err != nil { - return err - } - - // Handshake done, set application traffic secret - // TODO store initial traffic secret key for KeyUpdate GH #85 - c.out.exportKey(hs.keySchedule.suite, clientAppTrafficSecret) - c.out.setKey(c.vers, hs.keySchedule.suite, clientAppTrafficSecret) - if c.hand.Len() > 0 { - c.sendAlert(alertUnexpectedMessage) - return errors.New("tls: unexpected data after handshake") - } - c.in.exportKey(hs.keySchedule.suite, serverAppTrafficSecret) - c.in.setKey(c.vers, hs.keySchedule.suite, serverAppTrafficSecret) - return nil -} - -// supportedSigAlgorithmsCert iterates over schemes and filters out those algorithms -// which are not supported for certificate verification. -func supportedSigAlgorithmsCert(schemes []SignatureScheme) (ret []SignatureScheme) { - for _, sig := range schemes { - // X509 doesn't support PSS signatures - if !signatureSchemeIsPSS(sig) { - ret = append(ret, sig) - } - } - return -} - -// Functions below implement dhKex interface for different DH shared secret agreements - -// KEX: P-256, P-384, P-512 KEX -func (kexNist) generate(c *Conn, groupId CurveID) (private []byte, ks keyShare, err error) { - // never fails - curve, _ := curveForCurveID(groupId) - private, x, y, err := elliptic.GenerateKey(curve, c.config.rand()) - if err != nil { - return nil, keyShare{}, err - } - ks.group = groupId - ks.data = elliptic.Marshal(curve, x, y) - return -} -func (kexNist) derive(c *Conn, ks keyShare, secretKey []byte) []byte { - // never fails - curve, _ := curveForCurveID(ks.group) - x, y := elliptic.Unmarshal(curve, ks.data) - if x == nil { - return nil - } - x, _ = curve.ScalarMult(x, y, secretKey) - xBytes := x.Bytes() - curveSize := (curve.Params().BitSize + 8 - 1) >> 3 - if len(xBytes) == curveSize { - return xBytes - } - buf := make([]byte, curveSize) - copy(buf[len(buf)-len(xBytes):], xBytes) - return buf -} - -// KEX: X25519 -func (kexX25519) generate(c *Conn, groupId CurveID) ([]byte, keyShare, error) { - var scalar, public [x25519SharedSecretSz]byte - if _, err := io.ReadFull(c.config.rand(), scalar[:]); err != nil { - return nil, keyShare{}, err - } - curve25519.ScalarBaseMult(&public, &scalar) - return scalar[:], keyShare{group: X25519, data: public[:]}, nil -} - -func (kexX25519) derive(c *Conn, ks keyShare, secretKey []byte) []byte { - var theirPublic, sharedKey, scalar [x25519SharedSecretSz]byte - if len(ks.data) != x25519SharedSecretSz { - return nil - } - copy(theirPublic[:], ks.data) - copy(scalar[:], secretKey) - curve25519.ScalarMult(&sharedKey, &scalar, &theirPublic) - return sharedKey[:] -} - -// KEX: SIDH/503 -func (kexSIDHp503) generate(c *Conn, groupId CurveID) ([]byte, keyShare, error) { - var variant, _ = getSidhKeyVariant(c.isClient) - var prvKey = sidh.NewPrivateKey(sidh.FP_503, variant) - if prvKey.Generate(c.config.rand()) != nil { - return nil, keyShare{}, errors.New("tls: private SIDH key generation failed") - } - pubKey := prvKey.GeneratePublicKey() - return prvKey.Export(), keyShare{group: 0 /*UNUSED*/, data: pubKey.Export()}, nil -} - -func (kexSIDHp503) derive(c *Conn, ks keyShare, key []byte) []byte { - var prvVariant, pubVariant = getSidhKeyVariant(c.isClient) - var prvKeySize = P503PrvKeySz - - if len(ks.data) != P503PubKeySz || len(key) != prvKeySize { - return nil - } - - prvKey := sidh.NewPrivateKey(sidh.FP_503, prvVariant) - pubKey := sidh.NewPublicKey(sidh.FP_503, pubVariant) - - if err := prvKey.Import(key); err != nil { - return nil - } - if err := pubKey.Import(ks.data); err != nil { - return nil - } - - // Never fails - sharedKey, _ := sidh.DeriveSecret(prvKey, pubKey) - return sharedKey -} - -// KEX Hybrid SIDH/503-X25519 -func (kex *kexHybridSIDHp503X25519) generate(c *Conn, groupId CurveID) (private []byte, ks keyShare, err error) { - var pubHybrid [SIDHp503Curve25519PubKeySz]byte - var prvHybrid [SIDHp503Curve25519PrvKeySz]byte - - // Generate ephemeral key for classic x25519 - private, ks, err = kex.classicKEX.generate(c, groupId) - if err != nil { - return - } - copy(prvHybrid[:], private) - copy(pubHybrid[:], ks.data) - - // Generate PQ ephemeral key for SIDH - private, ks, err = kex.pqKEX.generate(c, groupId) - if err != nil { - return - } - copy(prvHybrid[x25519SharedSecretSz:], private) - copy(pubHybrid[x25519SharedSecretSz:], ks.data) - return prvHybrid[:], keyShare{group: HybridSIDHp503Curve25519, data: pubHybrid[:]}, nil -} - -func (kex *kexHybridSIDHp503X25519) derive(c *Conn, ks keyShare, key []byte) []byte { - var sharedKey [SIDHp503Curve25519SharedKeySz]byte - var ret []byte - var tmpKs keyShare - - // Key agreement for classic - tmpKs.group = X25519 - tmpKs.data = ks.data[:x25519SharedSecretSz] - ret = kex.classicKEX.derive(c, tmpKs, key[:x25519SharedSecretSz]) - if ret == nil { - return nil - } - copy(sharedKey[:], ret) - - // Key agreement for PQ - tmpKs.group = 0 /*UNUSED*/ - tmpKs.data = ks.data[x25519SharedSecretSz:] - ret = kex.pqKEX.derive(c, tmpKs, key[x25519SharedSecretSz:]) - if ret == nil { - return nil - } - copy(sharedKey[x25519SharedSecretSz:], ret) - return sharedKey[:] -} diff --git a/external/github.com/marten-seemann/qtls/LICENSE b/external/github.com/marten-seemann/qtls/LICENSE deleted file mode 100644 index 8c1dcdaf53..0000000000 --- a/external/github.com/marten-seemann/qtls/LICENSE +++ /dev/null @@ -1,63 +0,0 @@ -Copyright (c) 2018 Cloudflare. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Cloudflare nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -======================================================================== - -The code for TLSv1.2 and older TLS versions was derived from the -Golang standard library , available -under the following BSD license: - -======================================================================== - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/external/github.com/marten-seemann/qtls/README.md b/external/github.com/marten-seemann/qtls/README.md deleted file mode 100644 index be5c08c1d6..0000000000 --- a/external/github.com/marten-seemann/qtls/README.md +++ /dev/null @@ -1,107 +0,0 @@ -``` - _____ _ ____ _ _ -|_ _| | / ___| | |_ _ __(_)___ - | | | | \___ \ _____| __| '__| / __| - | | | |___ ___) |_____| |_| | | \__ \ - |_| |_____|____/ \__|_| |_|___/ - -``` - -crypto/tls, now with 100% more 1.3. - -THE API IS NOT STABLE AND DOCUMENTATION IS NOT GUARANTEED. - -[![Build Status](https://travis-ci.org/cloudflare/tls-tris.svg?branch=master)](https://travis-ci.org/cloudflare/tls-tris) - -## Usage - -Since `crypto/tls` is very deeply (and not that elegantly) coupled with the Go stdlib, -tls-tris shouldn't be used as an external package. It is also impossible to vendor it -as `crypto/tls` because stdlib packages would import the standard one and mismatch. - -So, to build with tls-tris, you need to use a custom GOROOT. - -A script is provided that will take care of it for you: `./_dev/go.sh`. -Just use that instead of the `go` tool. - -The script also transparently fetches the custom Cloudflare Go 1.10 compiler with the required backports. - -## Development - -### Dependencies - -Copy paste line bellow to install all required dependencies: - -* ArchLinux: -``` -pacman -S go docker gcc git make patch python2 python-docker rsync -``` - -* Debian: -``` -apt-get install build-essential docker go patch python python-pip rsync -pip install setuptools -pip install docker -``` - -* Ubuntu (18.04) : -``` -apt-get update -apt-get install build-essential docker docker.io golang patch python python-pip rsync sudo -pip install setuptools -pip install docker -sudo usermod -a -G docker $USER -``` - -Similar dependencies can be found on any UNIX based system/distribution. - -### Building - -There are number of things that need to be setup before running tests. Most important step is to copy ``go env GOROOT`` directory to ``_dev`` and swap TLS implementation and recompile GO. Then for testing we use go implementation from ``_dev/GOROOT``. - -``` -git clone https://github.com/cloudflare/tls-tris.git -cd tls-tris; cp _dev/utils/pre-commit .git/hooks/ -make -f _dev/Makefile build-all -``` - -### Testing - -We run 3 kinds of test:. - -* Unit testing:
``make -f _dev/Makefile test-unit`` -* Testing against BoringSSL test suite:
``make -f _dev/Makefile test-bogo`` -* Compatibility testing (see below):
``make -f _dev/Makefile test-interop`` - -To run all the tests in one go use: -``` -make -f _dev/Makefile test -``` - -### Testing interoperability with 3rd party libraries - -In order to ensure compatibility we are testing our implementation against BoringSSL, NSS and PicoTLS. - -Makefile has a specific target for testing interoperability with external libraries. Following command can be used in order to run such test: - -``` -make -f _dev/Makefile test-interop -``` - -The makefile target is just a wrapper and it executes ``_dev/interop_test_runner`` script written in python. The script implements interoperability tests using ``python unittest`` framework. - -Script can be started from command line directly. For example: - -``` -> ./interop_test_runner -v InteropServer_NSS.test_zero_rtt -test_zero_rtt (__main__.InteropServer_NSS) ... ok - ----------------------------------------------------------------------- -Ran 1 test in 8.765s - -OK -``` - -### Debugging - -When the environment variable `TLSDEBUG` is set to `error`, Tris will print a hexdump of the Client Hello and a stack trace if an handshake error occurs. If the value is `short`, only the error and the first meaningful stack frame are printed. diff --git a/external/github.com/marten-seemann/qtls/alert.go b/external/github.com/marten-seemann/qtls/alert.go deleted file mode 100644 index bfd552d53e..0000000000 --- a/external/github.com/marten-seemann/qtls/alert.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import "strconv" - -type alert uint8 - -const ( - // alert level - alertLevelWarning = 1 - alertLevelError = 2 -) - -const ( - alertCloseNotify alert = 0 - alertUnexpectedMessage alert = 10 - alertBadRecordMAC alert = 20 - alertDecryptionFailed alert = 21 - alertRecordOverflow alert = 22 - alertDecompressionFailure alert = 30 - alertHandshakeFailure alert = 40 - alertBadCertificate alert = 42 - alertUnsupportedCertificate alert = 43 - alertCertificateRevoked alert = 44 - alertCertificateExpired alert = 45 - alertCertificateUnknown alert = 46 - alertIllegalParameter alert = 47 - alertUnknownCA alert = 48 - alertAccessDenied alert = 49 - alertDecodeError alert = 50 - alertDecryptError alert = 51 - alertProtocolVersion alert = 70 - alertInsufficientSecurity alert = 71 - alertInternalError alert = 80 - alertInappropriateFallback alert = 86 - alertUserCanceled alert = 90 - alertNoRenegotiation alert = 100 - alertUnsupportedExtension alert = 110 - alertCertificateRequired alert = 116 - alertNoApplicationProtocol alert = 120 - alertSuccess alert = 255 // dummy value returned by unmarshal functions -) - -var alertText = map[alert]string{ - alertCloseNotify: "close notify", - alertUnexpectedMessage: "unexpected message", - alertBadRecordMAC: "bad record MAC", - alertDecryptionFailed: "decryption failed", - alertRecordOverflow: "record overflow", - alertDecompressionFailure: "decompression failure", - alertHandshakeFailure: "handshake failure", - alertBadCertificate: "bad certificate", - alertUnsupportedCertificate: "unsupported certificate", - alertCertificateRevoked: "revoked certificate", - alertCertificateExpired: "expired certificate", - alertCertificateUnknown: "unknown certificate", - alertIllegalParameter: "illegal parameter", - alertUnknownCA: "unknown certificate authority", - alertAccessDenied: "access denied", - alertDecodeError: "error decoding message", - alertDecryptError: "error decrypting message", - alertProtocolVersion: "protocol version not supported", - alertInsufficientSecurity: "insufficient security level", - alertInternalError: "internal error", - alertInappropriateFallback: "inappropriate fallback", - alertUserCanceled: "user canceled", - alertNoRenegotiation: "no renegotiation", - alertNoApplicationProtocol: "no application protocol", -} - -func (e alert) String() string { - s, ok := alertText[e] - if ok { - return "tls: " + s - } - return "tls: alert(" + strconv.Itoa(int(e)) + ")" -} - -func (e alert) Error() string { - return e.String() -} diff --git a/external/github.com/marten-seemann/qtls/auth.go b/external/github.com/marten-seemann/qtls/auth.go deleted file mode 100644 index a4e101f6ad..0000000000 --- a/external/github.com/marten-seemann/qtls/auth.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "encoding/asn1" - "errors" - "fmt" -) - -// pickSignatureAlgorithm selects a signature algorithm that is compatible with -// the given public key and the list of algorithms from both sides of connection. -// The lists of signature algorithms (peerSigAlgs and ourSigAlgs) are ignored -// for tlsVersion < VersionTLS12. -// -// The returned SignatureScheme codepoint is only meaningful for TLS 1.2 and newer -// previous TLS versions have a fixed hash function. -func pickSignatureAlgorithm(pubkey crypto.PublicKey, peerSigAlgs, ourSigAlgs []SignatureScheme, tlsVersion uint16) (SignatureScheme, uint8, crypto.Hash, error) { - if tlsVersion < VersionTLS12 || len(peerSigAlgs) == 0 { - // If the client didn't specify any signature_algorithms - // extension then we can assume that it supports SHA1. See - // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 - switch pubkey.(type) { - case *rsa.PublicKey: - if tlsVersion < VersionTLS12 { - return 0, signaturePKCS1v15, crypto.MD5SHA1, nil - } else { - return PKCS1WithSHA1, signaturePKCS1v15, crypto.SHA1, nil - } - case *ecdsa.PublicKey: - return ECDSAWithSHA1, signatureECDSA, crypto.SHA1, nil - default: - return 0, 0, 0, fmt.Errorf("tls: unsupported public key: %T", pubkey) - } - } - for _, sigAlg := range peerSigAlgs { - if !isSupportedSignatureAlgorithm(sigAlg, ourSigAlgs) { - continue - } - hashAlg, err := lookupTLSHash(sigAlg) - if err != nil { - panic("tls: supported signature algorithm has an unknown hash function") - } - sigType := signatureFromSignatureScheme(sigAlg) - if (sigType == signaturePKCS1v15 || hashAlg == crypto.SHA1) && tlsVersion >= VersionTLS13 { - // TLS 1.3 forbids RSASSA-PKCS1-v1_5 and SHA-1 for - // handshake messages. - continue - } - switch pubkey.(type) { - case *rsa.PublicKey: - if sigType == signaturePKCS1v15 || sigType == signatureRSAPSS { - return sigAlg, sigType, hashAlg, nil - } - case *ecdsa.PublicKey: - if sigType == signatureECDSA { - return sigAlg, sigType, hashAlg, nil - } - } - } - return 0, 0, 0, errors.New("tls: peer doesn't support any common signature algorithms") -} - -// verifyHandshakeSignature verifies a signature against pre-hashed handshake -// contents. -func verifyHandshakeSignature(sigType uint8, pubkey crypto.PublicKey, hashFunc crypto.Hash, digest, sig []byte) error { - switch sigType { - case signatureECDSA: - pubKey, ok := pubkey.(*ecdsa.PublicKey) - if !ok { - return errors.New("tls: ECDSA signing requires a ECDSA public key") - } - ecdsaSig := new(ecdsaSignature) - if _, err := asn1.Unmarshal(sig, ecdsaSig); err != nil { - return err - } - if ecdsaSig.R.Sign() <= 0 || ecdsaSig.S.Sign() <= 0 { - return errors.New("tls: ECDSA signature contained zero or negative values") - } - if !ecdsa.Verify(pubKey, digest, ecdsaSig.R, ecdsaSig.S) { - return errors.New("tls: ECDSA verification failure") - } - case signaturePKCS1v15: - pubKey, ok := pubkey.(*rsa.PublicKey) - if !ok { - return errors.New("tls: RSA signing requires a RSA public key") - } - if err := rsa.VerifyPKCS1v15(pubKey, hashFunc, digest, sig); err != nil { - return err - } - case signatureRSAPSS: - pubKey, ok := pubkey.(*rsa.PublicKey) - if !ok { - return errors.New("tls: RSA signing requires a RSA public key") - } - signOpts := &rsa.PSSOptions{SaltLength: rsa.PSSSaltLengthEqualsHash} - if err := rsa.VerifyPSS(pubKey, hashFunc, digest, sig, signOpts); err != nil { - return err - } - default: - return errors.New("tls: unknown signature algorithm") - } - return nil -} diff --git a/external/github.com/marten-seemann/qtls/cipher_suites.go b/external/github.com/marten-seemann/qtls/cipher_suites.go deleted file mode 100644 index 781c32282e..0000000000 --- a/external/github.com/marten-seemann/qtls/cipher_suites.go +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "crypto" - "crypto/aes" - "crypto/cipher" - "crypto/des" - "crypto/hmac" - "crypto/rc4" - "crypto/sha1" - "crypto/sha256" - "hash" - - "golang.org/x/crypto/chacha20poly1305" -) - -// a keyAgreement implements the client and server side of a TLS key agreement -// protocol by generating and processing key exchange messages. -type keyAgreement interface { - // On the server side, the first two methods are called in order. - - // In the case that the key agreement protocol doesn't use a - // ServerKeyExchange message, generateServerKeyExchange can return nil, - // nil. - generateServerKeyExchange(*Config, crypto.PrivateKey, *clientHelloMsg, *serverHelloMsg) (*serverKeyExchangeMsg, error) - processClientKeyExchange(*Config, crypto.PrivateKey, *clientKeyExchangeMsg, uint16) ([]byte, error) - - // On the client side, the next two methods are called in order. - - // This method may not be called if the server doesn't send a - // ServerKeyExchange message. - processServerKeyExchange(*Config, *clientHelloMsg, *serverHelloMsg, crypto.PublicKey, *serverKeyExchangeMsg) error - generateClientKeyExchange(*Config, *clientHelloMsg, crypto.PublicKey) ([]byte, *clientKeyExchangeMsg, error) -} - -const ( - // suiteECDH indicates that the cipher suite involves elliptic curve - // Diffie-Hellman. This means that it should only be selected when the - // client indicates that it supports ECC with a curve and point format - // that we're happy with. - suiteECDHE = 1 << iota - // suiteECDSA indicates that the cipher suite involves an ECDSA - // signature and therefore may only be selected when the server's - // certificate is ECDSA. If this is not set then the cipher suite is - // RSA based. - suiteECDSA - // suiteTLS12 indicates that the cipher suite should only be advertised - // and accepted when using TLS 1.2. - suiteTLS12 - // suiteTLS13 indicates that the ones and only cipher suites to be - // advertised and accepted when using TLS 1.3. - suiteTLS13 - // suiteSHA384 indicates that the cipher suite uses SHA384 as the - // handshake hash. - suiteSHA384 - // suiteDefaultOff indicates that this cipher suite is not included by - // default. - suiteDefaultOff -) - -// A cipherSuite is a specific combination of key agreement, cipher and MAC -// function. -type cipherSuite struct { - id uint16 - // the lengths, in bytes, of the key material needed for each component. - keyLen int - macLen int - ivLen int - ka func(version uint16) keyAgreement - // flags is a bitmask of the suite* values, above. - flags int - cipher func(key, iv []byte, isRead bool) interface{} - mac func(version uint16, macKey []byte) macFunction - aead func(key, fixedNonce []byte) cipher.AEAD -} - -type CipherSuite struct { - cipherSuite -} - -func (c *CipherSuite) Hash() crypto.Hash { return hashForSuite(&c.cipherSuite) } -func (c *CipherSuite) KeyLen() int { return c.keyLen } -func (c *CipherSuite) IVLen() int { return c.ivLen } -func (c *CipherSuite) AEAD(key, fixedNonce []byte) cipher.AEAD { return c.aead(key, fixedNonce) } - -var cipherSuites = []*cipherSuite{ - // TLS 1.3 ciphersuites specify only the AEAD and the HKDF hash. - {TLS_CHACHA20_POLY1305_SHA256, 32, 0, 12, nil, suiteTLS13, nil, nil, aeadChaCha20Poly1305}, - {TLS_AES_128_GCM_SHA256, 16, 0, 12, nil, suiteTLS13, nil, nil, aeadAESGCM13}, - {TLS_AES_256_GCM_SHA384, 32, 0, 12, nil, suiteTLS13 | suiteSHA384, nil, nil, aeadAESGCM13}, - - // Ciphersuite order is chosen so that ECDHE comes before plain RSA and - // AEADs are the top preference. - {TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, 32, 0, 12, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadChaCha20Poly1305}, - {TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, 32, 0, 12, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12, nil, nil, aeadChaCha20Poly1305}, - {TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12, nil, nil, aeadAESGCM12}, - {TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12, nil, nil, aeadAESGCM12}, - {TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheRSAKA, suiteECDHE | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM12}, - {TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM12}, - {TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 16, 32, 16, ecdheRSAKA, suiteECDHE | suiteTLS12 | suiteDefaultOff, cipherAES, macSHA256, nil}, - {TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil}, - {TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 16, 32, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteTLS12 | suiteDefaultOff, cipherAES, macSHA256, nil}, - {TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 16, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil}, - {TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheRSAKA, suiteECDHE, cipherAES, macSHA1, nil}, - {TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 32, 20, 16, ecdheECDSAKA, suiteECDHE | suiteECDSA, cipherAES, macSHA1, nil}, - {TLS_RSA_WITH_AES_128_GCM_SHA256, 16, 0, 4, rsaKA, suiteTLS12, nil, nil, aeadAESGCM12}, - {TLS_RSA_WITH_AES_256_GCM_SHA384, 32, 0, 4, rsaKA, suiteTLS12 | suiteSHA384, nil, nil, aeadAESGCM12}, - {TLS_RSA_WITH_AES_128_CBC_SHA256, 16, 32, 16, rsaKA, suiteTLS12 | suiteDefaultOff, cipherAES, macSHA256, nil}, - {TLS_RSA_WITH_AES_128_CBC_SHA, 16, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil}, - {TLS_RSA_WITH_AES_256_CBC_SHA, 32, 20, 16, rsaKA, 0, cipherAES, macSHA1, nil}, - {TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, ecdheRSAKA, suiteECDHE, cipher3DES, macSHA1, nil}, - {TLS_RSA_WITH_3DES_EDE_CBC_SHA, 24, 20, 8, rsaKA, 0, cipher3DES, macSHA1, nil}, - - // RC4-based cipher suites are disabled by default. - {TLS_RSA_WITH_RC4_128_SHA, 16, 20, 0, rsaKA, suiteDefaultOff, cipherRC4, macSHA1, nil}, - {TLS_ECDHE_RSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheRSAKA, suiteECDHE | suiteDefaultOff, cipherRC4, macSHA1, nil}, - {TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 16, 20, 0, ecdheECDSAKA, suiteECDHE | suiteECDSA | suiteDefaultOff, cipherRC4, macSHA1, nil}, -} - -func cipherRC4(key, iv []byte, isRead bool) interface{} { - cipher, _ := rc4.NewCipher(key) - return cipher -} - -func cipher3DES(key, iv []byte, isRead bool) interface{} { - block, _ := des.NewTripleDESCipher(key) - if isRead { - return cipher.NewCBCDecrypter(block, iv) - } - return cipher.NewCBCEncrypter(block, iv) -} - -func cipherAES(key, iv []byte, isRead bool) interface{} { - block, _ := aes.NewCipher(key) - if isRead { - return cipher.NewCBCDecrypter(block, iv) - } - return cipher.NewCBCEncrypter(block, iv) -} - -// macSHA1 returns a macFunction for the given protocol version. -func macSHA1(version uint16, key []byte) macFunction { - if version == VersionSSL30 { - mac := ssl30MAC{ - h: sha1.New(), - key: make([]byte, len(key)), - } - copy(mac.key, key) - return mac - } - return tls10MAC{hmac.New(newConstantTimeHash(sha1.New), key)} -} - -// macSHA256 returns a SHA-256 based MAC. These are only supported in TLS 1.2 -// so the given version is ignored. -func macSHA256(version uint16, key []byte) macFunction { - return tls10MAC{hmac.New(sha256.New, key)} -} - -type macFunction interface { - Size() int - MAC(digestBuf, seq, header, data, extra []byte) []byte -} - -type aead interface { - cipher.AEAD - - // explicitIVLen returns the number of bytes used by the explicit nonce - // that is included in the record. This is eight for older AEADs and - // zero for modern ones. - explicitNonceLen() int -} - -// fixedNonceAEAD wraps an AEAD and prefixes a fixed portion of the nonce to -// each call. -type fixedNonceAEAD struct { - // nonce contains the fixed part of the nonce in the first four bytes. - nonce [12]byte - aead cipher.AEAD -} - -func (f *fixedNonceAEAD) NonceSize() int { return 8 } - -// Overhead returns the maximum difference between the lengths of a -// plaintext and its ciphertext. -func (f *fixedNonceAEAD) Overhead() int { return f.aead.Overhead() } -func (f *fixedNonceAEAD) explicitNonceLen() int { return 8 } - -func (f *fixedNonceAEAD) Seal(out, nonce, plaintext, additionalData []byte) []byte { - copy(f.nonce[4:], nonce) - return f.aead.Seal(out, f.nonce[:], plaintext, additionalData) -} - -func (f *fixedNonceAEAD) Open(out, nonce, plaintext, additionalData []byte) ([]byte, error) { - copy(f.nonce[4:], nonce) - return f.aead.Open(out, f.nonce[:], plaintext, additionalData) -} - -// xoredNonceAEAD wraps an AEAD by XORing in a fixed pattern to the nonce -// before each call. -type xorNonceAEAD struct { - nonceMask [12]byte - aead cipher.AEAD -} - -func (f *xorNonceAEAD) NonceSize() int { return 8 } -func (f *xorNonceAEAD) Overhead() int { return f.aead.Overhead() } -func (f *xorNonceAEAD) explicitNonceLen() int { return 0 } - -func (f *xorNonceAEAD) Seal(out, nonce, plaintext, additionalData []byte) []byte { - for i, b := range nonce { - f.nonceMask[4+i] ^= b - } - result := f.aead.Seal(out, f.nonceMask[:], plaintext, additionalData) - for i, b := range nonce { - f.nonceMask[4+i] ^= b - } - - return result -} - -func (f *xorNonceAEAD) Open(out, nonce, plaintext, additionalData []byte) ([]byte, error) { - for i, b := range nonce { - f.nonceMask[4+i] ^= b - } - result, err := f.aead.Open(out, f.nonceMask[:], plaintext, additionalData) - for i, b := range nonce { - f.nonceMask[4+i] ^= b - } - - return result, err -} - -func aeadAESGCM12(key, fixedNonce []byte) cipher.AEAD { - aes, err := aes.NewCipher(key) - if err != nil { - panic(err) - } - aead, err := cipher.NewGCM(aes) - if err != nil { - panic(err) - } - - ret := &fixedNonceAEAD{aead: aead} - copy(ret.nonce[:], fixedNonce) - return ret -} - -// AEADAESGCM13 creates a new AES-GCM AEAD for TLS 1.3 -func AEADAESGCM13(key, fixedNonce []byte) cipher.AEAD { - return aeadAESGCM13(key, fixedNonce) -} - -func aeadAESGCM13(key, fixedNonce []byte) cipher.AEAD { - aes, err := aes.NewCipher(key) - if err != nil { - panic(err) - } - aead, err := cipher.NewGCM(aes) - if err != nil { - panic(err) - } - - ret := &xorNonceAEAD{aead: aead} - copy(ret.nonceMask[:], fixedNonce) - return ret -} - -func aeadChaCha20Poly1305(key, fixedNonce []byte) cipher.AEAD { - aead, err := chacha20poly1305.New(key) - if err != nil { - panic(err) - } - - ret := &xorNonceAEAD{aead: aead} - copy(ret.nonceMask[:], fixedNonce) - return ret -} - -// ssl30MAC implements the SSLv3 MAC function, as defined in -// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 5.2.3.1 -type ssl30MAC struct { - h hash.Hash - key []byte -} - -func (s ssl30MAC) Size() int { - return s.h.Size() -} - -var ssl30Pad1 = [48]byte{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36} - -var ssl30Pad2 = [48]byte{0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c} - -// MAC does not offer constant timing guarantees for SSL v3.0, since it's deemed -// useless considering the similar, protocol-level POODLE vulnerability. -func (s ssl30MAC) MAC(digestBuf, seq, header, data, extra []byte) []byte { - padLength := 48 - if s.h.Size() == 20 { - padLength = 40 - } - - s.h.Reset() - s.h.Write(s.key) - s.h.Write(ssl30Pad1[:padLength]) - s.h.Write(seq) - s.h.Write(header[:1]) - s.h.Write(header[3:5]) - s.h.Write(data) - digestBuf = s.h.Sum(digestBuf[:0]) - - s.h.Reset() - s.h.Write(s.key) - s.h.Write(ssl30Pad2[:padLength]) - s.h.Write(digestBuf) - return s.h.Sum(digestBuf[:0]) -} - -type constantTimeHash interface { - hash.Hash - ConstantTimeSum(b []byte) []byte -} - -// cthWrapper wraps any hash.Hash that implements ConstantTimeSum, and replaces -// with that all calls to Sum. It's used to obtain a ConstantTimeSum-based HMAC. -type cthWrapper struct { - h constantTimeHash -} - -func (c *cthWrapper) Size() int { return c.h.Size() } -func (c *cthWrapper) BlockSize() int { return c.h.BlockSize() } -func (c *cthWrapper) Reset() { c.h.Reset() } -func (c *cthWrapper) Write(p []byte) (int, error) { return c.h.Write(p) } -func (c *cthWrapper) Sum(b []byte) []byte { return c.h.ConstantTimeSum(b) } - -func newConstantTimeHash(h func() hash.Hash) func() hash.Hash { - return func() hash.Hash { - return &cthWrapper{h().(constantTimeHash)} - } -} - -// tls10MAC implements the TLS 1.0 MAC function. RFC 2246, section 6.2.3. -type tls10MAC struct { - h hash.Hash -} - -func (s tls10MAC) Size() int { - return s.h.Size() -} - -// MAC is guaranteed to take constant time, as long as -// len(seq)+len(header)+len(data)+len(extra) is constant. extra is not fed into -// the MAC, but is only provided to make the timing profile constant. -func (s tls10MAC) MAC(digestBuf, seq, header, data, extra []byte) []byte { - s.h.Reset() - s.h.Write(seq) - s.h.Write(header) - s.h.Write(data) - res := s.h.Sum(digestBuf[:0]) - if extra != nil { - s.h.Write(extra) - } - return res -} - -func rsaKA(version uint16) keyAgreement { - return rsaKeyAgreement{} -} - -func ecdheECDSAKA(version uint16) keyAgreement { - return &ecdheKeyAgreement{ - isRSA: false, - version: version, - } -} - -func ecdheRSAKA(version uint16) keyAgreement { - return &ecdheKeyAgreement{ - isRSA: true, - version: version, - } -} - -// mutualCipherSuite returns a cipherSuite given a list of supported -// ciphersuites and the id requested by the peer. -func mutualCipherSuite(have []uint16, want uint16) *cipherSuite { - for _, id := range have { - if id == want { - for _, suite := range cipherSuites { - if suite.id == want { - return suite - } - } - return nil - } - } - return nil -} - -// A list of cipher suite IDs that are, or have been, implemented by this -// package. -// -// Taken from http://www.iana.org/assignments/tls-parameters/tls-parameters.xml -const ( - // TLS 1.0 - 1.2 cipher suites. - TLS_RSA_WITH_RC4_128_SHA uint16 = 0x0005 - TLS_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0x000a - TLS_RSA_WITH_AES_128_CBC_SHA uint16 = 0x002f - TLS_RSA_WITH_AES_256_CBC_SHA uint16 = 0x0035 - TLS_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0x003c - TLS_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0x009c - TLS_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0x009d - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA uint16 = 0xc007 - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA uint16 = 0xc009 - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA uint16 = 0xc00a - TLS_ECDHE_RSA_WITH_RC4_128_SHA uint16 = 0xc011 - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA uint16 = 0xc012 - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA uint16 = 0xc013 - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA uint16 = 0xc014 - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 uint16 = 0xc023 - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 uint16 = 0xc027 - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02f - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 uint16 = 0xc02b - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc030 - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 uint16 = 0xc02c - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305 uint16 = 0xcca8 - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 uint16 = 0xcca9 - - // TLS 1.3+ cipher suites. - TLS_AES_128_GCM_SHA256 uint16 = 0x1301 - TLS_AES_256_GCM_SHA384 uint16 = 0x1302 - TLS_CHACHA20_POLY1305_SHA256 uint16 = 0x1303 - - // TLS_FALLBACK_SCSV isn't a standard cipher suite but an indicator - // that the client is doing version fallback. See - // https://tools.ietf.org/html/rfc7507. - TLS_FALLBACK_SCSV uint16 = 0x5600 -) diff --git a/external/github.com/marten-seemann/qtls/common.go b/external/github.com/marten-seemann/qtls/common.go deleted file mode 100644 index a8eee83d35..0000000000 --- a/external/github.com/marten-seemann/qtls/common.go +++ /dev/null @@ -1,1230 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "container/list" - "crypto" - "crypto/rand" - "crypto/sha512" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "io" - "math/big" - "net" - "strings" - "sync" - "time" -) - -const ( - VersionSSL30 = 0x0300 - VersionTLS10 = 0x0301 - VersionTLS11 = 0x0302 - VersionTLS12 = 0x0303 - VersionTLS13 = 0x0304 -) - -const ( - maxPlaintext = 16384 // maximum plaintext payload length - maxCiphertext = 16384 + 2048 // maximum ciphertext payload length - recordHeaderLen = 5 // record header length - maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB) - maxWarnAlertCount = 5 // maximum number of consecutive warning alerts - - minVersion = VersionTLS12 - maxVersion = VersionTLS13 -) - -// TLS record types. -type recordType uint8 - -const ( - recordTypeChangeCipherSpec recordType = 20 - recordTypeAlert recordType = 21 - recordTypeHandshake recordType = 22 - recordTypeApplicationData recordType = 23 -) - -// TLS handshake message types. -const ( - typeHelloRequest uint8 = 0 - typeClientHello uint8 = 1 - typeServerHello uint8 = 2 - typeNewSessionTicket uint8 = 4 - typeEndOfEarlyData uint8 = 5 - typeEncryptedExtensions uint8 = 8 - typeCertificate uint8 = 11 - typeServerKeyExchange uint8 = 12 - typeCertificateRequest uint8 = 13 - typeServerHelloDone uint8 = 14 - typeCertificateVerify uint8 = 15 - typeClientKeyExchange uint8 = 16 - typeFinished uint8 = 20 - typeCertificateStatus uint8 = 22 - typeNextProtocol uint8 = 67 // Not IANA assigned -) - -// TLS compression types. -const ( - compressionNone uint8 = 0 -) - -type Extension struct { - Type uint16 - Data []byte -} - -// TLS extension numbers -const ( - extensionServerName uint16 = 0 - extensionStatusRequest uint16 = 5 - extensionSupportedCurves uint16 = 10 // Supported Groups in 1.3 nomenclature - extensionSupportedPoints uint16 = 11 - extensionSignatureAlgorithms uint16 = 13 - extensionALPN uint16 = 16 - extensionSCT uint16 = 18 // https://tools.ietf.org/html/rfc6962#section-6 - extensionEMS uint16 = 23 - extensionSessionTicket uint16 = 35 - extensionPreSharedKey uint16 = 41 - extensionEarlyData uint16 = 42 - extensionSupportedVersions uint16 = 43 - extensionPSKKeyExchangeModes uint16 = 45 - extensionCAs uint16 = 47 - extensionSignatureAlgorithmsCert uint16 = 50 - extensionKeyShare uint16 = 51 - extensionNextProtoNeg uint16 = 13172 // not IANA assigned - extensionRenegotiationInfo uint16 = 0xff01 - extensionDelegatedCredential uint16 = 0xff02 // TODO(any) Get IANA assignment -) - -// TLS signaling cipher suite values -const ( - scsvRenegotiation uint16 = 0x00ff -) - -// PSK Key Exchange Modes -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.7 -const ( - pskDHEKeyExchange uint8 = 1 -) - -// CurveID is tls.CurveID -// TLS 1.3 refers to these as Groups, but this library implements only -// curve-based ones anyway. See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.4. -type CurveID = tls.CurveID - -const ( - // Exported IDs - CurveP256 = tls.CurveP256 - CurveP384 = tls.CurveP384 - CurveP521 = tls.CurveP521 - X25519 = tls.X25519 - - // Experimental KEX - HybridSIDHp503Curve25519 CurveID = 0xFE30 -) - -// TLS 1.3 Key Share -// See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.5 -type keyShare struct { - group CurveID - data []byte -} - -// TLS 1.3 PSK Identity and Binder, as sent by the client -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.6 - -type psk struct { - identity []byte - obfTicketAge uint32 - binder []byte -} - -// TLS Elliptic Curve Point Formats -// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-9 -const ( - pointFormatUncompressed uint8 = 0 -) - -// TLS CertificateStatusType (RFC 3546) -const ( - statusTypeOCSP uint8 = 1 -) - -// Certificate types (for certificateRequestMsg) -const ( - certTypeRSASign = 1 // A certificate containing an RSA key - certTypeDSSSign = 2 // A certificate containing a DSA key - certTypeRSAFixedDH = 3 // A certificate containing a static DH key - certTypeDSSFixedDH = 4 // A certificate containing a static DH key - - // See RFC 4492 sections 3 and 5.5. - certTypeECDSASign = 64 // A certificate containing an ECDSA-capable public key, signed with ECDSA. - certTypeRSAFixedECDH = 65 // A certificate containing an ECDH-capable public key, signed with RSA. - certTypeECDSAFixedECDH = 66 // A certificate containing an ECDH-capable public key, signed with ECDSA. - - // Rest of these are reserved by the TLS spec -) - -// Signature algorithms (for internal signaling use). Starting at 16 to avoid overlap with -// TLS 1.2 codepoints (RFC 5246, section A.4.1), with which these have nothing to do. -const ( - signaturePKCS1v15 uint8 = iota + 16 - signatureECDSA - signatureRSAPSS -) - -// supportedSignatureAlgorithms contains the signature and hash algorithms that -// the code advertises as supported in a TLS 1.2 ClientHello and in a TLS 1.2 -// CertificateRequest. The two fields are merged to match with TLS 1.3. -// Note that in TLS 1.2, the ECDSA algorithms are not constrained to P-256, etc. -var supportedSignatureAlgorithms = []SignatureScheme{ - PKCS1WithSHA256, - ECDSAWithP256AndSHA256, - PKCS1WithSHA384, - ECDSAWithP384AndSHA384, - PKCS1WithSHA512, - ECDSAWithP521AndSHA512, - PKCS1WithSHA1, - ECDSAWithSHA1, -} - -// supportedSignatureAlgorithms13 lists the advertised signature algorithms -// allowed for digital signatures. It includes TLS 1.2 + PSS. -var supportedSignatureAlgorithms13 = []SignatureScheme{ - PSSWithSHA256, - PKCS1WithSHA256, - ECDSAWithP256AndSHA256, - PSSWithSHA384, - PKCS1WithSHA384, - ECDSAWithP384AndSHA384, - PSSWithSHA512, - PKCS1WithSHA512, - ECDSAWithP521AndSHA512, - PKCS1WithSHA1, - ECDSAWithSHA1, -} - -// ConnectionState records basic TLS details about the connection. -type ConnectionState struct { - ConnectionID []byte // Random unique connection id - Version uint16 // TLS version used by the connection (e.g. VersionTLS12) - HandshakeComplete bool // TLS handshake is complete - DidResume bool // connection resumes a previous TLS connection - CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...) - NegotiatedProtocol string // negotiated next protocol (not guaranteed to be from Config.NextProtos) - NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server (client side only) - ServerName string // server name requested by client, if any (server side only) - PeerCertificates []*x509.Certificate // certificate chain presented by remote peer - VerifiedChains [][]*x509.Certificate // verified chains built from PeerCertificates - SignedCertificateTimestamps [][]byte // SCTs from the server, if any - OCSPResponse []byte // stapled OCSP response from server, if any - DelegatedCredential []byte // Delegated credential sent by the server, if any - - // TLSUnique contains the "tls-unique" channel binding value (see RFC - // 5929, section 3). For resumed sessions this value will be nil - // because resumption does not include enough context (see - // https://mitls.org/pages/attacks/3SHAKE#channelbindings). This will - // change in future versions of Go once the TLS master-secret fix has - // been standardized and implemented. - TLSUnique []byte - - // HandshakeConfirmed is true once all data returned by Read - // (past and future) is guaranteed not to be replayed. - HandshakeConfirmed bool - - // Unique0RTTToken is a value that never repeats, and can be used - // to detect replay attacks against 0-RTT connections. - // Unique0RTTToken is only present if HandshakeConfirmed is false. - Unique0RTTToken []byte - - ClientHello []byte // ClientHello packet -} - -// The ClientAuthType is the tls.ClientAuthType -type ClientAuthType = tls.ClientAuthType - -const ( - NoClientCert = tls.NoClientCert - RequestClientCert = tls.RequestClientCert - RequireAnyClientCert = tls.RequireAnyClientCert - VerifyClientCertIfGiven = tls.VerifyClientCertIfGiven - RequireAndVerifyClientCert = tls.RequireAndVerifyClientCert -) - -// ClientSessionState contains the state needed by clients to resume TLS -// sessions. -type ClientSessionState struct { - sessionTicket []uint8 // Encrypted ticket used for session resumption with server - vers uint16 // SSL/TLS version negotiated for the session - cipherSuite uint16 // Ciphersuite negotiated for the session - masterSecret []byte // MasterSecret generated by client on a full handshake - serverCertificates []*x509.Certificate // Certificate chain presented by the server - verifiedChains [][]*x509.Certificate // Certificate chains we built for verification - useEMS bool // State of extended master secret -} - -// ClientSessionCache is a cache of ClientSessionState objects that can be used -// by a client to resume a TLS session with a given server. ClientSessionCache -// implementations should expect to be called concurrently from different -// goroutines. Only ticket-based resumption is supported, not SessionID-based -// resumption. -type ClientSessionCache interface { - // Get searches for a ClientSessionState associated with the given key. - // On return, ok is true if one was found. - Get(sessionKey string) (session *ClientSessionState, ok bool) - - // Put adds the ClientSessionState to the cache with the given key. - Put(sessionKey string, cs *ClientSessionState) -} - -// SignatureScheme is a tls.SignatureScheme -type SignatureScheme = tls.SignatureScheme - -const ( - PKCS1WithSHA1 = tls.PKCS1WithSHA1 - PKCS1WithSHA256 = tls.PKCS1WithSHA256 - PKCS1WithSHA384 = tls.PKCS1WithSHA384 - PKCS1WithSHA512 = tls.PKCS1WithSHA512 - - PSSWithSHA256 = tls.PSSWithSHA256 - PSSWithSHA384 = tls.PSSWithSHA384 - PSSWithSHA512 = tls.PSSWithSHA512 - - ECDSAWithP256AndSHA256 = tls.ECDSAWithP256AndSHA256 - ECDSAWithP384AndSHA384 = tls.ECDSAWithP384AndSHA384 - ECDSAWithP521AndSHA512 = tls.ECDSAWithP521AndSHA512 - - // Legacy signature and hash algorithms for TLS 1.2. - ECDSAWithSHA1 = tls.ECDSAWithSHA1 -) - -// ClientHelloInfo contains information from a ClientHello message in order to -// guide certificate selection in the GetCertificate callback. -type ClientHelloInfo struct { - // CipherSuites lists the CipherSuites supported by the client (e.g. - // TLS_RSA_WITH_RC4_128_SHA). - CipherSuites []uint16 - - // ServerName indicates the name of the server requested by the client - // in order to support virtual hosting. ServerName is only set if the - // client is using SNI (see - // http://tools.ietf.org/html/rfc4366#section-3.1). - ServerName string - - // SupportedCurves lists the elliptic curves supported by the client. - // SupportedCurves is set only if the Supported Elliptic Curves - // Extension is being used (see - // http://tools.ietf.org/html/rfc4492#section-5.1.1). - SupportedCurves []CurveID - - // SupportedPoints lists the point formats supported by the client. - // SupportedPoints is set only if the Supported Point Formats Extension - // is being used (see - // http://tools.ietf.org/html/rfc4492#section-5.1.2). - SupportedPoints []uint8 - - // SignatureSchemes lists the signature and hash schemes that the client - // is willing to verify. SignatureSchemes is set only if the Signature - // Algorithms Extension is being used (see - // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1). - SignatureSchemes []SignatureScheme - - // SupportedProtos lists the application protocols supported by the client. - // SupportedProtos is set only if the Application-Layer Protocol - // Negotiation Extension is being used (see - // https://tools.ietf.org/html/rfc7301#section-3.1). - // - // Servers can select a protocol by setting Config.NextProtos in a - // GetConfigForClient return value. - SupportedProtos []string - - // SupportedVersions lists the TLS versions supported by the client. - // For TLS versions less than 1.3, this is extrapolated from the max - // version advertised by the client, so values other than the greatest - // might be rejected if used. - SupportedVersions []uint16 - - // Conn is the underlying net.Conn for the connection. Do not read - // from, or write to, this connection; that will cause the TLS - // connection to fail. - Conn net.Conn - - // Offered0RTTData is true if the client announced that it will send - // 0-RTT data. If the server Config.Accept0RTTData is true, and the - // client offered a session ticket valid for that purpose, it will - // be notified that the 0-RTT data is accepted and it will be made - // immediately available for Read. - Offered0RTTData bool - - // AcceptsDelegatedCredential is true if the client indicated willingness - // to negotiate the delegated credential extension. - AcceptsDelegatedCredential bool - - // The Fingerprint is an sequence of bytes unique to this Client Hello. - // It can be used to prevent or mitigate 0-RTT data replays as it's - // guaranteed that a replayed connection will have the same Fingerprint. - Fingerprint []byte -} - -// The CertificateRequestInfo is a tls.CertificateRequestInfo -type CertificateRequestInfo = tls.CertificateRequestInfo - -// RenegotiationSupport is a tls.RenegotiationSupport -type RenegotiationSupport = tls.RenegotiationSupport - -const ( - // RenegotiateNever disables renegotiation. - RenegotiateNever = tls.RenegotiateNever - - // RenegotiateOnceAsClient allows a remote server to request - // renegotiation once per connection. - RenegotiateOnceAsClient = tls.RenegotiateOnceAsClient - - // RenegotiateFreelyAsClient allows a remote server to repeatedly - // request renegotiation. - RenegotiateFreelyAsClient = tls.RenegotiateFreelyAsClient -) - -// A Config structure is used to configure a TLS client or server. -// After one has been passed to a TLS function it must not be -// modified. A Config may be reused; the tls package will also not -// modify it. -type Config struct { - // Rand provides the source of entropy for nonces and RSA blinding. - // If Rand is nil, TLS uses the cryptographic random reader in package - // crypto/rand. - // The Reader must be safe for use by multiple goroutines. - Rand io.Reader - - // Time returns the current time as the number of seconds since the epoch. - // If Time is nil, TLS uses time.Now. - Time func() time.Time - - // Certificates contains one or more certificate chains to present to - // the other side of the connection. Server configurations must include - // at least one certificate or else set GetCertificate. Clients doing - // client-authentication may set either Certificates or - // GetClientCertificate. - Certificates []Certificate - - // NameToCertificate maps from a certificate name to an element of - // Certificates. Note that a certificate name can be of the form - // '*.example.com' and so doesn't have to be a domain name as such. - // See Config.BuildNameToCertificate - // The nil value causes the first element of Certificates to be used - // for all connections. - NameToCertificate map[string]*Certificate - - // GetCertificate returns a Certificate based on the given - // ClientHelloInfo. It will only be called if the client supplies SNI - // information or if Certificates is empty. - // - // If GetCertificate is nil or returns nil, then the certificate is - // retrieved from NameToCertificate. If NameToCertificate is nil, the - // first element of Certificates will be used. - GetCertificate func(*ClientHelloInfo) (*Certificate, error) - - // GetClientCertificate, if not nil, is called when a server requests a - // certificate from a client. If set, the contents of Certificates will - // be ignored. - // - // If GetClientCertificate returns an error, the handshake will be - // aborted and that error will be returned. Otherwise - // GetClientCertificate must return a non-nil Certificate. If - // Certificate.Certificate is empty then no certificate will be sent to - // the server. If this is unacceptable to the server then it may abort - // the handshake. - // - // GetClientCertificate may be called multiple times for the same - // connection if renegotiation occurs or if TLS 1.3 is in use. - GetClientCertificate func(*CertificateRequestInfo) (*Certificate, error) - - // GetConfigForClient, if not nil, is called after a ClientHello is - // received from a client. It may return a non-nil Config in order to - // change the Config that will be used to handle this connection. If - // the returned Config is nil, the original Config will be used. The - // Config returned by this callback may not be subsequently modified. - // - // If GetConfigForClient is nil, the Config passed to Server() will be - // used for all connections. - // - // Uniquely for the fields in the returned Config, session ticket keys - // will be duplicated from the original Config if not set. - // Specifically, if SetSessionTicketKeys was called on the original - // config but not on the returned config then the ticket keys from the - // original config will be copied into the new config before use. - // Otherwise, if SessionTicketKey was set in the original config but - // not in the returned config then it will be copied into the returned - // config before use. If neither of those cases applies then the key - // material from the returned config will be used for session tickets. - GetConfigForClient func(*ClientHelloInfo) (*Config, error) - - // VerifyPeerCertificate, if not nil, is called after normal - // certificate verification by either a TLS client or server. It - // receives the raw ASN.1 certificates provided by the peer and also - // any verified chains that normal processing found. If it returns a - // non-nil error, the handshake is aborted and that error results. - // - // If normal verification fails then the handshake will abort before - // considering this callback. If normal verification is disabled by - // setting InsecureSkipVerify, or (for a server) when ClientAuth is - // RequestClientCert or RequireAnyClientCert, then this callback will - // be considered but the verifiedChains argument will always be nil. - VerifyPeerCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error - - // RootCAs defines the set of root certificate authorities - // that clients use when verifying server certificates. - // If RootCAs is nil, TLS uses the host's root CA set. - RootCAs *x509.CertPool - - // NextProtos is a list of supported, application level protocols. - NextProtos []string - - // ServerName is used to verify the hostname on the returned - // certificates unless InsecureSkipVerify is given. It is also included - // in the client's handshake to support virtual hosting unless it is - // an IP address. - ServerName string - - // ClientAuth determines the server's policy for - // TLS Client Authentication. The default is NoClientCert. - ClientAuth ClientAuthType - - // ClientCAs defines the set of root certificate authorities - // that servers use if required to verify a client certificate - // by the policy in ClientAuth. - ClientCAs *x509.CertPool - - // InsecureSkipVerify controls whether a client verifies the - // server's certificate chain and host name. - // If InsecureSkipVerify is true, TLS accepts any certificate - // presented by the server and any host name in that certificate. - // In this mode, TLS is susceptible to man-in-the-middle attacks. - // This should be used only for testing. - InsecureSkipVerify bool - - // CipherSuites is a list of supported cipher suites to be used in - // TLS 1.0-1.2. If CipherSuites is nil, TLS uses a list of suites - // supported by the implementation. - CipherSuites []uint16 - - // PreferServerCipherSuites controls whether the server selects the - // client's most preferred ciphersuite, or the server's most preferred - // ciphersuite. If true then the server's preference, as expressed in - // the order of elements in CipherSuites, is used. - PreferServerCipherSuites bool - - // SessionTicketsDisabled may be set to true to disable session ticket - // (resumption) support. Note that on clients, session ticket support is - // also disabled if ClientSessionCache is nil. - SessionTicketsDisabled bool - - // SessionTicketKey is used by TLS servers to provide session - // resumption. See RFC 5077. If zero, it will be filled with - // random data before the first server handshake. - // - // If multiple servers are terminating connections for the same host - // they should all have the same SessionTicketKey. If the - // SessionTicketKey leaks, previously recorded and future TLS - // connections using that key are compromised. - SessionTicketKey [32]byte - - // ClientSessionCache is a cache of ClientSessionState entries for TLS - // session resumption. It is only used by clients. - ClientSessionCache ClientSessionCache - - // MinVersion contains the minimum SSL/TLS version that is acceptable. - // If zero, then TLS 1.0 is taken as the minimum. - MinVersion uint16 - - // MaxVersion contains the maximum SSL/TLS version that is acceptable. - // If zero, then the maximum version supported by this package is used, - // which is currently TLS 1.2. - MaxVersion uint16 - - // CurvePreferences contains the elliptic curves that will be used in - // an ECDHE handshake, in preference order. If empty, the default will - // be used. - CurvePreferences []CurveID - - // DynamicRecordSizingDisabled disables adaptive sizing of TLS records. - // When true, the largest possible TLS record size is always used. When - // false, the size of TLS records may be adjusted in an attempt to - // improve latency. - DynamicRecordSizingDisabled bool - - // Renegotiation controls what types of renegotiation are supported. - // The default, none, is correct for the vast majority of applications. - Renegotiation RenegotiationSupport - - // KeyLogWriter optionally specifies a destination for TLS master secrets - // in NSS key log format that can be used to allow external programs - // such as Wireshark to decrypt TLS connections. - // See https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Key_Log_Format. - // Use of KeyLogWriter compromises security and should only be - // used for debugging. - KeyLogWriter io.Writer - - // If Max0RTTDataSize is not zero, the client will be allowed to use - // session tickets to send at most this number of bytes of 0-RTT data. - // 0-RTT data is subject to replay and has memory DoS implications. - // The server will later be able to refuse the 0-RTT data with - // Accept0RTTData, or wait for the client to prove that it's not - // replayed with Conn.ConfirmHandshake. - // - // It has no meaning on the client. - // - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-2.3. - Max0RTTDataSize uint32 - - // Accept0RTTData makes the 0-RTT data received from the client - // immediately available to Read. 0-RTT data is subject to replay. - // Use Conn.ConfirmHandshake to wait until the data is known not - // to be replayed after reading it. - // - // It has no meaning on the client. - // - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-2.3. - Accept0RTTData bool - - // SessionTicketSealer, if not nil, is used to wrap and unwrap - // session tickets, instead of SessionTicketKey. - SessionTicketSealer SessionTicketSealer - - // AcceptDelegatedCredential is true if the client is willing to negotiate - // the delegated credential extension. - // - // This value has no meaning for the server. - // - // See https://tools.ietf.org/html/draft-ietf-tls-subcerts-02. - AcceptDelegatedCredential bool - - // GetDelegatedCredential returns a DC and its private key for use in the - // delegated credential extension. The inputs to the callback are some - // information parsed from the ClientHello, as well as the protocol version - // selected by the server. This is necessary because the DC is bound to the - // protocol version in which it's used. The return value is the raw DC - // encoded in the wire format specified in - // https://tools.ietf.org/html/draft-ietf-tls-subcerts-02. If the return - // value is nil, then the server will not offer negotiate the extension. - // - // This value has no meaning for the client. - GetDelegatedCredential func(*ClientHelloInfo, uint16) ([]byte, crypto.PrivateKey, error) - - // GetExtensions, if not nil, is called before a message that allows - // sending of extensions is sent. - // Currently only implemented for the ClientHello message (for the client) - // and for the EncryptedExtensions message (for the server). - // Only valid for TLS 1.3. - GetExtensions func(handshakeMessageType uint8) []Extension - - // ReceivedExtensions, if not nil, is called when a message that allows the - // inclusion of extensions is received. - // It is called with an empty slice of extensions, if the message didn't - // contain any extensions. - // Currently only implemented for the ClientHello message (sent by the - // client) and for the EncryptedExtensions message (sent by the server). - // Only valid for TLS 1.3. - ReceivedExtensions func(handshakeMessageType uint8, exts []Extension) error - - serverInitOnce sync.Once // guards calling (*Config).serverInit - - // mutex protects sessionTicketKeys. - mutex sync.RWMutex - // sessionTicketKeys contains zero or more ticket keys. If the length - // is zero, SessionTicketsDisabled must be true. The first key is used - // for new tickets and any subsequent keys can be used to decrypt old - // tickets. - sessionTicketKeys []ticketKey - - // UseExtendedMasterSecret indicates whether or not the connection - // should use the extended master secret computation if available - UseExtendedMasterSecret bool - - // AlternativeRecordLayer is used by QUIC - AlternativeRecordLayer RecordLayer -} - -type RecordLayer interface { - SetReadKey(suite *CipherSuite, trafficSecret []byte) - SetWriteKey(suite *CipherSuite, trafficSecret []byte) - ReadHandshakeMessage() ([]byte, error) - WriteRecord([]byte) (int, error) -} - -// ticketKeyNameLen is the number of bytes of identifier that is prepended to -// an encrypted session ticket in order to identify the key used to encrypt it. -const ticketKeyNameLen = 16 - -// ticketKey is the internal representation of a session ticket key. -type ticketKey struct { - // keyName is an opaque byte string that serves to identify the session - // ticket key. It's exposed as plaintext in every session ticket. - keyName [ticketKeyNameLen]byte - aesKey [16]byte - hmacKey [16]byte -} - -// ticketKeyFromBytes converts from the external representation of a session -// ticket key to a ticketKey. Externally, session ticket keys are 32 random -// bytes and this function expands that into sufficient name and key material. -func ticketKeyFromBytes(b [32]byte) (key ticketKey) { - hashed := sha512.Sum512(b[:]) - copy(key.keyName[:], hashed[:ticketKeyNameLen]) - copy(key.aesKey[:], hashed[ticketKeyNameLen:ticketKeyNameLen+16]) - copy(key.hmacKey[:], hashed[ticketKeyNameLen+16:ticketKeyNameLen+32]) - return key -} - -// Clone returns a shallow clone of c. It is safe to clone a Config that is -// being used concurrently by a TLS client or server. -func (c *Config) Clone() *Config { - // Running serverInit ensures that it's safe to read - // SessionTicketsDisabled. - c.serverInitOnce.Do(func() { c.serverInit(nil) }) - - var sessionTicketKeys []ticketKey - c.mutex.RLock() - sessionTicketKeys = c.sessionTicketKeys - c.mutex.RUnlock() - - return &Config{ - Rand: c.Rand, - Time: c.Time, - Certificates: c.Certificates, - NameToCertificate: c.NameToCertificate, - GetCertificate: c.GetCertificate, - GetClientCertificate: c.GetClientCertificate, - GetConfigForClient: c.GetConfigForClient, - VerifyPeerCertificate: c.VerifyPeerCertificate, - RootCAs: c.RootCAs, - NextProtos: c.NextProtos, - ServerName: c.ServerName, - ClientAuth: c.ClientAuth, - ClientCAs: c.ClientCAs, - InsecureSkipVerify: c.InsecureSkipVerify, - CipherSuites: c.CipherSuites, - PreferServerCipherSuites: c.PreferServerCipherSuites, - SessionTicketsDisabled: c.SessionTicketsDisabled, - SessionTicketKey: c.SessionTicketKey, - ClientSessionCache: c.ClientSessionCache, - MinVersion: c.MinVersion, - MaxVersion: c.MaxVersion, - CurvePreferences: c.CurvePreferences, - DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, - Renegotiation: c.Renegotiation, - KeyLogWriter: c.KeyLogWriter, - Accept0RTTData: c.Accept0RTTData, - Max0RTTDataSize: c.Max0RTTDataSize, - SessionTicketSealer: c.SessionTicketSealer, - AcceptDelegatedCredential: c.AcceptDelegatedCredential, - GetDelegatedCredential: c.GetDelegatedCredential, - GetExtensions: c.GetExtensions, - ReceivedExtensions: c.ReceivedExtensions, - sessionTicketKeys: sessionTicketKeys, - UseExtendedMasterSecret: c.UseExtendedMasterSecret, - } -} - -// serverInit is run under c.serverInitOnce to do initialization of c. If c was -// returned by a GetConfigForClient callback then the argument should be the -// Config that was passed to Server, otherwise it should be nil. -func (c *Config) serverInit(originalConfig *Config) { - if c.SessionTicketsDisabled || len(c.ticketKeys()) != 0 || c.SessionTicketSealer != nil { - return - } - - alreadySet := false - for _, b := range c.SessionTicketKey { - if b != 0 { - alreadySet = true - break - } - } - - if !alreadySet { - if originalConfig != nil { - copy(c.SessionTicketKey[:], originalConfig.SessionTicketKey[:]) - } else if _, err := io.ReadFull(c.rand(), c.SessionTicketKey[:]); err != nil { - c.SessionTicketsDisabled = true - return - } - } - - if originalConfig != nil { - originalConfig.mutex.RLock() - c.sessionTicketKeys = originalConfig.sessionTicketKeys - originalConfig.mutex.RUnlock() - } else { - c.sessionTicketKeys = []ticketKey{ticketKeyFromBytes(c.SessionTicketKey)} - } -} - -func (c *Config) ticketKeys() []ticketKey { - c.mutex.RLock() - // c.sessionTicketKeys is constant once created. SetSessionTicketKeys - // will only update it by replacing it with a new value. - ret := c.sessionTicketKeys - c.mutex.RUnlock() - return ret -} - -// SetSessionTicketKeys updates the session ticket keys for a server. The first -// key will be used when creating new tickets, while all keys can be used for -// decrypting tickets. It is safe to call this function while the server is -// running in order to rotate the session ticket keys. The function will panic -// if keys is empty. -func (c *Config) SetSessionTicketKeys(keys [][32]byte) { - if len(keys) == 0 { - panic("tls: keys must have at least one key") - } - - newKeys := make([]ticketKey, len(keys)) - for i, bytes := range keys { - newKeys[i] = ticketKeyFromBytes(bytes) - } - - c.mutex.Lock() - c.sessionTicketKeys = newKeys - c.mutex.Unlock() -} - -func (c *Config) rand() io.Reader { - r := c.Rand - if r == nil { - return rand.Reader - } - return r -} - -func (c *Config) time() time.Time { - t := c.Time - if t == nil { - t = time.Now - } - return t() -} - -func hasOverlappingCipherSuites(cs1, cs2 []uint16) bool { - for _, c1 := range cs1 { - for _, c2 := range cs2 { - if c1 == c2 { - return true - } - } - } - return false -} - -func (c *Config) cipherSuites() []uint16 { - s := c.CipherSuites - if s == nil { - s = defaultCipherSuites() - } else if c.maxVersion() >= VersionTLS13 { - // Ensure that TLS 1.3 suites are always present, but respect - // the application cipher suite preferences. - s13 := defaultTLS13CipherSuites() - if !hasOverlappingCipherSuites(s, s13) { - allSuites := make([]uint16, len(s13)+len(s)) - allSuites = append(allSuites, s13...) - s = append(allSuites, s...) - } - } - return s -} - -func (c *Config) minVersion() uint16 { - if c == nil || c.MinVersion == 0 { - return minVersion - } - return c.MinVersion -} - -func (c *Config) maxVersion() uint16 { - if c == nil || c.MaxVersion == 0 { - return maxVersion - } - return c.MaxVersion -} - -var defaultCurvePreferences = []CurveID{X25519, CurveP256, CurveP384, CurveP521} - -func (c *Config) curvePreferences() []CurveID { - if c == nil || len(c.CurvePreferences) == 0 { - return defaultCurvePreferences - } - return c.CurvePreferences -} - -// mutualVersion returns the protocol version to use given the advertised -// version of the peer using the legacy non-extension methods. -func (c *Config) mutualVersion(vers uint16) (uint16, bool) { - minVersion := c.minVersion() - maxVersion := c.maxVersion() - - // Version 1.3 and higher are not negotiated via this mechanism. - if maxVersion > VersionTLS12 { - maxVersion = VersionTLS12 - } - - if vers < minVersion { - return 0, false - } - if vers > maxVersion { - vers = maxVersion - } - return vers, true -} - -// pickVersion returns the protocol version to use given the advertised -// versions of the peer using the Supported Versions extension. -func (c *Config) pickVersion(peerSupportedVersions []uint16) (uint16, bool) { - supportedVersions := c.getSupportedVersions() - for _, supportedVersion := range supportedVersions { - for _, version := range peerSupportedVersions { - if version == supportedVersion { - return version, true - } - } - } - return 0, false -} - -// configSuppVersArray is the backing array of Config.getSupportedVersions -var configSuppVersArray = [...]uint16{VersionTLS13, VersionTLS12, VersionTLS11, VersionTLS10, VersionSSL30} - -// getSupportedVersions returns the protocol versions that are supported by the -// current configuration. -func (c *Config) getSupportedVersions() []uint16 { - minVersion := c.minVersion() - maxVersion := c.maxVersion() - // Sanity check to avoid advertising unsupported versions. - if minVersion < VersionSSL30 { - minVersion = VersionSSL30 - } - if maxVersion > VersionTLS13 { - maxVersion = VersionTLS13 - } - if maxVersion < minVersion { - return nil - } - return configSuppVersArray[VersionTLS13-maxVersion : VersionTLS13-minVersion+1] -} - -// getCertificate returns the best certificate for the given ClientHelloInfo, -// defaulting to the first element of c.Certificates. -func (c *Config) getCertificate(clientHello *ClientHelloInfo) (*Certificate, error) { - if c.GetCertificate != nil && - (len(c.Certificates) == 0 || len(clientHello.ServerName) > 0) { - cert, err := c.GetCertificate(clientHello) - if cert != nil || err != nil { - return cert, err - } - } - - if len(c.Certificates) == 0 { - return nil, errors.New("tls: no certificates configured") - } - - if len(c.Certificates) == 1 || c.NameToCertificate == nil { - // There's only one choice, so no point doing any work. - return &c.Certificates[0], nil - } - - name := strings.ToLower(clientHello.ServerName) - for len(name) > 0 && name[len(name)-1] == '.' { - name = name[:len(name)-1] - } - - if cert, ok := c.NameToCertificate[name]; ok { - return cert, nil - } - - // try replacing labels in the name with wildcards until we get a - // match. - labels := strings.Split(name, ".") - for i := range labels { - labels[i] = "*" - candidate := strings.Join(labels, ".") - if cert, ok := c.NameToCertificate[candidate]; ok { - return cert, nil - } - } - - // If nothing matches, return the first certificate. - return &c.Certificates[0], nil -} - -// BuildNameToCertificate parses c.Certificates and builds c.NameToCertificate -// from the CommonName and SubjectAlternateName fields of each of the leaf -// certificates. -func (c *Config) BuildNameToCertificate() { - c.NameToCertificate = make(map[string]*Certificate) - for i := range c.Certificates { - cert := &c.Certificates[i] - x509Cert, err := x509.ParseCertificate(cert.Certificate[0]) - if err != nil { - continue - } - if len(x509Cert.Subject.CommonName) > 0 { - c.NameToCertificate[x509Cert.Subject.CommonName] = cert - } - for _, san := range x509Cert.DNSNames { - c.NameToCertificate[san] = cert - } - } -} - -// writeKeyLog logs client random and master secret if logging was enabled by -// setting c.KeyLogWriter. -func (c *Config) writeKeyLog(what string, clientRandom, masterSecret []byte) error { - if c.KeyLogWriter == nil { - return nil - } - - logLine := []byte(fmt.Sprintf("%s %x %x\n", what, clientRandom, masterSecret)) - - writerMutex.Lock() - _, err := c.KeyLogWriter.Write(logLine) - writerMutex.Unlock() - - return err -} - -// writerMutex protects all KeyLogWriters globally. It is rarely enabled, -// and is only for debugging, so a global mutex saves space. -var writerMutex sync.Mutex - -// A Certificate is a tls.Certificate -type Certificate = tls.Certificate - -type handshakeMessage interface { - marshal() []byte - unmarshal([]byte) alert -} - -// lruSessionCache is a ClientSessionCache implementation that uses an LRU -// caching strategy. -type lruSessionCache struct { - sync.Mutex - - m map[string]*list.Element - q *list.List - capacity int -} - -type lruSessionCacheEntry struct { - sessionKey string - state *ClientSessionState -} - -// NewLRUClientSessionCache returns a ClientSessionCache with the given -// capacity that uses an LRU strategy. If capacity is < 1, a default capacity -// is used instead. -func NewLRUClientSessionCache(capacity int) ClientSessionCache { - const defaultSessionCacheCapacity = 64 - - if capacity < 1 { - capacity = defaultSessionCacheCapacity - } - return &lruSessionCache{ - m: make(map[string]*list.Element), - q: list.New(), - capacity: capacity, - } -} - -// Put adds the provided (sessionKey, cs) pair to the cache. -func (c *lruSessionCache) Put(sessionKey string, cs *ClientSessionState) { - c.Lock() - defer c.Unlock() - - if elem, ok := c.m[sessionKey]; ok { - entry := elem.Value.(*lruSessionCacheEntry) - entry.state = cs - c.q.MoveToFront(elem) - return - } - - if c.q.Len() < c.capacity { - entry := &lruSessionCacheEntry{sessionKey, cs} - c.m[sessionKey] = c.q.PushFront(entry) - return - } - - elem := c.q.Back() - entry := elem.Value.(*lruSessionCacheEntry) - delete(c.m, entry.sessionKey) - entry.sessionKey = sessionKey - entry.state = cs - c.q.MoveToFront(elem) - c.m[sessionKey] = elem -} - -// Get returns the ClientSessionState value associated with a given key. It -// returns (nil, false) if no value is found. -func (c *lruSessionCache) Get(sessionKey string) (*ClientSessionState, bool) { - c.Lock() - defer c.Unlock() - - if elem, ok := c.m[sessionKey]; ok { - c.q.MoveToFront(elem) - return elem.Value.(*lruSessionCacheEntry).state, true - } - return nil, false -} - -// TODO(jsing): Make these available to both crypto/x509 and crypto/tls. -type dsaSignature struct { - R, S *big.Int -} - -type ecdsaSignature dsaSignature - -var emptyConfig Config - -func defaultConfig() *Config { - return &emptyConfig -} - -var ( - once sync.Once - varDefaultCipherSuites []uint16 - varDefaultTLS13CipherSuites []uint16 -) - -func defaultCipherSuites() []uint16 { - once.Do(initDefaultCipherSuites) - return varDefaultCipherSuites -} - -func defaultTLS13CipherSuites() []uint16 { - once.Do(initDefaultCipherSuites) - return varDefaultTLS13CipherSuites -} - -func initDefaultCipherSuites() { - var topCipherSuites, topTLS13CipherSuites []uint16 - - // TODO: check for hardware support - // Check the cpu flags for each platform that has optimized GCM implementations. - // Worst case, these variables will just all be false - // hasGCMAsmAMD64 := cpu.X86.HasAES && cpu.X86.HasPCLMULQDQ - - // hasGCMAsmARM64 := cpu.ARM64.HasAES && cpu.ARM64.HasPMULL - - // // Keep in sync with crypto/aes/cipher_s390x.go. - // hasGCMAsmS390X := cpu.S390X.HasAES && cpu.S390X.HasAESCBC && cpu.S390X.HasAESCTR && (cpu.S390X.HasGHASH || cpu.S390X.HasAESGCM) - - // hasGCMAsm := hasGCMAsmAMD64 || hasGCMAsmARM64 || hasGCMAsmS390X - - if true { - // If AES-GCM hardware is provided then prioritise AES-GCM - // cipher suites. - topTLS13CipherSuites = []uint16{ - TLS_AES_128_GCM_SHA256, - TLS_AES_256_GCM_SHA384, - TLS_CHACHA20_POLY1305_SHA256, - } - topCipherSuites = []uint16{ - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - } - } else { - // Without AES-GCM hardware, we put the ChaCha20-Poly1305 - // cipher suites first. - topTLS13CipherSuites = []uint16{ - TLS_CHACHA20_POLY1305_SHA256, - TLS_AES_128_GCM_SHA256, - TLS_AES_256_GCM_SHA384, - } - topCipherSuites = []uint16{ - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - } - } - - varDefaultTLS13CipherSuites = make([]uint16, 0, len(cipherSuites)) - varDefaultTLS13CipherSuites = append(varDefaultTLS13CipherSuites, topTLS13CipherSuites...) - varDefaultCipherSuites = make([]uint16, 0, len(cipherSuites)) - varDefaultCipherSuites = append(varDefaultCipherSuites, topCipherSuites...) - -NextCipherSuite: - for _, suite := range cipherSuites { - if suite.flags&suiteDefaultOff != 0 { - continue - } - if suite.flags&suiteTLS13 != 0 { - for _, existing := range varDefaultTLS13CipherSuites { - if existing == suite.id { - continue NextCipherSuite - } - } - varDefaultTLS13CipherSuites = append(varDefaultTLS13CipherSuites, suite.id) - } else { - for _, existing := range varDefaultCipherSuites { - if existing == suite.id { - continue NextCipherSuite - } - } - varDefaultCipherSuites = append(varDefaultCipherSuites, suite.id) - } - } - varDefaultCipherSuites = append(varDefaultTLS13CipherSuites, varDefaultCipherSuites...) -} - -func unexpectedMessageError(wanted, got interface{}) error { - return fmt.Errorf("tls: received unexpected handshake message of type %T when waiting for %T", got, wanted) -} - -func isSupportedSignatureAlgorithm(sigAlg SignatureScheme, supportedSignatureAlgorithms []SignatureScheme) bool { - for _, s := range supportedSignatureAlgorithms { - if s == sigAlg { - return true - } - } - return false -} - -// signatureFromSignatureScheme maps a signature algorithm to the underlying -// signature method (without hash function). -func signatureFromSignatureScheme(signatureAlgorithm SignatureScheme) uint8 { - switch signatureAlgorithm { - case PKCS1WithSHA1, PKCS1WithSHA256, PKCS1WithSHA384, PKCS1WithSHA512: - return signaturePKCS1v15 - case PSSWithSHA256, PSSWithSHA384, PSSWithSHA512: - return signatureRSAPSS - case ECDSAWithSHA1, ECDSAWithP256AndSHA256, ECDSAWithP384AndSHA384, ECDSAWithP521AndSHA512: - return signatureECDSA - default: - return 0 - } -} - -// TODO(kk): Use variable length encoding? -func getUint24(b []byte) int { - n := int(b[2]) - n += int(b[1] << 8) - n += int(b[0] << 16) - return n -} - -func putUint24(b []byte, n int) { - b[0] = byte(n >> 16) - b[1] = byte(n >> 8) - b[2] = byte(n & 0xff) -} diff --git a/external/github.com/marten-seemann/qtls/conn.go b/external/github.com/marten-seemann/qtls/conn.go deleted file mode 100644 index 669315399a..0000000000 --- a/external/github.com/marten-seemann/qtls/conn.go +++ /dev/null @@ -1,1771 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// TLS low level connection and record layer - -package qtls - -import ( - "bytes" - "crypto/cipher" - "crypto/subtle" - "crypto/x509" - "encoding/binary" - "errors" - "fmt" - "io" - "net" - "sync" - "sync/atomic" - "time" -) - -// A Conn represents a secured connection. -// It implements the net.Conn interface. -type Conn struct { - // constant - conn net.Conn - isClient bool - - phase handshakeStatus // protected by in.Mutex - // handshakeConfirmed is an atomic bool for phase == handshakeConfirmed - handshakeConfirmed int32 - // confirmMutex is held by any read operation before handshakeConfirmed - confirmMutex sync.Mutex - - // constant after handshake; protected by handshakeMutex - handshakeMutex sync.Mutex // handshakeMutex < in.Mutex, out.Mutex, errMutex - handshakeErr error // error resulting from handshake - connID []byte // Random connection id - clientHello []byte // ClientHello packet contents - vers uint16 // TLS version - haveVers bool // version has been negotiated - config *Config // configuration passed to constructor - // handshakeComplete is true if the connection reached application data - // and it's equivalent to phase > handshakeRunning - handshakeComplete bool - // handshakes counts the number of handshakes performed on the - // connection so far. If renegotiation is disabled then this is either - // zero or one. - handshakes int - didResume bool // whether this connection was a session resumption - cipherSuite uint16 - ocspResponse []byte // stapled OCSP response - scts [][]byte // Signed certificate timestamps from server - peerCertificates []*x509.Certificate - // verifiedChains contains the certificate chains that we built, as - // opposed to the ones presented by the server. - verifiedChains [][]*x509.Certificate - // verifiedDc is set by a client who negotiates the use of a valid delegated - // credential. - verifiedDc *delegatedCredential - // serverName contains the server name indicated by the client, if any. - serverName string - // secureRenegotiation is true if the server echoed the secure - // renegotiation extension. (This is meaningless as a server because - // renegotiation is not supported in that case.) - secureRenegotiation bool - // indicates wether extended MasterSecret extension is used (see RFC7627) - useEMS bool - - // clientFinishedIsFirst is true if the client sent the first Finished - // message during the most recent handshake. This is recorded because - // the first transmitted Finished message is the tls-unique - // channel-binding value. - clientFinishedIsFirst bool - - // closeNotifyErr is any error from sending the alertCloseNotify record. - closeNotifyErr error - // closeNotifySent is true if the Conn attempted to send an - // alertCloseNotify record. - closeNotifySent bool - - // clientFinished and serverFinished contain the Finished message sent - // by the client or server in the most recent handshake. This is - // retained to support the renegotiation extension and tls-unique - // channel-binding. - clientFinished [12]byte - serverFinished [12]byte - - clientProtocol string - clientProtocolFallback bool - - // ticketMaxEarlyData is the maximum bytes of 0-RTT application data - // that the client is allowed to send on the ticket it used. - ticketMaxEarlyData int64 - - // input/output - in, out halfConn // in.Mutex < out.Mutex - rawInput *block // raw input, right off the wire - input *block // application data waiting to be read - hand bytes.Buffer // handshake data waiting to be read - buffering bool // whether records are buffered in sendBuf - sendBuf []byte // a buffer of records waiting to be sent - - // bytesSent counts the bytes of application data sent. - // packetsSent counts packets. - bytesSent int64 - packetsSent int64 - - // warnCount counts the number of consecutive warning alerts received - // by Conn.readRecord. Protected by in.Mutex. - warnCount int - - // activeCall is an atomic int32; the low bit is whether Close has - // been called. the rest of the bits are the number of goroutines - // in Conn.Write. - activeCall int32 - - // TLS 1.3 needs the server state until it reaches the Client Finished - hs *serverHandshakeState - - // earlyDataBytes is the number of bytes of early data received so - // far. Tracked to enforce max_early_data_size. - // We don't keep track of rejected 0-RTT data since there's no need - // to ever buffer it. in.Mutex. - earlyDataBytes int64 - - // binder is the value of the PSK binder that was validated to - // accept the 0-RTT data. Exposed as ConnectionState.Unique0RTTToken. - binder []byte - - tmp [16]byte -} - -type handshakeStatus int - -const ( - handshakeRunning handshakeStatus = iota - discardingEarlyData - readingEarlyData - waitingClientFinished - readingClientFinished - handshakeConfirmed -) - -// Access to net.Conn methods. -// Cannot just embed net.Conn because that would -// export the struct field too. - -// LocalAddr returns the local network address. -func (c *Conn) LocalAddr() net.Addr { - return c.conn.LocalAddr() -} - -// RemoteAddr returns the remote network address. -func (c *Conn) RemoteAddr() net.Addr { - return c.conn.RemoteAddr() -} - -// SetDeadline sets the read and write deadlines associated with the connection. -// A zero value for t means Read and Write will not time out. -// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error. -func (c *Conn) SetDeadline(t time.Time) error { - return c.conn.SetDeadline(t) -} - -// SetReadDeadline sets the read deadline on the underlying connection. -// A zero value for t means Read will not time out. -func (c *Conn) SetReadDeadline(t time.Time) error { - return c.conn.SetReadDeadline(t) -} - -// SetWriteDeadline sets the write deadline on the underlying connection. -// A zero value for t means Write will not time out. -// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error. -func (c *Conn) SetWriteDeadline(t time.Time) error { - return c.conn.SetWriteDeadline(t) -} - -// A halfConn represents one direction of the record layer -// connection, either sending or receiving. -type halfConn struct { - sync.Mutex - - err error // first permanent error - version uint16 // protocol version - cipher interface{} // cipher algorithm - mac macFunction - seq [8]byte // 64-bit sequence number - bfree *block // list of free blocks - additionalData [13]byte // to avoid allocs; interface method args escape - - nextCipher interface{} // next encryption state - nextMac macFunction // next MAC algorithm - - // used to save allocating a new buffer for each MAC. - inDigestBuf, outDigestBuf []byte - - setKeyCallback func(suite *CipherSuite, trafficSecret []byte) - - traceErr func(error) -} - -func (hc *halfConn) setErrorLocked(err error) error { - hc.err = err - if hc.traceErr != nil { - hc.traceErr(err) - } - return err -} - -// prepareCipherSpec sets the encryption and MAC states -// that a subsequent changeCipherSpec will use. -func (hc *halfConn) prepareCipherSpec(version uint16, cipher interface{}, mac macFunction) { - hc.version = version - hc.nextCipher = cipher - hc.nextMac = mac -} - -// changeCipherSpec changes the encryption and MAC states -// to the ones previously passed to prepareCipherSpec. -func (hc *halfConn) changeCipherSpec() error { - if hc.nextCipher == nil { - return alertInternalError - } - hc.cipher = hc.nextCipher - hc.mac = hc.nextMac - hc.nextCipher = nil - hc.nextMac = nil - for i := range hc.seq { - hc.seq[i] = 0 - } - return nil -} - -func (hc *halfConn) exportKey(suite *cipherSuite, trafficSecret []byte) { - if hc.setKeyCallback != nil { - hc.setKeyCallback(&CipherSuite{*suite}, trafficSecret) - } -} - -func (hc *halfConn) setKey(version uint16, suite *cipherSuite, trafficSecret []byte) { - if hc.setKeyCallback != nil { - return - } - hc.version = version - hash := hashForSuite(suite) - key := hkdfExpandLabel(hash, trafficSecret, nil, "key", suite.keyLen) - iv := hkdfExpandLabel(hash, trafficSecret, nil, "iv", suite.ivLen) - hc.cipher = suite.aead(key, iv) - for i := range hc.seq { - hc.seq[i] = 0 - } -} - -// incSeq increments the sequence number. -func (hc *halfConn) incSeq() { - for i := 7; i >= 0; i-- { - hc.seq[i]++ - if hc.seq[i] != 0 { - return - } - } - - // Not allowed to let sequence number wrap. - // Instead, must renegotiate before it does. - // Not likely enough to bother. - panic("TLS: sequence number wraparound") -} - -// extractPadding returns, in constant time, the length of the padding to remove -// from the end of payload. It also returns a byte which is equal to 255 if the -// padding was valid and 0 otherwise. See RFC 2246, section 6.2.3.2 -func extractPadding(payload []byte) (toRemove int, good byte) { - if len(payload) < 1 { - return 0, 0 - } - - paddingLen := payload[len(payload)-1] - t := uint(len(payload)-1) - uint(paddingLen) - // if len(payload) >= (paddingLen - 1) then the MSB of t is zero - good = byte(int32(^t) >> 31) - - // The maximum possible padding length plus the actual length field - toCheck := 256 - // The length of the padded data is public, so we can use an if here - if toCheck > len(payload) { - toCheck = len(payload) - } - - for i := 0; i < toCheck; i++ { - t := uint(paddingLen) - uint(i) - // if i <= paddingLen then the MSB of t is zero - mask := byte(int32(^t) >> 31) - b := payload[len(payload)-1-i] - good &^= mask&paddingLen ^ mask&b - } - - // We AND together the bits of good and replicate the result across - // all the bits. - good &= good << 4 - good &= good << 2 - good &= good << 1 - good = uint8(int8(good) >> 7) - - toRemove = int(paddingLen) + 1 - return -} - -// extractPaddingSSL30 is a replacement for extractPadding in the case that the -// protocol version is SSLv3. In this version, the contents of the padding -// are random and cannot be checked. -func extractPaddingSSL30(payload []byte) (toRemove int, good byte) { - if len(payload) < 1 { - return 0, 0 - } - - paddingLen := int(payload[len(payload)-1]) + 1 - if paddingLen > len(payload) { - return 0, 0 - } - - return paddingLen, 255 -} - -func roundUp(a, b int) int { - return a + (b-a%b)%b -} - -// cbcMode is an interface for block ciphers using cipher block chaining. -type cbcMode interface { - cipher.BlockMode - SetIV([]byte) -} - -// decrypt checks and strips the mac and decrypts the data in b. Returns a -// success boolean, the number of bytes to skip from the start of the record in -// order to get the application payload, and an optional alert value. -func (hc *halfConn) decrypt(b *block) (ok bool, prefixLen int, alertValue alert) { - // pull out payload - payload := b.data[recordHeaderLen:] - - macSize := 0 - if hc.mac != nil { - macSize = hc.mac.Size() - } - - paddingGood := byte(255) - paddingLen := 0 - explicitIVLen := 0 - - // decrypt - if hc.cipher != nil { - switch c := hc.cipher.(type) { - case cipher.Stream: - c.XORKeyStream(payload, payload) - case aead: - explicitIVLen = c.explicitNonceLen() - if len(payload) < explicitIVLen { - return false, 0, alertBadRecordMAC - } - nonce := payload[:explicitIVLen] - payload = payload[explicitIVLen:] - - if len(nonce) == 0 { - nonce = hc.seq[:] - } - - var additionalData []byte - if hc.version < VersionTLS13 { - copy(hc.additionalData[:], hc.seq[:]) - copy(hc.additionalData[8:], b.data[:3]) - n := len(payload) - c.Overhead() - hc.additionalData[11] = byte(n >> 8) - hc.additionalData[12] = byte(n) - additionalData = hc.additionalData[:] - } else { - if len(payload) > int((1<<14)+256) { - return false, 0, alertRecordOverflow - } - // Check AD header, see 5.2 of RFC8446 - additionalData = make([]byte, 5) - additionalData[0] = byte(recordTypeApplicationData) - binary.BigEndian.PutUint16(additionalData[1:], VersionTLS12) - binary.BigEndian.PutUint16(additionalData[3:], uint16(len(payload))) - } - var err error - payload, err = c.Open(payload[:0], nonce, payload, additionalData) - if err != nil { - return false, 0, alertBadRecordMAC - } - b.resize(recordHeaderLen + explicitIVLen + len(payload)) - case cbcMode: - blockSize := c.BlockSize() - if hc.version >= VersionTLS11 { - explicitIVLen = blockSize - } - - if len(payload)%blockSize != 0 || len(payload) < roundUp(explicitIVLen+macSize+1, blockSize) { - return false, 0, alertBadRecordMAC - } - - if explicitIVLen > 0 { - c.SetIV(payload[:explicitIVLen]) - payload = payload[explicitIVLen:] - } - c.CryptBlocks(payload, payload) - if hc.version == VersionSSL30 { - paddingLen, paddingGood = extractPaddingSSL30(payload) - } else { - paddingLen, paddingGood = extractPadding(payload) - - // To protect against CBC padding oracles like Lucky13, the data - // past paddingLen (which is secret) is passed to the MAC - // function as extra data, to be fed into the HMAC after - // computing the digest. This makes the MAC constant time as - // long as the digest computation is constant time and does not - // affect the subsequent write. - } - default: - panic("unknown cipher type") - } - } - - // check, strip mac - if hc.mac != nil { - if len(payload) < macSize { - return false, 0, alertBadRecordMAC - } - - // strip mac off payload, b.data - n := len(payload) - macSize - paddingLen - n = subtle.ConstantTimeSelect(int(uint32(n)>>31), 0, n) // if n < 0 { n = 0 } - b.data[3] = byte(n >> 8) - b.data[4] = byte(n) - remoteMAC := payload[n : n+macSize] - localMAC := hc.mac.MAC(hc.inDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], payload[:n], payload[n+macSize:]) - - if subtle.ConstantTimeCompare(localMAC, remoteMAC) != 1 || paddingGood != 255 { - return false, 0, alertBadRecordMAC - } - hc.inDigestBuf = localMAC - - b.resize(recordHeaderLen + explicitIVLen + n) - } - hc.incSeq() - - return true, recordHeaderLen + explicitIVLen, 0 -} - -// padToBlockSize calculates the needed padding block, if any, for a payload. -// On exit, prefix aliases payload and extends to the end of the last full -// block of payload. finalBlock is a fresh slice which contains the contents of -// any suffix of payload as well as the needed padding to make finalBlock a -// full block. -func padToBlockSize(payload []byte, blockSize int) (prefix, finalBlock []byte) { - overrun := len(payload) % blockSize - paddingLen := blockSize - overrun - prefix = payload[:len(payload)-overrun] - finalBlock = make([]byte, blockSize) - copy(finalBlock, payload[len(payload)-overrun:]) - for i := overrun; i < blockSize; i++ { - finalBlock[i] = byte(paddingLen - 1) - } - return -} - -// encrypt encrypts and macs the data in b. -func (hc *halfConn) encrypt(b *block, explicitIVLen int) (bool, alert) { - // mac - if hc.mac != nil { - mac := hc.mac.MAC(hc.outDigestBuf, hc.seq[0:], b.data[:recordHeaderLen], b.data[recordHeaderLen+explicitIVLen:], nil) - - n := len(b.data) - b.resize(n + len(mac)) - copy(b.data[n:], mac) - hc.outDigestBuf = mac - } - - payload := b.data[recordHeaderLen:] - - // encrypt - if hc.cipher != nil { - switch c := hc.cipher.(type) { - case cipher.Stream: - c.XORKeyStream(payload, payload) - case aead: - // explicitIVLen is always 0 for TLS1.3 - payloadLen := len(b.data) - recordHeaderLen - explicitIVLen - payloadOffset := recordHeaderLen + explicitIVLen - nonce := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen] - if len(nonce) == 0 { - nonce = hc.seq[:] - } - - var additionalData []byte - if hc.version < VersionTLS13 { - // make room in a buffer for payload + MAC - b.resize(len(b.data) + c.Overhead()) - - payload = b.data[payloadOffset : payloadOffset+payloadLen] - copy(hc.additionalData[:], hc.seq[:]) - copy(hc.additionalData[8:], b.data[:3]) - binary.BigEndian.PutUint16(hc.additionalData[11:], uint16(payloadLen)) - additionalData = hc.additionalData[:] - } else { - // make room in a buffer for TLSCiphertext.encrypted_record: - // payload + MAC + extra data if needed - b.resize(len(b.data) + c.Overhead() + 1) - - payload = b.data[payloadOffset : payloadOffset+payloadLen+1] - // 1 byte of content type is appended to payload and encrypted - payload[len(payload)-1] = b.data[0] - - // opaque_type - b.data[0] = byte(recordTypeApplicationData) - - // Add AD header, see 5.2 of RFC8446 - additionalData = make([]byte, 5) - additionalData[0] = b.data[0] - binary.BigEndian.PutUint16(additionalData[1:], VersionTLS12) - binary.BigEndian.PutUint16(additionalData[3:], uint16(len(payload)+c.Overhead())) - } - c.Seal(payload[:0], nonce, payload, additionalData) - case cbcMode: - blockSize := c.BlockSize() - if explicitIVLen > 0 { - c.SetIV(payload[:explicitIVLen]) - payload = payload[explicitIVLen:] - } - prefix, finalBlock := padToBlockSize(payload, blockSize) - b.resize(recordHeaderLen + explicitIVLen + len(prefix) + len(finalBlock)) - c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen:], prefix) - c.CryptBlocks(b.data[recordHeaderLen+explicitIVLen+len(prefix):], finalBlock) - default: - panic("unknown cipher type") - } - } - - // update length to include MAC and any block padding needed. - n := len(b.data) - recordHeaderLen - b.data[3] = byte(n >> 8) - b.data[4] = byte(n) - hc.incSeq() - - return true, 0 -} - -// A block is a simple data buffer. -type block struct { - data []byte - off int // index for Read - link *block -} - -// resize resizes block to be n bytes, growing if necessary. -func (b *block) resize(n int) { - if n > cap(b.data) { - b.reserve(n) - } - b.data = b.data[0:n] -} - -// reserve makes sure that block contains a capacity of at least n bytes. -func (b *block) reserve(n int) { - if cap(b.data) >= n { - return - } - m := cap(b.data) - if m == 0 { - m = 1024 - } - for m < n { - m *= 2 - } - data := make([]byte, len(b.data), m) - copy(data, b.data) - b.data = data -} - -// readFromUntil reads from r into b until b contains at least n bytes -// or else returns an error. -func (b *block) readFromUntil(r io.Reader, n int) error { - // quick case - if len(b.data) >= n { - return nil - } - - // read until have enough. - b.reserve(n) - for { - m, err := r.Read(b.data[len(b.data):cap(b.data)]) - b.data = b.data[0 : len(b.data)+m] - if len(b.data) >= n { - // TODO(bradfitz,agl): slightly suspicious - // that we're throwing away r.Read's err here. - break - } - if err != nil { - return err - } - } - return nil -} - -func (b *block) Read(p []byte) (n int, err error) { - n = copy(p, b.data[b.off:]) - b.off += n - if b.off >= len(b.data) { - err = io.EOF - } - return -} - -// newBlock allocates a new block, from hc's free list if possible. -func (hc *halfConn) newBlock() *block { - b := hc.bfree - if b == nil { - return new(block) - } - hc.bfree = b.link - b.link = nil - b.resize(0) - return b -} - -// freeBlock returns a block to hc's free list. -// The protocol is such that each side only has a block or two on -// its free list at a time, so there's no need to worry about -// trimming the list, etc. -func (hc *halfConn) freeBlock(b *block) { - b.link = hc.bfree - hc.bfree = b -} - -// splitBlock splits a block after the first n bytes, -// returning a block with those n bytes and a -// block with the remainder. the latter may be nil. -func (hc *halfConn) splitBlock(b *block, n int) (*block, *block) { - if len(b.data) <= n { - return b, nil - } - bb := hc.newBlock() - bb.resize(len(b.data) - n) - copy(bb.data, b.data[n:]) - b.data = b.data[0:n] - return b, bb -} - -// RecordHeaderError results when a TLS record header is invalid. -type RecordHeaderError struct { - // Msg contains a human readable string that describes the error. - Msg string - // RecordHeader contains the five bytes of TLS record header that - // triggered the error. - RecordHeader [5]byte -} - -func (e RecordHeaderError) Error() string { return "tls: " + e.Msg } - -func (c *Conn) newRecordHeaderError(msg string) (err RecordHeaderError) { - err.Msg = msg - copy(err.RecordHeader[:], c.rawInput.data) - return err -} - -// readRecord reads the next TLS record from the connection -// and updates the record layer state. -// c.in.Mutex <= L; c.input == nil. -// c.input can still be nil after a call, retry if so. -func (c *Conn) readRecord(want recordType) error { - // Caller must be in sync with connection: - // handshake data if handshake not yet completed, - // else application data. - switch want { - default: - c.sendAlert(alertInternalError) - return c.in.setErrorLocked(errors.New("tls: unknown record type requested")) - case recordTypeHandshake, recordTypeChangeCipherSpec: - if c.phase != handshakeRunning && c.phase != readingClientFinished { - c.sendAlert(alertInternalError) - return c.in.setErrorLocked(errors.New("tls: handshake or ChangeCipherSpec requested while not in handshake")) - } - case recordTypeApplicationData: - if c.phase == handshakeRunning || c.phase == readingClientFinished { - c.sendAlert(alertInternalError) - return c.in.setErrorLocked(errors.New("tls: application data record requested while in handshake")) - } - } - -Again: - if c.rawInput == nil { - c.rawInput = c.in.newBlock() - } - b := c.rawInput - - // Read header, payload. - if err := b.readFromUntil(c.conn, recordHeaderLen); err != nil { - // RFC suggests that EOF without an alertCloseNotify is - // an error, but popular web sites seem to do this, - // so we can't make it an error. - // if err == io.EOF { - // err = io.ErrUnexpectedEOF - // } - if e, ok := err.(net.Error); !ok || !e.Temporary() { - c.in.setErrorLocked(err) - } - return err - } - typ := recordType(b.data[0]) - - // No valid TLS record has a type of 0x80, however SSLv2 handshakes - // start with a uint16 length where the MSB is set and the first record - // is always < 256 bytes long. Therefore typ == 0x80 strongly suggests - // an SSLv2 client. - if want == recordTypeHandshake && typ == 0x80 { - c.sendAlert(alertProtocolVersion) - return c.in.setErrorLocked(c.newRecordHeaderError("unsupported SSLv2 handshake received")) - } - - vers := uint16(b.data[1])<<8 | uint16(b.data[2]) - n := int(b.data[3])<<8 | int(b.data[4]) - if n > maxCiphertext { - c.sendAlert(alertRecordOverflow) - msg := fmt.Sprintf("oversized record received with length %d", n) - return c.in.setErrorLocked(c.newRecordHeaderError(msg)) - } - if !c.haveVers { - // First message, be extra suspicious: this might not be a TLS - // client. Bail out before reading a full 'body', if possible. - // The current max version is 3.3 so if the version is >= 16.0, - // it's probably not real. - if (typ != recordTypeAlert && typ != want) || vers >= 0x1000 { - c.sendAlert(alertUnexpectedMessage) - return c.in.setErrorLocked(c.newRecordHeaderError("first record does not look like a TLS handshake")) - } - } - if err := b.readFromUntil(c.conn, recordHeaderLen+n); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - if e, ok := err.(net.Error); !ok || !e.Temporary() { - c.in.setErrorLocked(err) - } - return err - } - - // Process message. - b, c.rawInput = c.in.splitBlock(b, recordHeaderLen+n) - - // TLS 1.3 middlebox compatibility: skip over unencrypted CCS. - if c.vers >= VersionTLS13 && typ == recordTypeChangeCipherSpec && c.phase != handshakeConfirmed { - if len(b.data) != 6 || b.data[5] != 1 { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - c.in.freeBlock(b) - return c.in.err - } - - peekedAlert := peekAlert(b) // peek at a possible alert before decryption - ok, off, alertValue := c.in.decrypt(b) - switch { - case !ok && c.phase == discardingEarlyData: - // If the client said that it's sending early data and we did not - // accept it, we are expected to fail decryption. - c.in.freeBlock(b) - return nil - case ok && c.phase == discardingEarlyData: - c.phase = waitingClientFinished - case !ok: - c.in.traceErr, c.out.traceErr = nil, nil // not that interesting - c.in.freeBlock(b) - err := c.sendAlert(alertValue) - // If decryption failed because the message is an unencrypted - // alert, return a more meaningful error message - if alertValue == alertBadRecordMAC && peekedAlert != nil { - err = peekedAlert - } - return c.in.setErrorLocked(err) - } - b.off = off - data := b.data[b.off:] - if (c.vers < VersionTLS13 && len(data) > maxPlaintext) || len(data) > maxPlaintext+1 { - c.in.freeBlock(b) - return c.in.setErrorLocked(c.sendAlert(alertRecordOverflow)) - } - - // After checking the plaintext length, remove 1.3 padding and - // extract the real content type. - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-5.4. - if c.vers >= VersionTLS13 { - i := len(data) - 1 - for i >= 0 { - if data[i] != 0 { - break - } - i-- - } - if i < 0 { - c.in.freeBlock(b) - return c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - typ = recordType(data[i]) - data = data[:i] - b.resize(b.off + i) // shrinks, guaranteed not to reallocate - } - - if typ != recordTypeAlert && len(data) > 0 { - // this is a valid non-alert message: reset the count of alerts - c.warnCount = 0 - } - - switch typ { - default: - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - - case recordTypeAlert: - if len(data) != 2 { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - break - } - if alert(data[1]) == alertCloseNotify { - c.in.setErrorLocked(io.EOF) - break - } - switch data[0] { - case alertLevelWarning: - // drop on the floor - c.in.freeBlock(b) - - c.warnCount++ - if c.warnCount > maxWarnAlertCount { - c.sendAlert(alertUnexpectedMessage) - return c.in.setErrorLocked(errors.New("tls: too many warn alerts")) - } - - goto Again - case alertLevelError: - c.in.setErrorLocked(&net.OpError{Op: "remote error", Err: alert(data[1])}) - default: - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - - case recordTypeChangeCipherSpec: - if typ != want || len(data) != 1 || data[0] != 1 || c.vers >= VersionTLS13 { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - break - } - // Handshake messages are not allowed to fragment across the CCS - if c.hand.Len() > 0 { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - break - } - // Handshake messages are not allowed to fragment across the CCS - if c.hand.Len() > 0 { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - break - } - err := c.in.changeCipherSpec() - if err != nil { - c.in.setErrorLocked(c.sendAlert(err.(alert))) - } - - case recordTypeApplicationData: - if typ != want || c.phase == waitingClientFinished { - c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - break - } - if c.phase == readingEarlyData { - c.earlyDataBytes += int64(len(b.data) - b.off) - if c.earlyDataBytes > c.ticketMaxEarlyData { - return c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - } - c.input = b - b = nil - - case recordTypeHandshake: - // TODO(rsc): Should at least pick off connection close. - // If early data was being read, a Finished message is expected - // instead of (early) application data. Other post-handshake - // messages include HelloRequest and NewSessionTicket. - if typ != want && want != recordTypeApplicationData { - return c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - c.hand.Write(data) - } - - if b != nil { - c.in.freeBlock(b) - } - return c.in.err -} - -// peekAlert looks at a message to spot an unencrypted alert. It must be -// called before decryption to avoid a side channel, and its result must -// only be used if decryption fails, to avoid false positives. -func peekAlert(b *block) error { - if len(b.data) < 7 { - return nil - } - if recordType(b.data[0]) != recordTypeAlert { - return nil - } - return &net.OpError{Op: "remote error", Err: alert(b.data[6])} -} - -// sendAlert sends a TLS alert message. -// c.out.Mutex <= L. -func (c *Conn) sendAlertLocked(err alert) error { - switch err { - case alertNoRenegotiation, alertCloseNotify: - c.tmp[0] = alertLevelWarning - default: - c.tmp[0] = alertLevelError - } - c.tmp[1] = byte(err) - - _, writeErr := c.writeRecordLocked(recordTypeAlert, c.tmp[0:2]) - if err == alertCloseNotify { - // closeNotify is a special case in that it isn't an error. - return writeErr - } - - return c.out.setErrorLocked(&net.OpError{Op: "local error", Err: err}) -} - -// sendAlert sends a TLS alert message. -// L < c.out.Mutex. -func (c *Conn) sendAlert(err alert) error { - if c.config.AlternativeRecordLayer != nil { - return nil - } - c.out.Lock() - defer c.out.Unlock() - return c.sendAlertLocked(err) -} - -const ( - // tcpMSSEstimate is a conservative estimate of the TCP maximum segment - // size (MSS). A constant is used, rather than querying the kernel for - // the actual MSS, to avoid complexity. The value here is the IPv6 - // minimum MTU (1280 bytes) minus the overhead of an IPv6 header (40 - // bytes) and a TCP header with timestamps (32 bytes). - tcpMSSEstimate = 1208 - - // recordSizeBoostThreshold is the number of bytes of application data - // sent after which the TLS record size will be increased to the - // maximum. - recordSizeBoostThreshold = 128 * 1024 -) - -// maxPayloadSizeForWrite returns the maximum TLS payload size to use for the -// next application data record. There is the following trade-off: -// -// - For latency-sensitive applications, such as web browsing, each TLS -// record should fit in one TCP segment. -// - For throughput-sensitive applications, such as large file transfers, -// larger TLS records better amortize framing and encryption overheads. -// -// A simple heuristic that works well in practice is to use small records for -// the first 1MB of data, then use larger records for subsequent data, and -// reset back to smaller records after the connection becomes idle. See "High -// Performance Web Networking", Chapter 4, or: -// https://www.igvita.com/2013/10/24/optimizing-tls-record-size-and-buffering-latency/ -// -// In the interests of simplicity and determinism, this code does not attempt -// to reset the record size once the connection is idle, however. -// -// c.out.Mutex <= L. -func (c *Conn) maxPayloadSizeForWrite(typ recordType, explicitIVLen int) int { - if c.config.DynamicRecordSizingDisabled || typ != recordTypeApplicationData { - return maxPlaintext - } - - if c.bytesSent >= recordSizeBoostThreshold { - return maxPlaintext - } - - // Subtract TLS overheads to get the maximum payload size. - macSize := 0 - if c.out.mac != nil { - macSize = c.out.mac.Size() - } - - payloadBytes := tcpMSSEstimate - recordHeaderLen - explicitIVLen - if c.out.cipher != nil { - switch ciph := c.out.cipher.(type) { - case cipher.Stream: - payloadBytes -= macSize - case cipher.AEAD: - payloadBytes -= ciph.Overhead() - if c.vers >= VersionTLS13 { - payloadBytes -= 1 // ContentType - } - case cbcMode: - blockSize := ciph.BlockSize() - // The payload must fit in a multiple of blockSize, with - // room for at least one padding byte. - payloadBytes = (payloadBytes & ^(blockSize - 1)) - 1 - // The MAC is appended before padding so affects the - // payload size directly. - payloadBytes -= macSize - default: - panic("unknown cipher type") - } - } - - // Allow packet growth in arithmetic progression up to max. - pkt := c.packetsSent - c.packetsSent++ - if pkt > 1000 { - return maxPlaintext // avoid overflow in multiply below - } - - n := payloadBytes * int(pkt+1) - if n > maxPlaintext { - n = maxPlaintext - } - return n -} - -// c.out.Mutex <= L. -func (c *Conn) write(data []byte) (int, error) { - if c.buffering { - c.sendBuf = append(c.sendBuf, data...) - return len(data), nil - } - - n, err := c.conn.Write(data) - c.bytesSent += int64(n) - return n, err -} - -func (c *Conn) flush() (int, error) { - if len(c.sendBuf) == 0 { - return 0, nil - } - - n, err := c.conn.Write(c.sendBuf) - c.bytesSent += int64(n) - c.sendBuf = nil - c.buffering = false - return n, err -} - -// writeRecordLocked writes a TLS record with the given type and payload to the -// connection and updates the record layer state. -// c.out.Mutex <= L. -func (c *Conn) writeRecordLocked(typ recordType, data []byte) (int, error) { - b := c.out.newBlock() - defer c.out.freeBlock(b) - - var n int - for len(data) > 0 { - explicitIVLen := 0 - explicitIVIsSeq := false - - var cbc cbcMode - if c.out.version >= VersionTLS11 { - var ok bool - if cbc, ok = c.out.cipher.(cbcMode); ok { - explicitIVLen = cbc.BlockSize() - } - } - if explicitIVLen == 0 { - if c, ok := c.out.cipher.(aead); ok { - explicitIVLen = c.explicitNonceLen() - - // The AES-GCM construction in TLS has an - // explicit nonce so that the nonce can be - // random. However, the nonce is only 8 bytes - // which is too small for a secure, random - // nonce. Therefore we use the sequence number - // as the nonce. - explicitIVIsSeq = explicitIVLen > 0 - } - } - m := len(data) - if maxPayload := c.maxPayloadSizeForWrite(typ, explicitIVLen); m > maxPayload { - m = maxPayload - } - b.resize(recordHeaderLen + explicitIVLen + m) - b.data[0] = byte(typ) - vers := c.vers - if vers == 0 { - // Some TLS servers fail if the record version is - // greater than TLS 1.0 for the initial ClientHello. - vers = VersionTLS10 - } - if c.vers >= VersionTLS13 { - // TLS 1.3 froze the record layer version at { 3, 1 }. - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-5.1. - // But for draft 22, this was changed to { 3, 3 }. - vers = VersionTLS12 - } - b.data[1] = byte(vers >> 8) - b.data[2] = byte(vers) - b.data[3] = byte(m >> 8) - b.data[4] = byte(m) - if explicitIVLen > 0 { - explicitIV := b.data[recordHeaderLen : recordHeaderLen+explicitIVLen] - if explicitIVIsSeq { - copy(explicitIV, c.out.seq[:]) - } else { - if _, err := io.ReadFull(c.config.rand(), explicitIV); err != nil { - return n, err - } - } - } - copy(b.data[recordHeaderLen+explicitIVLen:], data) - c.out.encrypt(b, explicitIVLen) - if _, err := c.write(b.data); err != nil { - return n, err - } - n += m - data = data[m:] - } - - if typ == recordTypeChangeCipherSpec && c.vers < VersionTLS13 { - if err := c.out.changeCipherSpec(); err != nil { - return n, c.sendAlertLocked(err.(alert)) - } - } - - return n, nil -} - -// writeRecord writes a TLS record with the given type and payload to the -// connection and updates the record layer state. -// L < c.out.Mutex. -func (c *Conn) writeRecord(typ recordType, data []byte) (int, error) { - if c.config.AlternativeRecordLayer != nil { - if typ == recordTypeChangeCipherSpec { - return len(data), nil - } - return c.config.AlternativeRecordLayer.WriteRecord(data) - } - - c.out.Lock() - defer c.out.Unlock() - - return c.writeRecordLocked(typ, data) -} - -// readHandshake reads the next handshake message from -// the record layer. -// c.in.Mutex < L; c.out.Mutex < L. -func (c *Conn) readHandshake() (interface{}, error) { - var data []byte - if c.config.AlternativeRecordLayer != nil { - var err error - data, err = c.config.AlternativeRecordLayer.ReadHandshakeMessage() - if err != nil { - return nil, err - } - } else { - for c.hand.Len() < 4 { - if err := c.in.err; err != nil { - return nil, err - } - if err := c.readRecord(recordTypeHandshake); err != nil { - return nil, err - } - } - - data = c.hand.Bytes() - n := int(data[1])<<16 | int(data[2])<<8 | int(data[3]) - if n > maxHandshake { - c.sendAlertLocked(alertInternalError) - return nil, c.in.setErrorLocked(fmt.Errorf("tls: handshake message of length %d bytes exceeds maximum of %d bytes", n, maxHandshake)) - } - for c.hand.Len() < 4+n { - if err := c.in.err; err != nil { - return nil, err - } - if err := c.readRecord(recordTypeHandshake); err != nil { - return nil, err - } - } - data = c.hand.Next(4 + n) - } - var m handshakeMessage - switch data[0] { - case typeHelloRequest: - m = new(helloRequestMsg) - case typeClientHello: - m = new(clientHelloMsg) - case typeServerHello: - m = new(serverHelloMsg) - case typeEncryptedExtensions: - m = new(encryptedExtensionsMsg) - case typeNewSessionTicket: - if c.vers >= VersionTLS13 { - m = new(newSessionTicketMsg13) - } else { - m = new(newSessionTicketMsg) - } - case typeEndOfEarlyData: - m = new(endOfEarlyDataMsg) - case typeCertificate: - if c.vers >= VersionTLS13 { - m = new(certificateMsg13) - } else { - m = new(certificateMsg) - } - case typeCertificateRequest: - if c.vers >= VersionTLS13 { - m = new(certificateRequestMsg13) - } else { - m = &certificateRequestMsg{ - hasSignatureAndHash: c.vers >= VersionTLS12, - } - } - case typeCertificateStatus: - m = new(certificateStatusMsg) - case typeServerKeyExchange: - m = new(serverKeyExchangeMsg) - case typeServerHelloDone: - m = new(serverHelloDoneMsg) - case typeClientKeyExchange: - m = new(clientKeyExchangeMsg) - case typeCertificateVerify: - m = &certificateVerifyMsg{ - hasSignatureAndHash: c.vers >= VersionTLS12, - } - case typeNextProtocol: - m = new(nextProtoMsg) - case typeFinished: - m = new(finishedMsg) - default: - return nil, c.in.setErrorLocked(c.sendAlert(alertUnexpectedMessage)) - } - - // The handshake message unmarshalers - // expect to be able to keep references to data, - // so pass in a fresh copy that won't be overwritten. - data = append([]byte(nil), data...) - - if unmarshalAlert := m.unmarshal(data); unmarshalAlert != alertSuccess { - return nil, c.in.setErrorLocked(c.sendAlert(unmarshalAlert)) - } - return m, nil -} - -var ( - errClosed = errors.New("tls: use of closed connection") - errShutdown = errors.New("tls: protocol is shutdown") -) - -// Write writes data to the connection. -func (c *Conn) Write(b []byte) (int, error) { - // interlock with Close below - for { - x := atomic.LoadInt32(&c.activeCall) - if x&1 != 0 { - return 0, errClosed - } - if atomic.CompareAndSwapInt32(&c.activeCall, x, x+2) { - defer atomic.AddInt32(&c.activeCall, -2) - break - } - } - - if err := c.Handshake(); err != nil { - return 0, err - } - - c.out.Lock() - defer c.out.Unlock() - - if err := c.out.err; err != nil { - return 0, err - } - - if !c.handshakeComplete { - return 0, alertInternalError - } - - if c.closeNotifySent { - return 0, errShutdown - } - - // SSL 3.0 and TLS 1.0 are susceptible to a chosen-plaintext - // attack when using block mode ciphers due to predictable IVs. - // This can be prevented by splitting each Application Data - // record into two records, effectively randomizing the IV. - // - // http://www.openssl.org/~bodo/tls-cbc.txt - // https://bugzilla.mozilla.org/show_bug.cgi?id=665814 - // http://www.imperialviolet.org/2012/01/15/beastfollowup.html - - var m int - if len(b) > 1 && c.vers <= VersionTLS10 { - if _, ok := c.out.cipher.(cipher.BlockMode); ok { - n, err := c.writeRecordLocked(recordTypeApplicationData, b[:1]) - if err != nil { - return n, c.out.setErrorLocked(err) - } - m, b = 1, b[1:] - } - } - - n, err := c.writeRecordLocked(recordTypeApplicationData, b) - return n + m, c.out.setErrorLocked(err) -} - -// Process Handshake messages after the handshake has completed. -// c.in.Mutex <= L -func (c *Conn) handlePostHandshake() error { - msg, err := c.readHandshake() - if err != nil { - return err - } - - switch hm := msg.(type) { - case *helloRequestMsg: - return c.handleRenegotiation(hm) - case *newSessionTicketMsg13: - if !c.isClient { - c.sendAlert(alertUnexpectedMessage) - return alertUnexpectedMessage - } - return nil // TODO implement session tickets - default: - c.sendAlert(alertUnexpectedMessage) - return alertUnexpectedMessage - } -} - -// handleRenegotiation processes a HelloRequest handshake message. -// c.in.Mutex <= L -func (c *Conn) handleRenegotiation(*helloRequestMsg) error { - if !c.isClient { - return c.sendAlert(alertNoRenegotiation) - } - - if c.vers >= VersionTLS13 { - return c.sendAlert(alertNoRenegotiation) - } - - switch c.config.Renegotiation { - case RenegotiateNever: - return c.sendAlert(alertNoRenegotiation) - case RenegotiateOnceAsClient: - if c.handshakes > 1 { - return c.sendAlert(alertNoRenegotiation) - } - case RenegotiateFreelyAsClient: - // Ok. - default: - c.sendAlert(alertInternalError) - return errors.New("tls: unknown Renegotiation value") - } - - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - - c.phase = handshakeRunning - c.handshakeComplete = false - if c.handshakeErr = c.clientHandshake(); c.handshakeErr == nil { - c.handshakes++ - } - return c.handshakeErr -} - -func (c *Conn) setAlternativeRecordLayer() { - if c.config.AlternativeRecordLayer != nil { - c.in.setKeyCallback = c.config.AlternativeRecordLayer.SetReadKey - c.out.setKeyCallback = c.config.AlternativeRecordLayer.SetWriteKey - } -} - -// ConfirmHandshake waits for the handshake to reach a point at which -// the connection is certainly not replayed. That is, after receiving -// the Client Finished. -// -// If ConfirmHandshake returns an error and until ConfirmHandshake -// returns, the 0-RTT data should not be trusted not to be replayed. -// -// This is only meaningful in TLS 1.3 when Accept0RTTData is true and the -// client sent valid 0-RTT data. In any other case it's equivalent to -// calling Handshake. -func (c *Conn) ConfirmHandshake() error { - if c.isClient { - panic("ConfirmHandshake should only be called for servers") - } - - if err := c.Handshake(); err != nil { - return err - } - - if c.vers < VersionTLS13 { - return nil - } - - c.confirmMutex.Lock() - if atomic.LoadInt32(&c.handshakeConfirmed) == 1 { // c.phase == handshakeConfirmed - c.confirmMutex.Unlock() - return nil - } else { - defer func() { - // If we transitioned to handshakeConfirmed we already released the lock, - // otherwise do it here. - if c.phase != handshakeConfirmed { - c.confirmMutex.Unlock() - } - }() - } - - c.in.Lock() - defer c.in.Unlock() - - var input *block - // Try to read all data (if phase==readingEarlyData) or extract the - // remaining data from the previous read that could not fit in the read - // buffer (if c.input != nil). - if c.phase == readingEarlyData || c.input != nil { - buf := &bytes.Buffer{} - if _, err := buf.ReadFrom(earlyDataReader{c}); err != nil { - c.in.setErrorLocked(err) - return err - } - input = &block{data: buf.Bytes()} - } - - // At this point, earlyDataReader has read all early data and received - // the end_of_early_data signal. Expect a Finished message. - // Locks held so far: c.confirmMutex, c.in - // not confirmed implies c.phase == discardingEarlyData || c.phase == waitingClientFinished - for c.phase != handshakeConfirmed { - if err := c.hs.readClientFinished13(true); err != nil { - c.in.setErrorLocked(err) - return err - } - } - - if c.phase != handshakeConfirmed { - panic("should have reached handshakeConfirmed state") - } - if c.input != nil { - panic("should not have read past the Client Finished") - } - - c.input = input - - return nil -} - -// earlyDataReader wraps a Conn and reads only early data, both buffered -// and still on the wire. -type earlyDataReader struct { - c *Conn -} - -// c.in.Mutex <= L -func (r earlyDataReader) Read(b []byte) (n int, err error) { - c := r.c - - if c.phase == handshakeConfirmed { - // c.input might not be early data - panic("earlyDataReader called at handshakeConfirmed") - } - - for c.input == nil && c.in.err == nil && c.phase == readingEarlyData { - if err := c.readRecord(recordTypeApplicationData); err != nil { - return 0, err - } - if c.hand.Len() > 0 { - if err := c.handleEndOfEarlyData(); err != nil { - return 0, err - } - } - } - if err := c.in.err; err != nil { - return 0, err - } - - if c.input != nil { - n, err = c.input.Read(b) - if err == io.EOF { - err = nil - c.in.freeBlock(c.input) - c.input = nil - } - } - - // Following early application data, an end_of_early_data is expected. - if err == nil && c.phase != readingEarlyData && c.input == nil { - err = io.EOF - } - return -} - -// Read can be made to time out and return a net.Error with Timeout() == true -// after a fixed time limit; see SetDeadline and SetReadDeadline. -func (c *Conn) Read(b []byte) (n int, err error) { - if err = c.Handshake(); err != nil { - return - } - if len(b) == 0 { - // Put this after Handshake, in case people were calling - // Read(nil) for the side effect of the Handshake. - return - } - - c.confirmMutex.Lock() - if atomic.LoadInt32(&c.handshakeConfirmed) == 1 { // c.phase == handshakeConfirmed - c.confirmMutex.Unlock() - } else { - defer func() { - // If we transitioned to handshakeConfirmed we already released the lock, - // otherwise do it here. - if c.phase != handshakeConfirmed { - c.confirmMutex.Unlock() - } - }() - } - - c.in.Lock() - defer c.in.Unlock() - - // Some OpenSSL servers send empty records in order to randomize the - // CBC IV. So this loop ignores a limited number of empty records. - const maxConsecutiveEmptyRecords = 100 - for emptyRecordCount := 0; emptyRecordCount <= maxConsecutiveEmptyRecords; emptyRecordCount++ { - for c.input == nil && c.in.err == nil { - if err := c.readRecord(recordTypeApplicationData); err != nil { - // Soft error, like EAGAIN - return 0, err - } - if c.hand.Len() > 0 { - if c.phase == readingEarlyData || c.phase == waitingClientFinished { - if c.phase == readingEarlyData { - if err := c.handleEndOfEarlyData(); err != nil { - return 0, err - } - } - // Server has received all early data, confirm - // by reading the Client Finished message. - if err := c.hs.readClientFinished13(true); err != nil { - c.in.setErrorLocked(err) - return 0, err - } - continue - } - if err := c.handlePostHandshake(); err != nil { - return 0, err - } - } - } - if err := c.in.err; err != nil { - return 0, err - } - - n, err = c.input.Read(b) - if err == io.EOF { - err = nil - c.in.freeBlock(c.input) - c.input = nil - } - - // If a close-notify alert is waiting, read it so that - // we can return (n, EOF) instead of (n, nil), to signal - // to the HTTP response reading goroutine that the - // connection is now closed. This eliminates a race - // where the HTTP response reading goroutine would - // otherwise not observe the EOF until its next read, - // by which time a client goroutine might have already - // tried to reuse the HTTP connection for a new - // request. - // See https://codereview.appspot.com/76400046 - // and https://golang.org/issue/3514 - if ri := c.rawInput; ri != nil && - n != 0 && err == nil && - c.input == nil && len(ri.data) > 0 && recordType(ri.data[0]) == recordTypeAlert { - if recErr := c.readRecord(recordTypeApplicationData); recErr != nil { - err = recErr // will be io.EOF on closeNotify - } - } - - if n != 0 || err != nil { - return n, err - } - } - - return 0, io.ErrNoProgress -} - -// Close closes the connection. -func (c *Conn) Close() error { - // Interlock with Conn.Write above. - var x int32 - for { - x = atomic.LoadInt32(&c.activeCall) - if x&1 != 0 { - return errClosed - } - if atomic.CompareAndSwapInt32(&c.activeCall, x, x|1) { - break - } - } - if x != 0 { - // io.Writer and io.Closer should not be used concurrently. - // If Close is called while a Write is currently in-flight, - // interpret that as a sign that this Close is really just - // being used to break the Write and/or clean up resources and - // avoid sending the alertCloseNotify, which may block - // waiting on handshakeMutex or the c.out mutex. - return c.conn.Close() - } - - var alertErr error - - c.handshakeMutex.Lock() - if c.handshakeComplete { - alertErr = c.closeNotify() - } - c.handshakeMutex.Unlock() - - if err := c.conn.Close(); err != nil { - return err - } - return alertErr -} - -var errEarlyCloseWrite = errors.New("tls: CloseWrite called before handshake complete") - -// CloseWrite shuts down the writing side of the connection. It should only be -// called once the handshake has completed and does not call CloseWrite on the -// underlying connection. Most callers should just use Close. -func (c *Conn) CloseWrite() error { - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - if !c.handshakeComplete { - return errEarlyCloseWrite - } - - return c.closeNotify() -} - -func (c *Conn) closeNotify() error { - c.out.Lock() - defer c.out.Unlock() - - if !c.closeNotifySent { - c.closeNotifyErr = c.sendAlertLocked(alertCloseNotify) - c.closeNotifySent = true - } - return c.closeNotifyErr -} - -// Handshake runs the client or server handshake -// protocol if it has not yet been run. -// Most uses of this package need not call Handshake -// explicitly: the first Read or Write will call it automatically. -// -// In TLS 1.3 Handshake returns after the client and server first flights, -// without waiting for the Client Finished. -func (c *Conn) Handshake() error { - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - - if err := c.handshakeErr; err != nil { - return err - } - if c.handshakeComplete { - return nil - } - - c.in.Lock() - defer c.in.Unlock() - - // The handshake cannot have completed when handshakeMutex was unlocked - // because this goroutine set handshakeCond. - if c.handshakeErr != nil || c.handshakeComplete { - panic("handshake should not have been able to complete after handshakeCond was set") - } - - c.connID = make([]byte, 8) - if _, err := io.ReadFull(c.config.rand(), c.connID); err != nil { - return err - } - - if c.isClient { - c.handshakeErr = c.clientHandshake() - } else { - c.handshakeErr = c.serverHandshake() - } - if c.handshakeErr == nil { - c.handshakes++ - } else { - // If an error occurred during the hadshake try to flush the - // alert that might be left in the buffer. - c.flush() - } - - if c.handshakeErr == nil && !c.handshakeComplete { - panic("handshake should have had a result.") - } - - return c.handshakeErr -} - -// ConnectionState returns basic TLS details about the connection. -func (c *Conn) ConnectionState() ConnectionState { - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - - var state ConnectionState - state.HandshakeComplete = c.handshakeComplete - state.ServerName = c.serverName - - if c.handshakeComplete { - state.ConnectionID = c.connID - state.ClientHello = c.clientHello - state.Version = c.vers - state.NegotiatedProtocol = c.clientProtocol - state.DidResume = c.didResume - state.NegotiatedProtocolIsMutual = !c.clientProtocolFallback - state.CipherSuite = c.cipherSuite - state.PeerCertificates = c.peerCertificates - state.VerifiedChains = c.verifiedChains - state.SignedCertificateTimestamps = c.scts - state.OCSPResponse = c.ocspResponse - if c.verifiedDc != nil { - state.DelegatedCredential = c.verifiedDc.raw - } - state.HandshakeConfirmed = atomic.LoadInt32(&c.handshakeConfirmed) == 1 - if !state.HandshakeConfirmed { - state.Unique0RTTToken = c.binder - } - if !c.didResume { - if c.clientFinishedIsFirst { - state.TLSUnique = c.clientFinished[:] - } else { - state.TLSUnique = c.serverFinished[:] - } - } - } - - return state -} - -// OCSPResponse returns the stapled OCSP response from the TLS server, if -// any. (Only valid for client connections.) -func (c *Conn) OCSPResponse() []byte { - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - - return c.ocspResponse -} - -// VerifyHostname checks that the peer certificate chain is valid for -// connecting to host. If so, it returns nil; if not, it returns an error -// describing the problem. -func (c *Conn) VerifyHostname(host string) error { - c.handshakeMutex.Lock() - defer c.handshakeMutex.Unlock() - if !c.isClient { - return errors.New("tls: VerifyHostname called on TLS server connection") - } - if !c.handshakeComplete { - return errors.New("tls: handshake has not yet been performed") - } - if len(c.verifiedChains) == 0 { - return errors.New("tls: handshake did not verify certificate chain") - } - return c.peerCertificates[0].VerifyHostname(host) -} diff --git a/external/github.com/marten-seemann/qtls/handshake_client.go b/external/github.com/marten-seemann/qtls/handshake_client.go deleted file mode 100644 index fbc5acadb7..0000000000 --- a/external/github.com/marten-seemann/qtls/handshake_client.go +++ /dev/null @@ -1,1006 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "bytes" - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "crypto/subtle" - "crypto/x509" - "errors" - "fmt" - "io" - "net" - "strconv" - "strings" - "sync/atomic" -) - -type clientHandshakeState struct { - c *Conn - serverHello *serverHelloMsg - hello *clientHelloMsg - suite *cipherSuite - masterSecret []byte - session *ClientSessionState - - // TLS 1.0-1.2 fields - finishedHash finishedHash - - // TLS 1.3 fields - keySchedule *keySchedule13 - privateKey []byte -} - -func makeClientHello(config *Config) (*clientHelloMsg, error) { - if len(config.ServerName) == 0 && !config.InsecureSkipVerify { - return nil, errors.New("tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config") - } - - nextProtosLength := 0 - for _, proto := range config.NextProtos { - if l := len(proto); l == 0 || l > 255 { - return nil, errors.New("tls: invalid NextProtos value") - } else { - nextProtosLength += 1 + l - } - } - - if nextProtosLength > 0xffff { - return nil, errors.New("tls: NextProtos values too large") - } - - hello := &clientHelloMsg{ - vers: config.maxVersion(), - compressionMethods: []uint8{compressionNone}, - random: make([]byte, 32), - ocspStapling: true, - scts: true, - serverName: hostnameInSNI(config.ServerName), - supportedCurves: config.curvePreferences(), - supportedPoints: []uint8{pointFormatUncompressed}, - nextProtoNeg: len(config.NextProtos) > 0, - secureRenegotiationSupported: true, - delegatedCredential: config.AcceptDelegatedCredential, - alpnProtocols: config.NextProtos, - extendedMSSupported: config.UseExtendedMasterSecret, - } - possibleCipherSuites := config.cipherSuites() - hello.cipherSuites = make([]uint16, 0, len(possibleCipherSuites)) - -NextCipherSuite: - for _, suiteId := range possibleCipherSuites { - for _, suite := range cipherSuites { - if suite.id != suiteId { - continue - } - // Don't advertise TLS 1.2-only cipher suites unless - // we're attempting TLS 1.2. - if hello.vers < VersionTLS12 && suite.flags&suiteTLS12 != 0 { - continue NextCipherSuite - } - // Don't advertise TLS 1.3-only cipher suites unless - // we're attempting TLS 1.3. - if hello.vers < VersionTLS13 && suite.flags&suiteTLS13 != 0 { - continue NextCipherSuite - } - hello.cipherSuites = append(hello.cipherSuites, suiteId) - continue NextCipherSuite - } - } - - _, err := io.ReadFull(config.rand(), hello.random) - if err != nil { - return nil, errors.New("tls: short read from Rand: " + err.Error()) - } - - if hello.vers >= VersionTLS12 { - hello.supportedSignatureAlgorithms = supportedSignatureAlgorithms - } - - if hello.vers >= VersionTLS13 { - // Version preference is indicated via "supported_extensions", - // set legacy_version to TLS 1.2 for backwards compatibility. - hello.vers = VersionTLS12 - hello.supportedVersions = config.getSupportedVersions() - hello.supportedSignatureAlgorithms = supportedSignatureAlgorithms13 - hello.supportedSignatureAlgorithmsCert = supportedSigAlgorithmsCert(supportedSignatureAlgorithms13) - if config.GetExtensions != nil { - hello.additionalExtensions = config.GetExtensions(typeClientHello) - } - } - - return hello, nil -} - -// c.out.Mutex <= L; c.handshakeMutex <= L. -func (c *Conn) clientHandshake() error { - if c.config == nil { - c.config = defaultConfig() - } - c.setAlternativeRecordLayer() - - // This may be a renegotiation handshake, in which case some fields - // need to be reset. - c.didResume = false - - hello, err := makeClientHello(c.config) - if err != nil { - return err - } - - if c.handshakes > 0 { - hello.secureRenegotiation = c.clientFinished[:] - } - - var session *ClientSessionState - var cacheKey string - sessionCache := c.config.ClientSessionCache - // TLS 1.3 has no session resumption based on session tickets. - if c.config.SessionTicketsDisabled || c.config.maxVersion() >= VersionTLS13 { - sessionCache = nil - } - - if sessionCache != nil { - hello.ticketSupported = true - } - - // Session resumption is not allowed if renegotiating because - // renegotiation is primarily used to allow a client to send a client - // certificate, which would be skipped if session resumption occurred. - if sessionCache != nil && c.handshakes == 0 { - // Try to resume a previously negotiated TLS session, if - // available. - cacheKey = clientSessionCacheKey(c.conn.RemoteAddr(), c.config) - candidateSession, ok := sessionCache.Get(cacheKey) - if ok { - // Check that the ciphersuite/version used for the - // previous session are still valid. - cipherSuiteOk := false - for _, id := range hello.cipherSuites { - if id == candidateSession.cipherSuite { - cipherSuiteOk = true - break - } - } - - versOk := candidateSession.vers >= c.config.minVersion() && - candidateSession.vers <= c.config.maxVersion() - if versOk && cipherSuiteOk { - session = candidateSession - } - } - } - - if session != nil { - hello.sessionTicket = session.sessionTicket - // A random session ID is used to detect when the - // server accepted the ticket and is resuming a session - // (see RFC 5077). - hello.sessionId = make([]byte, 16) - if _, err := io.ReadFull(c.config.rand(), hello.sessionId); err != nil { - return errors.New("tls: short read from Rand: " + err.Error()) - } - } - - hs := &clientHandshakeState{ - c: c, - hello: hello, - session: session, - } - - var clientKS keyShare - if c.config.maxVersion() >= VersionTLS13 { - // Create one keyshare for the first default curve. If it is not - // appropriate, the server should raise a HRR. - defaultGroup := c.config.curvePreferences()[0] - hs.privateKey, clientKS, err = c.generateKeyShare(defaultGroup) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - hello.keyShares = []keyShare{clientKS} - // middlebox compatibility mode, provide a non-empty session ID - hello.sessionId = make([]byte, 16) - if _, err := io.ReadFull(c.config.rand(), hello.sessionId); err != nil { - return errors.New("tls: short read from Rand: " + err.Error()) - } - } - - if err = hs.handshake(); err != nil { - return err - } - - // If we had a successful handshake and hs.session is different from - // the one already cached - cache a new one - if sessionCache != nil && hs.session != nil && session != hs.session && c.vers < VersionTLS13 { - sessionCache.Put(cacheKey, hs.session) - } - - return nil -} - -// Does the handshake, either a full one or resumes old session. -// Requires hs.c, hs.hello, and, optionally, hs.session to be set. -func (hs *clientHandshakeState) handshake() error { - c := hs.c - - // send ClientHello - if _, err := c.writeRecord(recordTypeHandshake, hs.hello.marshal()); err != nil { - return err - } - - msg, err := c.readHandshake() - if err != nil { - return err - } - - var ok bool - if hs.serverHello, ok = msg.(*serverHelloMsg); !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(hs.serverHello, msg) - } - - if err = hs.pickTLSVersion(); err != nil { - return err - } - - if err = hs.pickCipherSuite(); err != nil { - return err - } - - var isResume bool - if c.vers >= VersionTLS13 { - hs.keySchedule = newKeySchedule13(hs.suite, c.config, hs.hello.random) - hs.keySchedule.write(hs.hello.marshal()) - hs.keySchedule.write(hs.serverHello.marshal()) - } else { - isResume, err = hs.processServerHello() - if err != nil { - return err - } - - hs.finishedHash = newFinishedHash(c.vers, hs.suite) - - // No signatures of the handshake are needed in a resumption. - // Otherwise, in a full handshake, if we don't have any certificates - // configured then we will never send a CertificateVerify message and - // thus no signatures are needed in that case either. - if isResume || (len(c.config.Certificates) == 0 && c.config.GetClientCertificate == nil) { - hs.finishedHash.discardHandshakeBuffer() - } - - hs.finishedHash.Write(hs.hello.marshal()) - hs.finishedHash.Write(hs.serverHello.marshal()) - } - - c.buffering = true - if c.vers >= VersionTLS13 { - if err := hs.doTLS13Handshake(); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - } else if isResume { - if err := hs.establishKeys(); err != nil { - return err - } - if err := hs.readSessionTicket(); err != nil { - return err - } - if err := hs.readFinished(c.serverFinished[:]); err != nil { - return err - } - c.clientFinishedIsFirst = false - if err := hs.sendFinished(c.clientFinished[:]); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - } else { - if err := hs.doFullHandshake(); err != nil { - return err - } - if err := hs.establishKeys(); err != nil { - return err - } - if err := hs.sendFinished(c.clientFinished[:]); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - c.clientFinishedIsFirst = true - if err := hs.readSessionTicket(); err != nil { - return err - } - if err := hs.readFinished(c.serverFinished[:]); err != nil { - return err - } - } - - c.didResume = isResume - c.phase = handshakeConfirmed - atomic.StoreInt32(&c.handshakeConfirmed, 1) - c.handshakeComplete = true - - return nil -} - -func (hs *clientHandshakeState) pickTLSVersion() error { - vers, ok := hs.c.config.pickVersion([]uint16{hs.serverHello.vers}) - if !ok || vers < VersionTLS10 { - // TLS 1.0 is the minimum version supported as a client. - hs.c.sendAlert(alertProtocolVersion) - return fmt.Errorf("tls: server selected unsupported protocol version %x", hs.serverHello.vers) - } - - hs.c.vers = vers - hs.c.haveVers = true - - return nil -} - -func (hs *clientHandshakeState) pickCipherSuite() error { - if hs.suite = mutualCipherSuite(hs.hello.cipherSuites, hs.serverHello.cipherSuite); hs.suite == nil { - hs.c.sendAlert(alertHandshakeFailure) - return errors.New("tls: server chose an unconfigured cipher suite") - } - // Check that the chosen cipher suite matches the protocol version. - if hs.c.vers >= VersionTLS13 && hs.suite.flags&suiteTLS13 == 0 || - hs.c.vers < VersionTLS13 && hs.suite.flags&suiteTLS13 != 0 { - hs.c.sendAlert(alertHandshakeFailure) - return errors.New("tls: server chose an inappropriate cipher suite") - } - - hs.c.cipherSuite = hs.suite.id - return nil -} - -// processCertsFromServer takes a chain of server certificates from a -// Certificate message and verifies them. -func (hs *clientHandshakeState) processCertsFromServer(certificates [][]byte) error { - c := hs.c - certs := make([]*x509.Certificate, len(certificates)) - for i, asn1Data := range certificates { - cert, err := x509.ParseCertificate(asn1Data) - if err != nil { - c.sendAlert(alertBadCertificate) - return errors.New("tls: failed to parse certificate from server: " + err.Error()) - } - certs[i] = cert - } - - if !c.config.InsecureSkipVerify { - opts := x509.VerifyOptions{ - Roots: c.config.RootCAs, - CurrentTime: c.config.time(), - DNSName: c.config.ServerName, - Intermediates: x509.NewCertPool(), - } - - for i, cert := range certs { - if i == 0 { - continue - } - opts.Intermediates.AddCert(cert) - } - var err error - c.verifiedChains, err = certs[0].Verify(opts) - if err != nil { - c.sendAlert(alertBadCertificate) - return err - } - } - - if c.config.VerifyPeerCertificate != nil { - if err := c.config.VerifyPeerCertificate(certificates, c.verifiedChains); err != nil { - c.sendAlert(alertBadCertificate) - return err - } - } - - switch certs[0].PublicKey.(type) { - case *rsa.PublicKey, *ecdsa.PublicKey: - break - default: - c.sendAlert(alertUnsupportedCertificate) - return fmt.Errorf("tls: server's certificate contains an unsupported type of public key: %T", certs[0].PublicKey) - } - - c.peerCertificates = certs - return nil -} - -// processDelegatedCredentialFromServer unmarshals the delegated credential -// offered by the server (if present) and validates it using the peer -// certificate and the signature scheme (`scheme`) indicated by the server in -// the "signature_scheme" extension. -func (hs *clientHandshakeState) processDelegatedCredentialFromServer(serialized []byte, scheme SignatureScheme) error { - c := hs.c - - var dc *delegatedCredential - var err error - if serialized != nil { - // Assert that the DC extension was indicated by the client. - if !hs.hello.delegatedCredential { - c.sendAlert(alertUnexpectedMessage) - return errors.New("tls: got delegated credential extension without indication") - } - - // Parse the delegated credential. - dc, err = unmarshalDelegatedCredential(serialized) - if err != nil { - c.sendAlert(alertDecodeError) - return fmt.Errorf("tls: delegated credential: %s", err) - } - } - - if dc != nil && !c.config.InsecureSkipVerify { - if v, err := dc.validate(c.peerCertificates[0], c.config.time()); err != nil { - c.sendAlert(alertIllegalParameter) - return fmt.Errorf("delegated credential: %s", err) - } else if !v { - c.sendAlert(alertIllegalParameter) - return errors.New("delegated credential: signature invalid") - } else if dc.cred.expectedVersion != hs.c.vers { - c.sendAlert(alertIllegalParameter) - return errors.New("delegated credential: protocol version mismatch") - } else if dc.cred.expectedCertVerifyAlgorithm != scheme { - c.sendAlert(alertIllegalParameter) - return errors.New("delegated credential: signature scheme mismatch") - } - } - - c.verifiedDc = dc - return nil -} - -func (hs *clientHandshakeState) doFullHandshake() error { - c := hs.c - - msg, err := c.readHandshake() - if err != nil { - return err - } - certMsg, ok := msg.(*certificateMsg) - if !ok || len(certMsg.certificates) == 0 { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certMsg, msg) - } - hs.finishedHash.Write(certMsg.marshal()) - - if c.handshakes == 0 { - // If this is the first handshake on a connection, process and - // (optionally) verify the server's certificates. - if err := hs.processCertsFromServer(certMsg.certificates); err != nil { - return err - } - } else { - // This is a renegotiation handshake. We require that the - // server's identity (i.e. leaf certificate) is unchanged and - // thus any previous trust decision is still valid. - // - // See https://mitls.org/pages/attacks/3SHAKE for the - // motivation behind this requirement. - if !bytes.Equal(c.peerCertificates[0].Raw, certMsg.certificates[0]) { - c.sendAlert(alertBadCertificate) - return errors.New("tls: server's identity changed during renegotiation") - } - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - - cs, ok := msg.(*certificateStatusMsg) - if ok { - // RFC4366 on Certificate Status Request: - // The server MAY return a "certificate_status" message. - - if !hs.serverHello.ocspStapling { - // If a server returns a "CertificateStatus" message, then the - // server MUST have included an extension of type "status_request" - // with empty "extension_data" in the extended server hello. - - c.sendAlert(alertUnexpectedMessage) - return errors.New("tls: received unexpected CertificateStatus message") - } - hs.finishedHash.Write(cs.marshal()) - - if cs.statusType == statusTypeOCSP { - c.ocspResponse = cs.response - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - keyAgreement := hs.suite.ka(c.vers) - - // Set the public key used to verify the handshake. - pk := c.peerCertificates[0].PublicKey - - skx, ok := msg.(*serverKeyExchangeMsg) - if ok { - hs.finishedHash.Write(skx.marshal()) - - err = keyAgreement.processServerKeyExchange(c.config, hs.hello, hs.serverHello, pk, skx) - if err != nil { - c.sendAlert(alertUnexpectedMessage) - return err - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - var chainToSend *Certificate - var certRequested bool - certReq, ok := msg.(*certificateRequestMsg) - if ok { - certRequested = true - hs.finishedHash.Write(certReq.marshal()) - - if chainToSend, err = hs.getCertificate(certReq); err != nil { - c.sendAlert(alertInternalError) - return err - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - shd, ok := msg.(*serverHelloDoneMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(shd, msg) - } - hs.finishedHash.Write(shd.marshal()) - - // If the server requested a certificate then we have to send a - // Certificate message, even if it's empty because we don't have a - // certificate to send. - if certRequested { - certMsg = new(certificateMsg) - certMsg.certificates = chainToSend.Certificate - hs.finishedHash.Write(certMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certMsg.marshal()); err != nil { - return err - } - } - - preMasterSecret, ckx, err := keyAgreement.generateClientKeyExchange(c.config, hs.hello, pk) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - if ckx != nil { - hs.finishedHash.Write(ckx.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, ckx.marshal()); err != nil { - return err - } - } - c.useEMS = hs.serverHello.extendedMSSupported - hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.hello.random, hs.serverHello.random, hs.finishedHash, c.useEMS) - - if err := c.config.writeKeyLog("CLIENT_RANDOM", hs.hello.random, hs.masterSecret); err != nil { - c.sendAlert(alertInternalError) - return errors.New("tls: failed to write to key log: " + err.Error()) - } - - if chainToSend != nil && len(chainToSend.Certificate) > 0 { - certVerify := &certificateVerifyMsg{ - hasSignatureAndHash: c.vers >= VersionTLS12, - } - - key, ok := chainToSend.PrivateKey.(crypto.Signer) - if !ok { - c.sendAlert(alertInternalError) - return fmt.Errorf("tls: client certificate private key of type %T does not implement crypto.Signer", chainToSend.PrivateKey) - } - - signatureAlgorithm, sigType, hashFunc, err := pickSignatureAlgorithm(key.Public(), certReq.supportedSignatureAlgorithms, hs.hello.supportedSignatureAlgorithms, c.vers) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - // SignatureAndHashAlgorithm was introduced in TLS 1.2. - if certVerify.hasSignatureAndHash { - certVerify.signatureAlgorithm = signatureAlgorithm - } - digest, err := hs.finishedHash.hashForClientCertificate(sigType, hashFunc, hs.masterSecret) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - signOpts := crypto.SignerOpts(hashFunc) - if sigType == signatureRSAPSS { - signOpts = &rsa.PSSOptions{SaltLength: rsa.PSSSaltLengthEqualsHash, Hash: hashFunc} - } - certVerify.signature, err = key.Sign(c.config.rand(), digest, signOpts) - if err != nil { - c.sendAlert(alertInternalError) - return err - } - - hs.finishedHash.Write(certVerify.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certVerify.marshal()); err != nil { - return err - } - } - - hs.finishedHash.discardHandshakeBuffer() - - return nil -} - -func (hs *clientHandshakeState) establishKeys() error { - c := hs.c - - clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV := - keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.hello.random, hs.serverHello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen) - var clientCipher, serverCipher interface{} - var clientHash, serverHash macFunction - if hs.suite.cipher != nil { - clientCipher = hs.suite.cipher(clientKey, clientIV, false /* not for reading */) - clientHash = hs.suite.mac(c.vers, clientMAC) - serverCipher = hs.suite.cipher(serverKey, serverIV, true /* for reading */) - serverHash = hs.suite.mac(c.vers, serverMAC) - } else { - clientCipher = hs.suite.aead(clientKey, clientIV) - serverCipher = hs.suite.aead(serverKey, serverIV) - } - - c.in.prepareCipherSpec(c.vers, serverCipher, serverHash) - c.out.prepareCipherSpec(c.vers, clientCipher, clientHash) - return nil -} - -func (hs *clientHandshakeState) serverResumedSession() bool { - // If the server responded with the same sessionId then it means the - // sessionTicket is being used to resume a TLS session. - return hs.session != nil && hs.hello.sessionId != nil && - bytes.Equal(hs.serverHello.sessionId, hs.hello.sessionId) -} - -func (hs *clientHandshakeState) processServerHello() (bool, error) { - c := hs.c - - if hs.serverHello.compressionMethod != compressionNone { - c.sendAlert(alertUnexpectedMessage) - return false, errors.New("tls: server selected unsupported compression format") - } - - if c.handshakes == 0 && hs.serverHello.secureRenegotiationSupported { - c.secureRenegotiation = true - if len(hs.serverHello.secureRenegotiation) != 0 { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: initial handshake had non-empty renegotiation extension") - } - } - - if c.handshakes > 0 && c.secureRenegotiation { - var expectedSecureRenegotiation [24]byte - copy(expectedSecureRenegotiation[:], c.clientFinished[:]) - copy(expectedSecureRenegotiation[12:], c.serverFinished[:]) - if !bytes.Equal(hs.serverHello.secureRenegotiation, expectedSecureRenegotiation[:]) { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: incorrect renegotiation extension contents") - } - } - - if hs.serverHello.extendedMSSupported { - if hs.hello.extendedMSSupported { - c.useEMS = true - } else { - // server wants to calculate master secret in a different way than client - c.sendAlert(alertUnsupportedExtension) - return false, errors.New("tls: unexpected extension (EMS) received in SH") - } - } - - clientDidNPN := hs.hello.nextProtoNeg - clientDidALPN := len(hs.hello.alpnProtocols) > 0 - serverHasNPN := hs.serverHello.nextProtoNeg - serverHasALPN := len(hs.serverHello.alpnProtocol) > 0 - - if !clientDidNPN && serverHasNPN { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: server advertised unrequested NPN extension") - } - - if !clientDidALPN && serverHasALPN { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: server advertised unrequested ALPN extension") - } - - if serverHasNPN && serverHasALPN { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: server advertised both NPN and ALPN extensions") - } - - if serverHasALPN { - c.clientProtocol = hs.serverHello.alpnProtocol - c.clientProtocolFallback = false - } - c.scts = hs.serverHello.scts - - if !hs.serverResumedSession() { - return false, nil - } - - if hs.session.useEMS != c.useEMS { - return false, errors.New("differing EMS state") - } - - if hs.session.vers != c.vers { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: server resumed a session with a different version") - } - - if hs.session.cipherSuite != hs.suite.id { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: server resumed a session with a different cipher suite") - } - - // Restore masterSecret and peerCerts from previous state - hs.masterSecret = hs.session.masterSecret - c.peerCertificates = hs.session.serverCertificates - c.verifiedChains = hs.session.verifiedChains - return true, nil -} - -func (hs *clientHandshakeState) readFinished(out []byte) error { - c := hs.c - - c.readRecord(recordTypeChangeCipherSpec) - if c.in.err != nil { - return c.in.err - } - - msg, err := c.readHandshake() - if err != nil { - return err - } - serverFinished, ok := msg.(*finishedMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(serverFinished, msg) - } - - verify := hs.finishedHash.serverSum(hs.masterSecret) - if len(verify) != len(serverFinished.verifyData) || - subtle.ConstantTimeCompare(verify, serverFinished.verifyData) != 1 { - c.sendAlert(alertDecryptError) - return errors.New("tls: server's Finished message was incorrect") - } - hs.finishedHash.Write(serverFinished.marshal()) - copy(out, verify) - return nil -} - -func (hs *clientHandshakeState) readSessionTicket() error { - if !hs.serverHello.ticketSupported { - return nil - } - - c := hs.c - msg, err := c.readHandshake() - if err != nil { - return err - } - sessionTicketMsg, ok := msg.(*newSessionTicketMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(sessionTicketMsg, msg) - } - hs.finishedHash.Write(sessionTicketMsg.marshal()) - - hs.session = &ClientSessionState{ - sessionTicket: sessionTicketMsg.ticket, - vers: c.vers, - cipherSuite: hs.suite.id, - masterSecret: hs.masterSecret, - serverCertificates: c.peerCertificates, - verifiedChains: c.verifiedChains, - useEMS: c.useEMS, - } - - return nil -} - -func (hs *clientHandshakeState) sendFinished(out []byte) error { - c := hs.c - - if _, err := c.writeRecord(recordTypeChangeCipherSpec, []byte{1}); err != nil { - return err - } - if hs.serverHello.nextProtoNeg { - nextProto := new(nextProtoMsg) - proto, fallback := mutualProtocol(c.config.NextProtos, hs.serverHello.nextProtos) - nextProto.proto = proto - c.clientProtocol = proto - c.clientProtocolFallback = fallback - - hs.finishedHash.Write(nextProto.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, nextProto.marshal()); err != nil { - return err - } - } - - finished := new(finishedMsg) - finished.verifyData = hs.finishedHash.clientSum(hs.masterSecret) - hs.finishedHash.Write(finished.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, finished.marshal()); err != nil { - return err - } - copy(out, finished.verifyData) - return nil -} - -// tls11SignatureSchemes contains the signature schemes that we synthesise for -// a TLS <= 1.1 connection, based on the supported certificate types. -var tls11SignatureSchemes = []SignatureScheme{ECDSAWithP256AndSHA256, ECDSAWithP384AndSHA384, ECDSAWithP521AndSHA512, PKCS1WithSHA256, PKCS1WithSHA384, PKCS1WithSHA512, PKCS1WithSHA1} - -const ( - // tls11SignatureSchemesNumECDSA is the number of initial elements of - // tls11SignatureSchemes that use ECDSA. - tls11SignatureSchemesNumECDSA = 3 - // tls11SignatureSchemesNumRSA is the number of trailing elements of - // tls11SignatureSchemes that use RSA. - tls11SignatureSchemesNumRSA = 4 -) - -func (hs *clientHandshakeState) getCertificate(certReq *certificateRequestMsg) (*Certificate, error) { - c := hs.c - - var rsaAvail, ecdsaAvail bool - for _, certType := range certReq.certificateTypes { - switch certType { - case certTypeRSASign: - rsaAvail = true - case certTypeECDSASign: - ecdsaAvail = true - } - } - - if c.config.GetClientCertificate != nil { - var signatureSchemes []SignatureScheme - - if !certReq.hasSignatureAndHash { - // Prior to TLS 1.2, the signature schemes were not - // included in the certificate request message. In this - // case we use a plausible list based on the acceptable - // certificate types. - signatureSchemes = tls11SignatureSchemes - if !ecdsaAvail { - signatureSchemes = signatureSchemes[tls11SignatureSchemesNumECDSA:] - } - if !rsaAvail { - signatureSchemes = signatureSchemes[:len(signatureSchemes)-tls11SignatureSchemesNumRSA] - } - } else { - signatureSchemes = certReq.supportedSignatureAlgorithms - } - - return c.config.GetClientCertificate(&CertificateRequestInfo{ - AcceptableCAs: certReq.certificateAuthorities, - SignatureSchemes: signatureSchemes, - }) - } - - // RFC 4346 on the certificateAuthorities field: A list of the - // distinguished names of acceptable certificate authorities. - // These distinguished names may specify a desired - // distinguished name for a root CA or for a subordinate CA; - // thus, this message can be used to describe both known roots - // and a desired authorization space. If the - // certificate_authorities list is empty then the client MAY - // send any certificate of the appropriate - // ClientCertificateType, unless there is some external - // arrangement to the contrary. - - // We need to search our list of client certs for one - // where SignatureAlgorithm is acceptable to the server and the - // Issuer is in certReq.certificateAuthorities -findCert: - for i, chain := range c.config.Certificates { - if !rsaAvail && !ecdsaAvail { - continue - } - - for j, cert := range chain.Certificate { - x509Cert := chain.Leaf - // parse the certificate if this isn't the leaf - // node, or if chain.Leaf was nil - if j != 0 || x509Cert == nil { - var err error - if x509Cert, err = x509.ParseCertificate(cert); err != nil { - c.sendAlert(alertInternalError) - return nil, errors.New("tls: failed to parse client certificate #" + strconv.Itoa(i) + ": " + err.Error()) - } - } - - switch { - case rsaAvail && x509Cert.PublicKeyAlgorithm == x509.RSA: - case ecdsaAvail && x509Cert.PublicKeyAlgorithm == x509.ECDSA: - default: - continue findCert - } - - if len(certReq.certificateAuthorities) == 0 { - // they gave us an empty list, so just take the - // first cert from c.config.Certificates - return &chain, nil - } - - for _, ca := range certReq.certificateAuthorities { - if bytes.Equal(x509Cert.RawIssuer, ca) { - return &chain, nil - } - } - } - } - - // No acceptable certificate found. Don't send a certificate. - return new(Certificate), nil -} - -// clientSessionCacheKey returns a key used to cache sessionTickets that could -// be used to resume previously negotiated TLS sessions with a server. -func clientSessionCacheKey(serverAddr net.Addr, config *Config) string { - if len(config.ServerName) > 0 { - return config.ServerName - } - return serverAddr.String() -} - -// mutualProtocol finds the mutual Next Protocol Negotiation or ALPN protocol -// given list of possible protocols and a list of the preference order. The -// first list must not be empty. It returns the resulting protocol and flag -// indicating if the fallback case was reached. -func mutualProtocol(protos, preferenceProtos []string) (string, bool) { - for _, s := range preferenceProtos { - for _, c := range protos { - if s == c { - return s, false - } - } - } - - return protos[0], true -} - -// hostnameInSNI converts name into an appropriate hostname for SNI. -// Literal IP addresses and absolute FQDNs are not permitted as SNI values. -// See https://tools.ietf.org/html/rfc6066#section-3. -func hostnameInSNI(name string) string { - host := name - if len(host) > 0 && host[0] == '[' && host[len(host)-1] == ']' { - host = host[1 : len(host)-1] - } - if i := strings.LastIndex(host, "%"); i > 0 { - host = host[:i] - } - if net.ParseIP(host) != nil { - return "" - } - for len(name) > 0 && name[len(name)-1] == '.' { - name = name[:len(name)-1] - } - return name -} diff --git a/external/github.com/marten-seemann/qtls/handshake_messages.go b/external/github.com/marten-seemann/qtls/handshake_messages.go deleted file mode 100644 index dd9e543eed..0000000000 --- a/external/github.com/marten-seemann/qtls/handshake_messages.go +++ /dev/null @@ -1,2781 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "bytes" - "encoding/binary" - "strings" -) - -// signAlgosCertList helper function returns either list of signature algorithms in case -// signature_algorithms_cert extension should be marshalled or nil in the other case. -// signAlgos is a list of algorithms from signature_algorithms extension. signAlgosCert is a list -// of algorithms from signature_algorithms_cert extension. -func signAlgosCertList(signAlgos, signAlgosCert []SignatureScheme) []SignatureScheme { - if eqSignatureAlgorithms(signAlgos, signAlgosCert) { - // ensure that only supported_algorithms extension is send if supported_algorithms_cert - // has identical content - return nil - } - return signAlgosCert -} - -type clientHelloMsg struct { - raw []byte - rawTruncated []byte // for PSK binding - vers uint16 - random []byte - sessionId []byte - cipherSuites []uint16 - compressionMethods []uint8 - nextProtoNeg bool - serverName string - ocspStapling bool - scts bool - supportedCurves []CurveID - supportedPoints []uint8 - ticketSupported bool - sessionTicket []uint8 - supportedSignatureAlgorithms []SignatureScheme - supportedSignatureAlgorithmsCert []SignatureScheme - secureRenegotiation []byte - secureRenegotiationSupported bool - alpnProtocols []string - keyShares []keyShare - supportedVersions []uint16 - psks []psk - pskKeyExchangeModes []uint8 - earlyData bool - delegatedCredential bool - extendedMSSupported bool // RFC7627 - additionalExtensions []Extension -} - -// Function used for signature_algorithms and signature_algorithrms_cert -// extensions only (for more details, see TLS 1.3 draft 28, 4.2.3). -// -// It advances data slice and returns it, so that it can be used for further -// processing -func marshalExtensionSignatureAlgorithms(extension uint16, data []byte, schemes []SignatureScheme) []byte { - algNum := uint16(len(schemes)) - if algNum == 0 { - return data - } - - binary.BigEndian.PutUint16(data, extension) - data = data[2:] - binary.BigEndian.PutUint16(data, (2*algNum)+2) // +1 for length - data = data[2:] - binary.BigEndian.PutUint16(data, (2 * algNum)) - data = data[2:] - - for _, algo := range schemes { - binary.BigEndian.PutUint16(data, uint16(algo)) - data = data[2:] - } - return data -} - -// Function used for unmarshalling signature_algorithms or signature_algorithms_cert extensions only -// (for more details, see TLS 1.3 draft 28, 4.2.3) -// In case of error function returns alertDecoderError otherwise filled SignatureScheme slice and alertSuccess -func unmarshalExtensionSignatureAlgorithms(data []byte, length int) ([]SignatureScheme, alert) { - - if length < 2 || length&1 != 0 { - return nil, alertDecodeError - } - - algLen := binary.BigEndian.Uint16(data) - idx := 2 - - if int(algLen) != length-2 { - return nil, alertDecodeError - } - - schemes := make([]SignatureScheme, algLen/2) - for i := range schemes { - schemes[i] = SignatureScheme(binary.BigEndian.Uint16(data[idx:])) - idx += 2 - } - return schemes, alertSuccess -} - -func (m *clientHelloMsg) equal(i interface{}) bool { - m1, ok := i.(*clientHelloMsg) - if !ok { - return false - } - - if len(m.additionalExtensions) != len(m1.additionalExtensions) { - return false - } - for i, ex := range m.additionalExtensions { - ex1 := m1.additionalExtensions[i] - if ex.Type != ex1.Type || !bytes.Equal(ex.Data, ex1.Data) { - return false - } - } - - return bytes.Equal(m.raw, m1.raw) && - m.vers == m1.vers && - bytes.Equal(m.random, m1.random) && - bytes.Equal(m.sessionId, m1.sessionId) && - eqUint16s(m.cipherSuites, m1.cipherSuites) && - bytes.Equal(m.compressionMethods, m1.compressionMethods) && - m.nextProtoNeg == m1.nextProtoNeg && - m.serverName == m1.serverName && - m.ocspStapling == m1.ocspStapling && - m.scts == m1.scts && - eqCurveIDs(m.supportedCurves, m1.supportedCurves) && - bytes.Equal(m.supportedPoints, m1.supportedPoints) && - m.ticketSupported == m1.ticketSupported && - bytes.Equal(m.sessionTicket, m1.sessionTicket) && - eqSignatureAlgorithms(m.supportedSignatureAlgorithms, m1.supportedSignatureAlgorithms) && - eqSignatureAlgorithms(m.supportedSignatureAlgorithmsCert, m1.supportedSignatureAlgorithmsCert) && - m.secureRenegotiationSupported == m1.secureRenegotiationSupported && - bytes.Equal(m.secureRenegotiation, m1.secureRenegotiation) && - eqStrings(m.alpnProtocols, m1.alpnProtocols) && - eqKeyShares(m.keyShares, m1.keyShares) && - eqUint16s(m.supportedVersions, m1.supportedVersions) && - m.earlyData == m1.earlyData && - m.delegatedCredential == m1.delegatedCredential && - m.extendedMSSupported == m1.extendedMSSupported -} - -func (m *clientHelloMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - - length := 2 + 32 + 1 + len(m.sessionId) + 2 + len(m.cipherSuites)*2 + 1 + len(m.compressionMethods) - numExtensions := 0 - extensionsLength := 0 - - if m.nextProtoNeg { - numExtensions++ - } - if m.ocspStapling { - extensionsLength += 1 + 2 + 2 - numExtensions++ - } - if len(m.serverName) > 0 { - extensionsLength += 5 + len(m.serverName) - numExtensions++ - } - if len(m.supportedCurves) > 0 { - extensionsLength += 2 + 2*len(m.supportedCurves) - numExtensions++ - } - if len(m.supportedPoints) > 0 { - extensionsLength += 1 + len(m.supportedPoints) - numExtensions++ - } - if m.ticketSupported { - extensionsLength += len(m.sessionTicket) - numExtensions++ - } - if len(m.supportedSignatureAlgorithms) > 0 { - extensionsLength += 2 + 2*len(m.supportedSignatureAlgorithms) - numExtensions++ - } - if m.getSignatureAlgorithmsCert() != nil { - extensionsLength += 2 + 2*len(m.getSignatureAlgorithmsCert()) - numExtensions++ - } - if m.secureRenegotiationSupported { - extensionsLength += 1 + len(m.secureRenegotiation) - numExtensions++ - } - if len(m.alpnProtocols) > 0 { - extensionsLength += 2 - for _, s := range m.alpnProtocols { - if l := len(s); l == 0 || l > 255 { - panic("invalid ALPN protocol") - } - extensionsLength++ - extensionsLength += len(s) - } - numExtensions++ - } - if m.scts { - numExtensions++ - } - if len(m.keyShares) > 0 { - extensionsLength += 2 - for _, k := range m.keyShares { - extensionsLength += 4 + len(k.data) - } - numExtensions++ - } - if len(m.supportedVersions) > 0 { - extensionsLength += 1 + 2*len(m.supportedVersions) - numExtensions++ - } - if m.earlyData { - numExtensions++ - } - if m.delegatedCredential { - numExtensions++ - } - if m.extendedMSSupported { - numExtensions++ - } - if len(m.additionalExtensions) > 0 { - numExtensions += len(m.additionalExtensions) - for _, ex := range m.additionalExtensions { - extensionsLength += len(ex.Data) - } - } - if numExtensions > 0 { - extensionsLength += 4 * numExtensions - length += 2 + extensionsLength - } - - x := make([]byte, 4+length) - x[0] = typeClientHello - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - x[4] = uint8(m.vers >> 8) - x[5] = uint8(m.vers) - copy(x[6:38], m.random) - x[38] = uint8(len(m.sessionId)) - copy(x[39:39+len(m.sessionId)], m.sessionId) - y := x[39+len(m.sessionId):] - y[0] = uint8(len(m.cipherSuites) >> 7) - y[1] = uint8(len(m.cipherSuites) << 1) - for i, suite := range m.cipherSuites { - y[2+i*2] = uint8(suite >> 8) - y[3+i*2] = uint8(suite) - } - z := y[2+len(m.cipherSuites)*2:] - z[0] = uint8(len(m.compressionMethods)) - copy(z[1:], m.compressionMethods) - - z = z[1+len(m.compressionMethods):] - if numExtensions > 0 { - z[0] = byte(extensionsLength >> 8) - z[1] = byte(extensionsLength) - z = z[2:] - } - if m.nextProtoNeg { - z[0] = byte(extensionNextProtoNeg >> 8) - z[1] = byte(extensionNextProtoNeg & 0xff) - // The length is always 0 - z = z[4:] - } - if len(m.serverName) > 0 { - z[0] = byte(extensionServerName >> 8) - z[1] = byte(extensionServerName & 0xff) - l := len(m.serverName) + 5 - z[2] = byte(l >> 8) - z[3] = byte(l) - z = z[4:] - - // RFC 3546, section 3.1 - // - // struct { - // NameType name_type; - // select (name_type) { - // case host_name: HostName; - // } name; - // } ServerName; - // - // enum { - // host_name(0), (255) - // } NameType; - // - // opaque HostName<1..2^16-1>; - // - // struct { - // ServerName server_name_list<1..2^16-1> - // } ServerNameList; - - z[0] = byte((len(m.serverName) + 3) >> 8) - z[1] = byte(len(m.serverName) + 3) - z[3] = byte(len(m.serverName) >> 8) - z[4] = byte(len(m.serverName)) - copy(z[5:], []byte(m.serverName)) - z = z[l:] - } - if m.ocspStapling { - // RFC 4366, section 3.6 - z[0] = byte(extensionStatusRequest >> 8) - z[1] = byte(extensionStatusRequest) - z[2] = 0 - z[3] = 5 - z[4] = 1 // OCSP type - // Two zero valued uint16s for the two lengths. - z = z[9:] - } - if len(m.supportedCurves) > 0 { - // http://tools.ietf.org/html/rfc4492#section-5.5.1 - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.4 - z[0] = byte(extensionSupportedCurves >> 8) - z[1] = byte(extensionSupportedCurves) - l := 2 + 2*len(m.supportedCurves) - z[2] = byte(l >> 8) - z[3] = byte(l) - l -= 2 - z[4] = byte(l >> 8) - z[5] = byte(l) - z = z[6:] - for _, curve := range m.supportedCurves { - z[0] = byte(curve >> 8) - z[1] = byte(curve) - z = z[2:] - } - } - if len(m.supportedPoints) > 0 { - // http://tools.ietf.org/html/rfc4492#section-5.5.2 - z[0] = byte(extensionSupportedPoints >> 8) - z[1] = byte(extensionSupportedPoints) - l := 1 + len(m.supportedPoints) - z[2] = byte(l >> 8) - z[3] = byte(l) - l-- - z[4] = byte(l) - z = z[5:] - for _, pointFormat := range m.supportedPoints { - z[0] = pointFormat - z = z[1:] - } - } - if m.ticketSupported { - // http://tools.ietf.org/html/rfc5077#section-3.2 - z[0] = byte(extensionSessionTicket >> 8) - z[1] = byte(extensionSessionTicket) - l := len(m.sessionTicket) - z[2] = byte(l >> 8) - z[3] = byte(l) - z = z[4:] - copy(z, m.sessionTicket) - z = z[len(m.sessionTicket):] - } - - if len(m.supportedSignatureAlgorithms) > 0 { - z = marshalExtensionSignatureAlgorithms(extensionSignatureAlgorithms, z, m.supportedSignatureAlgorithms) - } - if m.getSignatureAlgorithmsCert() != nil { - // Ensure only one list of algorithms is sent if supported_algorithms and supported_algorithms_cert are the same - z = marshalExtensionSignatureAlgorithms(extensionSignatureAlgorithmsCert, z, m.getSignatureAlgorithmsCert()) - } - - if m.secureRenegotiationSupported { - z[0] = byte(extensionRenegotiationInfo >> 8) - z[1] = byte(extensionRenegotiationInfo & 0xff) - z[2] = 0 - z[3] = byte(len(m.secureRenegotiation) + 1) - z[4] = byte(len(m.secureRenegotiation)) - z = z[5:] - copy(z, m.secureRenegotiation) - z = z[len(m.secureRenegotiation):] - } - if len(m.alpnProtocols) > 0 { - z[0] = byte(extensionALPN >> 8) - z[1] = byte(extensionALPN & 0xff) - lengths := z[2:] - z = z[6:] - - stringsLength := 0 - for _, s := range m.alpnProtocols { - l := len(s) - z[0] = byte(l) - copy(z[1:], s) - z = z[1+l:] - stringsLength += 1 + l - } - - lengths[2] = byte(stringsLength >> 8) - lengths[3] = byte(stringsLength) - stringsLength += 2 - lengths[0] = byte(stringsLength >> 8) - lengths[1] = byte(stringsLength) - } - if m.scts { - // https://tools.ietf.org/html/rfc6962#section-3.3.1 - z[0] = byte(extensionSCT >> 8) - z[1] = byte(extensionSCT) - // zero uint16 for the zero-length extension_data - z = z[4:] - } - if len(m.keyShares) > 0 { - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.5 - z[0] = byte(extensionKeyShare >> 8) - z[1] = byte(extensionKeyShare) - lengths := z[2:] - z = z[6:] - - totalLength := 0 - for _, ks := range m.keyShares { - z[0] = byte(ks.group >> 8) - z[1] = byte(ks.group) - z[2] = byte(len(ks.data) >> 8) - z[3] = byte(len(ks.data)) - copy(z[4:], ks.data) - z = z[4+len(ks.data):] - totalLength += 4 + len(ks.data) - } - - lengths[2] = byte(totalLength >> 8) - lengths[3] = byte(totalLength) - totalLength += 2 - lengths[0] = byte(totalLength >> 8) - lengths[1] = byte(totalLength) - } - if len(m.supportedVersions) > 0 { - z[0] = byte(extensionSupportedVersions >> 8) - z[1] = byte(extensionSupportedVersions) - l := 1 + 2*len(m.supportedVersions) - z[2] = byte(l >> 8) - z[3] = byte(l) - l -= 1 - z[4] = byte(l) - z = z[5:] - for _, v := range m.supportedVersions { - z[0] = byte(v >> 8) - z[1] = byte(v) - z = z[2:] - } - } - if m.earlyData { - z[0] = byte(extensionEarlyData >> 8) - z[1] = byte(extensionEarlyData) - z = z[4:] - } - if m.delegatedCredential { - binary.BigEndian.PutUint16(z, extensionDelegatedCredential) - z = z[4:] - } - if m.extendedMSSupported { - binary.BigEndian.PutUint16(z, extensionEMS) - z = z[4:] - } - for _, ex := range m.additionalExtensions { - z[0] = byte(ex.Type >> 8) - z[1] = byte(ex.Type) - l := len(ex.Data) - z[2] = byte(l >> 8) - z[3] = byte(l) - copy(z[4:], ex.Data) - z = z[4+l:] - } - - m.raw = x - - return x -} - -func (m *clientHelloMsg) unmarshal(data []byte) alert { - if len(data) < 42 { - return alertDecodeError - } - m.raw = data - m.vers = uint16(data[4])<<8 | uint16(data[5]) - m.random = data[6:38] - sessionIdLen := int(data[38]) - if sessionIdLen > 32 || len(data) < 39+sessionIdLen { - return alertDecodeError - } - m.sessionId = data[39 : 39+sessionIdLen] - data = data[39+sessionIdLen:] - bindersOffset := 39 + sessionIdLen - if len(data) < 2 { - return alertDecodeError - } - // cipherSuiteLen is the number of bytes of cipher suite numbers. Since - // they are uint16s, the number must be even. - cipherSuiteLen := int(data[0])<<8 | int(data[1]) - if cipherSuiteLen%2 == 1 || len(data) < 2+cipherSuiteLen { - return alertDecodeError - } - numCipherSuites := cipherSuiteLen / 2 - m.cipherSuites = make([]uint16, numCipherSuites) - for i := 0; i < numCipherSuites; i++ { - m.cipherSuites[i] = uint16(data[2+2*i])<<8 | uint16(data[3+2*i]) - if m.cipherSuites[i] == scsvRenegotiation { - m.secureRenegotiationSupported = true - } - } - data = data[2+cipherSuiteLen:] - bindersOffset += 2 + cipherSuiteLen - if len(data) < 1 { - return alertDecodeError - } - compressionMethodsLen := int(data[0]) - if len(data) < 1+compressionMethodsLen { - return alertDecodeError - } - m.compressionMethods = data[1 : 1+compressionMethodsLen] - - data = data[1+compressionMethodsLen:] - bindersOffset += 1 + compressionMethodsLen - - m.nextProtoNeg = false - m.serverName = "" - m.ocspStapling = false - m.ticketSupported = false - m.sessionTicket = nil - m.supportedSignatureAlgorithms = nil - m.alpnProtocols = nil - m.scts = false - m.keyShares = nil - m.supportedVersions = nil - m.psks = nil - m.pskKeyExchangeModes = nil - m.earlyData = false - m.delegatedCredential = false - m.extendedMSSupported = false - - if len(data) == 0 { - // ClientHello is optionally followed by extension data - return alertSuccess - } - if len(data) < 2 { - return alertDecodeError - } - - extensionsLength := int(data[0])<<8 | int(data[1]) - data = data[2:] - bindersOffset += 2 - if extensionsLength != len(data) { - return alertDecodeError - } - - for len(data) != 0 { - if len(data) < 4 { - return alertDecodeError - } - ext := uint16(data[0])<<8 | uint16(data[1]) - length := int(data[2])<<8 | int(data[3]) - data = data[4:] - bindersOffset += 4 - if len(data) < length { - return alertDecodeError - } - - switch ext { - case extensionServerName: - d := data[:length] - if len(d) < 2 { - return alertDecodeError - } - namesLen := int(d[0])<<8 | int(d[1]) - d = d[2:] - if len(d) != namesLen { - return alertDecodeError - } - for len(d) > 0 { - if len(d) < 3 { - return alertDecodeError - } - nameType := d[0] - nameLen := int(d[1])<<8 | int(d[2]) - d = d[3:] - if len(d) < nameLen { - return alertDecodeError - } - if nameType == 0 { - m.serverName = string(d[:nameLen]) - // An SNI value may not include a - // trailing dot. See - // https://tools.ietf.org/html/rfc6066#section-3. - if strings.HasSuffix(m.serverName, ".") { - // TODO use alertDecodeError? - return alertUnexpectedMessage - } - break - } - d = d[nameLen:] - } - case extensionNextProtoNeg: - if length > 0 { - return alertDecodeError - } - m.nextProtoNeg = true - case extensionStatusRequest: - m.ocspStapling = length > 0 && data[0] == statusTypeOCSP - case extensionSupportedCurves: - // http://tools.ietf.org/html/rfc4492#section-5.5.1 - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.4 - if length < 2 { - return alertDecodeError - } - l := int(data[0])<<8 | int(data[1]) - if l%2 == 1 || length != l+2 { - return alertDecodeError - } - numCurves := l / 2 - m.supportedCurves = make([]CurveID, numCurves) - d := data[2:] - for i := 0; i < numCurves; i++ { - m.supportedCurves[i] = CurveID(d[0])<<8 | CurveID(d[1]) - d = d[2:] - } - case extensionSupportedPoints: - // http://tools.ietf.org/html/rfc4492#section-5.5.2 - if length < 1 { - return alertDecodeError - } - l := int(data[0]) - if length != l+1 { - return alertDecodeError - } - m.supportedPoints = make([]uint8, l) - copy(m.supportedPoints, data[1:]) - case extensionSessionTicket: - // http://tools.ietf.org/html/rfc5077#section-3.2 - m.ticketSupported = true - m.sessionTicket = data[:length] - case extensionSignatureAlgorithms: - // https://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.3 - if length < 2 || length&1 != 0 { - return alertDecodeError - } - l := int(data[0])<<8 | int(data[1]) - if l != length-2 { - return alertDecodeError - } - n := l / 2 - d := data[2:] - m.supportedSignatureAlgorithms = make([]SignatureScheme, n) - for i := range m.supportedSignatureAlgorithms { - m.supportedSignatureAlgorithms[i] = SignatureScheme(d[0])<<8 | SignatureScheme(d[1]) - d = d[2:] - } - case extensionRenegotiationInfo: - if length == 0 { - return alertDecodeError - } - d := data[:length] - l := int(d[0]) - d = d[1:] - if l != len(d) { - return alertDecodeError - } - - m.secureRenegotiation = d - m.secureRenegotiationSupported = true - case extensionALPN: - if length < 2 { - return alertDecodeError - } - l := int(data[0])<<8 | int(data[1]) - if l != length-2 { - return alertDecodeError - } - d := data[2:length] - for len(d) != 0 { - stringLen := int(d[0]) - d = d[1:] - if stringLen == 0 || stringLen > len(d) { - return alertDecodeError - } - m.alpnProtocols = append(m.alpnProtocols, string(d[:stringLen])) - d = d[stringLen:] - } - case extensionSCT: - m.scts = true - if length != 0 { - return alertDecodeError - } - case extensionKeyShare: - // https://tools.ietf.org/html/rfc8446#section-4.2.8 - if length < 2 { - return alertDecodeError - } - l := int(data[0])<<8 | int(data[1]) - if l != length-2 { - return alertDecodeError - } - d := data[2:length] - for len(d) != 0 { - if len(d) < 4 { - return alertDecodeError - } - dataLen := int(d[2])<<8 | int(d[3]) - if dataLen == 0 || 4+dataLen > len(d) { - return alertDecodeError - } - m.keyShares = append(m.keyShares, keyShare{ - group: CurveID(d[0])<<8 | CurveID(d[1]), - data: d[4 : 4+dataLen], - }) - d = d[4+dataLen:] - } - case extensionSupportedVersions: - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.1 - if length < 1 { - return alertDecodeError - } - l := int(data[0]) - if l%2 == 1 || length != l+1 { - return alertDecodeError - } - n := l / 2 - d := data[1:] - for i := 0; i < n; i++ { - v := uint16(d[0])<<8 + uint16(d[1]) - m.supportedVersions = append(m.supportedVersions, v) - d = d[2:] - } - case extensionPreSharedKey: - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.6 - if length < 2 { - return alertDecodeError - } - // Ensure this extension is the last one in the Client Hello - if len(data) != length { - return alertIllegalParameter - } - li := int(data[0])<<8 | int(data[1]) - if 2+li+2 > length { - return alertDecodeError - } - d := data[2 : 2+li] - bindersOffset += 2 + li - for len(d) > 0 { - if len(d) < 6 { - return alertDecodeError - } - l := int(d[0])<<8 | int(d[1]) - if len(d) < 2+l+4 { - return alertDecodeError - } - m.psks = append(m.psks, psk{ - identity: d[2 : 2+l], - obfTicketAge: uint32(d[l+2])<<24 | uint32(d[l+3])<<16 | - uint32(d[l+4])<<8 | uint32(d[l+5]), - }) - d = d[2+l+4:] - } - lb := int(data[li+2])<<8 | int(data[li+3]) - d = data[2+li+2:] - if lb != len(d) || lb == 0 { - return alertDecodeError - } - i := 0 - for len(d) > 0 { - if i >= len(m.psks) { - return alertIllegalParameter - } - if len(d) < 1 { - return alertDecodeError - } - l := int(d[0]) - if l > len(d)-1 { - return alertDecodeError - } - if i >= len(m.psks) { - return alertIllegalParameter - } - m.psks[i].binder = d[1 : 1+l] - d = d[1+l:] - i++ - } - if i != len(m.psks) { - return alertIllegalParameter - } - m.rawTruncated = m.raw[:bindersOffset] - case extensionPSKKeyExchangeModes: - if length < 2 { - return alertDecodeError - } - l := int(data[0]) - if length != l+1 { - return alertDecodeError - } - m.pskKeyExchangeModes = data[1:length] - case extensionEarlyData: - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.8 - m.earlyData = true - case extensionDelegatedCredential: - // https://tools.ietf.org/html/draft-ietf-tls-subcerts-02 - m.delegatedCredential = true - case extensionEMS: - // RFC 7627 - m.extendedMSSupported = true - if length != 0 { - return alertDecodeError - } - default: - m.additionalExtensions = append(m.additionalExtensions, - Extension{Type: ext, Data: data[:length]}) - } - data = data[length:] - bindersOffset += length - } - - return alertSuccess -} - -func (m *clientHelloMsg) getSignatureAlgorithmsCert() []SignatureScheme { - return signAlgosCertList(m.supportedSignatureAlgorithms, m.supportedSignatureAlgorithmsCert) -} - -type serverHelloMsg struct { - raw []byte - vers uint16 - random []byte - sessionId []byte - cipherSuite uint16 - compressionMethod uint8 - nextProtoNeg bool - nextProtos []string - ocspStapling bool - scts [][]byte - ticketSupported bool - secureRenegotiation []byte - secureRenegotiationSupported bool - alpnProtocol string - - // TLS 1.3 - keyShare keyShare - psk bool - pskIdentity uint16 - - // RFC7627 - extendedMSSupported bool -} - -func (m *serverHelloMsg) equal(i interface{}) bool { - m1, ok := i.(*serverHelloMsg) - if !ok { - return false - } - - if len(m.scts) != len(m1.scts) { - return false - } - for i, sct := range m.scts { - if !bytes.Equal(sct, m1.scts[i]) { - return false - } - } - - return bytes.Equal(m.raw, m1.raw) && - m.vers == m1.vers && - bytes.Equal(m.random, m1.random) && - bytes.Equal(m.sessionId, m1.sessionId) && - m.cipherSuite == m1.cipherSuite && - m.compressionMethod == m1.compressionMethod && - m.nextProtoNeg == m1.nextProtoNeg && - eqStrings(m.nextProtos, m1.nextProtos) && - m.ocspStapling == m1.ocspStapling && - m.ticketSupported == m1.ticketSupported && - m.secureRenegotiationSupported == m1.secureRenegotiationSupported && - bytes.Equal(m.secureRenegotiation, m1.secureRenegotiation) && - m.alpnProtocol == m1.alpnProtocol && - m.keyShare.group == m1.keyShare.group && - bytes.Equal(m.keyShare.data, m1.keyShare.data) && - m.psk == m1.psk && - m.pskIdentity == m1.pskIdentity && - m.extendedMSSupported == m1.extendedMSSupported -} - -func (m *serverHelloMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - - length := 38 + len(m.sessionId) - numExtensions := 0 - extensionsLength := 0 - - nextProtoLen := 0 - if m.nextProtoNeg { - numExtensions++ - for _, v := range m.nextProtos { - nextProtoLen += len(v) - } - nextProtoLen += len(m.nextProtos) - extensionsLength += nextProtoLen - } - if m.ocspStapling { - numExtensions++ - } - if m.ticketSupported { - numExtensions++ - } - if m.secureRenegotiationSupported { - extensionsLength += 1 + len(m.secureRenegotiation) - numExtensions++ - } - if m.extendedMSSupported { - numExtensions++ - } - if alpnLen := len(m.alpnProtocol); alpnLen > 0 { - if alpnLen >= 256 { - panic("invalid ALPN protocol") - } - extensionsLength += 2 + 1 + alpnLen - numExtensions++ - } - sctLen := 0 - if len(m.scts) > 0 { - for _, sct := range m.scts { - sctLen += len(sct) + 2 - } - extensionsLength += 2 + sctLen - numExtensions++ - } - if m.keyShare.group != 0 { - extensionsLength += 4 + len(m.keyShare.data) - numExtensions++ - } - if m.psk { - extensionsLength += 2 - numExtensions++ - } - // supported_versions extension - if m.vers >= VersionTLS13 { - extensionsLength += 2 - numExtensions++ - } - - if numExtensions > 0 { - extensionsLength += 4 * numExtensions - length += 2 + extensionsLength - } - - x := make([]byte, 4+length) - x[0] = typeServerHello - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - if m.vers >= VersionTLS13 { - x[4] = 3 - x[5] = 3 - } else { - x[4] = uint8(m.vers >> 8) - x[5] = uint8(m.vers) - } - copy(x[6:38], m.random) - z := x[38:] - x[38] = uint8(len(m.sessionId)) - copy(x[39:39+len(m.sessionId)], m.sessionId) - z = x[39+len(m.sessionId):] - z[0] = uint8(m.cipherSuite >> 8) - z[1] = uint8(m.cipherSuite) - z[2] = m.compressionMethod - z = z[3:] - - if numExtensions > 0 { - z[0] = byte(extensionsLength >> 8) - z[1] = byte(extensionsLength) - z = z[2:] - } - if m.vers >= VersionTLS13 { - z[0] = byte(extensionSupportedVersions >> 8) - z[1] = byte(extensionSupportedVersions) - z[3] = 2 - z[4] = uint8(m.vers >> 8) - z[5] = uint8(m.vers) - z = z[6:] - } - if m.nextProtoNeg { - z[0] = byte(extensionNextProtoNeg >> 8) - z[1] = byte(extensionNextProtoNeg & 0xff) - z[2] = byte(nextProtoLen >> 8) - z[3] = byte(nextProtoLen) - z = z[4:] - - for _, v := range m.nextProtos { - l := len(v) - if l > 255 { - l = 255 - } - z[0] = byte(l) - copy(z[1:], []byte(v[0:l])) - z = z[1+l:] - } - } - if m.ocspStapling { - z[0] = byte(extensionStatusRequest >> 8) - z[1] = byte(extensionStatusRequest) - z = z[4:] - } - if m.ticketSupported { - z[0] = byte(extensionSessionTicket >> 8) - z[1] = byte(extensionSessionTicket) - z = z[4:] - } - if m.secureRenegotiationSupported { - z[0] = byte(extensionRenegotiationInfo >> 8) - z[1] = byte(extensionRenegotiationInfo & 0xff) - z[2] = 0 - z[3] = byte(len(m.secureRenegotiation) + 1) - z[4] = byte(len(m.secureRenegotiation)) - z = z[5:] - copy(z, m.secureRenegotiation) - z = z[len(m.secureRenegotiation):] - } - if alpnLen := len(m.alpnProtocol); alpnLen > 0 { - z[0] = byte(extensionALPN >> 8) - z[1] = byte(extensionALPN & 0xff) - l := 2 + 1 + alpnLen - z[2] = byte(l >> 8) - z[3] = byte(l) - l -= 2 - z[4] = byte(l >> 8) - z[5] = byte(l) - l -= 1 - z[6] = byte(l) - copy(z[7:], []byte(m.alpnProtocol)) - z = z[7+alpnLen:] - } - if sctLen > 0 { - z[0] = byte(extensionSCT >> 8) - z[1] = byte(extensionSCT) - l := sctLen + 2 - z[2] = byte(l >> 8) - z[3] = byte(l) - z[4] = byte(sctLen >> 8) - z[5] = byte(sctLen) - - z = z[6:] - for _, sct := range m.scts { - z[0] = byte(len(sct) >> 8) - z[1] = byte(len(sct)) - copy(z[2:], sct) - z = z[len(sct)+2:] - } - } - if m.keyShare.group != 0 { - z[0] = uint8(extensionKeyShare >> 8) - z[1] = uint8(extensionKeyShare) - l := 4 + len(m.keyShare.data) - z[2] = uint8(l >> 8) - z[3] = uint8(l) - z[4] = uint8(m.keyShare.group >> 8) - z[5] = uint8(m.keyShare.group) - l -= 4 - z[6] = uint8(l >> 8) - z[7] = uint8(l) - copy(z[8:], m.keyShare.data) - z = z[8+l:] - } - - if m.psk { - z[0] = byte(extensionPreSharedKey >> 8) - z[1] = byte(extensionPreSharedKey) - z[3] = 2 - z[4] = byte(m.pskIdentity >> 8) - z[5] = byte(m.pskIdentity) - z = z[6:] - } - if m.extendedMSSupported { - binary.BigEndian.PutUint16(z, extensionEMS) - z = z[4:] - } - - m.raw = x - - return x -} - -func (m *serverHelloMsg) unmarshal(data []byte) alert { - if len(data) < 42 { - return alertDecodeError - } - m.raw = data - m.vers = uint16(data[4])<<8 | uint16(data[5]) - m.random = data[6:38] - sessionIdLen := int(data[38]) - if sessionIdLen > 32 || len(data) < 39+sessionIdLen { - return alertDecodeError - } - m.sessionId = data[39 : 39+sessionIdLen] - data = data[39+sessionIdLen:] - if len(data) < 3 { - return alertDecodeError - } - m.cipherSuite = uint16(data[0])<<8 | uint16(data[1]) - m.compressionMethod = data[2] - data = data[3:] - - m.nextProtoNeg = false - m.nextProtos = nil - m.ocspStapling = false - m.scts = nil - m.ticketSupported = false - m.alpnProtocol = "" - m.keyShare.group = 0 - m.keyShare.data = nil - m.psk = false - m.pskIdentity = 0 - m.extendedMSSupported = false - - if len(data) == 0 { - // ServerHello is optionally followed by extension data - return alertSuccess - } - if len(data) < 2 { - return alertDecodeError - } - - extensionsLength := int(data[0])<<8 | int(data[1]) - data = data[2:] - if len(data) != extensionsLength { - return alertDecodeError - } - - svData := findExtension(data, extensionSupportedVersions) - if svData != nil { - if len(svData) != 2 { - return alertDecodeError - } - if m.vers != VersionTLS12 { - return alertDecodeError - } - rcvVer := binary.BigEndian.Uint16(svData[0:]) - if rcvVer < VersionTLS13 { - return alertIllegalParameter - } - m.vers = rcvVer - } - - for len(data) != 0 { - if len(data) < 4 { - return alertDecodeError - } - extension := uint16(data[0])<<8 | uint16(data[1]) - length := int(data[2])<<8 | int(data[3]) - data = data[4:] - if len(data) < length { - return alertDecodeError - } - - switch extension { - case extensionNextProtoNeg: - m.nextProtoNeg = true - d := data[:length] - for len(d) > 0 { - l := int(d[0]) - d = d[1:] - if l == 0 || l > len(d) { - return alertDecodeError - } - m.nextProtos = append(m.nextProtos, string(d[:l])) - d = d[l:] - } - case extensionStatusRequest: - if length > 0 { - return alertDecodeError - } - m.ocspStapling = true - case extensionSessionTicket: - if length > 0 { - return alertDecodeError - } - m.ticketSupported = true - case extensionRenegotiationInfo: - if length == 0 { - return alertDecodeError - } - d := data[:length] - l := int(d[0]) - d = d[1:] - if l != len(d) { - return alertDecodeError - } - - m.secureRenegotiation = d - m.secureRenegotiationSupported = true - case extensionALPN: - d := data[:length] - if len(d) < 3 { - return alertDecodeError - } - l := int(d[0])<<8 | int(d[1]) - if l != len(d)-2 { - return alertDecodeError - } - d = d[2:] - l = int(d[0]) - if l != len(d)-1 { - return alertDecodeError - } - d = d[1:] - if len(d) == 0 { - // ALPN protocols must not be empty. - return alertDecodeError - } - m.alpnProtocol = string(d) - case extensionSCT: - d := data[:length] - - if len(d) < 2 { - return alertDecodeError - } - l := int(d[0])<<8 | int(d[1]) - d = d[2:] - if len(d) != l || l == 0 { - return alertDecodeError - } - - m.scts = make([][]byte, 0, 3) - for len(d) != 0 { - if len(d) < 2 { - return alertDecodeError - } - sctLen := int(d[0])<<8 | int(d[1]) - d = d[2:] - if sctLen == 0 || len(d) < sctLen { - return alertDecodeError - } - m.scts = append(m.scts, d[:sctLen]) - d = d[sctLen:] - } - case extensionKeyShare: - d := data[:length] - - if len(d) < 4 { - return alertDecodeError - } - m.keyShare.group = CurveID(d[0])<<8 | CurveID(d[1]) - l := int(d[2])<<8 | int(d[3]) - d = d[4:] - if len(d) != l { - return alertDecodeError - } - m.keyShare.data = d[:l] - case extensionPreSharedKey: - if length != 2 { - return alertDecodeError - } - m.psk = true - m.pskIdentity = uint16(data[0])<<8 | uint16(data[1]) - case extensionEMS: - m.extendedMSSupported = true - } - data = data[length:] - } - - return alertSuccess -} - -type encryptedExtensionsMsg struct { - raw []byte - alpnProtocol string - earlyData bool - - additionalExtensions []Extension -} - -func (m *encryptedExtensionsMsg) equal(i interface{}) bool { - m1, ok := i.(*encryptedExtensionsMsg) - if !ok { - return false - } - - if len(m.additionalExtensions) != len(m1.additionalExtensions) { - return false - } - for i, ex := range m.additionalExtensions { - ex1 := m1.additionalExtensions[i] - if ex.Type != ex1.Type || !bytes.Equal(ex.Data, ex1.Data) { - return false - } - } - - return bytes.Equal(m.raw, m1.raw) && - m.alpnProtocol == m1.alpnProtocol && - m.earlyData == m1.earlyData -} - -func (m *encryptedExtensionsMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - - length := 2 - - if m.earlyData { - length += 4 - } - alpnLen := len(m.alpnProtocol) - if alpnLen > 0 { - if alpnLen >= 256 { - panic("invalid ALPN protocol") - } - length += 2 + 2 + 2 + 1 + alpnLen - } - if len(m.additionalExtensions) > 0 { - for _, ex := range m.additionalExtensions { - length += 4 + len(ex.Data) - } - } - - x := make([]byte, 4+length) - x[0] = typeEncryptedExtensions - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - length -= 2 - x[4] = uint8(length >> 8) - x[5] = uint8(length) - - z := x[6:] - if alpnLen > 0 { - z[0] = byte(extensionALPN >> 8) - z[1] = byte(extensionALPN) - l := 2 + 1 + alpnLen - z[2] = byte(l >> 8) - z[3] = byte(l) - l -= 2 - z[4] = byte(l >> 8) - z[5] = byte(l) - l -= 1 - z[6] = byte(l) - copy(z[7:], []byte(m.alpnProtocol)) - z = z[7+alpnLen:] - } - - if m.earlyData { - z[0] = byte(extensionEarlyData >> 8) - z[1] = byte(extensionEarlyData) - z = z[4:] - } - - for _, ex := range m.additionalExtensions { - z[0] = byte(ex.Type >> 8) - z[1] = byte(ex.Type) - l := len(ex.Data) - z[2] = byte(l >> 8) - z[3] = byte(l) - copy(z[4:], ex.Data) - z = z[4+l:] - } - - m.raw = x - return x -} - -func (m *encryptedExtensionsMsg) unmarshal(data []byte) alert { - if len(data) < 6 { - return alertDecodeError - } - m.raw = data - - m.alpnProtocol = "" - m.earlyData = false - - extensionsLength := int(data[4])<<8 | int(data[5]) - data = data[6:] - if len(data) != extensionsLength { - return alertDecodeError - } - - for len(data) != 0 { - if len(data) < 4 { - return alertDecodeError - } - ext := uint16(data[0])<<8 | uint16(data[1]) - length := int(data[2])<<8 | int(data[3]) - data = data[4:] - if len(data) < length { - return alertDecodeError - } - - switch ext { - case extensionALPN: - d := data[:length] - if len(d) < 3 { - return alertDecodeError - } - l := int(d[0])<<8 | int(d[1]) - if l != len(d)-2 { - return alertDecodeError - } - d = d[2:] - l = int(d[0]) - if l != len(d)-1 { - return alertDecodeError - } - d = d[1:] - if len(d) == 0 { - // ALPN protocols must not be empty. - return alertDecodeError - } - m.alpnProtocol = string(d) - case extensionEarlyData: - // https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.8 - m.earlyData = true - default: - m.additionalExtensions = append(m.additionalExtensions, - Extension{Type: ext, Data: data[:length]}) - } - - data = data[length:] - } - - return alertSuccess -} - -type certificateMsg struct { - raw []byte - certificates [][]byte -} - -func (m *certificateMsg) equal(i interface{}) bool { - m1, ok := i.(*certificateMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - eqByteSlices(m.certificates, m1.certificates) -} - -func (m *certificateMsg) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - var i int - for _, slice := range m.certificates { - i += len(slice) - } - - length := 3 + 3*len(m.certificates) + i - x = make([]byte, 4+length) - x[0] = typeCertificate - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - certificateOctets := length - 3 - x[4] = uint8(certificateOctets >> 16) - x[5] = uint8(certificateOctets >> 8) - x[6] = uint8(certificateOctets) - - y := x[7:] - for _, slice := range m.certificates { - y[0] = uint8(len(slice) >> 16) - y[1] = uint8(len(slice) >> 8) - y[2] = uint8(len(slice)) - copy(y[3:], slice) - y = y[3+len(slice):] - } - - m.raw = x - return -} - -func (m *certificateMsg) unmarshal(data []byte) alert { - if len(data) < 7 { - return alertDecodeError - } - - m.raw = data - certsLen := uint32(data[4])<<16 | uint32(data[5])<<8 | uint32(data[6]) - if uint32(len(data)) != certsLen+7 { - return alertDecodeError - } - - numCerts := 0 - d := data[7:] - for certsLen > 0 { - if len(d) < 4 { - return alertDecodeError - } - certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) - if uint32(len(d)) < 3+certLen { - return alertDecodeError - } - d = d[3+certLen:] - certsLen -= 3 + certLen - numCerts++ - } - - m.certificates = make([][]byte, numCerts) - d = data[7:] - for i := 0; i < numCerts; i++ { - certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) - m.certificates[i] = d[3 : 3+certLen] - d = d[3+certLen:] - } - - return alertSuccess -} - -type certificateEntry struct { - data []byte - ocspStaple []byte - sctList [][]byte - delegatedCredential []byte -} - -type certificateMsg13 struct { - raw []byte - requestContext []byte - certificates []certificateEntry -} - -func (m *certificateMsg13) equal(i interface{}) bool { - m1, ok := i.(*certificateMsg13) - if !ok { - return false - } - - if len(m.certificates) != len(m1.certificates) { - return false - } - for i, _ := range m.certificates { - ok := bytes.Equal(m.certificates[i].data, m1.certificates[i].data) - ok = ok && bytes.Equal(m.certificates[i].ocspStaple, m1.certificates[i].ocspStaple) - ok = ok && eqByteSlices(m.certificates[i].sctList, m1.certificates[i].sctList) - ok = ok && bytes.Equal(m.certificates[i].delegatedCredential, m1.certificates[i].delegatedCredential) - if !ok { - return false - } - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.requestContext, m1.requestContext) -} - -func (m *certificateMsg13) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - var i int - for _, cert := range m.certificates { - i += len(cert.data) - if len(cert.ocspStaple) != 0 { - i += 8 + len(cert.ocspStaple) - } - if len(cert.sctList) != 0 { - i += 6 - for _, sct := range cert.sctList { - i += 2 + len(sct) - } - } - if len(cert.delegatedCredential) != 0 { - i += 4 + len(cert.delegatedCredential) - } - } - - length := 3 + 3*len(m.certificates) + i - length += 2 * len(m.certificates) // extensions - length += 1 + len(m.requestContext) - x = make([]byte, 4+length) - x[0] = typeCertificate - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - z := x[4:] - - z[0] = byte(len(m.requestContext)) - copy(z[1:], m.requestContext) - z = z[1+len(m.requestContext):] - - certificateOctets := len(z) - 3 - z[0] = uint8(certificateOctets >> 16) - z[1] = uint8(certificateOctets >> 8) - z[2] = uint8(certificateOctets) - - z = z[3:] - for _, cert := range m.certificates { - z[0] = uint8(len(cert.data) >> 16) - z[1] = uint8(len(cert.data) >> 8) - z[2] = uint8(len(cert.data)) - copy(z[3:], cert.data) - z = z[3+len(cert.data):] - - extLenPos := z[:2] - z = z[2:] - - extensionLen := 0 - if len(cert.ocspStaple) != 0 { - stapleLen := 4 + len(cert.ocspStaple) - z[0] = uint8(extensionStatusRequest >> 8) - z[1] = uint8(extensionStatusRequest) - z[2] = uint8(stapleLen >> 8) - z[3] = uint8(stapleLen) - - stapleLen -= 4 - z[4] = statusTypeOCSP - z[5] = uint8(stapleLen >> 16) - z[6] = uint8(stapleLen >> 8) - z[7] = uint8(stapleLen) - copy(z[8:], cert.ocspStaple) - z = z[8+stapleLen:] - - extensionLen += 8 + stapleLen - } - if len(cert.sctList) != 0 { - z[0] = uint8(extensionSCT >> 8) - z[1] = uint8(extensionSCT) - sctLenPos := z[2:6] - z = z[6:] - extensionLen += 6 - - sctLen := 2 - for _, sct := range cert.sctList { - z[0] = uint8(len(sct) >> 8) - z[1] = uint8(len(sct)) - copy(z[2:], sct) - z = z[2+len(sct):] - - extensionLen += 2 + len(sct) - sctLen += 2 + len(sct) - } - sctLenPos[0] = uint8(sctLen >> 8) - sctLenPos[1] = uint8(sctLen) - sctLen -= 2 - sctLenPos[2] = uint8(sctLen >> 8) - sctLenPos[3] = uint8(sctLen) - } - if len(cert.delegatedCredential) != 0 { - binary.BigEndian.PutUint16(z, extensionDelegatedCredential) - binary.BigEndian.PutUint16(z[2:], uint16(len(cert.delegatedCredential))) - z = z[4:] - copy(z, cert.delegatedCredential) - z = z[len(cert.delegatedCredential):] - extensionLen += 4 + len(cert.delegatedCredential) - } - - extLenPos[0] = uint8(extensionLen >> 8) - extLenPos[1] = uint8(extensionLen) - } - - m.raw = x - return -} - -func (m *certificateMsg13) unmarshal(data []byte) alert { - if len(data) < 5 { - return alertDecodeError - } - - m.raw = data - - ctxLen := data[4] - if len(data) < int(ctxLen)+5+3 { - return alertDecodeError - } - m.requestContext = data[5 : 5+ctxLen] - - d := data[5+ctxLen:] - certsLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) - if uint32(len(d)) != certsLen+3 { - return alertDecodeError - } - - numCerts := 0 - d = d[3:] - for certsLen > 0 { - if len(d) < 4 { - return alertDecodeError - } - certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) - if uint32(len(d)) < 3+certLen { - return alertDecodeError - } - d = d[3+certLen:] - - if len(d) < 2 { - return alertDecodeError - } - extLen := uint16(d[0])<<8 | uint16(d[1]) - if uint16(len(d)) < 2+extLen { - return alertDecodeError - } - d = d[2+extLen:] - - certsLen -= 3 + certLen + 2 + uint32(extLen) - numCerts++ - } - - m.certificates = make([]certificateEntry, numCerts) - d = data[8+ctxLen:] - for i := 0; i < numCerts; i++ { - certLen := uint32(d[0])<<16 | uint32(d[1])<<8 | uint32(d[2]) - m.certificates[i].data = d[3 : 3+certLen] - d = d[3+certLen:] - - extLen := uint16(d[0])<<8 | uint16(d[1]) - d = d[2:] - for extLen > 0 { - if extLen < 4 { - return alertDecodeError - } - typ := uint16(d[0])<<8 | uint16(d[1]) - bodyLen := uint16(d[2])<<8 | uint16(d[3]) - if extLen < 4+bodyLen { - return alertDecodeError - } - body := d[4 : 4+bodyLen] - d = d[4+bodyLen:] - extLen -= 4 + bodyLen - - switch typ { - case extensionStatusRequest: - if len(body) < 4 || body[0] != 0x01 { - return alertDecodeError - } - ocspLen := int(body[1])<<16 | int(body[2])<<8 | int(body[3]) - if len(body) != 4+ocspLen { - return alertDecodeError - } - m.certificates[i].ocspStaple = body[4:] - - case extensionSCT: - if len(body) < 2 { - return alertDecodeError - } - listLen := int(body[0])<<8 | int(body[1]) - body = body[2:] - if len(body) != listLen { - return alertDecodeError - } - for len(body) > 0 { - if len(body) < 2 { - return alertDecodeError - } - sctLen := int(body[0])<<8 | int(body[1]) - if len(body) < 2+sctLen { - return alertDecodeError - } - m.certificates[i].sctList = append(m.certificates[i].sctList, body[2:2+sctLen]) - body = body[2+sctLen:] - } - case extensionDelegatedCredential: - m.certificates[i].delegatedCredential = body - } - } - } - - return alertSuccess -} - -type serverKeyExchangeMsg struct { - raw []byte - key []byte -} - -func (m *serverKeyExchangeMsg) equal(i interface{}) bool { - m1, ok := i.(*serverKeyExchangeMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.key, m1.key) -} - -func (m *serverKeyExchangeMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - length := len(m.key) - x := make([]byte, length+4) - x[0] = typeServerKeyExchange - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - copy(x[4:], m.key) - - m.raw = x - return x -} - -func (m *serverKeyExchangeMsg) unmarshal(data []byte) alert { - m.raw = data - if len(data) < 4 { - return alertDecodeError - } - m.key = data[4:] - return alertSuccess -} - -type certificateStatusMsg struct { - raw []byte - statusType uint8 - response []byte -} - -func (m *certificateStatusMsg) equal(i interface{}) bool { - m1, ok := i.(*certificateStatusMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - m.statusType == m1.statusType && - bytes.Equal(m.response, m1.response) -} - -func (m *certificateStatusMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - - var x []byte - if m.statusType == statusTypeOCSP { - x = make([]byte, 4+4+len(m.response)) - x[0] = typeCertificateStatus - l := len(m.response) + 4 - x[1] = byte(l >> 16) - x[2] = byte(l >> 8) - x[3] = byte(l) - x[4] = statusTypeOCSP - - l -= 4 - x[5] = byte(l >> 16) - x[6] = byte(l >> 8) - x[7] = byte(l) - copy(x[8:], m.response) - } else { - x = []byte{typeCertificateStatus, 0, 0, 1, m.statusType} - } - - m.raw = x - return x -} - -func (m *certificateStatusMsg) unmarshal(data []byte) alert { - m.raw = data - if len(data) < 5 { - return alertDecodeError - } - m.statusType = data[4] - - m.response = nil - if m.statusType == statusTypeOCSP { - if len(data) < 8 { - return alertDecodeError - } - respLen := uint32(data[5])<<16 | uint32(data[6])<<8 | uint32(data[7]) - if uint32(len(data)) != 4+4+respLen { - return alertDecodeError - } - m.response = data[8:] - } - return alertSuccess -} - -type serverHelloDoneMsg struct{} - -func (m *serverHelloDoneMsg) equal(i interface{}) bool { - _, ok := i.(*serverHelloDoneMsg) - return ok -} - -func (m *serverHelloDoneMsg) marshal() []byte { - x := make([]byte, 4) - x[0] = typeServerHelloDone - return x -} - -func (m *serverHelloDoneMsg) unmarshal(data []byte) alert { - if len(data) != 4 { - return alertDecodeError - } - return alertSuccess -} - -type clientKeyExchangeMsg struct { - raw []byte - ciphertext []byte -} - -func (m *clientKeyExchangeMsg) equal(i interface{}) bool { - m1, ok := i.(*clientKeyExchangeMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.ciphertext, m1.ciphertext) -} - -func (m *clientKeyExchangeMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - length := len(m.ciphertext) - x := make([]byte, length+4) - x[0] = typeClientKeyExchange - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - copy(x[4:], m.ciphertext) - - m.raw = x - return x -} - -func (m *clientKeyExchangeMsg) unmarshal(data []byte) alert { - m.raw = data - if len(data) < 4 { - return alertDecodeError - } - l := int(data[1])<<16 | int(data[2])<<8 | int(data[3]) - if l != len(data)-4 { - return alertDecodeError - } - m.ciphertext = data[4:] - return alertSuccess -} - -type finishedMsg struct { - raw []byte - verifyData []byte -} - -func (m *finishedMsg) equal(i interface{}) bool { - m1, ok := i.(*finishedMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.verifyData, m1.verifyData) -} - -func (m *finishedMsg) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - x = make([]byte, 4+len(m.verifyData)) - x[0] = typeFinished - x[3] = byte(len(m.verifyData)) - copy(x[4:], m.verifyData) - m.raw = x - return -} - -func (m *finishedMsg) unmarshal(data []byte) alert { - m.raw = data - if len(data) < 4 { - return alertDecodeError - } - m.verifyData = data[4:] - return alertSuccess -} - -type nextProtoMsg struct { - raw []byte - proto string -} - -func (m *nextProtoMsg) equal(i interface{}) bool { - m1, ok := i.(*nextProtoMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - m.proto == m1.proto -} - -func (m *nextProtoMsg) marshal() []byte { - if m.raw != nil { - return m.raw - } - l := len(m.proto) - if l > 255 { - l = 255 - } - - padding := 32 - (l+2)%32 - length := l + padding + 2 - x := make([]byte, length+4) - x[0] = typeNextProtocol - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - y := x[4:] - y[0] = byte(l) - copy(y[1:], []byte(m.proto[0:l])) - y = y[1+l:] - y[0] = byte(padding) - - m.raw = x - - return x -} - -func (m *nextProtoMsg) unmarshal(data []byte) alert { - m.raw = data - - if len(data) < 5 { - return alertDecodeError - } - data = data[4:] - protoLen := int(data[0]) - data = data[1:] - if len(data) < protoLen { - return alertDecodeError - } - m.proto = string(data[0:protoLen]) - data = data[protoLen:] - - if len(data) < 1 { - return alertDecodeError - } - paddingLen := int(data[0]) - data = data[1:] - if len(data) != paddingLen { - return alertDecodeError - } - - return alertSuccess -} - -type certificateRequestMsg struct { - raw []byte - // hasSignatureAndHash indicates whether this message includes a list - // of signature and hash functions. This change was introduced with TLS - // 1.2. - hasSignatureAndHash bool - - certificateTypes []byte - supportedSignatureAlgorithms []SignatureScheme - certificateAuthorities [][]byte -} - -func (m *certificateRequestMsg) equal(i interface{}) bool { - m1, ok := i.(*certificateRequestMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.certificateTypes, m1.certificateTypes) && - eqByteSlices(m.certificateAuthorities, m1.certificateAuthorities) && - eqSignatureAlgorithms(m.supportedSignatureAlgorithms, m1.supportedSignatureAlgorithms) -} - -func (m *certificateRequestMsg) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - // See http://tools.ietf.org/html/rfc4346#section-7.4.4 - length := 1 + len(m.certificateTypes) + 2 - casLength := 0 - for _, ca := range m.certificateAuthorities { - casLength += 2 + len(ca) - } - length += casLength - - if m.hasSignatureAndHash { - length += 2 + 2*len(m.supportedSignatureAlgorithms) - } - - x = make([]byte, 4+length) - x[0] = typeCertificateRequest - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - x[4] = uint8(len(m.certificateTypes)) - - copy(x[5:], m.certificateTypes) - y := x[5+len(m.certificateTypes):] - - if m.hasSignatureAndHash { - n := len(m.supportedSignatureAlgorithms) * 2 - y[0] = uint8(n >> 8) - y[1] = uint8(n) - y = y[2:] - for _, sigAlgo := range m.supportedSignatureAlgorithms { - y[0] = uint8(sigAlgo >> 8) - y[1] = uint8(sigAlgo) - y = y[2:] - } - } - - y[0] = uint8(casLength >> 8) - y[1] = uint8(casLength) - y = y[2:] - for _, ca := range m.certificateAuthorities { - y[0] = uint8(len(ca) >> 8) - y[1] = uint8(len(ca)) - y = y[2:] - copy(y, ca) - y = y[len(ca):] - } - - m.raw = x - return -} - -func (m *certificateRequestMsg) unmarshal(data []byte) alert { - m.raw = data - - if len(data) < 5 { - return alertDecodeError - } - - length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) - if uint32(len(data))-4 != length { - return alertDecodeError - } - - numCertTypes := int(data[4]) - data = data[5:] - if numCertTypes == 0 || len(data) <= numCertTypes { - return alertDecodeError - } - - m.certificateTypes = make([]byte, numCertTypes) - if copy(m.certificateTypes, data) != numCertTypes { - return alertDecodeError - } - - data = data[numCertTypes:] - - if m.hasSignatureAndHash { - if len(data) < 2 { - return alertDecodeError - } - sigAndHashLen := uint16(data[0])<<8 | uint16(data[1]) - data = data[2:] - if sigAndHashLen&1 != 0 { - return alertDecodeError - } - if len(data) < int(sigAndHashLen) { - return alertDecodeError - } - numSigAlgos := sigAndHashLen / 2 - m.supportedSignatureAlgorithms = make([]SignatureScheme, numSigAlgos) - for i := range m.supportedSignatureAlgorithms { - m.supportedSignatureAlgorithms[i] = SignatureScheme(data[0])<<8 | SignatureScheme(data[1]) - data = data[2:] - } - } - - if len(data) < 2 { - return alertDecodeError - } - casLength := uint16(data[0])<<8 | uint16(data[1]) - data = data[2:] - if len(data) < int(casLength) { - return alertDecodeError - } - cas := make([]byte, casLength) - copy(cas, data) - data = data[casLength:] - - m.certificateAuthorities = nil - for len(cas) > 0 { - if len(cas) < 2 { - return alertDecodeError - } - caLen := uint16(cas[0])<<8 | uint16(cas[1]) - cas = cas[2:] - - if len(cas) < int(caLen) { - return alertDecodeError - } - - m.certificateAuthorities = append(m.certificateAuthorities, cas[:caLen]) - cas = cas[caLen:] - } - - if len(data) != 0 { - return alertDecodeError - } - - return alertSuccess -} - -type certificateRequestMsg13 struct { - raw []byte - - requestContext []byte - supportedSignatureAlgorithms []SignatureScheme - supportedSignatureAlgorithmsCert []SignatureScheme - certificateAuthorities [][]byte -} - -func (m *certificateRequestMsg13) equal(i interface{}) bool { - m1, ok := i.(*certificateRequestMsg13) - return ok && - bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.requestContext, m1.requestContext) && - eqByteSlices(m.certificateAuthorities, m1.certificateAuthorities) && - eqSignatureAlgorithms(m.supportedSignatureAlgorithms, m1.supportedSignatureAlgorithms) && - eqSignatureAlgorithms(m.supportedSignatureAlgorithmsCert, m1.supportedSignatureAlgorithmsCert) -} - -func (m *certificateRequestMsg13) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-21#section-4.3.2 - length := 1 + len(m.requestContext) - numExtensions := 1 - extensionsLength := 2 + 2*len(m.supportedSignatureAlgorithms) - - if m.getSignatureAlgorithmsCert() != nil { - numExtensions += 1 - extensionsLength += 2 + 2*len(m.getSignatureAlgorithmsCert()) - } - - casLength := 0 - if len(m.certificateAuthorities) > 0 { - for _, ca := range m.certificateAuthorities { - casLength += 2 + len(ca) - } - extensionsLength += 2 + casLength - numExtensions++ - } - - extensionsLength += 4 * numExtensions - length += 2 + extensionsLength - - x = make([]byte, 4+length) - x[0] = typeCertificateRequest - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - x[4] = uint8(len(m.requestContext)) - copy(x[5:], m.requestContext) - z := x[5+len(m.requestContext):] - - z[0] = byte(extensionsLength >> 8) - z[1] = byte(extensionsLength) - z = z[2:] - - // TODO: this function should be reused by CH - z = marshalExtensionSignatureAlgorithms(extensionSignatureAlgorithms, z, m.supportedSignatureAlgorithms) - - if m.getSignatureAlgorithmsCert() != nil { - z = marshalExtensionSignatureAlgorithms(extensionSignatureAlgorithmsCert, z, m.getSignatureAlgorithmsCert()) - } - // certificate_authorities - if casLength > 0 { - z[0] = byte(extensionCAs >> 8) - z[1] = byte(extensionCAs) - l := 2 + casLength - z[2] = byte(l >> 8) - z[3] = byte(l) - z = z[4:] - - z[0] = uint8(casLength >> 8) - z[1] = uint8(casLength) - z = z[2:] - for _, ca := range m.certificateAuthorities { - z[0] = uint8(len(ca) >> 8) - z[1] = uint8(len(ca)) - z = z[2:] - copy(z, ca) - z = z[len(ca):] - } - } - - m.raw = x - return -} - -func (m *certificateRequestMsg13) unmarshal(data []byte) alert { - m.raw = data - m.supportedSignatureAlgorithms = nil - m.certificateAuthorities = nil - - if len(data) < 5 { - return alertDecodeError - } - - length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) - if uint32(len(data))-4 != length { - return alertDecodeError - } - - ctxLen := data[4] - if len(data) < 5+int(ctxLen)+2 { - return alertDecodeError - } - m.requestContext = data[5 : 5+ctxLen] - data = data[5+ctxLen:] - - extensionsLength := int(data[0])<<8 | int(data[1]) - data = data[2:] - if len(data) != extensionsLength { - return alertDecodeError - } - - for len(data) != 0 { - if len(data) < 4 { - return alertDecodeError - } - extension := uint16(data[0])<<8 | uint16(data[1]) - length := int(data[2])<<8 | int(data[3]) - data = data[4:] - if len(data) < length { - return alertDecodeError - } - - switch extension { - case extensionSignatureAlgorithms: - // TODO: unmarshalExtensionSignatureAlgorithms should be shared with CH and pre-1.3 CV - // https://tools.ietf.org/html/draft-ietf-tls-tls13-21#section-4.2.3 - var err alert - m.supportedSignatureAlgorithms, err = unmarshalExtensionSignatureAlgorithms(data, length) - if err != alertSuccess { - return err - } - case extensionSignatureAlgorithmsCert: - var err alert - m.supportedSignatureAlgorithmsCert, err = unmarshalExtensionSignatureAlgorithms(data, length) - if err != alertSuccess { - return err - } - case extensionCAs: - // TODO DRY: share code with CH - if length < 2 { - return alertDecodeError - } - l := int(data[0])<<8 | int(data[1]) - if l != length-2 || l < 3 { - return alertDecodeError - } - cas := make([]byte, l) - copy(cas, data[2:]) - m.certificateAuthorities = nil - for len(cas) > 0 { - if len(cas) < 2 { - return alertDecodeError - } - caLen := uint16(cas[0])<<8 | uint16(cas[1]) - cas = cas[2:] - - if len(cas) < int(caLen) { - return alertDecodeError - } - - m.certificateAuthorities = append(m.certificateAuthorities, cas[:caLen]) - cas = cas[caLen:] - } - } - data = data[length:] - } - - if len(m.supportedSignatureAlgorithms) == 0 { - return alertDecodeError - } - return alertSuccess -} - -func (m *certificateRequestMsg13) getSignatureAlgorithmsCert() []SignatureScheme { - return signAlgosCertList(m.supportedSignatureAlgorithms, m.supportedSignatureAlgorithmsCert) -} - -type certificateVerifyMsg struct { - raw []byte - hasSignatureAndHash bool - signatureAlgorithm SignatureScheme - signature []byte -} - -func (m *certificateVerifyMsg) equal(i interface{}) bool { - m1, ok := i.(*certificateVerifyMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - m.hasSignatureAndHash == m1.hasSignatureAndHash && - m.signatureAlgorithm == m1.signatureAlgorithm && - bytes.Equal(m.signature, m1.signature) -} - -func (m *certificateVerifyMsg) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - // See http://tools.ietf.org/html/rfc4346#section-7.4.8 - siglength := len(m.signature) - length := 2 + siglength - if m.hasSignatureAndHash { - length += 2 - } - x = make([]byte, 4+length) - x[0] = typeCertificateVerify - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - y := x[4:] - if m.hasSignatureAndHash { - y[0] = uint8(m.signatureAlgorithm >> 8) - y[1] = uint8(m.signatureAlgorithm) - y = y[2:] - } - y[0] = uint8(siglength >> 8) - y[1] = uint8(siglength) - copy(y[2:], m.signature) - - m.raw = x - - return -} - -func (m *certificateVerifyMsg) unmarshal(data []byte) alert { - m.raw = data - - if len(data) < 6 { - return alertDecodeError - } - - length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) - if uint32(len(data))-4 != length { - return alertDecodeError - } - - data = data[4:] - if m.hasSignatureAndHash { - m.signatureAlgorithm = SignatureScheme(data[0])<<8 | SignatureScheme(data[1]) - data = data[2:] - } - - if len(data) < 2 { - return alertDecodeError - } - siglength := int(data[0])<<8 + int(data[1]) - data = data[2:] - if len(data) != siglength { - return alertDecodeError - } - - m.signature = data - - return alertSuccess -} - -type newSessionTicketMsg struct { - raw []byte - ticket []byte -} - -func (m *newSessionTicketMsg) equal(i interface{}) bool { - m1, ok := i.(*newSessionTicketMsg) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - bytes.Equal(m.ticket, m1.ticket) -} - -func (m *newSessionTicketMsg) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - // See http://tools.ietf.org/html/rfc5077#section-3.3 - ticketLen := len(m.ticket) - length := 2 + 4 + ticketLen - x = make([]byte, 4+length) - x[0] = typeNewSessionTicket - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - x[8] = uint8(ticketLen >> 8) - x[9] = uint8(ticketLen) - copy(x[10:], m.ticket) - - m.raw = x - - return -} - -func (m *newSessionTicketMsg) unmarshal(data []byte) alert { - m.raw = data - - if len(data) < 10 { - return alertDecodeError - } - - length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) - if uint32(len(data))-4 != length { - return alertDecodeError - } - - ticketLen := int(data[8])<<8 + int(data[9]) - if len(data)-10 != ticketLen { - return alertDecodeError - } - - m.ticket = data[10:] - - return alertSuccess -} - -type newSessionTicketMsg13 struct { - raw []byte - lifetime uint32 - ageAdd uint32 - nonce []byte - ticket []byte - withEarlyDataInfo bool - maxEarlyDataLength uint32 -} - -func (m *newSessionTicketMsg13) equal(i interface{}) bool { - m1, ok := i.(*newSessionTicketMsg13) - if !ok { - return false - } - - return bytes.Equal(m.raw, m1.raw) && - m.lifetime == m1.lifetime && - m.ageAdd == m1.ageAdd && - bytes.Equal(m.nonce, m1.nonce) && - bytes.Equal(m.ticket, m1.ticket) && - m.withEarlyDataInfo == m1.withEarlyDataInfo && - m.maxEarlyDataLength == m1.maxEarlyDataLength -} - -func (m *newSessionTicketMsg13) marshal() (x []byte) { - if m.raw != nil { - return m.raw - } - - // See https://tools.ietf.org/html/draft-ietf-tls-tls13-21#section-4.6.1 - nonceLen := len(m.nonce) - ticketLen := len(m.ticket) - length := 13 + nonceLen + ticketLen - if m.withEarlyDataInfo { - length += 8 - } - x = make([]byte, 4+length) - x[0] = typeNewSessionTicket - x[1] = uint8(length >> 16) - x[2] = uint8(length >> 8) - x[3] = uint8(length) - - x[4] = uint8(m.lifetime >> 24) - x[5] = uint8(m.lifetime >> 16) - x[6] = uint8(m.lifetime >> 8) - x[7] = uint8(m.lifetime) - x[8] = uint8(m.ageAdd >> 24) - x[9] = uint8(m.ageAdd >> 16) - x[10] = uint8(m.ageAdd >> 8) - x[11] = uint8(m.ageAdd) - - x[12] = uint8(nonceLen) - copy(x[13:13+nonceLen], m.nonce) - - y := x[13+nonceLen:] - y[0] = uint8(ticketLen >> 8) - y[1] = uint8(ticketLen) - copy(y[2:2+ticketLen], m.ticket) - - if m.withEarlyDataInfo { - z := y[2+ticketLen:] - // z[0] is already 0, this is the extensions vector length. - z[1] = 8 - z[2] = uint8(extensionEarlyData >> 8) - z[3] = uint8(extensionEarlyData) - z[5] = 4 - z[6] = uint8(m.maxEarlyDataLength >> 24) - z[7] = uint8(m.maxEarlyDataLength >> 16) - z[8] = uint8(m.maxEarlyDataLength >> 8) - z[9] = uint8(m.maxEarlyDataLength) - } - - m.raw = x - - return -} - -func (m *newSessionTicketMsg13) unmarshal(data []byte) alert { - m.raw = data - m.maxEarlyDataLength = 0 - m.withEarlyDataInfo = false - - if len(data) < 17 { - return alertDecodeError - } - - length := uint32(data[1])<<16 | uint32(data[2])<<8 | uint32(data[3]) - if uint32(len(data))-4 != length { - return alertDecodeError - } - - m.lifetime = uint32(data[4])<<24 | uint32(data[5])<<16 | - uint32(data[6])<<8 | uint32(data[7]) - m.ageAdd = uint32(data[8])<<24 | uint32(data[9])<<16 | - uint32(data[10])<<8 | uint32(data[11]) - - nonceLen := int(data[12]) - if nonceLen == 0 || 13+nonceLen+2 > len(data) { - return alertDecodeError - } - m.nonce = data[13 : 13+nonceLen] - - data = data[13+nonceLen:] - ticketLen := int(data[0])<<8 + int(data[1]) - if ticketLen == 0 || 2+ticketLen+2 > len(data) { - return alertDecodeError - } - m.ticket = data[2 : 2+ticketLen] - - data = data[2+ticketLen:] - extLen := int(data[0])<<8 + int(data[1]) - if extLen != len(data)-2 { - return alertDecodeError - } - - data = data[2:] - for len(data) > 0 { - if len(data) < 4 { - return alertDecodeError - } - extType := uint16(data[0])<<8 + uint16(data[1]) - length := int(data[2])<<8 + int(data[3]) - data = data[4:] - - switch extType { - case extensionEarlyData: - if length != 4 { - return alertDecodeError - } - m.withEarlyDataInfo = true - m.maxEarlyDataLength = uint32(data[0])<<24 | uint32(data[1])<<16 | - uint32(data[2])<<8 | uint32(data[3]) - } - data = data[length:] - } - - return alertSuccess -} - -type endOfEarlyDataMsg struct { -} - -func (*endOfEarlyDataMsg) marshal() []byte { - return []byte{typeEndOfEarlyData, 0, 0, 0} -} - -func (*endOfEarlyDataMsg) unmarshal(data []byte) alert { - if len(data) != 4 { - return alertDecodeError - } - return alertSuccess -} - -type helloRequestMsg struct { -} - -func (*helloRequestMsg) marshal() []byte { - return []byte{typeHelloRequest, 0, 0, 0} -} - -func (*helloRequestMsg) unmarshal(data []byte) alert { - if len(data) != 4 { - return alertDecodeError - } - return alertSuccess -} - -func eqUint16s(x, y []uint16) bool { - if len(x) != len(y) { - return false - } - for i, v := range x { - if y[i] != v { - return false - } - } - return true -} - -func eqCurveIDs(x, y []CurveID) bool { - if len(x) != len(y) { - return false - } - for i, v := range x { - if y[i] != v { - return false - } - } - return true -} - -func eqStrings(x, y []string) bool { - if len(x) != len(y) { - return false - } - for i, v := range x { - if y[i] != v { - return false - } - } - return true -} - -func eqByteSlices(x, y [][]byte) bool { - if len(x) != len(y) { - return false - } - for i, v := range x { - if !bytes.Equal(v, y[i]) { - return false - } - } - return true -} - -func eqSignatureAlgorithms(x, y []SignatureScheme) bool { - if len(x) != len(y) { - return false - } - for i, v := range x { - if v != y[i] { - return false - } - } - return true -} - -func eqKeyShares(x, y []keyShare) bool { - if len(x) != len(y) { - return false - } - for i := range x { - if x[i].group != y[i].group { - return false - } - if !bytes.Equal(x[i].data, y[i].data) { - return false - } - } - return true -} - -func findExtension(data []byte, extensionType uint16) []byte { - for len(data) != 0 { - if len(data) < 4 { - return nil - } - extension := uint16(data[0])<<8 | uint16(data[1]) - length := int(data[2])<<8 | int(data[3]) - data = data[4:] - if len(data) < length { - return nil - } - if extension == extensionType { - return data[:length] - } - data = data[length:] - } - return nil -} diff --git a/external/github.com/marten-seemann/qtls/handshake_server.go b/external/github.com/marten-seemann/qtls/handshake_server.go deleted file mode 100644 index 38004fe729..0000000000 --- a/external/github.com/marten-seemann/qtls/handshake_server.go +++ /dev/null @@ -1,943 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "crypto/subtle" - "crypto/x509" - "errors" - "fmt" - "io" - "sync/atomic" -) - -// serverHandshakeState contains details of a server handshake in progress. -// It's discarded once the handshake has completed. -type serverHandshakeState struct { - c *Conn - suite *cipherSuite - masterSecret []byte - cachedClientHelloInfo *ClientHelloInfo - clientHello *clientHelloMsg - hello *serverHelloMsg - cert *Certificate - privateKey crypto.PrivateKey - - // A marshalled DelegatedCredential to be sent to the client in the - // handshake. - delegatedCredential []byte - - // TLS 1.0-1.2 fields - ellipticOk bool - ecdsaOk bool - rsaDecryptOk bool - rsaSignOk bool - sessionState *sessionState - finishedHash finishedHash - certsFromClient [][]byte - - // TLS 1.3 fields - hello13Enc *encryptedExtensionsMsg - keySchedule *keySchedule13 - clientFinishedKey []byte - hsClientTrafficSecret []byte - appClientTrafficSecret []byte -} - -// serverHandshake performs a TLS handshake as a server. -// c.out.Mutex <= L; c.handshakeMutex <= L. -func (c *Conn) serverHandshake() error { - // If this is the first server handshake, we generate a random key to - // encrypt the tickets with. - c.config.serverInitOnce.Do(func() { c.config.serverInit(nil) }) - c.setAlternativeRecordLayer() - - hs := serverHandshakeState{ - c: c, - } - c.in.traceErr = hs.traceErr - c.out.traceErr = hs.traceErr - isResume, err := hs.readClientHello() - if err != nil { - return err - } - - // For an overview of TLS handshaking, see https://tools.ietf.org/html/rfc5246#section-7.3 - // and https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-2 - c.buffering = true - if c.vers >= VersionTLS13 { - if err := hs.doTLS13Handshake(); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - c.hs = &hs - // If the client is sending early data while the server expects - // it, delay the Finished check until HandshakeConfirmed() is - // called or until all early data is Read(). Otherwise, complete - // authenticating the client now (there is no support for - // sending 0.5-RTT data to a potential unauthenticated client). - if c.phase != readingEarlyData { - if err := hs.readClientFinished13(false); err != nil { - return err - } - } - c.handshakeComplete = true - return nil - } else if isResume { - // The client has included a session ticket and so we do an abbreviated handshake. - if err := hs.doResumeHandshake(); err != nil { - return err - } - if err := hs.establishKeys(); err != nil { - return err - } - // ticketSupported is set in a resumption handshake if the - // ticket from the client was encrypted with an old session - // ticket key and thus a refreshed ticket should be sent. - if hs.hello.ticketSupported { - if err := hs.sendSessionTicket(); err != nil { - return err - } - } - if err := hs.sendFinished(c.serverFinished[:]); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - c.clientFinishedIsFirst = false - if err := hs.readFinished(nil); err != nil { - return err - } - c.didResume = true - } else { - // The client didn't include a session ticket, or it wasn't - // valid so we do a full handshake. - if err := hs.doFullHandshake(); err != nil { - return err - } - if err := hs.establishKeys(); err != nil { - return err - } - if err := hs.readFinished(c.clientFinished[:]); err != nil { - return err - } - c.clientFinishedIsFirst = true - c.buffering = true - if err := hs.sendSessionTicket(); err != nil { - return err - } - if err := hs.sendFinished(nil); err != nil { - return err - } - if _, err := c.flush(); err != nil { - return err - } - } - if c.hand.Len() > 0 { - return c.sendAlert(alertUnexpectedMessage) - } - c.phase = handshakeConfirmed - atomic.StoreInt32(&c.handshakeConfirmed, 1) - c.handshakeComplete = true - - return nil -} - -// readClientHello reads a ClientHello message from the client and decides -// whether we will perform session resumption. -func (hs *serverHandshakeState) readClientHello() (isResume bool, err error) { - c := hs.c - - msg, err := c.readHandshake() - if err != nil { - return false, err - } - var ok bool - hs.clientHello, ok = msg.(*clientHelloMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return false, unexpectedMessageError(hs.clientHello, msg) - } - - if c.config.GetConfigForClient != nil { - if newConfig, err := c.config.GetConfigForClient(hs.clientHelloInfo()); err != nil { - c.out.traceErr, c.in.traceErr = nil, nil // disable tracing - c.sendAlert(alertInternalError) - return false, err - } else if newConfig != nil { - newConfig.serverInitOnce.Do(func() { newConfig.serverInit(c.config) }) - c.config = newConfig - } - } - - var keyShares []CurveID - for _, ks := range hs.clientHello.keyShares { - keyShares = append(keyShares, ks.group) - } - - if hs.clientHello.supportedVersions != nil { - c.vers, ok = c.config.pickVersion(hs.clientHello.supportedVersions) - if !ok { - c.sendAlert(alertProtocolVersion) - return false, fmt.Errorf("tls: none of the client versions (%x) are supported", hs.clientHello.supportedVersions) - } - } else { - c.vers, ok = c.config.mutualVersion(hs.clientHello.vers) - if !ok { - c.sendAlert(alertProtocolVersion) - return false, fmt.Errorf("tls: client offered an unsupported, maximum protocol version of %x", hs.clientHello.vers) - } - } - c.haveVers = true - - preferredCurves := c.config.curvePreferences() -Curves: - for _, curve := range hs.clientHello.supportedCurves { - for _, supported := range preferredCurves { - if supported == curve { - hs.ellipticOk = true - break Curves - } - } - } - - // If present, the supported points extension must include uncompressed. - // Can be absent. This behavior mirrors BoringSSL. - if hs.clientHello.supportedPoints != nil { - supportedPointFormat := false - for _, pointFormat := range hs.clientHello.supportedPoints { - if pointFormat == pointFormatUncompressed { - supportedPointFormat = true - break - } - } - if !supportedPointFormat { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: client does not support uncompressed points") - } - } - - foundCompression := false - // We only support null compression, so check that the client offered it. - for _, compression := range hs.clientHello.compressionMethods { - if compression == compressionNone { - foundCompression = true - break - } - } - - if !foundCompression { - c.sendAlert(alertIllegalParameter) - return false, errors.New("tls: client does not support uncompressed connections") - } - if len(hs.clientHello.compressionMethods) != 1 && c.vers >= VersionTLS13 { - c.sendAlert(alertIllegalParameter) - return false, errors.New("tls: 1.3 client offered compression") - } - - if len(hs.clientHello.secureRenegotiation) != 0 { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: initial handshake had non-empty renegotiation extension") - } - - if c.vers < VersionTLS13 { - hs.hello = new(serverHelloMsg) - hs.hello.vers = c.vers - hs.hello.random = make([]byte, 32) - _, err = io.ReadFull(c.config.rand(), hs.hello.random) - if err != nil { - c.sendAlert(alertInternalError) - return false, err - } - hs.hello.secureRenegotiationSupported = hs.clientHello.secureRenegotiationSupported - hs.hello.compressionMethod = compressionNone - } else { - if hs.c.config.ReceivedExtensions != nil { - if err := hs.c.config.ReceivedExtensions(typeClientHello, hs.clientHello.additionalExtensions); err != nil { - c.sendAlert(alertInternalError) - return false, err - } - } - hs.hello = new(serverHelloMsg) - hs.hello13Enc = new(encryptedExtensionsMsg) - if hs.c.config.GetExtensions != nil { - hs.hello13Enc.additionalExtensions = hs.c.config.GetExtensions(typeEncryptedExtensions) - } - hs.hello.vers = c.vers - hs.hello.random = make([]byte, 32) - hs.hello.sessionId = hs.clientHello.sessionId - _, err = io.ReadFull(c.config.rand(), hs.hello.random) - if err != nil { - c.sendAlert(alertInternalError) - return false, err - } - } - - if len(hs.clientHello.serverName) > 0 { - c.serverName = hs.clientHello.serverName - } - - if len(hs.clientHello.alpnProtocols) > 0 { - if selectedProto, fallback := mutualProtocol(hs.clientHello.alpnProtocols, c.config.NextProtos); !fallback { - if hs.hello13Enc != nil { - hs.hello13Enc.alpnProtocol = selectedProto - } else { - hs.hello.alpnProtocol = selectedProto - } - c.clientProtocol = selectedProto - } - } else { - // Although sending an empty NPN extension is reasonable, Firefox has - // had a bug around this. Best to send nothing at all if - // c.config.NextProtos is empty. See - // https://golang.org/issue/5445. - if hs.clientHello.nextProtoNeg && len(c.config.NextProtos) > 0 && c.vers < VersionTLS13 { - hs.hello.nextProtoNeg = true - hs.hello.nextProtos = c.config.NextProtos - } - } - - hs.cert, err = c.config.getCertificate(hs.clientHelloInfo()) - if err != nil { - c.sendAlert(alertInternalError) - return false, err - } - - // Set the private key for this handshake to the certificate's secret key. - hs.privateKey = hs.cert.PrivateKey - - if hs.clientHello.scts { - hs.hello.scts = hs.cert.SignedCertificateTimestamps - } - - // Set the private key to the DC private key if the client and server are - // willing to negotiate the delegated credential extension. - // - // Check to see if a DelegatedCredential is available and should be used. - // If one is available, the session is using TLS >= 1.2, and the client - // accepts the delegated credential extension, then set the handshake - // private key to the DC private key. - if c.config.GetDelegatedCredential != nil && hs.clientHello.delegatedCredential && c.vers >= VersionTLS12 { - dc, sk, err := c.config.GetDelegatedCredential(hs.clientHelloInfo(), c.vers) - if err != nil { - c.sendAlert(alertInternalError) - return false, err - } - - // Set the handshake private key. - if dc != nil { - hs.privateKey = sk - hs.delegatedCredential = dc - } - } - - if priv, ok := hs.privateKey.(crypto.Signer); ok { - switch priv.Public().(type) { - case *ecdsa.PublicKey: - hs.ecdsaOk = true - case *rsa.PublicKey: - hs.rsaSignOk = true - default: - c.sendAlert(alertInternalError) - return false, fmt.Errorf("tls: unsupported signing key type (%T)", priv.Public()) - } - } - if priv, ok := hs.privateKey.(crypto.Decrypter); ok { - switch priv.Public().(type) { - case *rsa.PublicKey: - hs.rsaDecryptOk = true - default: - c.sendAlert(alertInternalError) - return false, fmt.Errorf("tls: unsupported decryption key type (%T)", priv.Public()) - } - } - - if c.vers != VersionTLS13 && hs.checkForResumption() { - return true, nil - } - - var preferenceList, supportedList []uint16 - if c.config.PreferServerCipherSuites { - preferenceList = c.config.cipherSuites() - supportedList = hs.clientHello.cipherSuites - } else { - preferenceList = hs.clientHello.cipherSuites - supportedList = c.config.cipherSuites() - } - - for _, id := range preferenceList { - if hs.setCipherSuite(id, supportedList, c.vers) { - break - } - } - - if hs.suite == nil { - c.sendAlert(alertHandshakeFailure) - return false, errors.New("tls: no cipher suite supported by both client and server") - } - - // See https://tools.ietf.org/html/rfc7507. - for _, id := range hs.clientHello.cipherSuites { - if id == TLS_FALLBACK_SCSV { - // The client is doing a fallback connection. - if c.vers < c.config.maxVersion() { - c.sendAlert(alertInappropriateFallback) - return false, errors.New("tls: client using inappropriate protocol fallback") - } - break - } - } - - return false, nil -} - -// checkForResumption reports whether we should perform resumption on this connection. -func (hs *serverHandshakeState) checkForResumption() bool { - c := hs.c - - if c.config.SessionTicketsDisabled { - return false - } - - sessionTicket := append([]uint8{}, hs.clientHello.sessionTicket...) - serializedState, usedOldKey := c.decryptTicket(sessionTicket) - hs.sessionState = &sessionState{usedOldKey: usedOldKey} - if hs.sessionState.unmarshal(serializedState) != alertSuccess { - return false - } - - // Never resume a session for a different TLS version. - if c.vers != hs.sessionState.vers { - return false - } - - // Do not resume connections where client support for EMS has changed - if (hs.clientHello.extendedMSSupported && c.config.UseExtendedMasterSecret) != hs.sessionState.usedEMS { - return false - } - - cipherSuiteOk := false - // Check that the client is still offering the ciphersuite in the session. - for _, id := range hs.clientHello.cipherSuites { - if id == hs.sessionState.cipherSuite { - cipherSuiteOk = true - break - } - } - if !cipherSuiteOk { - return false - } - - // Check that we also support the ciphersuite from the session. - if !hs.setCipherSuite(hs.sessionState.cipherSuite, c.config.cipherSuites(), hs.sessionState.vers) { - return false - } - - sessionHasClientCerts := len(hs.sessionState.certificates) != 0 - needClientCerts := c.config.ClientAuth == RequireAnyClientCert || c.config.ClientAuth == RequireAndVerifyClientCert - if needClientCerts && !sessionHasClientCerts { - return false - } - if sessionHasClientCerts && c.config.ClientAuth == NoClientCert { - return false - } - - return true -} - -func (hs *serverHandshakeState) doResumeHandshake() error { - c := hs.c - - hs.hello.cipherSuite = hs.suite.id - // We echo the client's session ID in the ServerHello to let it know - // that we're doing a resumption. - hs.hello.sessionId = hs.clientHello.sessionId - hs.hello.ticketSupported = hs.sessionState.usedOldKey - hs.hello.extendedMSSupported = hs.clientHello.extendedMSSupported && c.config.UseExtendedMasterSecret - hs.finishedHash = newFinishedHash(c.vers, hs.suite) - hs.finishedHash.discardHandshakeBuffer() - hs.finishedHash.Write(hs.clientHello.marshal()) - hs.finishedHash.Write(hs.hello.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, hs.hello.marshal()); err != nil { - return err - } - - if len(hs.sessionState.certificates) > 0 { - if _, err := hs.processCertsFromClient(hs.sessionState.certificates); err != nil { - return err - } - } - - hs.masterSecret = hs.sessionState.masterSecret - c.useEMS = hs.sessionState.usedEMS - - return nil -} - -func (hs *serverHandshakeState) doFullHandshake() error { - c := hs.c - - if hs.clientHello.ocspStapling && len(hs.cert.OCSPStaple) > 0 { - hs.hello.ocspStapling = true - } - - hs.hello.ticketSupported = hs.clientHello.ticketSupported && !c.config.SessionTicketsDisabled - hs.hello.cipherSuite = hs.suite.id - hs.hello.extendedMSSupported = hs.clientHello.extendedMSSupported && c.config.UseExtendedMasterSecret - - hs.finishedHash = newFinishedHash(hs.c.vers, hs.suite) - if c.config.ClientAuth == NoClientCert { - // No need to keep a full record of the handshake if client - // certificates won't be used. - hs.finishedHash.discardHandshakeBuffer() - } - hs.finishedHash.Write(hs.clientHello.marshal()) - hs.finishedHash.Write(hs.hello.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, hs.hello.marshal()); err != nil { - return err - } - - certMsg := new(certificateMsg) - certMsg.certificates = hs.cert.Certificate - hs.finishedHash.Write(certMsg.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certMsg.marshal()); err != nil { - return err - } - - if hs.hello.ocspStapling { - certStatus := new(certificateStatusMsg) - certStatus.statusType = statusTypeOCSP - certStatus.response = hs.cert.OCSPStaple - hs.finishedHash.Write(certStatus.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certStatus.marshal()); err != nil { - return err - } - } - - keyAgreement := hs.suite.ka(c.vers) - skx, err := keyAgreement.generateServerKeyExchange(c.config, hs.privateKey, hs.clientHello, hs.hello) - if err != nil { - c.sendAlert(alertHandshakeFailure) - return err - } - if skx != nil { - hs.finishedHash.Write(skx.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, skx.marshal()); err != nil { - return err - } - } - - if c.config.ClientAuth >= RequestClientCert { - // Request a client certificate - certReq := new(certificateRequestMsg) - certReq.certificateTypes = []byte{ - byte(certTypeRSASign), - byte(certTypeECDSASign), - } - if c.vers >= VersionTLS12 { - certReq.hasSignatureAndHash = true - certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms - } - - // An empty list of certificateAuthorities signals to - // the client that it may send any certificate in response - // to our request. When we know the CAs we trust, then - // we can send them down, so that the client can choose - // an appropriate certificate to give to us. - if c.config.ClientCAs != nil { - certReq.certificateAuthorities = c.config.ClientCAs.Subjects() - } - hs.finishedHash.Write(certReq.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, certReq.marshal()); err != nil { - return err - } - } - - helloDone := new(serverHelloDoneMsg) - hs.finishedHash.Write(helloDone.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, helloDone.marshal()); err != nil { - return err - } - - if _, err := c.flush(); err != nil { - return err - } - - var pub crypto.PublicKey // public key for client auth, if any - - msg, err := c.readHandshake() - if err != nil { - return err - } - - var ok bool - // If we requested a client certificate, then the client must send a - // certificate message, even if it's empty. - if c.config.ClientAuth >= RequestClientCert { - if certMsg, ok = msg.(*certificateMsg); !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certMsg, msg) - } - hs.finishedHash.Write(certMsg.marshal()) - - pub, err = hs.processCertsFromClient(certMsg.certificates) - if err != nil { - return err - } - - msg, err = c.readHandshake() - if err != nil { - return err - } - } - - // Get client key exchange - ckx, ok := msg.(*clientKeyExchangeMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(ckx, msg) - } - hs.finishedHash.Write(ckx.marshal()) - - preMasterSecret, err := keyAgreement.processClientKeyExchange(c.config, hs.privateKey, ckx, c.vers) - if err != nil { - if err == errClientKeyExchange { - c.sendAlert(alertDecodeError) - } else { - c.sendAlert(alertInternalError) - } - return err - } - c.useEMS = hs.hello.extendedMSSupported - hs.masterSecret = masterFromPreMasterSecret(c.vers, hs.suite, preMasterSecret, hs.clientHello.random, hs.hello.random, hs.finishedHash, c.useEMS) - if err := c.config.writeKeyLog("CLIENT_RANDOM", hs.clientHello.random, hs.masterSecret); err != nil { - c.sendAlert(alertInternalError) - return err - } - - // If we received a client cert in response to our certificate request message, - // the client will send us a certificateVerifyMsg immediately after the - // clientKeyExchangeMsg. This message is a digest of all preceding - // handshake-layer messages that is signed using the private key corresponding - // to the client's certificate. This allows us to verify that the client is in - // possession of the private key of the certificate. - if len(c.peerCertificates) > 0 { - msg, err = c.readHandshake() - if err != nil { - return err - } - certVerify, ok := msg.(*certificateVerifyMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(certVerify, msg) - } - - // Determine the signature type. - _, sigType, hashFunc, err := pickSignatureAlgorithm(pub, []SignatureScheme{certVerify.signatureAlgorithm}, supportedSignatureAlgorithms, c.vers) - if err != nil { - c.sendAlert(alertIllegalParameter) - return err - } - - var digest []byte - if digest, err = hs.finishedHash.hashForClientCertificate(sigType, hashFunc, hs.masterSecret); err == nil { - err = verifyHandshakeSignature(sigType, pub, hashFunc, digest, certVerify.signature) - } - if err != nil { - c.sendAlert(alertBadCertificate) - return errors.New("tls: could not validate signature of connection nonces: " + err.Error()) - } - - hs.finishedHash.Write(certVerify.marshal()) - } - - hs.finishedHash.discardHandshakeBuffer() - - return nil -} - -func (hs *serverHandshakeState) establishKeys() error { - c := hs.c - - clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV := - keysFromMasterSecret(c.vers, hs.suite, hs.masterSecret, hs.clientHello.random, hs.hello.random, hs.suite.macLen, hs.suite.keyLen, hs.suite.ivLen) - - var clientCipher, serverCipher interface{} - var clientHash, serverHash macFunction - - if hs.suite.aead == nil { - clientCipher = hs.suite.cipher(clientKey, clientIV, true /* for reading */) - clientHash = hs.suite.mac(c.vers, clientMAC) - serverCipher = hs.suite.cipher(serverKey, serverIV, false /* not for reading */) - serverHash = hs.suite.mac(c.vers, serverMAC) - } else { - clientCipher = hs.suite.aead(clientKey, clientIV) - serverCipher = hs.suite.aead(serverKey, serverIV) - } - - c.in.prepareCipherSpec(c.vers, clientCipher, clientHash) - c.out.prepareCipherSpec(c.vers, serverCipher, serverHash) - - return nil -} - -func (hs *serverHandshakeState) readFinished(out []byte) error { - c := hs.c - - c.readRecord(recordTypeChangeCipherSpec) - if c.in.err != nil { - return c.in.err - } - - if hs.hello.nextProtoNeg { - msg, err := c.readHandshake() - if err != nil { - return err - } - nextProto, ok := msg.(*nextProtoMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(nextProto, msg) - } - hs.finishedHash.Write(nextProto.marshal()) - c.clientProtocol = nextProto.proto - } - - msg, err := c.readHandshake() - if err != nil { - return err - } - clientFinished, ok := msg.(*finishedMsg) - if !ok { - c.sendAlert(alertUnexpectedMessage) - return unexpectedMessageError(clientFinished, msg) - } - - verify := hs.finishedHash.clientSum(hs.masterSecret) - if len(verify) != len(clientFinished.verifyData) || - subtle.ConstantTimeCompare(verify, clientFinished.verifyData) != 1 { - c.sendAlert(alertDecryptError) - return errors.New("tls: client's Finished message is incorrect") - } - - hs.finishedHash.Write(clientFinished.marshal()) - copy(out, verify) - return nil -} - -func (hs *serverHandshakeState) sendSessionTicket() error { - if !hs.hello.ticketSupported { - return nil - } - - c := hs.c - m := new(newSessionTicketMsg) - - var err error - state := sessionState{ - vers: c.vers, - cipherSuite: hs.suite.id, - masterSecret: hs.masterSecret, - certificates: hs.certsFromClient, - usedEMS: c.useEMS, - } - m.ticket, err = c.encryptTicket(state.marshal()) - if err != nil { - return err - } - - hs.finishedHash.Write(m.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, m.marshal()); err != nil { - return err - } - - return nil -} - -func (hs *serverHandshakeState) sendFinished(out []byte) error { - c := hs.c - - if _, err := c.writeRecord(recordTypeChangeCipherSpec, []byte{1}); err != nil { - return err - } - - finished := new(finishedMsg) - finished.verifyData = hs.finishedHash.serverSum(hs.masterSecret) - hs.finishedHash.Write(finished.marshal()) - if _, err := c.writeRecord(recordTypeHandshake, finished.marshal()); err != nil { - return err - } - - c.cipherSuite = hs.suite.id - copy(out, finished.verifyData) - - return nil -} - -// processCertsFromClient takes a chain of client certificates either from a -// Certificates message or from a sessionState and verifies them. It returns -// the public key of the leaf certificate. -func (hs *serverHandshakeState) processCertsFromClient(certificates [][]byte) (crypto.PublicKey, error) { - c := hs.c - - if len(certificates) == 0 { - // The client didn't actually send a certificate - switch c.config.ClientAuth { - case RequireAnyClientCert, RequireAndVerifyClientCert: - c.sendAlert(alertBadCertificate) - return nil, errors.New("tls: client didn't provide a certificate") - } - } - - hs.certsFromClient = certificates - certs := make([]*x509.Certificate, len(certificates)) - var err error - for i, asn1Data := range certificates { - if certs[i], err = x509.ParseCertificate(asn1Data); err != nil { - c.sendAlert(alertBadCertificate) - return nil, errors.New("tls: failed to parse client certificate: " + err.Error()) - } - } - - if c.config.ClientAuth >= VerifyClientCertIfGiven && len(certs) > 0 { - opts := x509.VerifyOptions{ - Roots: c.config.ClientCAs, - CurrentTime: c.config.time(), - Intermediates: x509.NewCertPool(), - KeyUsages: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}, - } - - for _, cert := range certs[1:] { - opts.Intermediates.AddCert(cert) - } - - chains, err := certs[0].Verify(opts) - if err != nil { - c.sendAlert(alertBadCertificate) - return nil, errors.New("tls: failed to verify client's certificate: " + err.Error()) - } - - c.verifiedChains = chains - } - - if c.config.VerifyPeerCertificate != nil { - if err := c.config.VerifyPeerCertificate(certificates, c.verifiedChains); err != nil { - c.sendAlert(alertBadCertificate) - return nil, err - } - } - - if len(certs) == 0 { - return nil, nil - } - - var pub crypto.PublicKey - switch key := certs[0].PublicKey.(type) { - case *ecdsa.PublicKey, *rsa.PublicKey: - pub = key - default: - c.sendAlert(alertUnsupportedCertificate) - return nil, fmt.Errorf("tls: client's certificate contains an unsupported public key of type %T", certs[0].PublicKey) - } - c.peerCertificates = certs - return pub, nil -} - -// setCipherSuite sets a cipherSuite with the given id as the serverHandshakeState -// suite if that cipher suite is acceptable to use. -// It returns a bool indicating if the suite was set. -func (hs *serverHandshakeState) setCipherSuite(id uint16, supportedCipherSuites []uint16, version uint16) bool { - for _, supported := range supportedCipherSuites { - if id == supported { - var candidate *cipherSuite - - for _, s := range cipherSuites { - if s.id == id { - candidate = s - break - } - } - if candidate == nil { - continue - } - - if version >= VersionTLS13 && candidate.flags&suiteTLS13 != 0 { - hs.suite = candidate - return true - } - if version < VersionTLS13 && candidate.flags&suiteTLS13 != 0 { - continue - } - - // Don't select a ciphersuite which we can't - // support for this client. - if candidate.flags&suiteECDHE != 0 { - if !hs.ellipticOk { - continue - } - if candidate.flags&suiteECDSA != 0 { - if !hs.ecdsaOk { - continue - } - } else if !hs.rsaSignOk { - continue - } - } else if !hs.rsaDecryptOk { - continue - } - if version < VersionTLS12 && candidate.flags&suiteTLS12 != 0 { - continue - } - hs.suite = candidate - return true - } - } - return false -} - -// suppVersArray is the backing array of ClientHelloInfo.SupportedVersions -var suppVersArray = [...]uint16{VersionTLS12, VersionTLS11, VersionTLS10, VersionSSL30} - -func (hs *serverHandshakeState) clientHelloInfo() *ClientHelloInfo { - if hs.cachedClientHelloInfo != nil { - return hs.cachedClientHelloInfo - } - - var supportedVersions []uint16 - if hs.clientHello.supportedVersions != nil { - supportedVersions = hs.clientHello.supportedVersions - } else if hs.clientHello.vers > VersionTLS12 { - supportedVersions = suppVersArray[:] - } else if hs.clientHello.vers >= VersionSSL30 { - supportedVersions = suppVersArray[VersionTLS12-hs.clientHello.vers:] - } - - var pskBinder []byte - if len(hs.clientHello.psks) > 0 { - pskBinder = hs.clientHello.psks[0].binder - } - - hs.cachedClientHelloInfo = &ClientHelloInfo{ - CipherSuites: hs.clientHello.cipherSuites, - ServerName: hs.clientHello.serverName, - SupportedCurves: hs.clientHello.supportedCurves, - SupportedPoints: hs.clientHello.supportedPoints, - SignatureSchemes: hs.clientHello.supportedSignatureAlgorithms, - SupportedProtos: hs.clientHello.alpnProtocols, - SupportedVersions: supportedVersions, - Conn: hs.c.conn, - Offered0RTTData: hs.clientHello.earlyData, - AcceptsDelegatedCredential: hs.clientHello.delegatedCredential, - Fingerprint: pskBinder, - } - - return hs.cachedClientHelloInfo -} diff --git a/external/github.com/marten-seemann/qtls/hkdf.go b/external/github.com/marten-seemann/qtls/hkdf.go deleted file mode 100644 index 456de3f7b0..0000000000 --- a/external/github.com/marten-seemann/qtls/hkdf.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -// Mostly derived from golang.org/x/crypto/hkdf, but with an exposed -// Extract API. -// -// HKDF is a cryptographic key derivation function (KDF) with the goal of -// expanding limited input keying material into one or more cryptographically -// strong secret keys. -// -// RFC 5869: https://tools.ietf.org/html/rfc5869 - -import ( - "crypto" - "crypto/hmac" -) - -func hkdfExpand(hash crypto.Hash, prk, info []byte, l int) []byte { - var ( - expander = hmac.New(hash.New, prk) - res = make([]byte, l) - counter = byte(1) - prev []byte - ) - - if l > 255*expander.Size() { - panic("hkdf: requested too much output") - } - - p := res - for len(p) > 0 { - expander.Reset() - expander.Write(prev) - expander.Write(info) - expander.Write([]byte{counter}) - prev = expander.Sum(prev[:0]) - counter++ - n := copy(p, prev) - p = p[n:] - } - - return res -} - -// HkdfExtract generates a pseudorandom key for use with Expand from an input secret and an optional independent salt. -func HkdfExtract(hash crypto.Hash, secret, salt []byte) []byte { - return hkdfExtract(hash, secret, salt) -} - -func hkdfExtract(hash crypto.Hash, secret, salt []byte) []byte { - if salt == nil { - salt = make([]byte, hash.Size()) - } - if secret == nil { - secret = make([]byte, hash.Size()) - } - extractor := hmac.New(hash.New, salt) - extractor.Write(secret) - return extractor.Sum(nil) -} diff --git a/external/github.com/marten-seemann/qtls/key_agreement.go b/external/github.com/marten-seemann/qtls/key_agreement.go deleted file mode 100644 index 6bdbbd9497..0000000000 --- a/external/github.com/marten-seemann/qtls/key_agreement.go +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "crypto" - "crypto/elliptic" - "crypto/md5" - "crypto/rsa" - "crypto/sha1" - "errors" - "io" - "math/big" - - "golang.org/x/crypto/curve25519" -) - -var errClientKeyExchange = errors.New("tls: invalid ClientKeyExchange message") -var errServerKeyExchange = errors.New("tls: invalid ServerKeyExchange message") - -// rsaKeyAgreement implements the standard TLS key agreement where the client -// encrypts the pre-master secret to the server's public key. -type rsaKeyAgreement struct{} - -func (ka rsaKeyAgreement) generateServerKeyExchange(config *Config, sk crypto.PrivateKey, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) { - return nil, nil -} - -func (ka rsaKeyAgreement) processClientKeyExchange(config *Config, sk crypto.PrivateKey, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) { - if len(ckx.ciphertext) < 2 { - return nil, errClientKeyExchange - } - - ciphertext := ckx.ciphertext - if version != VersionSSL30 { - ciphertextLen := int(ckx.ciphertext[0])<<8 | int(ckx.ciphertext[1]) - if ciphertextLen != len(ckx.ciphertext)-2 { - return nil, errClientKeyExchange - } - ciphertext = ckx.ciphertext[2:] - } - priv, ok := sk.(crypto.Decrypter) - if !ok { - return nil, errors.New("tls: certificate private key does not implement crypto.Decrypter") - } - // Perform constant time RSA PKCS#1 v1.5 decryption - preMasterSecret, err := priv.Decrypt(config.rand(), ciphertext, &rsa.PKCS1v15DecryptOptions{SessionKeyLen: 48}) - if err != nil { - return nil, err - } - // We don't check the version number in the premaster secret. For one, - // by checking it, we would leak information about the validity of the - // encrypted pre-master secret. Secondly, it provides only a small - // benefit against a downgrade attack and some implementations send the - // wrong version anyway. See the discussion at the end of section - // 7.4.7.1 of RFC 4346. - return preMasterSecret, nil -} - -func (ka rsaKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, pk crypto.PublicKey, skx *serverKeyExchangeMsg) error { - return errors.New("tls: unexpected ServerKeyExchange") -} - -func (ka rsaKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, pk crypto.PublicKey) ([]byte, *clientKeyExchangeMsg, error) { - preMasterSecret := make([]byte, 48) - preMasterSecret[0] = byte(clientHello.vers >> 8) - preMasterSecret[1] = byte(clientHello.vers) - _, err := io.ReadFull(config.rand(), preMasterSecret[2:]) - if err != nil { - return nil, nil, err - } - - encrypted, err := rsa.EncryptPKCS1v15(config.rand(), pk.(*rsa.PublicKey), preMasterSecret) - if err != nil { - return nil, nil, err - } - ckx := new(clientKeyExchangeMsg) - ckx.ciphertext = make([]byte, len(encrypted)+2) - ckx.ciphertext[0] = byte(len(encrypted) >> 8) - ckx.ciphertext[1] = byte(len(encrypted)) - copy(ckx.ciphertext[2:], encrypted) - return preMasterSecret, ckx, nil -} - -// sha1Hash calculates a SHA1 hash over the given byte slices. -func sha1Hash(slices [][]byte) []byte { - hsha1 := sha1.New() - for _, slice := range slices { - hsha1.Write(slice) - } - return hsha1.Sum(nil) -} - -// md5SHA1Hash implements TLS 1.0's hybrid hash function which consists of the -// concatenation of an MD5 and SHA1 hash. -func md5SHA1Hash(slices [][]byte) []byte { - md5sha1 := make([]byte, md5.Size+sha1.Size) - hmd5 := md5.New() - for _, slice := range slices { - hmd5.Write(slice) - } - copy(md5sha1, hmd5.Sum(nil)) - copy(md5sha1[md5.Size:], sha1Hash(slices)) - return md5sha1 -} - -// hashForServerKeyExchange hashes the given slices and returns their digest -// using the given hash function. -func hashForServerKeyExchange(sigType uint8, hashFunc crypto.Hash, version uint16, slices ...[]byte) ([]byte, error) { - if version >= VersionTLS12 { - h := hashFunc.New() - for _, slice := range slices { - h.Write(slice) - } - digest := h.Sum(nil) - return digest, nil - } - if sigType == signatureECDSA { - return sha1Hash(slices), nil - } - return md5SHA1Hash(slices), nil -} - -func curveForCurveID(id CurveID) (elliptic.Curve, bool) { - switch id { - case CurveP256: - return elliptic.P256(), true - case CurveP384: - return elliptic.P384(), true - case CurveP521: - return elliptic.P521(), true - default: - return nil, false - } - -} - -// ecdheKeyAgreement implements a TLS key agreement where the server -// generates an ephemeral EC public/private key pair and signs it. The -// pre-master secret is then calculated using ECDH. The signature may -// either be ECDSA or RSA. -type ecdheKeyAgreement struct { - version uint16 - isRSA bool - privateKey []byte - curveid CurveID - - // publicKey is used to store the peer's public value when X25519 is - // being used. - publicKey []byte - // x and y are used to store the peer's public value when one of the - // NIST curves is being used. - x, y *big.Int -} - -func (ka *ecdheKeyAgreement) generateServerKeyExchange(config *Config, sk crypto.PrivateKey, clientHello *clientHelloMsg, hello *serverHelloMsg) (*serverKeyExchangeMsg, error) { - preferredCurves := config.curvePreferences() - -NextCandidate: - for _, candidate := range preferredCurves { - for _, c := range clientHello.supportedCurves { - if candidate == c { - ka.curveid = c - break NextCandidate - } - } - } - - if ka.curveid == 0 { - return nil, errors.New("tls: no supported elliptic curves offered") - } - - var ecdhePublic []byte - - if ka.curveid == X25519 { - var scalar, public [32]byte - if _, err := io.ReadFull(config.rand(), scalar[:]); err != nil { - return nil, err - } - - curve25519.ScalarBaseMult(&public, &scalar) - ka.privateKey = scalar[:] - ecdhePublic = public[:] - } else { - curve, ok := curveForCurveID(ka.curveid) - if !ok { - return nil, errors.New("tls: preferredCurves includes unsupported curve") - } - - var x, y *big.Int - var err error - ka.privateKey, x, y, err = elliptic.GenerateKey(curve, config.rand()) - if err != nil { - return nil, err - } - ecdhePublic = elliptic.Marshal(curve, x, y) - } - - // http://tools.ietf.org/html/rfc4492#section-5.4 - serverECDHParams := make([]byte, 1+2+1+len(ecdhePublic)) - serverECDHParams[0] = 3 // named curve - serverECDHParams[1] = byte(ka.curveid >> 8) - serverECDHParams[2] = byte(ka.curveid) - serverECDHParams[3] = byte(len(ecdhePublic)) - copy(serverECDHParams[4:], ecdhePublic) - - priv, ok := sk.(crypto.Signer) - if !ok { - return nil, errors.New("tls: certificate private key does not implement crypto.Signer") - } - - signatureAlgorithm, sigType, hashFunc, err := pickSignatureAlgorithm(priv.Public(), clientHello.supportedSignatureAlgorithms, supportedSignatureAlgorithms, ka.version) - if err != nil { - return nil, err - } - if (sigType == signaturePKCS1v15 || sigType == signatureRSAPSS) != ka.isRSA { - return nil, errors.New("tls: certificate cannot be used with the selected cipher suite") - } - - digest, err := hashForServerKeyExchange(sigType, hashFunc, ka.version, clientHello.random, hello.random, serverECDHParams) - if err != nil { - return nil, err - } - - var sig []byte - signOpts := crypto.SignerOpts(hashFunc) - if sigType == signatureRSAPSS { - signOpts = &rsa.PSSOptions{SaltLength: rsa.PSSSaltLengthEqualsHash, Hash: hashFunc} - } - sig, err = priv.Sign(config.rand(), digest, signOpts) - if err != nil { - return nil, errors.New("tls: failed to sign ECDHE parameters: " + err.Error()) - } - - skx := new(serverKeyExchangeMsg) - sigAndHashLen := 0 - if ka.version >= VersionTLS12 { - sigAndHashLen = 2 - } - skx.key = make([]byte, len(serverECDHParams)+sigAndHashLen+2+len(sig)) - copy(skx.key, serverECDHParams) - k := skx.key[len(serverECDHParams):] - if ka.version >= VersionTLS12 { - k[0] = byte(signatureAlgorithm >> 8) - k[1] = byte(signatureAlgorithm) - k = k[2:] - } - k[0] = byte(len(sig) >> 8) - k[1] = byte(len(sig)) - copy(k[2:], sig) - - return skx, nil -} - -func (ka *ecdheKeyAgreement) processClientKeyExchange(config *Config, sk crypto.PrivateKey, ckx *clientKeyExchangeMsg, version uint16) ([]byte, error) { - if len(ckx.ciphertext) == 0 || int(ckx.ciphertext[0]) != len(ckx.ciphertext)-1 { - return nil, errClientKeyExchange - } - - if ka.curveid == X25519 { - if len(ckx.ciphertext) != 1+32 { - return nil, errClientKeyExchange - } - - var theirPublic, sharedKey, scalar [32]byte - copy(theirPublic[:], ckx.ciphertext[1:]) - copy(scalar[:], ka.privateKey) - curve25519.ScalarMult(&sharedKey, &scalar, &theirPublic) - return sharedKey[:], nil - } - - curve, ok := curveForCurveID(ka.curveid) - if !ok { - panic("internal error") - } - x, y := elliptic.Unmarshal(curve, ckx.ciphertext[1:]) // Unmarshal also checks whether the given point is on the curve - if x == nil { - return nil, errClientKeyExchange - } - x, _ = curve.ScalarMult(x, y, ka.privateKey) - curveSize := (curve.Params().BitSize + 7) >> 3 - xBytes := x.Bytes() - if len(xBytes) == curveSize { - return xBytes, nil - } - preMasterSecret := make([]byte, curveSize) - copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes) - return preMasterSecret, nil -} - -func (ka *ecdheKeyAgreement) processServerKeyExchange(config *Config, clientHello *clientHelloMsg, serverHello *serverHelloMsg, pk crypto.PublicKey, skx *serverKeyExchangeMsg) error { - if len(skx.key) < 4 { - return errServerKeyExchange - } - if skx.key[0] != 3 { // named curve - return errors.New("tls: server selected unsupported curve") - } - ka.curveid = CurveID(skx.key[1])<<8 | CurveID(skx.key[2]) - - publicLen := int(skx.key[3]) - if publicLen+4 > len(skx.key) { - return errServerKeyExchange - } - serverECDHParams := skx.key[:4+publicLen] - publicKey := serverECDHParams[4:] - - sig := skx.key[4+publicLen:] - if len(sig) < 2 { - return errServerKeyExchange - } - - if ka.curveid == X25519 { - if len(publicKey) != 32 { - return errors.New("tls: bad X25519 public value") - } - ka.publicKey = publicKey - } else { - curve, ok := curveForCurveID(ka.curveid) - if !ok { - return errors.New("tls: server selected unsupported curve") - } - ka.x, ka.y = elliptic.Unmarshal(curve, publicKey) // Unmarshal also checks whether the given point is on the curve - if ka.x == nil { - return errServerKeyExchange - } - } - - var signatureAlgorithm SignatureScheme - if ka.version >= VersionTLS12 { - // handle SignatureAndHashAlgorithm - signatureAlgorithm = SignatureScheme(sig[0])<<8 | SignatureScheme(sig[1]) - sig = sig[2:] - if len(sig) < 2 { - return errServerKeyExchange - } - } - _, sigType, hashFunc, err := pickSignatureAlgorithm(pk, []SignatureScheme{signatureAlgorithm}, clientHello.supportedSignatureAlgorithms, ka.version) - if err != nil { - return err - } - if (sigType == signaturePKCS1v15 || sigType == signatureRSAPSS) != ka.isRSA { - return errServerKeyExchange - } - - sigLen := int(sig[0])<<8 | int(sig[1]) - if sigLen+2 != len(sig) { - return errServerKeyExchange - } - sig = sig[2:] - - digest, err := hashForServerKeyExchange(sigType, hashFunc, ka.version, clientHello.random, serverHello.random, serverECDHParams) - if err != nil { - return err - } - return verifyHandshakeSignature(sigType, pk, hashFunc, digest, sig) -} - -func (ka *ecdheKeyAgreement) generateClientKeyExchange(config *Config, clientHello *clientHelloMsg, pk crypto.PublicKey) ([]byte, *clientKeyExchangeMsg, error) { - if ka.curveid == 0 { - return nil, nil, errors.New("tls: missing ServerKeyExchange message") - } - - var serialized, preMasterSecret []byte - - if ka.curveid == X25519 { - var ourPublic, theirPublic, sharedKey, scalar [32]byte - - if _, err := io.ReadFull(config.rand(), scalar[:]); err != nil { - return nil, nil, err - } - - copy(theirPublic[:], ka.publicKey) - curve25519.ScalarBaseMult(&ourPublic, &scalar) - curve25519.ScalarMult(&sharedKey, &scalar, &theirPublic) - serialized = ourPublic[:] - preMasterSecret = sharedKey[:] - } else { - curve, ok := curveForCurveID(ka.curveid) - if !ok { - panic("internal error") - } - priv, mx, my, err := elliptic.GenerateKey(curve, config.rand()) - if err != nil { - return nil, nil, err - } - x, _ := curve.ScalarMult(ka.x, ka.y, priv) - preMasterSecret = make([]byte, (curve.Params().BitSize+7)>>3) - xBytes := x.Bytes() - copy(preMasterSecret[len(preMasterSecret)-len(xBytes):], xBytes) - - serialized = elliptic.Marshal(curve, mx, my) - } - - ckx := new(clientKeyExchangeMsg) - ckx.ciphertext = make([]byte, 1+len(serialized)) - ckx.ciphertext[0] = byte(len(serialized)) - copy(ckx.ciphertext[1:], serialized) - - return preMasterSecret, ckx, nil -} diff --git a/external/github.com/marten-seemann/qtls/prf.go b/external/github.com/marten-seemann/qtls/prf.go deleted file mode 100644 index 1a6d3156da..0000000000 --- a/external/github.com/marten-seemann/qtls/prf.go +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "crypto" - "crypto/hmac" - "crypto/md5" - "crypto/sha1" - "crypto/sha256" - "crypto/sha512" - "errors" - "fmt" - "hash" -) - -// Split a premaster secret in two as specified in RFC 4346, section 5. -func splitPreMasterSecret(secret []byte) (s1, s2 []byte) { - s1 = secret[0 : (len(secret)+1)/2] - s2 = secret[len(secret)/2:] - return -} - -// pHash implements the P_hash function, as defined in RFC 4346, section 5. -func pHash(result, secret, seed []byte, hash func() hash.Hash) { - h := hmac.New(hash, secret) - h.Write(seed) - a := h.Sum(nil) - - j := 0 - for j < len(result) { - h.Reset() - h.Write(a) - h.Write(seed) - b := h.Sum(nil) - copy(result[j:], b) - j += len(b) - - h.Reset() - h.Write(a) - a = h.Sum(nil) - } -} - -// prf10 implements the TLS 1.0 pseudo-random function, as defined in RFC 2246, section 5. -func prf10(result, secret, label, seed []byte) { - hashSHA1 := sha1.New - hashMD5 := md5.New - - labelAndSeed := make([]byte, len(label)+len(seed)) - copy(labelAndSeed, label) - copy(labelAndSeed[len(label):], seed) - - s1, s2 := splitPreMasterSecret(secret) - pHash(result, s1, labelAndSeed, hashMD5) - result2 := make([]byte, len(result)) - pHash(result2, s2, labelAndSeed, hashSHA1) - - for i, b := range result2 { - result[i] ^= b - } -} - -// prf12 implements the TLS 1.2 pseudo-random function, as defined in RFC 5246, section 5. -func prf12(hashFunc func() hash.Hash) func(result, secret, label, seed []byte) { - return func(result, secret, label, seed []byte) { - labelAndSeed := make([]byte, len(label)+len(seed)) - copy(labelAndSeed, label) - copy(labelAndSeed[len(label):], seed) - - pHash(result, secret, labelAndSeed, hashFunc) - } -} - -// prf30 implements the SSL 3.0 pseudo-random function, as defined in -// www.mozilla.org/projects/security/pki/nss/ssl/draft302.txt section 6. -func prf30(result, secret, label, seed []byte) { - hashSHA1 := sha1.New() - hashMD5 := md5.New() - - done := 0 - i := 0 - // RFC 5246 section 6.3 says that the largest PRF output needed is 128 - // bytes. Since no more ciphersuites will be added to SSLv3, this will - // remain true. Each iteration gives us 16 bytes so 10 iterations will - // be sufficient. - var b [11]byte - for done < len(result) { - for j := 0; j <= i; j++ { - b[j] = 'A' + byte(i) - } - - hashSHA1.Reset() - hashSHA1.Write(b[:i+1]) - hashSHA1.Write(secret) - hashSHA1.Write(seed) - digest := hashSHA1.Sum(nil) - - hashMD5.Reset() - hashMD5.Write(secret) - hashMD5.Write(digest) - - done += copy(result[done:], hashMD5.Sum(nil)) - i++ - } -} - -const ( - tlsRandomLength = 32 // Length of a random nonce in TLS 1.1. - masterSecretLength = 48 // Length of a master secret in TLS 1.1. - finishedVerifyLength = 12 // Length of verify_data in a Finished message. -) - -var masterSecretLabel = []byte("master secret") -var keyExpansionLabel = []byte("key expansion") -var clientFinishedLabel = []byte("client finished") -var serverFinishedLabel = []byte("server finished") -var extendedMasterSecretLabel = []byte("extended master secret") - -func prfAndHashForVersion(version uint16, suite *cipherSuite) (func(result, secret, label, seed []byte), crypto.Hash) { - switch version { - case VersionSSL30: - return prf30, crypto.Hash(0) - case VersionTLS10, VersionTLS11: - return prf10, crypto.Hash(0) - case VersionTLS12: - if suite.flags&suiteSHA384 != 0 { - return prf12(sha512.New384), crypto.SHA384 - } - return prf12(sha256.New), crypto.SHA256 - default: - panic("unknown version") - } -} - -func prfForVersion(version uint16, suite *cipherSuite) func(result, secret, label, seed []byte) { - prf, _ := prfAndHashForVersion(version, suite) - return prf -} - -// masterFromPreMasterSecret generates the master secret from the pre-master -// secret. See http://tools.ietf.org/html/rfc5246#section-8.1 -func masterFromPreMasterSecret(version uint16, suite *cipherSuite, preMasterSecret, clientRandom, serverRandom []byte, fin finishedHash, ems bool) []byte { - if ems { - session_hash := fin.Sum() - masterSecret := make([]byte, masterSecretLength) - prfForVersion(version, suite)(masterSecret, preMasterSecret, extendedMasterSecretLabel, session_hash) - return masterSecret - } else { - seed := make([]byte, 0, len(clientRandom)+len(serverRandom)) - seed = append(seed, clientRandom...) - seed = append(seed, serverRandom...) - - masterSecret := make([]byte, masterSecretLength) - prfForVersion(version, suite)(masterSecret, preMasterSecret, masterSecretLabel, seed) - return masterSecret - } -} - -// keysFromMasterSecret generates the connection keys from the master -// secret, given the lengths of the MAC key, cipher key and IV, as defined in -// RFC 2246, section 6.3. -func keysFromMasterSecret(version uint16, suite *cipherSuite, masterSecret, clientRandom, serverRandom []byte, macLen, keyLen, ivLen int) (clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV []byte) { - seed := make([]byte, 0, len(serverRandom)+len(clientRandom)) - seed = append(seed, serverRandom...) - seed = append(seed, clientRandom...) - - n := 2*macLen + 2*keyLen + 2*ivLen - keyMaterial := make([]byte, n) - prfForVersion(version, suite)(keyMaterial, masterSecret, keyExpansionLabel, seed) - clientMAC = keyMaterial[:macLen] - keyMaterial = keyMaterial[macLen:] - serverMAC = keyMaterial[:macLen] - keyMaterial = keyMaterial[macLen:] - clientKey = keyMaterial[:keyLen] - keyMaterial = keyMaterial[keyLen:] - serverKey = keyMaterial[:keyLen] - keyMaterial = keyMaterial[keyLen:] - clientIV = keyMaterial[:ivLen] - keyMaterial = keyMaterial[ivLen:] - serverIV = keyMaterial[:ivLen] - return -} - -// lookupTLSHash looks up the corresponding crypto.Hash for a given -// hash from a TLS SignatureScheme. -func lookupTLSHash(signatureAlgorithm SignatureScheme) (crypto.Hash, error) { - switch signatureAlgorithm { - case PKCS1WithSHA1, ECDSAWithSHA1: - return crypto.SHA1, nil - case PKCS1WithSHA256, PSSWithSHA256, ECDSAWithP256AndSHA256: - return crypto.SHA256, nil - case PKCS1WithSHA384, PSSWithSHA384, ECDSAWithP384AndSHA384: - return crypto.SHA384, nil - case PKCS1WithSHA512, PSSWithSHA512, ECDSAWithP521AndSHA512: - return crypto.SHA512, nil - default: - return 0, fmt.Errorf("tls: unsupported signature algorithm: %#04x", signatureAlgorithm) - } -} - -func newFinishedHash(version uint16, cipherSuite *cipherSuite) finishedHash { - var buffer []byte - if version == VersionSSL30 || version >= VersionTLS12 { - buffer = []byte{} - } - - prf, hash := prfAndHashForVersion(version, cipherSuite) - if hash != 0 { - return finishedHash{hash.New(), hash.New(), nil, nil, buffer, version, prf} - } - - return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf} -} - -// A finishedHash calculates the hash of a set of handshake messages suitable -// for including in a Finished message. -type finishedHash struct { - client hash.Hash - server hash.Hash - - // Prior to TLS 1.2, an additional MD5 hash is required. - clientMD5 hash.Hash - serverMD5 hash.Hash - - // In TLS 1.2, a full buffer is sadly required. - buffer []byte - - version uint16 - prf func(result, secret, label, seed []byte) -} - -func (h *finishedHash) Write(msg []byte) (n int, err error) { - h.client.Write(msg) - h.server.Write(msg) - - if h.version < VersionTLS12 { - h.clientMD5.Write(msg) - h.serverMD5.Write(msg) - } - - if h.buffer != nil { - h.buffer = append(h.buffer, msg...) - } - - return len(msg), nil -} - -func (h finishedHash) Sum() []byte { - if h.version >= VersionTLS12 { - return h.client.Sum(nil) - } - - out := make([]byte, 0, md5.Size+sha1.Size) - out = h.clientMD5.Sum(out) - return h.client.Sum(out) -} - -// finishedSum30 calculates the contents of the verify_data member of a SSLv3 -// Finished message given the MD5 and SHA1 hashes of a set of handshake -// messages. -func finishedSum30(md5, sha1 hash.Hash, masterSecret []byte, magic []byte) []byte { - md5.Write(magic) - md5.Write(masterSecret) - md5.Write(ssl30Pad1[:]) - md5Digest := md5.Sum(nil) - - md5.Reset() - md5.Write(masterSecret) - md5.Write(ssl30Pad2[:]) - md5.Write(md5Digest) - md5Digest = md5.Sum(nil) - - sha1.Write(magic) - sha1.Write(masterSecret) - sha1.Write(ssl30Pad1[:40]) - sha1Digest := sha1.Sum(nil) - - sha1.Reset() - sha1.Write(masterSecret) - sha1.Write(ssl30Pad2[:40]) - sha1.Write(sha1Digest) - sha1Digest = sha1.Sum(nil) - - ret := make([]byte, len(md5Digest)+len(sha1Digest)) - copy(ret, md5Digest) - copy(ret[len(md5Digest):], sha1Digest) - return ret -} - -var ssl3ClientFinishedMagic = [4]byte{0x43, 0x4c, 0x4e, 0x54} -var ssl3ServerFinishedMagic = [4]byte{0x53, 0x52, 0x56, 0x52} - -// clientSum returns the contents of the verify_data member of a client's -// Finished message. -func (h finishedHash) clientSum(masterSecret []byte) []byte { - if h.version == VersionSSL30 { - return finishedSum30(h.clientMD5, h.client, masterSecret, ssl3ClientFinishedMagic[:]) - } - - out := make([]byte, finishedVerifyLength) - h.prf(out, masterSecret, clientFinishedLabel, h.Sum()) - return out -} - -// serverSum returns the contents of the verify_data member of a server's -// Finished message. -func (h finishedHash) serverSum(masterSecret []byte) []byte { - if h.version == VersionSSL30 { - return finishedSum30(h.serverMD5, h.server, masterSecret, ssl3ServerFinishedMagic[:]) - } - - out := make([]byte, finishedVerifyLength) - h.prf(out, masterSecret, serverFinishedLabel, h.Sum()) - return out -} - -// hashForClientCertificate returns a digest over the handshake messages so far, -// suitable for signing by a TLS client certificate. -func (h finishedHash) hashForClientCertificate(sigType uint8, hashAlg crypto.Hash, masterSecret []byte) ([]byte, error) { - if (h.version == VersionSSL30 || h.version >= VersionTLS12) && h.buffer == nil { - panic("a handshake hash for a client-certificate was requested after discarding the handshake buffer") - } - - if h.version == VersionSSL30 { - if sigType != signaturePKCS1v15 { - return nil, errors.New("tls: unsupported signature type for client certificate") - } - - md5Hash := md5.New() - md5Hash.Write(h.buffer) - sha1Hash := sha1.New() - sha1Hash.Write(h.buffer) - return finishedSum30(md5Hash, sha1Hash, masterSecret, nil), nil - } - if h.version >= VersionTLS12 { - hash := hashAlg.New() - hash.Write(h.buffer) - return hash.Sum(nil), nil - } - - if sigType == signatureECDSA { - return h.server.Sum(nil), nil - } - - return h.Sum(), nil -} - -// discardHandshakeBuffer is called when there is no more need to -// buffer the entirety of the handshake messages. -func (h *finishedHash) discardHandshakeBuffer() { - h.buffer = nil -} diff --git a/external/github.com/marten-seemann/qtls/subcerts.go b/external/github.com/marten-seemann/qtls/subcerts.go deleted file mode 100644 index e1cfaf4307..0000000000 --- a/external/github.com/marten-seemann/qtls/subcerts.go +++ /dev/null @@ -1,392 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -// Delegated credentials for TLS -// (https://tools.ietf.org/html/draft-ietf-tls-subcerts-02) is an IETF Internet -// draft and proposed TLS extension. This allows a backend server to delegate -// TLS termination to a trusted frontend. If the client supports this extension, -// then the frontend may use a "delegated credential" as the signing key in the -// handshake. A delegated credential is a short lived key pair delegated to the -// server by an entity trusted by the client. Once issued, credentials can't be -// revoked; in order to mitigate risk in case the frontend is compromised, the -// credential is only valid for a short time (days, hours, or even minutes). -// -// This implements draft 02. This draft doesn't specify an object identifier for -// the X.509 extension; we use one assigned by Cloudflare. In addition, IANA has -// not assigned an extension ID for this extension; we picked up one that's not -// yet taken. -// -// TODO(cjpatton) Only ECDSA is supported with delegated credentials for now; -// we'd like to suppoort for EcDSA signatures once these have better support -// upstream. - -import ( - "bytes" - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/x509" - "encoding/asn1" - "encoding/binary" - "errors" - "fmt" - "time" -) - -const ( - // length of the public key field - dcPubKeyFieldLen = 3 - dcMaxTTLSeconds = 60 * 60 * 24 * 7 // 7 days - dcMaxTTL = time.Duration(dcMaxTTLSeconds * time.Second) - dcMaxPublicKeyLen = 1 << 24 // Bytes - dcMaxSignatureLen = 1 << 16 // Bytes -) - -var errNoDelegationUsage = errors.New("certificate not authorized for delegation") - -// delegationUsageId is the DelegationUsage X.509 extension OID -// -// NOTE(cjpatton) This OID is a child of Cloudflare's IANA-assigned OID. -var delegationUsageId = asn1.ObjectIdentifier{1, 3, 6, 1, 4, 1, 44363, 44} - -// canDelegate returns true if a certificate can be used for delegated -// credentials. -func canDelegate(cert *x509.Certificate) bool { - // Check that the digitalSignature key usage is set. - if (cert.KeyUsage & x509.KeyUsageDigitalSignature) == 0 { - return false - } - - // Check that the certificate has the DelegationUsage extension and that - // it's non-critical (per the spec). - for _, extension := range cert.Extensions { - if extension.Id.Equal(delegationUsageId) { - return true - } - } - return false -} - -// credential stores the public components of a credential. -type credential struct { - // The serialized form of the credential. - raw []byte - - // The amount of time for which the credential is valid. Specifically, the - // the credential expires `ValidTime` seconds after the `notBefore` of the - // delegation certificate. The delegator shall not issue delegated - // credentials that are valid for more than 7 days from the current time. - // - // When this data structure is serialized, this value is converted to a - // uint32 representing the duration in seconds. - validTime time.Duration - - // The signature scheme associated with the delegated credential public key. - expectedCertVerifyAlgorithm SignatureScheme - - // The version of TLS in which the credential will be used. - expectedVersion uint16 - - // The credential public key. - publicKey crypto.PublicKey -} - -// isExpired returns true if the credential has expired. The end of the validity -// interval is defined as the delegator certificate's notBefore field (`start`) -// plus ValidTime seconds. This function simply checks that the current time -// (`now`) is before the end of the valdity interval. -func (cred *credential) isExpired(start, now time.Time) bool { - end := start.Add(cred.validTime) - return !now.Before(end) -} - -// invalidTTL returns true if the credential's validity period is longer than the -// maximum permitted. This is defined by the certificate's notBefore field -// (`start`) plus the ValidTime, minus the current time (`now`). -func (cred *credential) invalidTTL(start, now time.Time) bool { - return cred.validTime > (now.Sub(start) + dcMaxTTL).Round(time.Second) -} - -// marshalSubjectPublicKeyInfo returns a DER encoded SubjectPublicKeyInfo structure -// (as defined in the X.509 standard) for the credential. -func (cred *credential) marshalSubjectPublicKeyInfo() ([]byte, error) { - switch cred.expectedCertVerifyAlgorithm { - case ECDSAWithP256AndSHA256, - ECDSAWithP384AndSHA384, - ECDSAWithP521AndSHA512: - serializedPublicKey, err := x509.MarshalPKIXPublicKey(cred.publicKey) - if err != nil { - return nil, err - } - return serializedPublicKey, nil - - default: - return nil, fmt.Errorf("unsupported signature scheme: 0x%04x", cred.expectedCertVerifyAlgorithm) - } -} - -// marshal encodes a credential in the wire format specified in -// https://tools.ietf.org/html/draft-ietf-tls-subcerts-02. -func (cred *credential) marshal() ([]byte, error) { - // The number of bytes comprising the DC parameters, which includes the - // validity time (4 bytes), the signature scheme of the public key (2 bytes), and - // the protocol version (2 bytes). - paramsLen := 8 - - // The first 4 bytes are the valid_time, scheme, and version fields. - serialized := make([]byte, paramsLen+dcPubKeyFieldLen) - binary.BigEndian.PutUint32(serialized, uint32(cred.validTime/time.Second)) - binary.BigEndian.PutUint16(serialized[4:], uint16(cred.expectedCertVerifyAlgorithm)) - binary.BigEndian.PutUint16(serialized[6:], cred.expectedVersion) - - // Encode the public key and assert that the encoding is no longer than 2^16 - // bytes (per the spec). - serializedPublicKey, err := cred.marshalSubjectPublicKeyInfo() - if err != nil { - return nil, err - } - if len(serializedPublicKey) > dcMaxPublicKeyLen { - return nil, errors.New("public key is too long") - } - - // The next 3 bytes are the length of the public key field, which may be up - // to 2^24 bytes long. - putUint24(serialized[paramsLen:], len(serializedPublicKey)) - - // The remaining bytes are the public key itself. - serialized = append(serialized, serializedPublicKey...) - cred.raw = serialized - return serialized, nil -} - -// unmarshalCredential decodes a credential and returns it. -func unmarshalCredential(serialized []byte) (*credential, error) { - // The number of bytes comprising the DC parameters. - paramsLen := 8 - - if len(serialized) < paramsLen+dcPubKeyFieldLen { - return nil, errors.New("credential is too short") - } - - // Parse the valid_time, scheme, and version fields. - validTime := time.Duration(binary.BigEndian.Uint32(serialized)) * time.Second - scheme := SignatureScheme(binary.BigEndian.Uint16(serialized[4:])) - version := binary.BigEndian.Uint16(serialized[6:]) - - // Parse the SubjectPublicKeyInfo. - pk, err := x509.ParsePKIXPublicKey(serialized[paramsLen+dcPubKeyFieldLen:]) - if err != nil { - return nil, err - } - - if _, ok := pk.(*ecdsa.PublicKey); !ok { - return nil, fmt.Errorf("unsupported delegation key type: %T", pk) - } - - return &credential{ - raw: serialized, - validTime: validTime, - expectedCertVerifyAlgorithm: scheme, - expectedVersion: version, - publicKey: pk, - }, nil -} - -// getCredentialLen returns the number of bytes comprising the serialized -// credential that starts at the beginning of the input slice. It returns an -// error if the input is too short to contain a credential. -func getCredentialLen(serialized []byte) (int, error) { - paramsLen := 8 - if len(serialized) < paramsLen+dcPubKeyFieldLen { - return 0, errors.New("credential is too short") - } - // First several bytes are the valid_time, scheme, and version fields. - serialized = serialized[paramsLen:] - - // The next 3 bytes are the length of the serialized public key, which may - // be up to 2^24 bytes in length. - serializedPublicKeyLen := getUint24(serialized) - serialized = serialized[dcPubKeyFieldLen:] - - if len(serialized) < serializedPublicKeyLen { - return 0, errors.New("public key of credential is too short") - } - - return paramsLen + dcPubKeyFieldLen + serializedPublicKeyLen, nil -} - -// delegatedCredential stores a credential and its delegation. -type delegatedCredential struct { - raw []byte - - // The credential, which contains a public and its validity time. - cred *credential - - // The signature scheme used to sign the credential. - algorithm SignatureScheme - - // The credential's delegation. - signature []byte -} - -// ensureCertificateHasLeaf parses the leaf certificate if needed. -func ensureCertificateHasLeaf(cert *Certificate) error { - var err error - if cert.Leaf == nil { - if len(cert.Certificate[0]) == 0 { - return errors.New("missing leaf certificate") - } - cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) - if err != nil { - return err - } - } - return nil -} - -// validate checks that that the signature is valid, that the credential hasn't -// expired, and that the TTL is valid. It also checks that certificate can be -// used for delegation. -func (dc *delegatedCredential) validate(cert *x509.Certificate, now time.Time) (bool, error) { - // Check that the cert can delegate. - if !canDelegate(cert) { - return false, errNoDelegationUsage - } - - if dc.cred.isExpired(cert.NotBefore, now) { - return false, errors.New("credential has expired") - } - - if dc.cred.invalidTTL(cert.NotBefore, now) { - return false, errors.New("credential TTL is invalid") - } - - // Prepare the credential for verification. - rawCred, err := dc.cred.marshal() - if err != nil { - return false, err - } - hash := getHash(dc.algorithm) - in := prepareDelegation(hash, rawCred, cert.Raw, dc.algorithm) - - // TODO(any) This code overlaps significantly with verifyHandshakeSignature() - // in ../auth.go. This should be refactored. - switch dc.algorithm { - case ECDSAWithP256AndSHA256, - ECDSAWithP384AndSHA384, - ECDSAWithP521AndSHA512: - pk, ok := cert.PublicKey.(*ecdsa.PublicKey) - if !ok { - return false, errors.New("expected ECDSA public key") - } - sig := new(ecdsaSignature) - if _, err = asn1.Unmarshal(dc.signature, sig); err != nil { - return false, err - } - return ecdsa.Verify(pk, in, sig.R, sig.S), nil - - default: - return false, fmt.Errorf( - "unsupported signature scheme: 0x%04x", dc.algorithm) - } -} - -// unmarshalDelegatedCredential decodes a DelegatedCredential structure. -func unmarshalDelegatedCredential(serialized []byte) (*delegatedCredential, error) { - // Get the length of the serialized credential that begins at the start of - // the input slice. - serializedCredentialLen, err := getCredentialLen(serialized) - if err != nil { - return nil, err - } - - // Parse the credential. - cred, err := unmarshalCredential(serialized[:serializedCredentialLen]) - if err != nil { - return nil, err - } - - // Parse the signature scheme. - serialized = serialized[serializedCredentialLen:] - if len(serialized) < 4 { - return nil, errors.New("delegated credential is too short") - } - scheme := SignatureScheme(binary.BigEndian.Uint16(serialized)) - - // Parse the signature length. - serialized = serialized[2:] - serializedSignatureLen := binary.BigEndian.Uint16(serialized) - - // Prase the signature. - serialized = serialized[2:] - if len(serialized) < int(serializedSignatureLen) { - return nil, errors.New("signature of delegated credential is too short") - } - sig := serialized[:serializedSignatureLen] - - return &delegatedCredential{ - raw: serialized, - cred: cred, - algorithm: scheme, - signature: sig, - }, nil -} - -// getCurve maps the SignatureScheme to its corresponding elliptic.Curve. -func getCurve(scheme SignatureScheme) elliptic.Curve { - switch scheme { - case ECDSAWithP256AndSHA256: - return elliptic.P256() - case ECDSAWithP384AndSHA384: - return elliptic.P384() - case ECDSAWithP521AndSHA512: - return elliptic.P521() - default: - return nil - } -} - -// getHash maps the SignatureScheme to its corresponding hash function. -// -// TODO(any) This function overlaps with hashForSignatureScheme in 13.go. -func getHash(scheme SignatureScheme) crypto.Hash { - switch scheme { - case ECDSAWithP256AndSHA256: - return crypto.SHA256 - case ECDSAWithP384AndSHA384: - return crypto.SHA384 - case ECDSAWithP521AndSHA512: - return crypto.SHA512 - default: - return 0 // Unknown hash function - } -} - -// prepareDelegation returns a hash of the message that the delegator is to -// sign. The inputs are the credential (`cred`), the DER-encoded delegator -// certificate (`delegatorCert`) and the signature scheme of the delegator -// (`delegatorAlgorithm`). -func prepareDelegation(hash crypto.Hash, cred, delegatorCert []byte, delegatorAlgorithm SignatureScheme) []byte { - h := hash.New() - - // The header. - h.Write(bytes.Repeat([]byte{0x20}, 64)) - h.Write([]byte("TLS, server delegated credentials")) - h.Write([]byte{0x00}) - - // The delegation certificate. - h.Write(delegatorCert) - - // The credential. - h.Write(cred) - - // The delegator signature scheme. - var serializedScheme [2]byte - binary.BigEndian.PutUint16(serializedScheme[:], uint16(delegatorAlgorithm)) - h.Write(serializedScheme[:]) - - return h.Sum(nil) -} diff --git a/external/github.com/marten-seemann/qtls/ticket.go b/external/github.com/marten-seemann/qtls/ticket.go deleted file mode 100644 index e5bffa99c7..0000000000 --- a/external/github.com/marten-seemann/qtls/ticket.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package qtls - -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "crypto/hmac" - "crypto/sha256" - "crypto/subtle" - "errors" - "io" -) - -// A SessionTicketSealer provides a way to securely encapsulate -// session state for storage on the client. All methods are safe for -// concurrent use. -type SessionTicketSealer interface { - // Seal returns a session ticket value that can be later passed to Unseal - // to recover the content, usually by encrypting it. The ticket will be sent - // to the client to be stored, and will be sent back in plaintext, so it can - // be read and modified by an attacker. - Seal(cs *ConnectionState, content []byte) (ticket []byte, err error) - - // Unseal returns a session ticket contents. The ticket can't be safely - // assumed to have been generated by Seal. - // If unable to unseal the ticket, the connection will proceed with a - // complete handshake. - Unseal(chi *ClientHelloInfo, ticket []byte) (content []byte, success bool) -} - -// sessionState contains the information that is serialized into a session -// ticket in order to later resume a connection. -type sessionState struct { - vers uint16 - cipherSuite uint16 - usedEMS bool - masterSecret []byte - certificates [][]byte - // usedOldKey is true if the ticket from which this session came from - // was encrypted with an older key and thus should be refreshed. - usedOldKey bool -} - -func (s *sessionState) equal(i interface{}) bool { - s1, ok := i.(*sessionState) - if !ok { - return false - } - - if s.vers != s1.vers || - s.usedEMS != s1.usedEMS || - s.cipherSuite != s1.cipherSuite || - !bytes.Equal(s.masterSecret, s1.masterSecret) { - return false - } - - if len(s.certificates) != len(s1.certificates) { - return false - } - - for i := range s.certificates { - if !bytes.Equal(s.certificates[i], s1.certificates[i]) { - return false - } - } - - return true -} - -func (s *sessionState) marshal() []byte { - length := 2 + 2 + 2 + len(s.masterSecret) + 2 - for _, cert := range s.certificates { - length += 4 + len(cert) - } - - ret := make([]byte, length) - x := ret - was_used := byte(0) - if s.usedEMS { - was_used = byte(0x80) - } - - x[0] = byte(s.vers>>8) | byte(was_used) - x[1] = byte(s.vers) - x[2] = byte(s.cipherSuite >> 8) - x[3] = byte(s.cipherSuite) - x[4] = byte(len(s.masterSecret) >> 8) - x[5] = byte(len(s.masterSecret)) - x = x[6:] - copy(x, s.masterSecret) - x = x[len(s.masterSecret):] - - x[0] = byte(len(s.certificates) >> 8) - x[1] = byte(len(s.certificates)) - x = x[2:] - - for _, cert := range s.certificates { - x[0] = byte(len(cert) >> 24) - x[1] = byte(len(cert) >> 16) - x[2] = byte(len(cert) >> 8) - x[3] = byte(len(cert)) - copy(x[4:], cert) - x = x[4+len(cert):] - } - - return ret -} - -func (s *sessionState) unmarshal(data []byte) alert { - if len(data) < 8 { - return alertDecodeError - } - - s.vers = (uint16(data[0])<<8 | uint16(data[1])) & 0x7fff - s.cipherSuite = uint16(data[2])<<8 | uint16(data[3]) - s.usedEMS = (data[0] & 0x80) == 0x80 - masterSecretLen := int(data[4])<<8 | int(data[5]) - data = data[6:] - if len(data) < masterSecretLen { - return alertDecodeError - } - - s.masterSecret = data[:masterSecretLen] - data = data[masterSecretLen:] - - if len(data) < 2 { - return alertDecodeError - } - - numCerts := int(data[0])<<8 | int(data[1]) - data = data[2:] - - s.certificates = make([][]byte, numCerts) - for i := range s.certificates { - if len(data) < 4 { - return alertDecodeError - } - certLen := int(data[0])<<24 | int(data[1])<<16 | int(data[2])<<8 | int(data[3]) - data = data[4:] - if certLen < 0 { - return alertDecodeError - } - if len(data) < certLen { - return alertDecodeError - } - s.certificates[i] = data[:certLen] - data = data[certLen:] - } - - if len(data) != 0 { - return alertDecodeError - } - return alertSuccess -} - -type sessionState13 struct { - vers uint16 - suite uint16 - ageAdd uint32 - createdAt uint64 - maxEarlyDataLen uint32 - pskSecret []byte - alpnProtocol string - SNI string -} - -func (s *sessionState13) equal(i interface{}) bool { - s1, ok := i.(*sessionState13) - if !ok { - return false - } - - return s.vers == s1.vers && - s.suite == s1.suite && - s.ageAdd == s1.ageAdd && - s.createdAt == s1.createdAt && - s.maxEarlyDataLen == s1.maxEarlyDataLen && - subtle.ConstantTimeCompare(s.pskSecret, s1.pskSecret) == 1 && - s.alpnProtocol == s1.alpnProtocol && - s.SNI == s1.SNI -} - -func (s *sessionState13) marshal() []byte { - length := 2 + 2 + 4 + 8 + 4 + 2 + len(s.pskSecret) + 2 + len(s.alpnProtocol) + 2 + len(s.SNI) - - x := make([]byte, length) - x[0] = byte(s.vers >> 8) - x[1] = byte(s.vers) - x[2] = byte(s.suite >> 8) - x[3] = byte(s.suite) - x[4] = byte(s.ageAdd >> 24) - x[5] = byte(s.ageAdd >> 16) - x[6] = byte(s.ageAdd >> 8) - x[7] = byte(s.ageAdd) - x[8] = byte(s.createdAt >> 56) - x[9] = byte(s.createdAt >> 48) - x[10] = byte(s.createdAt >> 40) - x[11] = byte(s.createdAt >> 32) - x[12] = byte(s.createdAt >> 24) - x[13] = byte(s.createdAt >> 16) - x[14] = byte(s.createdAt >> 8) - x[15] = byte(s.createdAt) - x[16] = byte(s.maxEarlyDataLen >> 24) - x[17] = byte(s.maxEarlyDataLen >> 16) - x[18] = byte(s.maxEarlyDataLen >> 8) - x[19] = byte(s.maxEarlyDataLen) - x[20] = byte(len(s.pskSecret) >> 8) - x[21] = byte(len(s.pskSecret)) - copy(x[22:], s.pskSecret) - z := x[22+len(s.pskSecret):] - z[0] = byte(len(s.alpnProtocol) >> 8) - z[1] = byte(len(s.alpnProtocol)) - copy(z[2:], s.alpnProtocol) - z = z[2+len(s.alpnProtocol):] - z[0] = byte(len(s.SNI) >> 8) - z[1] = byte(len(s.SNI)) - copy(z[2:], s.SNI) - - return x -} - -func (s *sessionState13) unmarshal(data []byte) alert { - if len(data) < 24 { - return alertDecodeError - } - - s.vers = uint16(data[0])<<8 | uint16(data[1]) - s.suite = uint16(data[2])<<8 | uint16(data[3]) - s.ageAdd = uint32(data[4])<<24 | uint32(data[5])<<16 | uint32(data[6])<<8 | uint32(data[7]) - s.createdAt = uint64(data[8])<<56 | uint64(data[9])<<48 | uint64(data[10])<<40 | uint64(data[11])<<32 | - uint64(data[12])<<24 | uint64(data[13])<<16 | uint64(data[14])<<8 | uint64(data[15]) - s.maxEarlyDataLen = uint32(data[16])<<24 | uint32(data[17])<<16 | uint32(data[18])<<8 | uint32(data[19]) - - l := int(data[20])<<8 | int(data[21]) - if len(data) < 22+l+2 { - return alertDecodeError - } - s.pskSecret = data[22 : 22+l] - z := data[22+l:] - - l = int(z[0])<<8 | int(z[1]) - if len(z) < 2+l+2 { - return alertDecodeError - } - s.alpnProtocol = string(z[2 : 2+l]) - z = z[2+l:] - - l = int(z[0])<<8 | int(z[1]) - if len(z) != 2+l { - return alertDecodeError - } - s.SNI = string(z[2 : 2+l]) - - return alertSuccess -} - -func (c *Conn) encryptTicket(serialized []byte) ([]byte, error) { - encrypted := make([]byte, ticketKeyNameLen+aes.BlockSize+len(serialized)+sha256.Size) - keyName := encrypted[:ticketKeyNameLen] - iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize] - macBytes := encrypted[len(encrypted)-sha256.Size:] - - if _, err := io.ReadFull(c.config.rand(), iv); err != nil { - return nil, err - } - key := c.config.ticketKeys()[0] - copy(keyName, key.keyName[:]) - block, err := aes.NewCipher(key.aesKey[:]) - if err != nil { - return nil, errors.New("tls: failed to create cipher while encrypting ticket: " + err.Error()) - } - cipher.NewCTR(block, iv).XORKeyStream(encrypted[ticketKeyNameLen+aes.BlockSize:], serialized) - - mac := hmac.New(sha256.New, key.hmacKey[:]) - mac.Write(encrypted[:len(encrypted)-sha256.Size]) - mac.Sum(macBytes[:0]) - - return encrypted, nil -} - -func (c *Conn) decryptTicket(encrypted []byte) (serialized []byte, usedOldKey bool) { - if c.config.SessionTicketsDisabled || - len(encrypted) < ticketKeyNameLen+aes.BlockSize+sha256.Size { - return nil, false - } - - keyName := encrypted[:ticketKeyNameLen] - iv := encrypted[ticketKeyNameLen : ticketKeyNameLen+aes.BlockSize] - macBytes := encrypted[len(encrypted)-sha256.Size:] - - keys := c.config.ticketKeys() - keyIndex := -1 - for i, candidateKey := range keys { - if bytes.Equal(keyName, candidateKey.keyName[:]) { - keyIndex = i - break - } - } - - if keyIndex == -1 { - return nil, false - } - key := &keys[keyIndex] - - mac := hmac.New(sha256.New, key.hmacKey[:]) - mac.Write(encrypted[:len(encrypted)-sha256.Size]) - expected := mac.Sum(nil) - - if subtle.ConstantTimeCompare(macBytes, expected) != 1 { - return nil, false - } - - block, err := aes.NewCipher(key.aesKey[:]) - if err != nil { - return nil, false - } - ciphertext := encrypted[ticketKeyNameLen+aes.BlockSize : len(encrypted)-sha256.Size] - plaintext := ciphertext - cipher.NewCTR(block, iv).XORKeyStream(plaintext, ciphertext) - - return plaintext, keyIndex > 0 -} diff --git a/external/github.com/marten-seemann/qtls/tls.go b/external/github.com/marten-seemann/qtls/tls.go deleted file mode 100644 index 21e2c4db04..0000000000 --- a/external/github.com/marten-seemann/qtls/tls.go +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package tls partially implements TLS 1.2, as specified in RFC 5246. -package qtls - -// BUG(agl): The crypto/tls package only implements some countermeasures -// against Lucky13 attacks on CBC-mode encryption, and only on SHA1 -// variants. See http://www.isg.rhul.ac.uk/tls/TLStiming.pdf and -// https://www.imperialviolet.org/2013/02/04/luckythirteen.html. - -import ( - "crypto" - "crypto/ecdsa" - "crypto/rsa" - "crypto/x509" - "encoding/pem" - "errors" - "fmt" - "io/ioutil" - "net" - "strings" - "time" -) - -// Server returns a new TLS server side connection -// using conn as the underlying transport. -// The configuration config must be non-nil and must include -// at least one certificate or else set GetCertificate. -func Server(conn net.Conn, config *Config) *Conn { - return &Conn{conn: conn, config: config} -} - -// Client returns a new TLS client side connection -// using conn as the underlying transport. -// The config cannot be nil: users must set either ServerName or -// InsecureSkipVerify in the config. -func Client(conn net.Conn, config *Config) *Conn { - return &Conn{conn: conn, config: config, isClient: true} -} - -// A listener implements a network listener (net.Listener) for TLS connections. -type listener struct { - net.Listener - config *Config -} - -// Accept waits for and returns the next incoming TLS connection. -// The returned connection is of type *Conn. -func (l *listener) Accept() (net.Conn, error) { - c, err := l.Listener.Accept() - if err != nil { - return nil, err - } - return Server(c, l.config), nil -} - -// NewListener creates a Listener which accepts connections from an inner -// Listener and wraps each connection with Server. -// The configuration config must be non-nil and must include -// at least one certificate or else set GetCertificate. -func NewListener(inner net.Listener, config *Config) net.Listener { - l := new(listener) - l.Listener = inner - l.config = config - return l -} - -// Listen creates a TLS listener accepting connections on the -// given network address using net.Listen. -// The configuration config must be non-nil and must include -// at least one certificate or else set GetCertificate. -func Listen(network, laddr string, config *Config) (net.Listener, error) { - if config == nil || (len(config.Certificates) == 0 && config.GetCertificate == nil) { - return nil, errors.New("tls: neither Certificates nor GetCertificate set in Config") - } - l, err := net.Listen(network, laddr) - if err != nil { - return nil, err - } - return NewListener(l, config), nil -} - -type timeoutError struct{} - -func (timeoutError) Error() string { return "tls: DialWithDialer timed out" } -func (timeoutError) Timeout() bool { return true } -func (timeoutError) Temporary() bool { return true } - -// DialWithDialer connects to the given network address using dialer.Dial and -// then initiates a TLS handshake, returning the resulting TLS connection. Any -// timeout or deadline given in the dialer apply to connection and TLS -// handshake as a whole. -// -// DialWithDialer interprets a nil configuration as equivalent to the zero -// configuration; see the documentation of Config for the defaults. -func DialWithDialer(dialer *net.Dialer, network, addr string, config *Config) (*Conn, error) { - // We want the Timeout and Deadline values from dialer to cover the - // whole process: TCP connection and TLS handshake. This means that we - // also need to start our own timers now. - timeout := dialer.Timeout - - if !dialer.Deadline.IsZero() { - deadlineTimeout := time.Until(dialer.Deadline) - if timeout == 0 || deadlineTimeout < timeout { - timeout = deadlineTimeout - } - } - - var errChannel chan error - - if timeout != 0 { - errChannel = make(chan error, 2) - time.AfterFunc(timeout, func() { - errChannel <- timeoutError{} - }) - } - - rawConn, err := dialer.Dial(network, addr) - if err != nil { - return nil, err - } - - colonPos := strings.LastIndex(addr, ":") - if colonPos == -1 { - colonPos = len(addr) - } - hostname := addr[:colonPos] - - if config == nil { - config = defaultConfig() - } - // If no ServerName is set, infer the ServerName - // from the hostname we're connecting to. - if config.ServerName == "" { - // Make a copy to avoid polluting argument or default. - c := config.Clone() - c.ServerName = hostname - config = c - } - - conn := Client(rawConn, config) - - if timeout == 0 { - err = conn.Handshake() - } else { - go func() { - errChannel <- conn.Handshake() - }() - - err = <-errChannel - } - - if err != nil { - rawConn.Close() - return nil, err - } - - return conn, nil -} - -// Dial connects to the given network address using net.Dial -// and then initiates a TLS handshake, returning the resulting -// TLS connection. -// Dial interprets a nil configuration as equivalent to -// the zero configuration; see the documentation of Config -// for the defaults. -func Dial(network, addr string, config *Config) (*Conn, error) { - return DialWithDialer(new(net.Dialer), network, addr, config) -} - -// LoadX509KeyPair reads and parses a public/private key pair from a pair -// of files. The files must contain PEM encoded data. The certificate file -// may contain intermediate certificates following the leaf certificate to -// form a certificate chain. On successful return, Certificate.Leaf will -// be nil because the parsed form of the certificate is not retained. -func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) { - certPEMBlock, err := ioutil.ReadFile(certFile) - if err != nil { - return Certificate{}, err - } - keyPEMBlock, err := ioutil.ReadFile(keyFile) - if err != nil { - return Certificate{}, err - } - return X509KeyPair(certPEMBlock, keyPEMBlock) -} - -// X509KeyPair parses a public/private key pair from a pair of -// PEM encoded data. On successful return, Certificate.Leaf will be nil because -// the parsed form of the certificate is not retained. -func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) { - fail := func(err error) (Certificate, error) { return Certificate{}, err } - - var cert Certificate - var skippedBlockTypes []string - for { - var certDERBlock *pem.Block - certDERBlock, certPEMBlock = pem.Decode(certPEMBlock) - if certDERBlock == nil { - break - } - if certDERBlock.Type == "CERTIFICATE" { - cert.Certificate = append(cert.Certificate, certDERBlock.Bytes) - } else { - skippedBlockTypes = append(skippedBlockTypes, certDERBlock.Type) - } - } - - if len(cert.Certificate) == 0 { - if len(skippedBlockTypes) == 0 { - return fail(errors.New("tls: failed to find any PEM data in certificate input")) - } - if len(skippedBlockTypes) == 1 && strings.HasSuffix(skippedBlockTypes[0], "PRIVATE KEY") { - return fail(errors.New("tls: failed to find certificate PEM data in certificate input, but did find a private key; PEM inputs may have been switched")) - } - return fail(fmt.Errorf("tls: failed to find \"CERTIFICATE\" PEM block in certificate input after skipping PEM blocks of the following types: %v", skippedBlockTypes)) - } - - skippedBlockTypes = skippedBlockTypes[:0] - var keyDERBlock *pem.Block - for { - keyDERBlock, keyPEMBlock = pem.Decode(keyPEMBlock) - if keyDERBlock == nil { - if len(skippedBlockTypes) == 0 { - return fail(errors.New("tls: failed to find any PEM data in key input")) - } - if len(skippedBlockTypes) == 1 && skippedBlockTypes[0] == "CERTIFICATE" { - return fail(errors.New("tls: found a certificate rather than a key in the PEM for the private key")) - } - return fail(fmt.Errorf("tls: failed to find PEM block with type ending in \"PRIVATE KEY\" in key input after skipping PEM blocks of the following types: %v", skippedBlockTypes)) - } - if keyDERBlock.Type == "PRIVATE KEY" || strings.HasSuffix(keyDERBlock.Type, " PRIVATE KEY") { - break - } - skippedBlockTypes = append(skippedBlockTypes, keyDERBlock.Type) - } - - // We don't need to parse the public key for TLS, but we so do anyway - // to check that it looks sane and matches the private key. - x509Cert, err := x509.ParseCertificate(cert.Certificate[0]) - if err != nil { - return fail(err) - } - - cert.PrivateKey, err = parsePrivateKey(keyDERBlock.Bytes) - if err != nil { - return fail(err) - } - - switch pub := x509Cert.PublicKey.(type) { - case *rsa.PublicKey: - priv, ok := cert.PrivateKey.(*rsa.PrivateKey) - if !ok { - return fail(errors.New("tls: private key type does not match public key type")) - } - if pub.N.Cmp(priv.N) != 0 { - return fail(errors.New("tls: private key does not match public key")) - } - case *ecdsa.PublicKey: - priv, ok := cert.PrivateKey.(*ecdsa.PrivateKey) - if !ok { - return fail(errors.New("tls: private key type does not match public key type")) - } - if pub.X.Cmp(priv.X) != 0 || pub.Y.Cmp(priv.Y) != 0 { - return fail(errors.New("tls: private key does not match public key")) - } - default: - return fail(errors.New("tls: unknown public key algorithm")) - } - - return cert, nil -} - -// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates -// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys. -// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three. -func parsePrivateKey(der []byte) (crypto.PrivateKey, error) { - if key, err := x509.ParsePKCS1PrivateKey(der); err == nil { - return key, nil - } - if key, err := x509.ParsePKCS8PrivateKey(der); err == nil { - switch key := key.(type) { - case *rsa.PrivateKey, *ecdsa.PrivateKey: - return key, nil - default: - return nil, errors.New("tls: found unknown private key type in PKCS#8 wrapping") - } - } - if key, err := x509.ParseECPrivateKey(der); err == nil { - return key, nil - } - - return nil, errors.New("tls: failed to parse private key") -} diff --git a/external/update-deps.sh b/external/update-deps.sh deleted file mode 100755 index 400785f3e8..0000000000 --- a/external/update-deps.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -pushd $GOPATH/src/v2ray.com/core/external - -rsync -rv "$GOPATH/src/github.com/lucas-clemente/quic-go/" "./github.com/lucas-clemente/quic-go/" -rm -rf ./github.com/lucas-clemente/quic-go/\.* -rm -rf ./github.com/lucas-clemente/quic-go/benchmark -rm -rf ./github.com/lucas-clemente/quic-go/docs -rm -rf ./github.com/lucas-clemente/quic-go/example -rm -rf ./github.com/lucas-clemente/quic-go/h2quic -rm -rf ./github.com/lucas-clemente/quic-go/integrationtests -rm -rf ./github.com/lucas-clemente/quic-go/internal/mocks -rm ./github.com/lucas-clemente/quic-go/vendor/vendor.json - -rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/cheekybits/" "./github.com/cheekybits/" -rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/cloudflare/" "./github.com/cloudflare/" -rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/marten-seemann/" "./github.com/marten-seemann/" -rm -rf "./github.com/lucas-clemente/quic-go/vendor/" - - -find . -name "*_test.go" -delete -find . -name "*.yml" -delete -find . -name "*.go" -type f -print0 | LC_ALL=C xargs -0 sed -i '' 's#\"github\.com#\"v2ray\.com/core/external/github\.com#g' - -popd diff --git a/features/feature.go b/features/feature.go index ac7b77a71c..5cd0adbd15 100644 --- a/features/feature.go +++ b/features/feature.go @@ -2,7 +2,7 @@ package features import "v2ray.com/core/common" -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen // Feature is the interface for V2Ray features. All features must implement this interface. // All existing features have an implementation in app directory. These features can be replaced by third-party ones. diff --git a/features/routing/context.go b/features/routing/context.go new file mode 100644 index 0000000000..8fea191506 --- /dev/null +++ b/features/routing/context.go @@ -0,0 +1,40 @@ +package routing + +import ( + "v2ray.com/core/common/net" +) + +// Context is a feature to store connection information for routing. +// +// v2ray:api:stable +type Context interface { + // GetInboundTag returns the tag of the inbound the connection was from. + GetInboundTag() string + + // GetSourcesIPs returns the source IPs bound to the connection. + GetSourceIPs() []net.IP + + // GetSourcePort returns the source port of the connection. + GetSourcePort() net.Port + + // GetTargetIPs returns the target IP of the connection or resolved IPs of target domain. + GetTargetIPs() []net.IP + + // GetTargetPort returns the target port of the connection. + GetTargetPort() net.Port + + // GetTargetDomain returns the target domain of the connection, if exists. + GetTargetDomain() string + + // GetNetwork returns the network type of the connection. + GetNetwork() net.Network + + // GetProtocol returns the protocol from the connection content, if sniffed out. + GetProtocol() string + + // GetUser returns the user email from the connection content, if exists. + GetUser() string + + // GetAttributes returns extra attributes from the conneciont content. + GetAttributes() map[string]string +} diff --git a/features/routing/dns/context.go b/features/routing/dns/context.go new file mode 100644 index 0000000000..e36fa1575a --- /dev/null +++ b/features/routing/dns/context.go @@ -0,0 +1,44 @@ +package dns + +//go:generate go run v2ray.com/core/common/errors/errorgen + +import ( + "v2ray.com/core/common/net" + "v2ray.com/core/features/dns" + "v2ray.com/core/features/routing" +) + +// ResolvableContext is an implementation of routing.Context, with domain resolving capability. +type ResolvableContext struct { + routing.Context + dnsClient dns.Client + resolvedIPs []net.IP +} + +// GetTargetIPs overrides original routing.Context's implementation. +func (ctx *ResolvableContext) GetTargetIPs() []net.IP { + if ips := ctx.Context.GetTargetIPs(); len(ips) != 0 { + return ips + } + + if len(ctx.resolvedIPs) > 0 { + return ctx.resolvedIPs + } + + if domain := ctx.GetTargetDomain(); len(domain) != 0 { + ips, err := ctx.dnsClient.LookupIP(domain) + if err == nil { + ctx.resolvedIPs = ips + return ips + } + newError("resolve ip for ", domain).Base(err).WriteToLog() + } + + return nil +} + +// ContextWithDNSClient creates a new routing context with domain resolving capability. +// Resolved domain IPs can be retrieved by GetTargetIPs(). +func ContextWithDNSClient(ctx routing.Context, client dns.Client) routing.Context { + return &ResolvableContext{Context: ctx, dnsClient: client} +} diff --git a/features/routing/dns/errors.generated.go b/features/routing/dns/errors.generated.go new file mode 100644 index 0000000000..ba70372f07 --- /dev/null +++ b/features/routing/dns/errors.generated.go @@ -0,0 +1,9 @@ +package dns + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/features/routing/router.go b/features/routing/router.go index a71927b88b..2acc965144 100644 --- a/features/routing/router.go +++ b/features/routing/router.go @@ -1,8 +1,6 @@ package routing import ( - "context" - "v2ray.com/core/common" "v2ray.com/core/features" ) @@ -13,8 +11,22 @@ import ( type Router interface { features.Feature - // PickRoute returns a tag of an OutboundHandler based on the given context. - PickRoute(ctx context.Context) (string, error) + // PickRoute returns a route decision based on the given routing context. + PickRoute(ctx Context) (Route, error) +} + +// Route is the routing result of Router feature. +// +// v2ray:api:stable +type Route interface { + // A Route is also a routing context. + Context + + // GetOutboundGroupTags returns the detoured outbound group tags in sequence before a final outbound is chosen. + GetOutboundGroupTags() []string + + // GetOutboundTag returns the tag of the outbound the connection was dispatched to. + GetOutboundTag() string } // RouterType return the type of Router interface. Can be used to implement common.HasType. @@ -33,8 +45,8 @@ func (DefaultRouter) Type() interface{} { } // PickRoute implements Router. -func (DefaultRouter) PickRoute(ctx context.Context) (string, error) { - return "", common.ErrNoClue +func (DefaultRouter) PickRoute(ctx Context) (Route, error) { + return nil, common.ErrNoClue } // Start implements common.Runnable. diff --git a/features/routing/session/context.go b/features/routing/session/context.go new file mode 100644 index 0000000000..bd5bb63378 --- /dev/null +++ b/features/routing/session/context.go @@ -0,0 +1,119 @@ +package session + +import ( + "context" + + "v2ray.com/core/common/net" + "v2ray.com/core/common/session" + "v2ray.com/core/features/routing" +) + +// Context is an implementation of routing.Context, which is a wrapper of context.context with session info. +type Context struct { + Inbound *session.Inbound + Outbound *session.Outbound + Content *session.Content +} + +// GetInboundTag implements routing.Context. +func (ctx *Context) GetInboundTag() string { + if ctx.Inbound == nil { + return "" + } + return ctx.Inbound.Tag +} + +// GetSourceIPs implements routing.Context. +func (ctx *Context) GetSourceIPs() []net.IP { + if ctx.Inbound == nil || !ctx.Inbound.Source.IsValid() { + return nil + } + dest := ctx.Inbound.Source + if dest.Address.Family().IsDomain() { + return nil + } + + return []net.IP{dest.Address.IP()} +} + +// GetSourcePort implements routing.Context. +func (ctx *Context) GetSourcePort() net.Port { + if ctx.Inbound == nil || !ctx.Inbound.Source.IsValid() { + return 0 + } + return ctx.Inbound.Source.Port +} + +// GetTargetIPs implements routing.Context. +func (ctx *Context) GetTargetIPs() []net.IP { + if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { + return nil + } + + if ctx.Outbound.Target.Address.Family().IsIP() { + return []net.IP{ctx.Outbound.Target.Address.IP()} + } + + return nil +} + +// GetTargetPort implements routing.Context. +func (ctx *Context) GetTargetPort() net.Port { + if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { + return 0 + } + return ctx.Outbound.Target.Port +} + +// GetTargetDomain implements routing.Context. +func (ctx *Context) GetTargetDomain() string { + if ctx.Outbound == nil || !ctx.Outbound.Target.IsValid() { + return "" + } + dest := ctx.Outbound.Target + if !dest.Address.Family().IsDomain() { + return "" + } + return dest.Address.Domain() +} + +// GetNetwork implements routing.Context. +func (ctx *Context) GetNetwork() net.Network { + if ctx.Outbound == nil { + return net.Network_Unknown + } + return ctx.Outbound.Target.Network +} + +// GetProtocol implements routing.Context. +func (ctx *Context) GetProtocol() string { + if ctx.Content == nil { + return "" + } + return ctx.Content.Protocol +} + +// GetUser implements routing.Context. +func (ctx *Context) GetUser() string { + if ctx.Inbound == nil || ctx.Inbound.User == nil { + return "" + } + return ctx.Inbound.User.Email +} + +// GetAttributes implements routing.Context. +func (ctx *Context) GetAttributes() map[string]string { + if ctx.Content == nil { + return nil + } + return ctx.Content.Attributes +} + +// AsRoutingContext creates a context from context.context with session info. +func AsRoutingContext(ctx context.Context) routing.Context { + return &Context{ + Inbound: session.InboundFromContext(ctx), + Outbound: session.OutboundFromContext(ctx), + Content: session.ContentFromContext(ctx), + } +} diff --git a/features/stats/stats.go b/features/stats/stats.go index 267416e603..d0a188adf7 100644 --- a/features/stats/stats.go +++ b/features/stats/stats.go @@ -1,8 +1,13 @@ package stats -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen -import "v2ray.com/core/features" +import ( + "context" + + "v2ray.com/core/common" + "v2ray.com/core/features" +) // Counter is the interface for stats counters. // @@ -16,17 +21,62 @@ type Counter interface { Add(int64) int64 } +// Channel is the interface for stats channel. +// +// v2ray:api:stable +type Channel interface { + // Channel is a runnable unit. + common.Runnable + // Publish broadcasts a message through the channel with a controlling context. + Publish(context.Context, interface{}) + // SubscriberCount returns the number of the subscribers. + Subscribers() []chan interface{} + // Subscribe registers for listening to channel stream and returns a new listener channel. + Subscribe() (chan interface{}, error) + // Unsubscribe unregisters a listener channel from current Channel object. + Unsubscribe(chan interface{}) error +} + +// SubscribeRunnableChannel subscribes the channel and starts it if there is first subscriber coming. +func SubscribeRunnableChannel(c Channel) (chan interface{}, error) { + if len(c.Subscribers()) == 0 { + if err := c.Start(); err != nil { + return nil, err + } + } + return c.Subscribe() +} + +// UnsubscribeClosableChannel unsubcribes the channel and close it if there is no more subscriber. +func UnsubscribeClosableChannel(c Channel, sub chan interface{}) error { + if err := c.Unsubscribe(sub); err != nil { + return err + } + if len(c.Subscribers()) == 0 { + return c.Close() + } + return nil +} + // Manager is the interface for stats manager. // // v2ray:api:stable type Manager interface { features.Feature - // RegisterCounter registers a new counter to the manager. The identifier string must not be emtpy, and unique among other counters. + // RegisterCounter registers a new counter to the manager. The identifier string must not be empty, and unique among other counters. RegisterCounter(string) (Counter, error) + // UnregisterCounter unregisters a counter from the manager by its identifier. UnregisterCounter(string) error // GetCounter returns a counter by its identifier. GetCounter(string) Counter + + // RegisterChannel registers a new channel to the manager. The identifier string must not be empty, and unique among other channels. + RegisterChannel(string) (Channel, error) + // UnregisterCounter unregisters a channel from the manager by its identifier. + UnregisterChannel(string) error + // GetChannel returns a channel by its identifier. + GetChannel(string) Channel } // GetOrRegisterCounter tries to get the StatCounter first. If not exist, it then tries to create a new counter. @@ -39,6 +89,16 @@ func GetOrRegisterCounter(m Manager, name string) (Counter, error) { return m.RegisterCounter(name) } +// GetOrRegisterChannel tries to get the StatChannel first. If not exist, it then tries to create a new channel. +func GetOrRegisterChannel(m Manager, name string) (Channel, error) { + channel := m.GetChannel(name) + if channel != nil { + return channel, nil + } + + return m.RegisterChannel(name) +} + // ManagerType returns the type of Manager interface. Can be used to implement common.HasType. // // v2ray:api:stable @@ -61,7 +121,7 @@ func (NoopManager) RegisterCounter(string) (Counter, error) { // UnregisterCounter implements Manager. func (NoopManager) UnregisterCounter(string) error { - return newError("not implemented") + return nil } // GetCounter implements Manager. @@ -69,6 +129,21 @@ func (NoopManager) GetCounter(string) Counter { return nil } +// RegisterChannel implements Manager. +func (NoopManager) RegisterChannel(string) (Channel, error) { + return nil, newError("not implemented") +} + +// UnregisterChannel implements Manager. +func (NoopManager) UnregisterChannel(string) error { + return nil +} + +// GetChannel implements Manager. +func (NoopManager) GetChannel(string) Channel { + return nil +} + // Start implements common.Runnable. func (NoopManager) Start() error { return nil } diff --git a/go.mod b/go.mod index 5ce4ac05be..b62b21d1a0 100644 --- a/go.mod +++ b/go.mod @@ -1,24 +1,26 @@ module v2ray.com/core +go 1.15 + require ( - github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc // indirect - github.com/golang/mock v1.4.3 + github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 // indirect + github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.2 - github.com/google/go-cmp v0.5.0 + github.com/google/go-cmp v0.5.3 github.com/gorilla/websocket v1.4.2 - github.com/miekg/dns v1.1.29 - github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57 + github.com/lucas-clemente/quic-go v0.18.1 + github.com/miekg/dns v1.1.31 + github.com/pires/go-proxyproto v0.2.0 github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841 - github.com/stretchr/testify v1.6.1 - github.com/xiaokangwang/VSign v0.0.0-20200704130305-63f4b4d7a751 - go.starlark.net v0.0.0-20190919145610-979af19b165c - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 - golang.org/x/net v0.0.0-20200602114024-627f9648deb9 - golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a - golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd - google.golang.org/grpc v1.30.0 + github.com/stretchr/testify v1.8.1 + github.com/xiaokangwang/VSign v0.0.0-20200828155424-dc1c86b73fbf + github.com/xtls/go v0.0.0-20201007031018-d42c13c57942 + go.starlark.net v0.0.0-20201006213952-227f4aabceb5 + golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 + golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 + golang.org/x/sync v0.0.0-20200930132711-30421366ff76 + golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf + google.golang.org/grpc v1.32.0 google.golang.org/protobuf v1.25.0 h12.io/socks v1.0.1 ) - -go 1.13 diff --git a/go.sum b/go.sum index f34cc196cb..ae1cd68b67 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,58 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= +dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= +dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= +dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= +dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc h1:8WFBn63wegobsYAX0YjD+8suexZDga5CctH4CCTx2+8= -github.com/dgryski/go-metro v0.0.0-20180109044635-280f6062b5bc/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= +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/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 h1:BS21ZUJ/B5X2UVUbczfmdWH7GapPWAhxcMsDnjJTU1E= +github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/ebfe/bcrypt_pbkdf v0.0.0-20140212075826-3c8d2dcb253a h1:YtdtTUN1iH97s+6PUjLnaiKSQj4oG1/EZ3N9bx6g4kU= github.com/ebfe/bcrypt_pbkdf v0.0.0-20140212075826-3c8d2dcb253a/go.mod h1:/CZpbhAusDOobpcb9yubw46kdYjq0zRC0Wpg9a9zFQM= 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/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.1/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.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= @@ -30,79 +63,199 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI= github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364/go.mod h1:eDJQioIyy4Yn3MVivT7rv/39gAJTrA7lgmYr8EW950c= -github.com/miekg/dns v1.1.29 h1:xHBEhR+t5RzcFJjBLJlax2daXOrTYtr9z4WdKEfWFzg= -github.com/miekg/dns v1.1.29/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +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/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lucas-clemente/quic-go v0.18.1 h1:DMR7guC0NtVS8zNZR3IO7NARZvZygkSC56GGtC6cyys= +github.com/lucas-clemente/quic-go v0.18.1/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= +github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/marten-seemann/qpack v0.2.0/go.mod h1:F7Gl5L1jIgN1D11ucXefiuJS9UMVP2opoCp2jDKb7wc= +github.com/marten-seemann/qtls v0.10.0 h1:ECsuYUKalRL240rRD4Ri33ISb7kAQ3qGDlrrl55b2pc= +github.com/marten-seemann/qtls v0.10.0/go.mod h1:UvMd1oaYDACI99/oZUYLzMCkBXQVT0aGm99sJhbT8hs= +github.com/marten-seemann/qtls-go1-15 v0.1.0 h1:i/YPXVxz8q9umso/5y474CNcHmTpA+5DH+mFPjx6PZg= +github.com/marten-seemann/qtls-go1-15 v0.1.0/go.mod h1:GyFwywLKkRt+6mfU99csTEY1joMZz5vmB1WNZH3P81I= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= +github.com/miekg/dns v1.1.31 h1:sJFOl9BgwbYAWOGEwr61FU28pqsBNdpRBnhGXtO06Oo= +github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= +github.com/pires/go-proxyproto v0.2.0 h1:WyYKlv9pkt77b+LjMvPfwrsAxviaGCFhG4KDIy1ofLY= +github.com/pires/go-proxyproto v0.2.0/go.mod h1:Odh9VFOZJCf9G8cLW5o435Xf1J95Jw9Gw5rnCjcwzAY= +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_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57 h1:SL1K0QAuC1b54KoY1pjPWe6kSlsFHwK9/oC960fKrTY= -github.com/refraction-networking/utls v0.0.0-20190909200633-43c36d3c1f57/go.mod h1:tz9gX959MEFfFN5whTIocCLUG57WiILqtdVxI8c6Wj0= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841 h1:pnfutQFsV7ySmHUeX6ANGfPsBo29RctUvDn8G3rmJVw= github.com/seiflotfy/cuckoofilter v0.0.0-20200511222245-56093a4d3841/go.mod h1:ET5mVvNjwaGXRgZxO9UZr7X+8eAf87AfIYNwRSp9s4Y= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= +github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= +github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= +github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= +github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= +github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= +github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= +github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= +github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= +github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= +github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= +github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/xiaokangwang/VSign v0.0.0-20200704121915-cb2e1f64f24c h1:ZhNj6V5QpDFbJZQR1FYywUTwRgr1HmlsvuExY/U0vJI= -github.com/xiaokangwang/VSign v0.0.0-20200704121915-cb2e1f64f24c/go.mod h1:jTwBnzBuqZP3VX/Z65ErYb9zd4anQprSC7N38TmAp1E= -github.com/xiaokangwang/VSign v0.0.0-20200704130305-63f4b4d7a751 h1:vpFL+XrF7TFUuoV3PX/CJebjK77XA0yc9NnCs5AaxUY= -github.com/xiaokangwang/VSign v0.0.0-20200704130305-63f4b4d7a751/go.mod h1:jTwBnzBuqZP3VX/Z65ErYb9zd4anQprSC7N38TmAp1E= -go.starlark.net v0.0.0-20190919145610-979af19b165c h1:WR7X1xgXJlXhQBdorVc9Db3RhwG+J/kp6bLuMyJjfVw= -go.starlark.net v0.0.0-20190919145610-979af19b165c/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= +github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= +github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/xiaokangwang/VSign v0.0.0-20200828155424-dc1c86b73fbf h1:d4keT3SwLbrgnEe2zbtijPLgKE15n0ZbvJZzRH/a9GM= +github.com/xiaokangwang/VSign v0.0.0-20200828155424-dc1c86b73fbf/go.mod h1:jTwBnzBuqZP3VX/Z65ErYb9zd4anQprSC7N38TmAp1E= +github.com/xtls/go v0.0.0-20201007031018-d42c13c57942 h1:J+h5T5dtgVtszPN0vOFBzTapdVRZ16sXP6o6RPFNs20= +github.com/xtls/go v0.0.0-20201007031018-d42c13c57942/go.mod h1:5TB2+k58gx4A4g2Nf5miSHNDF6CuAzHKpWBooLAshTs= +go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.starlark.net v0.0.0-20201006213952-227f4aabceb5 h1:ApvY/1gw+Yiqb/FKeks3KnVPWpkR3xzij82XPKLjJVw= +go.starlark.net v0.0.0-20201006213952-227f4aabceb5/go.mod h1:f0znQkUKRrkk36XxWbGjMqQM8wGv/xHBVE2qc3B5oFU= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM= -golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= +golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= -golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/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-20200930132711-30421366ff76 h1:JnxiSYT3Nm0BT2a8CyvYyM6cnrWpidecD1UuSYbhKm0= +golang.org/x/sync v0.0.0-20200930132711-30421366ff76/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf h1:Bg47KQy0JhTHuf4sLiQwTMKwUMfSDwgSGatrxGR7nLM= +golang.org/x/sys v0.0.0-20201006155630-ac719f4daadf/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -112,40 +265,65 @@ golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapK golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= +google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 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 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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= +grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= h12.io/socks v1.0.1 h1:bXESSI/+hbdrp+22vcc7/JiXjmLH4UWktKdYgGr3ShA= h12.io/socks v1.0.1/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -rsc.io/quote/v3 v3.1.0 h1:9JKUTTIUgS6kzR9mK1YuGKv6Nl+DijDNIc0ghT58FaY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0 h1:7uVkIFmeBqHfdjD+gZwtXXI+RODJ2Wc4O7MPEh/QiW4= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/infra/bazel/build.bzl b/infra/bazel/build.bzl index 3121757097..aa107b9790 100644 --- a/infra/bazel/build.bzl +++ b/infra/bazel/build.bzl @@ -3,20 +3,18 @@ def _go_command(ctx): if ctx.attr.os == "windows": output = output + ".exe" - output_file = ctx.actions.declare_file(ctx.attr.os + "/" + ctx.attr.arch + "/" + output) + output_file = ctx.actions.declare_file(ctx.attr.os + "/" + ctx.attr.arch + "/" + ctx.attr.ver + "/" + output) pkg = ctx.attr.pkg - ld_flags = "-s -w" + ld_flags = "-s -w -buildid=" if ctx.attr.ld: ld_flags = ld_flags + " " + ctx.attr.ld options = [ "go", "build", - "-o", output_file.path, - "-compiler", "gc", - "-gcflags", '"all=-trimpath=${GOPATH}/src"', - "-asmflags", '"all=-trimpath=${GOPATH}/src"', + "-trimpath", + "-o", output_file.path, "-ldflags", "'%s'" % ld_flags, "-tags", "'%s'" % ctx.attr.gotags, pkg, @@ -28,7 +26,6 @@ def _go_command(ctx): "CGO_ENABLED=0", "GOOS="+ctx.attr.os, "GOARCH="+ctx.attr.arch, - #"GOROOT_FINAL=/go", "GO111MODULE=on", "GOCACHE=${TMPDIR}/gocache" ] @@ -61,6 +58,7 @@ foreign_go_binary = rule( 'output': attr.string(), 'os': attr.string(mandatory=True), 'arch': attr.string(mandatory=True), + 'ver': attr.string(mandatory=True), 'mips': attr.string(), 'arm': attr.string(), 'ld': attr.string(), diff --git a/infra/bazel/gpg.bzl b/infra/bazel/gpg.bzl deleted file mode 100644 index c0a879283f..0000000000 --- a/infra/bazel/gpg.bzl +++ /dev/null @@ -1,23 +0,0 @@ -def _gpg_sign_impl(ctx): - output_file = ctx.actions.declare_file(ctx.file.base.basename + ctx.attr.suffix, sibling = ctx.file.base) - if not ctx.configuration.default_shell_env.get("GPG_PASS"): - ctx.actions.write(output_file, "") - else: - command = "echo ${GPG_PASS} | gpg --pinentry-mode loopback --digest-algo SHA512 --passphrase-fd 0 --output %s --detach-sig %s" % (output_file.path, ctx.file.base.path) - ctx.actions.run_shell( - command = command, - use_default_shell_env = True, - inputs = [ctx.file.base], - outputs = [output_file], - progress_message = "Signing binary", - mnemonic = "gpg", - ) - return [DefaultInfo(files = depset([output_file]))] - -gpg_sign = rule( - implementation = _gpg_sign_impl, - attrs = { - "base": attr.label(allow_single_file=True), - "suffix": attr.string(default=".sig"), - }, -) diff --git a/infra/bazel/matrix.bzl b/infra/bazel/matrix.bzl index 1c53021d94..3db57d5b0d 100644 --- a/infra/bazel/matrix.bzl +++ b/infra/bazel/matrix.bzl @@ -1,22 +1,25 @@ SUPPORTED_MATRIX = [ - ("windows", "amd64"), - ("windows", "386"), - ("windows", "arm"), - ("darwin", "amd64"), - ("linux", "amd64"), - ("linux", "386"), - ("linux", "arm64"), - ("linux", "arm"), - ("linux", "mips64"), - ("linux", "mips"), - ("linux", "mips64le"), - ("linux", "mipsle"), - ("linux", "ppc64"), - ("linux", "ppc64le"), - ("linux", "s390x"), - ("freebsd", "amd64"), - ("freebsd", "386"), - ("openbsd", "amd64"), - ("openbsd", "386"), - ("dragonfly", "amd64"), + ("windows", "amd64", "0"), + ("windows", "386", "0"), + ("windows", "arm", "7"), + ("darwin", "amd64", "0"), + ("linux", "amd64", "0"), + ("linux", "386", "0"), + ("linux", "arm64", "0"), + ("linux", "arm", "7"), + ("linux", "arm", "6"), + ("linux", "arm", "5"), + ("linux", "mips64", "0"), + ("linux", "mips", "0"), + ("linux", "mips64le", "0"), + ("linux", "mipsle", "0"), + ("linux", "ppc64", "0"), + ("linux", "ppc64le", "0"), + ("linux", "riscv64", "0"), + ("linux", "s390x", "0"), + ("freebsd", "amd64", "0"), + ("freebsd", "386", "0"), + ("openbsd", "amd64", "0"), + ("openbsd", "386", "0"), + ("dragonfly", "amd64", "0"), ] diff --git a/infra/conf/command/command.go b/infra/conf/command/command.go index 9f8c12d562..b7d7829cb3 100644 --- a/infra/conf/command/command.go +++ b/infra/conf/command/command.go @@ -1,6 +1,6 @@ package command -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "os" diff --git a/infra/conf/conf.go b/infra/conf/conf.go index 63b7313fec..4a0993847f 100644 --- a/infra/conf/conf.go +++ b/infra/conf/conf.go @@ -1,3 +1,3 @@ package conf -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/infra/conf/dns.go b/infra/conf/dns.go index 0a9eb50a84..e9222a4c07 100644 --- a/infra/conf/dns.go +++ b/infra/conf/dns.go @@ -62,11 +62,12 @@ func (c *NameServerConfig) Build() (*dns.NameServer, error) { } var domains []*dns.NameServer_PriorityDomain + var originalRules []*dns.NameServer_OriginalRule - for _, d := range c.Domains { - parsedDomain, err := parseDomainRule(d) + for _, rule := range c.Domains { + parsedDomain, err := parseDomainRule(rule) if err != nil { - return nil, newError("invalid domain rule: ", d).Base(err) + return nil, newError("invalid domain rule: ", rule).Base(err) } for _, pd := range parsedDomain { @@ -75,6 +76,10 @@ func (c *NameServerConfig) Build() (*dns.NameServer, error) { Domain: pd.Value, }) } + originalRules = append(originalRules, &dns.NameServer_OriginalRule{ + Rule: rule, + Size: uint32(len(parsedDomain)), + }) } geoipList, err := toCidrList(c.ExpectIPs) @@ -90,6 +95,7 @@ func (c *NameServerConfig) Build() (*dns.NameServer, error) { }, PrioritizedDomain: domains, Geoip: geoipList, + OriginalRules: originalRules, }, nil } @@ -185,6 +191,19 @@ func (c *DnsConfig) Build() (*dns.Config, error) { mapping.Type = dns.DomainMatchingType_Full mapping.Domain = domain[5:] + mappings = append(mappings, mapping) + } else if strings.HasPrefix(domain, "dotless:") { + mapping := getHostMapping(addr) + mapping.Type = dns.DomainMatchingType_Regex + switch substr := domain[8:]; { + case substr == "": + mapping.Domain = "^[^.]*$" + case !strings.Contains(substr, "."): + mapping.Domain = "^[^.]*" + substr + "[^.]*$" + default: + return nil, newError("substr in dotless rule should not contain a dot: ", substr) + } + mappings = append(mappings, mapping) } else if strings.HasPrefix(domain, "ext:") { kv := strings.Split(domain[4:], ":") diff --git a/infra/conf/dns_test.go b/infra/conf/dns_test.go index fc3a4ba139..ca5a037ffd 100644 --- a/infra/conf/dns_test.go +++ b/infra/conf/dns_test.go @@ -20,9 +20,12 @@ func init() { wd, err := os.Getwd() common.Must(err) - common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) + if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && os.IsNotExist(err) { + common.Must(filesystem.CopyFile(platform.GetAssetLocation("geoip.dat"), filepath.Join(wd, "..", "..", "release", "config", "geoip.dat"))) + } - geositeFilePath := platform.GetAssetLocation("geosite.dat") + geositeFilePath := filepath.Join(wd, "geosite.dat") + os.Setenv("v2ray.location.asset", wd) geositeFile, err := os.OpenFile(geositeFilePath, os.O_CREATE|os.O_WRONLY, 0600) common.Must(err) defer geositeFile.Close() @@ -46,6 +49,7 @@ func TestDnsConfigParsing(t *testing.T) { geositePath := platform.GetAssetLocation("geosite.dat") defer func() { os.Remove(geositePath) + os.Unsetenv("v2ray.location.asset") }() parserCreator := func() func(string) (proto.Message, error) { @@ -94,6 +98,12 @@ func TestDnsConfigParsing(t *testing.T) { Domain: "v2ray.com", }, }, + OriginalRules: []*dns.NameServer_OriginalRule{ + { + Rule: "domain:v2ray.com", + Size: 1, + }, + }, }, }, StaticHosts: []*dns.Config_HostMapping{ diff --git a/infra/conf/router.go b/infra/conf/router.go index b3870e45d1..10b51993f8 100644 --- a/infra/conf/router.go +++ b/infra/conf/router.go @@ -162,7 +162,7 @@ func loadIP(filename, country string) ([]*router.CIDR, error) { } } - return nil, newError("country not found: " + country) + return nil, newError("country not found in ", filename, ": ", country) } func loadSite(filename, country string) ([]*router.Domain, error) { @@ -181,7 +181,7 @@ func loadSite(filename, country string) ([]*router.Domain, error) { } } - return nil, newError("country not found: " + country) + return nil, newError("list not found in ", filename, ": ", country) } type AttributeMatcher interface { @@ -260,9 +260,19 @@ func parseDomainRule(domain string) ([]*router.Domain, error) { } return domains, nil } - - if strings.HasPrefix(domain, "ext:") { - kv := strings.Split(domain[4:], ":") + var isExtDatFile = 0 + { + const prefix = "ext:" + if strings.HasPrefix(domain, prefix) { + isExtDatFile = len(prefix) + } + const prefixQualified = "ext-domain:" + if strings.HasPrefix(domain, prefixQualified) { + isExtDatFile = len(prefixQualified) + } + } + if isExtDatFile != 0 { + kv := strings.Split(domain[isExtDatFile:], ":") if len(kv) != 2 { return nil, newError("invalid external resource: ", domain) } @@ -289,6 +299,16 @@ func parseDomainRule(domain string) ([]*router.Domain, error) { case strings.HasPrefix(domain, "keyword:"): domainRule.Type = router.Domain_Plain domainRule.Value = domain[8:] + case strings.HasPrefix(domain, "dotless:"): + domainRule.Type = router.Domain_Regex + switch substr := domain[8:]; { + case substr == "": + domainRule.Value = "^[^.]*$" + case !strings.Contains(substr, "."): + domainRule.Value = "^[^.]*" + substr + "[^.]*$" + default: + return nil, newError("substr in dotless rule should not contain a dot: ", substr) + } default: domainRule.Type = router.Domain_Plain domainRule.Value = domain @@ -314,9 +334,19 @@ func toCidrList(ips StringList) ([]*router.GeoIP, error) { }) continue } - - if strings.HasPrefix(ip, "ext:") { - kv := strings.Split(ip[4:], ":") + var isExtDatFile = 0 + { + const prefix = "ext:" + if strings.HasPrefix(ip, prefix) { + isExtDatFile = len(prefix) + } + const prefixQualified = "ext-ip:" + if strings.HasPrefix(ip, prefixQualified) { + isExtDatFile = len(prefixQualified) + } + } + if isExtDatFile != 0 { + kv := strings.Split(ip[isExtDatFile:], ":") if len(kv) != 2 { return nil, newError("invalid external resource: ", ip) } @@ -360,6 +390,7 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) { Port *PortList `json:"port"` Network *NetworkList `json:"network"` SourceIP *StringList `json:"source"` + SourcePort *PortList `json:"sourcePort"` User *StringList `json:"user"` InboundTag *StringList `json:"inboundTag"` Protocols *StringList `json:"protocol"` @@ -418,6 +449,10 @@ func parseFieldRule(msg json.RawMessage) (*router.RoutingRule, error) { rule.SourceGeoip = geoipList } + if rawFieldRule.SourcePort != nil { + rule.SourcePortList = rawFieldRule.SourcePort.Build() + } + if rawFieldRule.User != nil { for _, s := range *rawFieldRule.User { rule.UserEmail = append(rule.UserEmail, s) diff --git a/infra/conf/serial/serial.go b/infra/conf/serial/serial.go index 8314cb0138..8c0604ac42 100644 --- a/infra/conf/serial/serial.go +++ b/infra/conf/serial/serial.go @@ -1,3 +1,3 @@ package serial -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 8f61ccf84e..b56c8710d0 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -26,6 +26,8 @@ func cipherFromString(c string) shadowsocks.CipherType { return shadowsocks.CipherType_AES_256_GCM case "chacha20-poly1305", "aead_chacha20_poly1305", "chacha20-ietf-poly1305": return shadowsocks.CipherType_CHACHA20_POLY1305 + case "none", "plain": + return shadowsocks.CipherType_NONE default: return shadowsocks.CipherType_UNKNOWN } @@ -37,7 +39,6 @@ type ShadowsocksServerConfig struct { UDP bool `json:"udp"` Level byte `json:"level"` Email string `json:"email"` - OTA *bool `json:"ota"` NetworkList *NetworkList `json:"network"` } @@ -51,14 +52,6 @@ func (v *ShadowsocksServerConfig) Build() (proto.Message, error) { } account := &shadowsocks.Account{ Password: v.Password, - Ota: shadowsocks.Account_Auto, - } - if v.OTA != nil { - if *v.OTA { - account.Ota = shadowsocks.Account_Enabled - } else { - account.Ota = shadowsocks.Account_Disabled - } } account.CipherType = cipherFromString(v.Cipher) if account.CipherType == shadowsocks.CipherType_UNKNOWN { @@ -108,10 +101,6 @@ func (v *ShadowsocksClientConfig) Build() (proto.Message, error) { } account := &shadowsocks.Account{ Password: server.Password, - Ota: shadowsocks.Account_Enabled, - } - if !server.Ota { - account.Ota = shadowsocks.Account_Disabled } account.CipherType = cipherFromString(server.Cipher) if account.CipherType == shadowsocks.CipherType_UNKNOWN { diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 4cd604e709..3906baddaa 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -16,6 +16,7 @@ import ( "v2ray.com/core/transport/internet/tcp" "v2ray.com/core/transport/internet/tls" "v2ray.com/core/transport/internet/websocket" + "v2ray.com/core/transport/internet/xtls" ) var ( @@ -109,7 +110,8 @@ func (c *KCPConfig) Build() (proto.Message, error) { } type TCPConfig struct { - HeaderConfig json.RawMessage `json:"header"` + HeaderConfig json.RawMessage `json:"header"` + AcceptProxyProtocol bool `json:"acceptProxyProtocol"` } // Build implements Buildable. @@ -126,14 +128,17 @@ func (c *TCPConfig) Build() (proto.Message, error) { } config.HeaderSettings = serial.ToTypedMessage(ts) } - + if c.AcceptProxyProtocol { + config.AcceptProxyProtocol = c.AcceptProxyProtocol + } return config, nil } type WebSocketConfig struct { - Path string `json:"path"` - Path2 string `json:"Path"` // The key was misspelled. For backward compatibility, we have to keep track the old key. - Headers map[string]string `json:"headers"` + Path string `json:"path"` + Path2 string `json:"Path"` // The key was misspelled. For backward compatibility, we have to keep track the old key. + Headers map[string]string `json:"headers"` + AcceptProxyProtocol bool `json:"acceptProxyProtocol"` } // Build implements Buildable. @@ -149,11 +154,13 @@ func (c *WebSocketConfig) Build() (proto.Message, error) { Value: value, }) } - config := &websocket.Config{ Path: path, Header: header, } + if c.AcceptProxyProtocol { + config.AcceptProxyProtocol = c.AcceptProxyProtocol + } return config, nil } @@ -162,6 +169,7 @@ type HTTPConfig struct { Path string `json:"path"` } +// Build implements Buildable. func (c *HTTPConfig) Build() (proto.Message, error) { config := &http.Config{ Path: c.Path, @@ -178,6 +186,7 @@ type QUICConfig struct { Key string `json:"key"` } +// Build implements Buildable. func (c *QUICConfig) Build() (proto.Message, error) { config := &quic.Config{ Key: c.Key, @@ -213,25 +222,22 @@ func (c *QUICConfig) Build() (proto.Message, error) { } type DomainSocketConfig struct { - Path string `json:"path"` - Abstract bool `json:"abstract"` + Path string `json:"path"` + Abstract bool `json:"abstract"` + Padding bool `json:"padding"` + AcceptProxyProtocol bool `json:"acceptProxyProtocol"` } +// Build implements Buildable. func (c *DomainSocketConfig) Build() (proto.Message, error) { return &domainsocket.Config{ - Path: c.Path, - Abstract: c.Abstract, + Path: c.Path, + Abstract: c.Abstract, + Padding: c.Padding, + AcceptProxyProtocol: c.AcceptProxyProtocol, }, nil } -type TLSCertConfig struct { - CertFile string `json:"certificateFile"` - CertStr []string `json:"certificate"` - KeyFile string `json:"keyFile"` - KeyStr []string `json:"key"` - Usage string `json:"usage"` -} - func readFileOrString(f string, s []string) ([]byte, error) { if len(f) > 0 { return filesystem.ReadFile(f) @@ -242,6 +248,15 @@ func readFileOrString(f string, s []string) ([]byte, error) { return nil, newError("both file and bytes are empty.") } +type TLSCertConfig struct { + CertFile string `json:"certificateFile"` + CertStr []string `json:"certificate"` + KeyFile string `json:"keyFile"` + KeyStr []string `json:"key"` + Usage string `json:"usage"` +} + +// Build implements Buildable. func (c *TLSCertConfig) Build() (*tls.Certificate, error) { certificate := new(tls.Certificate) @@ -308,6 +323,81 @@ func (c *TLSConfig) Build() (proto.Message, error) { return config, nil } +type XTLSCertConfig struct { + CertFile string `json:"certificateFile"` + CertStr []string `json:"certificate"` + KeyFile string `json:"keyFile"` + KeyStr []string `json:"key"` + Usage string `json:"usage"` +} + +// Build implements Buildable. +func (c *XTLSCertConfig) Build() (*xtls.Certificate, error) { + certificate := new(xtls.Certificate) + + cert, err := readFileOrString(c.CertFile, c.CertStr) + if err != nil { + return nil, newError("failed to parse certificate").Base(err) + } + certificate.Certificate = cert + + if len(c.KeyFile) > 0 || len(c.KeyStr) > 0 { + key, err := readFileOrString(c.KeyFile, c.KeyStr) + if err != nil { + return nil, newError("failed to parse key").Base(err) + } + certificate.Key = key + } + + switch strings.ToLower(c.Usage) { + case "encipherment": + certificate.Usage = xtls.Certificate_ENCIPHERMENT + case "verify": + certificate.Usage = xtls.Certificate_AUTHORITY_VERIFY + case "issue": + certificate.Usage = xtls.Certificate_AUTHORITY_ISSUE + default: + certificate.Usage = xtls.Certificate_ENCIPHERMENT + } + + return certificate, nil +} + +type XTLSConfig struct { + Insecure bool `json:"allowInsecure"` + InsecureCiphers bool `json:"allowInsecureCiphers"` + Certs []*XTLSCertConfig `json:"certificates"` + ServerName string `json:"serverName"` + ALPN *StringList `json:"alpn"` + DisableSessionResumption bool `json:"disableSessionResumption"` + DisableSystemRoot bool `json:"disableSystemRoot"` +} + +// Build implements Buildable. +func (c *XTLSConfig) Build() (proto.Message, error) { + config := new(xtls.Config) + config.Certificate = make([]*xtls.Certificate, len(c.Certs)) + for idx, certConf := range c.Certs { + cert, err := certConf.Build() + if err != nil { + return nil, err + } + config.Certificate[idx] = cert + } + serverName := c.ServerName + config.AllowInsecure = c.Insecure + config.AllowInsecureCiphers = c.InsecureCiphers + if len(c.ServerName) > 0 { + config.ServerName = serverName + } + if c.ALPN != nil && len(*c.ALPN) > 0 { + config.NextProtocol = []string(*c.ALPN) + } + config.DisableSessionResumption = c.DisableSessionResumption + config.DisableSystemRoot = c.DisableSystemRoot + return config, nil +} + type TransportProtocol string // Build implements Buildable. @@ -336,6 +426,7 @@ type SocketConfig struct { TProxy string `json:"tproxy"` } +// Build implements Buildable. func (c *SocketConfig) Build() (*internet.SocketConfig, error) { var tfoSettings internet.SocketConfig_TCPFastOpenState if c.TFO != nil { @@ -366,6 +457,7 @@ type StreamConfig struct { Network *TransportProtocol `json:"network"` Security string `json:"security"` TLSSettings *TLSConfig `json:"tlsSettings"` + XTLSSettings *XTLSConfig `json:"xtlsSettings"` TCPSettings *TCPConfig `json:"tcpSettings"` KCPSettings *KCPConfig `json:"kcpSettings"` WSSettings *WebSocketConfig `json:"wsSettings"` @@ -390,6 +482,9 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) { if strings.EqualFold(c.Security, "tls") { tlsSettings := c.TLSSettings if tlsSettings == nil { + if c.XTLSSettings != nil { + return nil, newError(`TLS: Please use "tlsSettings" instead of "xtlsSettings".`) + } tlsSettings = &TLSConfig{} } ts, err := tlsSettings.Build() @@ -400,6 +495,25 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) { config.SecuritySettings = append(config.SecuritySettings, tm) config.SecurityType = tm.Type } + if strings.EqualFold(c.Security, "xtls") { + if config.ProtocolName != "tcp" && config.ProtocolName != "mkcp" && config.ProtocolName != "domainsocket" { + return nil, newError("XTLS only supports TCP, mKCP and DomainSocket for now.") + } + xtlsSettings := c.XTLSSettings + if xtlsSettings == nil { + if c.TLSSettings != nil { + return nil, newError(`XTLS: Please use "xtlsSettings" instead of "tlsSettings".`) + } + xtlsSettings = &XTLSConfig{} + } + ts, err := xtlsSettings.Build() + if err != nil { + return nil, newError("Failed to build XTLS config.").Base(err) + } + tm := serial.ToTypedMessage(ts) + config.SecuritySettings = append(config.SecuritySettings, tm) + config.SecurityType = tm.Type + } if c.TCPSettings != nil { ts, err := c.TCPSettings.Build() if err != nil { @@ -453,7 +567,7 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) { if c.QUICSettings != nil { qs, err := c.QUICSettings.Build() if err != nil { - return nil, newError("failed to build QUIC config").Base(err) + return nil, newError("Failed to build QUIC config").Base(err) } config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{ ProtocolName: "quic", @@ -463,7 +577,7 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) { if c.SocketSettings != nil { ss, err := c.SocketSettings.Build() if err != nil { - return nil, newError("failed to build sockopt").Base(err) + return nil, newError("Failed to build sockopt").Base(err) } config.SocketSettings = ss } diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go new file mode 100644 index 0000000000..88fd605d93 --- /dev/null +++ b/infra/conf/trojan.go @@ -0,0 +1,176 @@ +package conf + +import ( + "encoding/json" + "runtime" + "strconv" + "syscall" + + "github.com/golang/protobuf/proto" // nolint: staticcheck + + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/serial" + "v2ray.com/core/proxy/trojan" +) + +// TrojanServerTarget is configuration of a single trojan server +type TrojanServerTarget struct { + Address *Address `json:"address"` + Port uint16 `json:"port"` + Password string `json:"password"` + Email string `json:"email"` + Level byte `json:"level"` +} + +// TrojanClientConfig is configuration of trojan servers +type TrojanClientConfig struct { + Servers []*TrojanServerTarget `json:"servers"` +} + +// Build implements Buildable +func (c *TrojanClientConfig) Build() (proto.Message, error) { + config := new(trojan.ClientConfig) + + if len(c.Servers) == 0 { + return nil, newError("0 Trojan server configured.") + } + + serverSpecs := make([]*protocol.ServerEndpoint, len(c.Servers)) + for idx, rec := range c.Servers { + if rec.Address == nil { + return nil, newError("Trojan server address is not set.") + } + if rec.Port == 0 { + return nil, newError("Invalid Trojan port.") + } + if rec.Password == "" { + return nil, newError("Trojan password is not specified.") + } + account := &trojan.Account{ + Password: rec.Password, + } + trojan := &protocol.ServerEndpoint{ + Address: rec.Address.Build(), + Port: uint32(rec.Port), + User: []*protocol.User{ + { + Level: uint32(rec.Level), + Email: rec.Email, + Account: serial.ToTypedMessage(account), + }, + }, + } + + serverSpecs[idx] = trojan + } + + config.Server = serverSpecs + + return config, nil +} + +// TrojanInboundFallback is fallback configuration +type TrojanInboundFallback struct { + Alpn string `json:"alpn"` + Path string `json:"path"` + Type string `json:"type"` + Dest json.RawMessage `json:"dest"` + Xver uint64 `json:"xver"` +} + +// TrojanUserConfig is user configuration +type TrojanUserConfig struct { + Password string `json:"password"` + Level byte `json:"level"` + Email string `json:"email"` +} + +// TrojanServerConfig is Inbound configuration +type TrojanServerConfig struct { + Clients []*TrojanUserConfig `json:"clients"` + Fallback json.RawMessage `json:"fallback"` + Fallbacks []*TrojanInboundFallback `json:"fallbacks"` +} + +// Build implements Buildable +func (c *TrojanServerConfig) Build() (proto.Message, error) { + config := new(trojan.ServerConfig) + + if len(c.Clients) == 0 { + return nil, newError("No trojan user settings.") + } + + config.Users = make([]*protocol.User, len(c.Clients)) + for idx, rawUser := range c.Clients { + user := new(protocol.User) + account := &trojan.Account{ + Password: rawUser.Password, + } + + user.Email = rawUser.Email + user.Level = uint32(rawUser.Level) + user.Account = serial.ToTypedMessage(account) + config.Users[idx] = user + } + + if c.Fallback != nil { + return nil, newError(`Trojan settings: please use "fallbacks":[{}] instead of "fallback":{}`) + } + for _, fb := range c.Fallbacks { + var i uint16 + var s string + if err := json.Unmarshal(fb.Dest, &i); err == nil { + s = strconv.Itoa(int(i)) + } else { + _ = json.Unmarshal(fb.Dest, &s) + } + config.Fallbacks = append(config.Fallbacks, &trojan.Fallback{ + Alpn: fb.Alpn, + Path: fb.Path, + Type: fb.Type, + Dest: s, + Xver: fb.Xver, + }) + } + for _, fb := range config.Fallbacks { + /* + if fb.Alpn == "h2" && fb.Path != "" { + return nil, newError(`Trojan fallbacks: "alpn":"h2" doesn't support "path"`) + } + */ + if fb.Path != "" && fb.Path[0] != '/' { + return nil, newError(`Trojan fallbacks: "path" must be empty or start with "/"`) + } + if fb.Type == "" && fb.Dest != "" { + if fb.Dest == "serve-ws-none" { + fb.Type = "serve" + } else { + switch fb.Dest[0] { + case '@', '/': + fb.Type = "unix" + if fb.Dest[0] == '@' && len(fb.Dest) > 1 && fb.Dest[1] == '@' && runtime.GOOS == "linux" { + fullAddr := make([]byte, len(syscall.RawSockaddrUnix{}.Path)) // may need padding to work in front of haproxy + copy(fullAddr, fb.Dest[1:]) + fb.Dest = string(fullAddr) + } + default: + if _, err := strconv.Atoi(fb.Dest); err == nil { + fb.Dest = "127.0.0.1:" + fb.Dest + } + if _, _, err := net.SplitHostPort(fb.Dest); err == nil { + fb.Type = "tcp" + } + } + } + } + if fb.Type == "" { + return nil, newError(`Trojan fallbacks: please fill in a valid value for every "dest"`) + } + if fb.Xver > 2 { + return nil, newError(`Trojan fallbacks: invalid PROXY protocol version, "xver" only accepts 0, 1, 2`) + } + } + + return config, nil +} diff --git a/infra/conf/v2ray.go b/infra/conf/v2ray.go index 8f0d7d1a72..8625f1f53e 100644 --- a/infra/conf/v2ray.go +++ b/infra/conf/v2ray.go @@ -11,6 +11,7 @@ import ( "v2ray.com/core/app/proxyman" "v2ray.com/core/app/stats" "v2ray.com/core/common/serial" + "v2ray.com/core/transport/internet/xtls" ) var ( @@ -19,7 +20,9 @@ var ( "http": func() interface{} { return new(HttpServerConfig) }, "shadowsocks": func() interface{} { return new(ShadowsocksServerConfig) }, "socks": func() interface{} { return new(SocksServerConfig) }, + "vless": func() interface{} { return new(VLessInboundConfig) }, "vmess": func() interface{} { return new(VMessInboundConfig) }, + "trojan": func() interface{} { return new(TrojanServerConfig) }, "mtproto": func() interface{} { return new(MTProtoServerConfig) }, }, "protocol", "settings") @@ -28,8 +31,10 @@ var ( "freedom": func() interface{} { return new(FreedomConfig) }, "http": func() interface{} { return new(HttpClientConfig) }, "shadowsocks": func() interface{} { return new(ShadowsocksClientConfig) }, - "vmess": func() interface{} { return new(VMessOutboundConfig) }, "socks": func() interface{} { return new(SocksClientConfig) }, + "vless": func() interface{} { return new(VLessOutboundConfig) }, + "vmess": func() interface{} { return new(VMessOutboundConfig) }, + "trojan": func() interface{} { return new(TrojanClientConfig) }, "mtproto": func() interface{} { return new(MTProtoClientConfig) }, "dns": func() interface{} { return new(DnsOutboundConfig) }, }, "protocol", "settings") @@ -57,6 +62,7 @@ type SniffingConfig struct { DestOverride *StringList `json:"destOverride"` } +// Build implements Buildable. func (c *SniffingConfig) Build() (*proxyman.SniffingConfig, error) { var p []string if c.DestOverride != nil { @@ -182,6 +188,9 @@ func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error) { if err != nil { return nil, err } + if ss.SecurityType == serial.GetMessageType(&xtls.Config{}) && !strings.EqualFold(c.Protocol, "vless") { + return nil, newError("XTLS only supports VLESS for now.") + } receiverSettings.StreamSettings = ss } if c.SniffingConfig != nil { @@ -249,6 +258,9 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) { if err != nil { return nil, err } + if ss.SecurityType == serial.GetMessageType(&xtls.Config{}) && !strings.EqualFold(c.Protocol, "vless") { + return nil, newError("XTLS only supports VLESS for now.") + } senderSettings.StreamSettings = ss } @@ -261,7 +273,15 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) { } if c.MuxSettings != nil { - senderSettings.MultiplexSettings = c.MuxSettings.Build() + ms := c.MuxSettings.Build() + if ms != nil && ms.Enabled { + if ss := senderSettings.StreamSettings; ss != nil { + if ss.SecurityType == serial.GetMessageType(&xtls.Config{}) { + return nil, newError("XTLS doesn't support Mux for now.") + } + } + } + senderSettings.MultiplexSettings = ms } settings := []byte("{}") @@ -286,6 +306,7 @@ func (c *OutboundDetourConfig) Build() (*core.OutboundHandlerConfig, error) { type StatsConfig struct{} +// Build implements Buildable. func (c *StatsConfig) Build() (*stats.Config, error) { return &stats.Config{}, nil } diff --git a/infra/conf/v2ray_test.go b/infra/conf/v2ray_test.go index 8c59a7ae83..e51a42c580 100644 --- a/infra/conf/v2ray_test.go +++ b/infra/conf/v2ray_test.go @@ -404,39 +404,39 @@ func TestConfig_Override(t *testing.T) { }, }, {"combine/newattr", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "old"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "old"}}}, &Config{LogConfig: &LogConfig{}}, "", - &Config{LogConfig: &LogConfig{}, InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "old"}}}}, + &Config{LogConfig: &LogConfig{}, InboundConfigs: []InboundDetourConfig{{Tag: "old"}}}}, {"replace/inbounds", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos0"}, InboundDetourConfig{Protocol: "vmess", Tag: "pos1"}}}, - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}}}, "", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos0"}, InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos0"}, {Tag: "pos1", Protocol: "kcp"}}}}, {"replace/inbounds-replaceall", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos0"}, InboundDetourConfig{Protocol: "vmess", Tag: "pos1"}}}, - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}, InboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}, {Tag: "pos2", Protocol: "kcp"}}}, "", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}, InboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}, {Tag: "pos2", Protocol: "kcp"}}}}, {"replace/notag-append", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{}, InboundDetourConfig{Protocol: "vmess"}}}, - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{}, {Protocol: "vmess"}}}, + &Config{InboundConfigs: []InboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}}}, "", - &Config{InboundConfigs: []InboundDetourConfig{InboundDetourConfig{}, InboundDetourConfig{Protocol: "vmess"}, InboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}}, + &Config{InboundConfigs: []InboundDetourConfig{{}, {Protocol: "vmess"}, {Tag: "pos1", Protocol: "kcp"}}}}, {"replace/outbounds", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos0"}, OutboundDetourConfig{Protocol: "vmess", Tag: "pos1"}}}, - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}}}, "", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos0"}, OutboundDetourConfig{Tag: "pos1", Protocol: "kcp"}}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos0"}, {Tag: "pos1", Protocol: "kcp"}}}}, {"replace/outbounds-prepend", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos0"}, OutboundDetourConfig{Protocol: "vmess", Tag: "pos1"}}}, - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos1", Protocol: "kcp"}, OutboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}, {Tag: "pos2", Protocol: "kcp"}}}, "config.json", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos1", Protocol: "kcp"}, OutboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos1", Protocol: "kcp"}, {Tag: "pos2", Protocol: "kcp"}}}}, {"replace/outbounds-append", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos0"}, OutboundDetourConfig{Protocol: "vmess", Tag: "pos1"}}}, - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos2", Protocol: "kcp"}}}, "config_tail.json", - &Config{OutboundConfigs: []OutboundDetourConfig{OutboundDetourConfig{Tag: "pos0"}, OutboundDetourConfig{Protocol: "vmess", Tag: "pos1"}, OutboundDetourConfig{Tag: "pos2", Protocol: "kcp"}}}}, + &Config{OutboundConfigs: []OutboundDetourConfig{{Tag: "pos0"}, {Protocol: "vmess", Tag: "pos1"}, {Tag: "pos2", Protocol: "kcp"}}}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/infra/conf/vless.go b/infra/conf/vless.go new file mode 100644 index 0000000000..4939696e6c --- /dev/null +++ b/infra/conf/vless.go @@ -0,0 +1,191 @@ +package conf + +import ( + "encoding/json" + "runtime" + "strconv" + "syscall" + + "github.com/golang/protobuf/proto" + + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/serial" + "v2ray.com/core/proxy/vless" + "v2ray.com/core/proxy/vless/inbound" + "v2ray.com/core/proxy/vless/outbound" +) + +type VLessInboundFallback struct { + Alpn string `json:"alpn"` + Path string `json:"path"` + Type string `json:"type"` + Dest json.RawMessage `json:"dest"` + Xver uint64 `json:"xver"` +} + +type VLessInboundConfig struct { + Clients []json.RawMessage `json:"clients"` + Decryption string `json:"decryption"` + Fallback json.RawMessage `json:"fallback"` + Fallbacks []*VLessInboundFallback `json:"fallbacks"` +} + +// Build implements Buildable +func (c *VLessInboundConfig) Build() (proto.Message, error) { + + config := new(inbound.Config) + + if len(c.Clients) == 0 { + //return nil, newError(`VLESS settings: "clients" is empty`) + } + config.Clients = make([]*protocol.User, len(c.Clients)) + for idx, rawUser := range c.Clients { + user := new(protocol.User) + if err := json.Unmarshal(rawUser, user); err != nil { + return nil, newError(`VLESS clients: invalid user`).Base(err) + } + account := new(vless.Account) + if err := json.Unmarshal(rawUser, account); err != nil { + return nil, newError(`VLESS clients: invalid user`).Base(err) + } + + switch account.Flow { + case "", "xtls-rprx-origin", "xtls-rprx-direct": + default: + return nil, newError(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) + } + + if account.Encryption != "" { + return nil, newError(`VLESS clients: "encryption" should not in inbound settings`) + } + + user.Account = serial.ToTypedMessage(account) + config.Clients[idx] = user + } + + if c.Decryption != "none" { + return nil, newError(`VLESS settings: please add/set "decryption":"none" to every settings`) + } + config.Decryption = c.Decryption + + if c.Fallback != nil { + return nil, newError(`VLESS settings: please use "fallbacks":[{}] instead of "fallback":{}`) + } + for _, fb := range c.Fallbacks { + var i uint16 + var s string + if err := json.Unmarshal(fb.Dest, &i); err == nil { + s = strconv.Itoa(int(i)) + } else { + _ = json.Unmarshal(fb.Dest, &s) + } + config.Fallbacks = append(config.Fallbacks, &inbound.Fallback{ + Alpn: fb.Alpn, + Path: fb.Path, + Type: fb.Type, + Dest: s, + Xver: fb.Xver, + }) + } + for _, fb := range config.Fallbacks { + /* + if fb.Alpn == "h2" && fb.Path != "" { + return nil, newError(`VLESS fallbacks: "alpn":"h2" doesn't support "path"`) + } + */ + if fb.Path != "" && fb.Path[0] != '/' { + return nil, newError(`VLESS fallbacks: "path" must be empty or start with "/"`) + } + if fb.Type == "" && fb.Dest != "" { + if fb.Dest == "serve-ws-none" { + fb.Type = "serve" + } else { + switch fb.Dest[0] { + case '@', '/': + fb.Type = "unix" + if fb.Dest[0] == '@' && len(fb.Dest) > 1 && fb.Dest[1] == '@' && runtime.GOOS == "linux" { + fullAddr := make([]byte, len(syscall.RawSockaddrUnix{}.Path)) // may need padding to work in front of haproxy + copy(fullAddr, fb.Dest[1:]) + fb.Dest = string(fullAddr) + } + default: + if _, err := strconv.Atoi(fb.Dest); err == nil { + fb.Dest = "127.0.0.1:" + fb.Dest + } + if _, _, err := net.SplitHostPort(fb.Dest); err == nil { + fb.Type = "tcp" + } + } + } + } + if fb.Type == "" { + return nil, newError(`VLESS fallbacks: please fill in a valid value for every "dest"`) + } + if fb.Xver > 2 { + return nil, newError(`VLESS fallbacks: invalid PROXY protocol version, "xver" only accepts 0, 1, 2`) + } + } + + return config, nil +} + +type VLessOutboundVnext struct { + Address *Address `json:"address"` + Port uint16 `json:"port"` + Users []json.RawMessage `json:"users"` +} + +type VLessOutboundConfig struct { + Vnext []*VLessOutboundVnext `json:"vnext"` +} + +// Build implements Buildable +func (c *VLessOutboundConfig) Build() (proto.Message, error) { + + config := new(outbound.Config) + + if len(c.Vnext) == 0 { + return nil, newError(`VLESS settings: "vnext" is empty`) + } + config.Vnext = make([]*protocol.ServerEndpoint, len(c.Vnext)) + for idx, rec := range c.Vnext { + if rec.Address == nil { + return nil, newError(`VLESS vnext: "address" is not set`) + } + if len(rec.Users) == 0 { + return nil, newError(`VLESS vnext: "users" is empty`) + } + spec := &protocol.ServerEndpoint{ + Address: rec.Address.Build(), + Port: uint32(rec.Port), + User: make([]*protocol.User, len(rec.Users)), + } + for idx, rawUser := range rec.Users { + user := new(protocol.User) + if err := json.Unmarshal(rawUser, user); err != nil { + return nil, newError(`VLESS users: invalid user`).Base(err) + } + account := new(vless.Account) + if err := json.Unmarshal(rawUser, account); err != nil { + return nil, newError(`VLESS users: invalid user`).Base(err) + } + + switch account.Flow { + case "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443": + default: + return nil, newError(`VLESS users: "flow" doesn't support "` + account.Flow + `" in this version`) + } + + if account.Encryption != "none" { + return nil, newError(`VLESS users: please add/set "encryption":"none" for every user`) + } + + user.Account = serial.ToTypedMessage(account) + spec.User[idx] = user + } + config.Vnext[idx] = spec + } + + return config, nil +} diff --git a/infra/conf/vless_test.go b/infra/conf/vless_test.go new file mode 100644 index 0000000000..01eb9619dd --- /dev/null +++ b/infra/conf/vless_test.go @@ -0,0 +1,134 @@ +package conf_test + +import ( + "testing" + + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/serial" + . "v2ray.com/core/infra/conf" + "v2ray.com/core/proxy/vless" + "v2ray.com/core/proxy/vless/inbound" + "v2ray.com/core/proxy/vless/outbound" +) + +func TestVLessOutbound(t *testing.T) { + creator := func() Buildable { + return new(VLessOutboundConfig) + } + + runMultiTestCase(t, []TestCase{ + { + Input: `{ + "vnext": [{ + "address": "example.com", + "port": 443, + "users": [ + { + "id": "27848739-7e62-4138-9fd3-098a63964b6b", + "flow": "xtls-rprx-origin-udp443", + "encryption": "none", + "level": 0 + } + ] + }] + }`, + Parser: loadJSON(creator), + Output: &outbound.Config{ + Vnext: []*protocol.ServerEndpoint{ + { + Address: &net.IPOrDomain{ + Address: &net.IPOrDomain_Domain{ + Domain: "example.com", + }, + }, + Port: 443, + User: []*protocol.User{ + { + Account: serial.ToTypedMessage(&vless.Account{ + Id: "27848739-7e62-4138-9fd3-098a63964b6b", + Flow: "xtls-rprx-origin-udp443", + Encryption: "none", + }), + Level: 0, + }, + }, + }, + }, + }, + }, + }) +} + +func TestVLessInbound(t *testing.T) { + creator := func() Buildable { + return new(VLessInboundConfig) + } + + runMultiTestCase(t, []TestCase{ + { + Input: `{ + "clients": [ + { + "id": "27848739-7e62-4138-9fd3-098a63964b6b", + "flow": "xtls-rprx-origin", + "level": 0, + "email": "love@v2fly.org" + } + ], + "decryption": "none", + "fallbacks": [ + { + "dest": 80 + }, + { + "alpn": "h2", + "dest": "@/dev/shm/domain.socket", + "xver": 2 + }, + { + "path": "/innerws", + "dest": "serve-ws-none" + } + ] + }`, + Parser: loadJSON(creator), + Output: &inbound.Config{ + Clients: []*protocol.User{ + { + Account: serial.ToTypedMessage(&vless.Account{ + Id: "27848739-7e62-4138-9fd3-098a63964b6b", + Flow: "xtls-rprx-origin", + }), + Level: 0, + Email: "love@v2fly.org", + }, + }, + Decryption: "none", + Fallbacks: []*inbound.Fallback{ + { + Alpn: "", + Path: "", + Type: "tcp", + Dest: "127.0.0.1:80", + Xver: 0, + }, + { + Alpn: "h2", + Path: "", + Type: "unix", + Dest: "@/dev/shm/domain.socket", + Xver: 2, + }, + { + Alpn: "", + Path: "/innerws", + Type: "serve", + Dest: "serve-ws-none", + Xver: 0, + }, + }, + }, + }, + }) +} diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index 838fa26328..093bf62de2 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -14,10 +14,9 @@ import ( ) type VMessAccount struct { - ID string `json:"id"` - AlterIds uint16 `json:"alterId"` - Security string `json:"security"` - TestsEnabled string `json:"testsEnabled"` + ID string `json:"id"` + AlterIds uint16 `json:"alterId"` + Security string `json:"security"` } // Build implements Buildable @@ -41,7 +40,6 @@ func (a *VMessAccount) Build() *vmess.Account { SecuritySettings: &protocol.SecurityConfig{ Type: st, }, - TestsEnabled: a.TestsEnabled, } } diff --git a/infra/control/control.go b/infra/control/control.go index adac14d85b..7c05ea278d 100644 --- a/infra/control/control.go +++ b/infra/control/control.go @@ -1,3 +1,3 @@ package control -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/infra/control/main/BUILD b/infra/control/main/BUILD index 5869198043..02ba8976c7 100644 --- a/infra/control/main/BUILD +++ b/infra/control/main/BUILD @@ -1,5 +1,3 @@ -load("//infra/bazel:build.bzl", "foreign_go_binary") -load("//infra/bazel:gpg.bzl", "gpg_sign") load("//infra/bazel:matrix.bzl", "SUPPORTED_MATRIX") load("//infra/control/main:targets.bzl", "gen_targets") diff --git a/infra/control/main/targets.bzl b/infra/control/main/targets.bzl index 91bdf608d5..b52dae664d 100644 --- a/infra/control/main/targets.bzl +++ b/infra/control/main/targets.bzl @@ -1,88 +1,45 @@ load("//infra/bazel:build.bzl", "foreign_go_binary") -load("//infra/bazel:gpg.bzl", "gpg_sign") def gen_targets(matrix): + pkg = "./infra/control/main" output = "v2ctl" - pkg = "v2ray.com/core/infra/control/main" - for (os, arch) in matrix: - bin_name = "v2ctl_" + os + "_" + arch - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output, - os = os, - arch = arch, - gotags = "confonly", - ) + for (os, arch, ver) in matrix: - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - if arch in ["mips", "mipsle"]: - bin_name = "v2ctl_" + os + "_" + arch + "_softfloat" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output + "_softfloat", - os = os, - arch = arch, - mips = "softfloat", - gotags = "confonly", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - if arch in ["arm"]: - bin_name = "v2ctl_" + os + "_" + arch + "_armv7" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output + "_armv7", - os = os, - arch = arch, - arm = "7", - gotags = "confonly", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ctl_" + os + "_" + arch + "_armv6" + bin_name = "v2ctl_" + os + "_" + arch + "_" + ver foreign_go_binary( name = bin_name, pkg = pkg, - output = output + "_armv6", + output = output, os = os, arch = arch, - arm = "6", + ver = ver, + arm = ver, gotags = "confonly", ) - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ctl_" + os + "_" + arch + "_armv5" + else: + bin_name = "v2ctl_" + os + "_" + arch foreign_go_binary( name = bin_name, pkg = pkg, output = output, os = os, arch = arch, - arm = "5", + ver = ver, gotags = "confonly", ) - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) + if arch in ["mips", "mipsle"]: + bin_name = "v2ctl_" + os + "_" + arch + "_softfloat" + foreign_go_binary( + name = bin_name, + pkg = pkg, + output = output + "_softfloat", + os = os, + arch = arch, + ver = ver, + mips = "softfloat", + gotags = "confonly", + ) diff --git a/infra/vprotogen/main.go b/infra/vprotogen/main.go index 403b61e915..98091bf8a1 100644 --- a/infra/vprotogen/main.go +++ b/infra/vprotogen/main.go @@ -1,38 +1,29 @@ package main import ( - "bytes" - "flag" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "strings" + "v2ray.com/core" "v2ray.com/core/common" ) -var protocMap = map[string]string{ - "windows": filepath.Join(os.Getenv("GOPATH"), "src", "v2ray.com", "core", ".dev", "protoc", "windows", "protoc.exe"), - "darwin": filepath.Join(os.Getenv("GOPATH"), "src", "v2ray.com", "core", ".dev", "protoc", "macos", "protoc"), - "linux": filepath.Join(os.Getenv("GOPATH"), "src", "v2ray.com", "core", ".dev", "protoc", "linux", "protoc"), -} - -var ( - repo = flag.String("repo", "", "Repo for protobuf generation, such as v2ray.com/core") -) - func main() { - flag.Parse() + pwd, wdErr := os.Getwd() + if wdErr != nil { + fmt.Println("Can not get current working directory.") + os.Exit(1) + } - protofiles := make(map[string][]string) - protoc := protocMap[runtime.GOOS] - gosrc := filepath.Join(os.Getenv("GOPATH"), "src") - reporoot := filepath.Join(os.Getenv("GOPATH"), "src", *repo) + GOBIN := common.GetGOBIN() + protoc := core.ProtocMap[runtime.GOOS] - filepath.Walk(reporoot, func(path string, info os.FileInfo, err error) error { + protoFilesMap := make(map[string][]string) + walkErr := filepath.Walk("./", func(path string, info os.FileInfo, err error) error { if err != nil { fmt.Println(err) return err @@ -45,27 +36,48 @@ func main() { dir := filepath.Dir(path) filename := filepath.Base(path) if strings.HasSuffix(filename, ".proto") { - protofiles[dir] = append(protofiles[dir], path) + protoFilesMap[dir] = append(protoFilesMap[dir], path) } return nil }) + if walkErr != nil { + fmt.Println(walkErr) + os.Exit(1) + } - for _, files := range protofiles { - args := []string{"--proto_path", gosrc, "--go_out", "plugins=grpc:" + gosrc} - args = append(args, files...) - cmd := exec.Command(protoc, args...) - cmd.Env = append(cmd.Env, os.Environ()...) - output, err := cmd.CombinedOutput() - if len(output) > 0 { - fmt.Println(string(output)) - } - if err != nil { - fmt.Println(err) + for _, files := range protoFilesMap { + for _, relProtoFile := range files { + var args []string + if core.ProtoFilesUsingProtocGenGoFast[relProtoFile] { + args = []string{"--gofast_out", pwd, "--plugin", "protoc-gen-gofast=" + GOBIN + "/protoc-gen-gofast"} + } else { + args = []string{"--go_out", pwd, "--go-grpc_out", pwd, "--plugin", "protoc-gen-go=" + GOBIN + "/protoc-gen-go", "--plugin", "protoc-gen-go-grpc=" + GOBIN + "/protoc-gen-go-grpc"} + } + args = append(args, relProtoFile) + cmd := exec.Command(protoc, args...) + cmd.Env = append(cmd.Env, os.Environ()...) + cmd.Env = append(cmd.Env, "GOBIN="+GOBIN) + output, cmdErr := cmd.CombinedOutput() + if len(output) > 0 { + fmt.Println(string(output)) + } + if cmdErr != nil { + fmt.Println(cmdErr) + os.Exit(1) + } } } - common.Must(filepath.Walk(reporoot, func(path string, info os.FileInfo, err error) error { + moduleName, gmnErr := common.GetModuleName(pwd) + if gmnErr != nil { + fmt.Println(gmnErr) + os.Exit(1) + } + modulePath := filepath.Join(strings.Split(moduleName, "/")...) + + pbGoFilesMap := make(map[string][]string) + walkErr2 := filepath.Walk(modulePath, func(path string, info os.FileInfo, err error) error { if err != nil { fmt.Println(err) return err @@ -75,21 +87,63 @@ func main() { return nil } - if !strings.HasSuffix(info.Name(), ".pb.go") { - return nil + dir := filepath.Dir(path) + filename := filepath.Base(path) + if strings.HasSuffix(filename, ".pb.go") { + pbGoFilesMap[dir] = append(pbGoFilesMap[dir], path) } - content, err := ioutil.ReadFile(path) - if err != nil { - return err - } - content = bytes.Replace(content, []byte("\"golang.org/x/net/context\""), []byte("\"context\""), 1) + return nil + }) + if walkErr2 != nil { + fmt.Println(walkErr2) + os.Exit(1) + } - pos := bytes.Index(content, []byte("\npackage")) - if pos > 0 { - content = content[pos+1:] + var err error + for _, srcPbGoFiles := range pbGoFilesMap { + for _, srcPbGoFile := range srcPbGoFiles { + var dstPbGoFile string + dstPbGoFile, err = filepath.Rel(modulePath, srcPbGoFile) + if err != nil { + fmt.Println(err) + continue + } + err = os.Link(srcPbGoFile, dstPbGoFile) + if err != nil { + if os.IsNotExist(err) { + fmt.Printf("'%s' does not exist\n", srcPbGoFile) + continue + } + if os.IsPermission(err) { + fmt.Println(err) + continue + } + if os.IsExist(err) { + err = os.Remove(dstPbGoFile) + if err != nil { + fmt.Printf("Failed to delete file '%s'\n", dstPbGoFile) + continue + } + err = os.Rename(srcPbGoFile, dstPbGoFile) + if err != nil { + fmt.Printf("Can not move '%s' to '%s'\n", srcPbGoFile, dstPbGoFile) + } + continue + } + } + err = os.Rename(srcPbGoFile, dstPbGoFile) + if err != nil { + fmt.Printf("Can not move '%s' to '%s'\n", srcPbGoFile, dstPbGoFile) + } + continue } + } - return ioutil.WriteFile(path, content, info.Mode()) - })) + if err == nil { + err = os.RemoveAll(strings.Split(modulePath, "/")[0]) + if err != nil { + fmt.Println(err) + } + } } diff --git a/main/BUILD b/main/BUILD index cab4297d79..98a45e1fb3 100644 --- a/main/BUILD +++ b/main/BUILD @@ -1,5 +1,3 @@ -load("//infra/bazel:build.bzl", "foreign_go_binary") -load("//infra/bazel:gpg.bzl", "gpg_sign") load("//infra/bazel:matrix.bzl", "SUPPORTED_MATRIX") load("//main:targets.bzl", "gen_targets") diff --git a/main/confloader/external/external.go b/main/confloader/external/external.go index a16f0c7a54..f6bcf7d5b5 100644 --- a/main/confloader/external/external.go +++ b/main/confloader/external/external.go @@ -1,6 +1,6 @@ package external -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "bytes" diff --git a/main/distro/all/all.go b/main/distro/all/all.go index 71144c0875..8c3914c72f 100644 --- a/main/distro/all/all.go +++ b/main/distro/all/all.go @@ -31,6 +31,9 @@ import ( _ "v2ray.com/core/proxy/mtproto" _ "v2ray.com/core/proxy/shadowsocks" _ "v2ray.com/core/proxy/socks" + _ "v2ray.com/core/proxy/trojan" + _ "v2ray.com/core/proxy/vless/inbound" + _ "v2ray.com/core/proxy/vless/outbound" _ "v2ray.com/core/proxy/vmess/inbound" _ "v2ray.com/core/proxy/vmess/outbound" @@ -43,6 +46,7 @@ import ( _ "v2ray.com/core/transport/internet/tls" _ "v2ray.com/core/transport/internet/udp" _ "v2ray.com/core/transport/internet/websocket" + _ "v2ray.com/core/transport/internet/xtls" // Transport headers _ "v2ray.com/core/transport/internet/headers/http" diff --git a/main/json/config_json.go b/main/json/config_json.go index 59bcc63d05..650aceb515 100644 --- a/main/json/config_json.go +++ b/main/json/config_json.go @@ -1,6 +1,6 @@ package json -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "io" diff --git a/main/main.go b/main/main.go index 4fe18844df..8390af3e72 100644 --- a/main/main.go +++ b/main/main.go @@ -1,6 +1,6 @@ package main -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "flag" diff --git a/main/targets.bzl b/main/targets.bzl index 95fbc21a67..dcf2bee254 100644 --- a/main/targets.bzl +++ b/main/targets.bzl @@ -1,147 +1,67 @@ load("//infra/bazel:build.bzl", "foreign_go_binary") -load("//infra/bazel:gpg.bzl", "gpg_sign") def gen_targets(matrix): - pkg = "v2ray.com/core/main" + pkg = "./main" output = "v2ray" - for (os, arch) in matrix: - bin_name = "v2ray_" + os + "_" + arch - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output, - os = os, - arch = arch, - ) + for (os, arch, ver) in matrix: - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - if os in ["windows"]: - bin_name = "v2ray_" + os + "_" + arch + "_nowindow" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = "w" + output, - os = os, - arch = arch, - ld = "-H windowsgui", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ray_" + os + "_" + arch + "_armv7_nowindow" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = "w" + output + "_armv7", - os = os, - arch = arch, - arm = "7", - ld = "-H windowsgui", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ray_" + os + "_" + arch + "_armv6_nowindow" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = "w" + output + "_armv6", - os = os, - arch = arch, - arm = "6", - ld = "-H windowsgui", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ray_" + os + "_" + arch + "_armv5_nowindow" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = "w" + output, - os = os, - arch = arch, - arm = "5", - ld = "-H windowsgui", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - if arch in ["mips", "mipsle"]: - bin_name = "v2ray_" + os + "_" + arch + "_softfloat" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output+"_softfloat", - os = os, - arch = arch, - mips = "softfloat", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - if arch in ["arm"]: - bin_name = "v2ray_" + os + "_" + arch + "_armv7" + bin_name = "v2ray_" + os + "_" + arch + "_" + ver foreign_go_binary( name = bin_name, pkg = pkg, - output = output + "_armv7", - os = os, - arch = arch, - arm = "7", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ray_" + os + "_" + arch + "_armv6" - foreign_go_binary( - name = bin_name, - pkg = pkg, - output = output + "_armv6", + output = output, os = os, arch = arch, - arm = "6", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) - - bin_name = "v2ray_" + os + "_" + arch + "_armv5" + ver = ver, + arm = ver, + ) + + if os in ["windows"]: + bin_name = "v2ray_" + os + "_" + arch + "_" + ver + "_nowindow" + foreign_go_binary( + name = bin_name, + pkg = pkg, + output = "w" + output, + os = os, + arch = arch, + ver = ver, + arm = ver, + ld = "-H windowsgui", + ) + + else: + bin_name = "v2ray_" + os + "_" + arch foreign_go_binary( name = bin_name, pkg = pkg, output = output, os = os, arch = arch, - arm = "5", - ) - - gpg_sign( - name = bin_name + "_sig", - base = ":" + bin_name, - ) + ver = ver, + ) + + if os in ["windows"]: + bin_name = "v2ray_" + os + "_" + arch + "_nowindow" + foreign_go_binary( + name = bin_name, + pkg = pkg, + output = "w" + output, + os = os, + arch = arch, + ver = ver, + ld = "-H windowsgui", + ) + + if arch in ["mips", "mipsle"]: + bin_name = "v2ray_" + os + "_" + arch + "_softfloat" + foreign_go_binary( + name = bin_name, + pkg = pkg, + output = output + "_softfloat", + os = os, + arch = arch, + ver = ver, + mips = "softfloat", + ) diff --git a/mocks.go b/mocks.go index c50c6f5122..3b1cc89425 100644 --- a/mocks.go +++ b/mocks.go @@ -1,11 +1,8 @@ package core -//go:generate go get -u github.com/golang/mock/gomock -//go:generate go install github.com/golang/mock/mockgen - -//go:generate mockgen -package mocks -destination testing/mocks/io.go -mock_names Reader=Reader,Writer=Writer io Reader,Writer -//go:generate mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler v2ray.com/core/common/log Handler -//go:generate mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory v2ray.com/core/common/mux ClientWorkerFactory -//go:generate mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient v2ray.com/core/features/dns Client -//go:generate mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector v2ray.com/core/features/outbound Manager,HandlerSelector -//go:generate mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound v2ray.com/core/proxy Inbound,Outbound +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/io.go -mock_names Reader=Reader,Writer=Writer io Reader,Writer +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler v2ray.com/core/common/log Handler +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory v2ray.com/core/common/mux ClientWorkerFactory +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient v2ray.com/core/features/dns Client +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector v2ray.com/core/features/outbound Manager,HandlerSelector +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound v2ray.com/core/proxy Inbound,Outbound diff --git a/proto.go b/proto.go index 779cdf8dcc..b490c136ec 100644 --- a/proto.go +++ b/proto.go @@ -1,6 +1,19 @@ package core -//go:generate go get -u "github.com/golang/protobuf/protoc-gen-go" -//go:generate go get -u "github.com/golang/protobuf/proto" -//go:generate go install "v2ray.com/core/infra/vprotogen" -//go:generate vprotogen -repo v2ray.com/core +//go:generate go install -v google.golang.org/protobuf/cmd/protoc-gen-go +//go:generate go install -v google.golang.org/grpc/cmd/protoc-gen-go-grpc +//go:generate go install -v github.com/gogo/protobuf/protoc-gen-gofast +//go:generate go run ./infra/vprotogen/main.go + +import "path/filepath" + +// ProtoFilesUsingProtocGenGoFast is the map of Proto files +// that use `protoc-gen-gofast` to generate pb.go files +var ProtoFilesUsingProtocGenGoFast = map[string]bool{"proxy/vless/encoding/addons.proto": true} + +// ProtocMap is the map of paths to `protoc` binary excutable files of specific platform +var ProtocMap = map[string]string{ + "windows": filepath.Join(".dev", "protoc", "windows", "protoc.exe"), + "darwin": filepath.Join(".dev", "protoc", "macos", "protoc"), + "linux": filepath.Join(".dev", "protoc", "linux", "protoc"), +} diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index 8bcc5f5eca..d2213390b3 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -4,7 +4,7 @@ package blackhole -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/proxy/blackhole/config.pb.go b/proxy/blackhole/config.pb.go index d3c4893869..45d1146c7e 100644 --- a/proxy/blackhole/config.pb.go +++ b/proxy/blackhole/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/blackhole/config.proto + package blackhole import ( @@ -29,7 +35,7 @@ type NoneResponse struct { func (x *NoneResponse) Reset() { *x = NoneResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[0] + mi := &file_proxy_blackhole_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -42,7 +48,7 @@ func (x *NoneResponse) String() string { func (*NoneResponse) ProtoMessage() {} func (x *NoneResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[0] + mi := &file_proxy_blackhole_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -55,7 +61,7 @@ func (x *NoneResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use NoneResponse.ProtoReflect.Descriptor instead. func (*NoneResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_blackhole_config_proto_rawDescGZIP(), []int{0} + return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{0} } type HTTPResponse struct { @@ -67,7 +73,7 @@ type HTTPResponse struct { func (x *HTTPResponse) Reset() { *x = HTTPResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[1] + mi := &file_proxy_blackhole_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -80,7 +86,7 @@ func (x *HTTPResponse) String() string { func (*HTTPResponse) ProtoMessage() {} func (x *HTTPResponse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[1] + mi := &file_proxy_blackhole_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -93,7 +99,7 @@ func (x *HTTPResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HTTPResponse.ProtoReflect.Descriptor instead. func (*HTTPResponse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_blackhole_config_proto_rawDescGZIP(), []int{1} + return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{1} } type Config struct { @@ -107,7 +113,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[2] + mi := &file_proxy_blackhole_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -120,7 +126,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[2] + mi := &file_proxy_blackhole_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -133,7 +139,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_blackhole_config_proto_rawDescGZIP(), []int{2} + return file_proxy_blackhole_config_proto_rawDescGZIP(), []int{2} } func (x *Config) GetResponse() *serial.TypedMessage { @@ -143,51 +149,51 @@ func (x *Config) GetResponse() *serial.TypedMessage { return nil } -var File_v2ray_com_core_proxy_blackhole_config_proto protoreflect.FileDescriptor +var File_proxy_blackhole_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_proxy_blackhole_config_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x4c, 0x0a, 0x06, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x09, 0x62, - 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_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, 0x1a, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4c, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5f, 0x0a, 0x1e, 0x63, + 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, + 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, + 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_proxy_blackhole_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_blackhole_config_proto_rawDescData = file_v2ray_com_core_proxy_blackhole_config_proto_rawDesc + file_proxy_blackhole_config_proto_rawDescOnce sync.Once + file_proxy_blackhole_config_proto_rawDescData = file_proxy_blackhole_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_blackhole_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_blackhole_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_blackhole_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_blackhole_config_proto_rawDescData) +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_v2ray_com_core_proxy_blackhole_config_proto_rawDescData + return file_proxy_blackhole_config_proto_rawDescData } -var file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_proxy_blackhole_config_proto_goTypes = []interface{}{ +var file_proxy_blackhole_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proxy_blackhole_config_proto_goTypes = []interface{}{ (*NoneResponse)(nil), // 0: v2ray.core.proxy.blackhole.NoneResponse (*HTTPResponse)(nil), // 1: v2ray.core.proxy.blackhole.HTTPResponse (*Config)(nil), // 2: v2ray.core.proxy.blackhole.Config (*serial.TypedMessage)(nil), // 3: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_proxy_blackhole_config_proto_depIdxs = []int32{ +var file_proxy_blackhole_config_proto_depIdxs = []int32{ 3, // 0: v2ray.core.proxy.blackhole.Config.response:type_name -> v2ray.core.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 @@ -196,13 +202,13 @@ var file_v2ray_com_core_proxy_blackhole_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_blackhole_config_proto_init() } -func file_v2ray_com_core_proxy_blackhole_config_proto_init() { - if File_v2ray_com_core_proxy_blackhole_config_proto != nil { +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_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_blackhole_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NoneResponse); i { case 0: return &v.state @@ -214,7 +220,7 @@ func file_v2ray_com_core_proxy_blackhole_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_blackhole_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HTTPResponse); i { case 0: return &v.state @@ -226,7 +232,7 @@ func file_v2ray_com_core_proxy_blackhole_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proxy_blackhole_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -243,18 +249,18 @@ func file_v2ray_com_core_proxy_blackhole_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_blackhole_config_proto_rawDesc, + RawDescriptor: file_proxy_blackhole_config_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_blackhole_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_blackhole_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_blackhole_config_proto_msgTypes, + GoTypes: file_proxy_blackhole_config_proto_goTypes, + DependencyIndexes: file_proxy_blackhole_config_proto_depIdxs, + MessageInfos: file_proxy_blackhole_config_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_blackhole_config_proto = out.File - file_v2ray_com_core_proxy_blackhole_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_blackhole_config_proto_goTypes = nil - file_v2ray_com_core_proxy_blackhole_config_proto_depIdxs = nil + 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/proxy/blackhole/config.proto b/proxy/blackhole/config.proto index f9733329de..aae9869c9f 100644 --- a/proxy/blackhole/config.proto +++ b/proxy/blackhole/config.proto @@ -2,17 +2,15 @@ syntax = "proto3"; package v2ray.core.proxy.blackhole; option csharp_namespace = "V2Ray.Core.Proxy.Blackhole"; -option go_package = "blackhole"; +option go_package = "v2ray.com/core/proxy/blackhole"; option java_package = "com.v2ray.core.proxy.blackhole"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; -message NoneResponse { -} +message NoneResponse {} -message HTTPResponse { -} +message HTTPResponse {} message Config { v2ray.core.common.serial.TypedMessage response = 1; diff --git a/proxy/dns/config.pb.go b/proxy/dns/config.pb.go index eafa7e8e46..823f371876 100644 --- a/proxy/dns/config.pb.go +++ b/proxy/dns/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/dns/config.proto + package dns import ( @@ -25,14 +31,15 @@ type Config struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Server is the DNS server address. If specified, this address overrides the original one. + // 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"` } func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_dns_config_proto_msgTypes[0] + mi := &file_proxy_dns_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +52,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_dns_config_proto_msgTypes[0] + mi := &file_proxy_dns_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -58,7 +65,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_dns_config_proto_rawDescGZIP(), []int{0} + return file_proxy_dns_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetServer() *net.Endpoint { @@ -68,44 +75,44 @@ func (x *Config) GetServer() *net.Endpoint { return nil } -var File_v2ray_com_core_proxy_dns_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_dns_config_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x1a, 0x2b, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x41, 0x0a, 0x06, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x42, 0x38, 0x0a, - 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x03, 0x64, 0x6e, 0x73, - 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +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, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x41, 0x0a, 0x06, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x42, + 0x4d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x18, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_dns_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_dns_config_proto_rawDescData = file_v2ray_com_core_proxy_dns_config_proto_rawDesc + file_proxy_dns_config_proto_rawDescOnce sync.Once + file_proxy_dns_config_proto_rawDescData = file_proxy_dns_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_dns_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_dns_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_dns_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_dns_config_proto_rawDescData) +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_v2ray_com_core_proxy_dns_config_proto_rawDescData + return file_proxy_dns_config_proto_rawDescData } -var file_v2ray_com_core_proxy_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_proxy_dns_config_proto_goTypes = []interface{}{ +var file_proxy_dns_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_proxy_dns_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.proxy.dns.Config (*net.Endpoint)(nil), // 1: v2ray.core.common.net.Endpoint } -var file_v2ray_com_core_proxy_dns_config_proto_depIdxs = []int32{ +var file_proxy_dns_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.proxy.dns.Config.server:type_name -> v2ray.core.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 @@ -114,13 +121,13 @@ var file_v2ray_com_core_proxy_dns_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_dns_config_proto_init() } -func file_v2ray_com_core_proxy_dns_config_proto_init() { - if File_v2ray_com_core_proxy_dns_config_proto != nil { +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_v2ray_com_core_proxy_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_dns_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -137,18 +144,18 @@ func file_v2ray_com_core_proxy_dns_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_dns_config_proto_rawDesc, + RawDescriptor: file_proxy_dns_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_dns_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_dns_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_dns_config_proto_msgTypes, + GoTypes: file_proxy_dns_config_proto_goTypes, + DependencyIndexes: file_proxy_dns_config_proto_depIdxs, + MessageInfos: file_proxy_dns_config_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_dns_config_proto = out.File - file_v2ray_com_core_proxy_dns_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_dns_config_proto_goTypes = nil - file_v2ray_com_core_proxy_dns_config_proto_depIdxs = nil + 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/proxy/dns/config.proto b/proxy/dns/config.proto index c9a35e373d..e56054082f 100644 --- a/proxy/dns/config.proto +++ b/proxy/dns/config.proto @@ -2,13 +2,14 @@ syntax = "proto3"; package v2ray.core.proxy.dns; option csharp_namespace = "V2Ray.Core.Proxy.Dns"; -option go_package = "dns"; +option go_package = "v2ray.com/core/proxy/dns"; option java_package = "com.v2ray.core.proxy.dns"; option java_multiple_files = true; -import "v2ray.com/core/common/net/destination.proto"; +import "common/net/destination.proto"; message Config { - // Server is the DNS server address. If specified, this address overrides the original one. + // Server is the DNS server address. If specified, this address overrides the + // original one. v2ray.core.common.net.Endpoint server = 1; } diff --git a/proxy/dns/dns_test.go b/proxy/dns/dns_test.go index 4419794338..7ac7d520d3 100644 --- a/proxy/dns/dns_test.go +++ b/proxy/dns/dns_test.go @@ -135,7 +135,7 @@ func TestUDPDNSTunnel(t *testing.T) { m1.Id = dns.Id() m1.RecursionDesired = true m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"google.com.", dns.TypeA, dns.ClassINET} + m1.Question[0] = dns.Question{Name: "google.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET} c := new(dns.Client) in, _, err := c.Exchange(m1, "127.0.0.1:"+strconv.Itoa(int(serverPort))) @@ -159,7 +159,7 @@ func TestUDPDNSTunnel(t *testing.T) { m1.Id = dns.Id() m1.RecursionDesired = true m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"ipv4only.google.com.", dns.TypeAAAA, dns.ClassINET} + m1.Question[0] = dns.Question{Name: "ipv4only.google.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET} c := new(dns.Client) c.Timeout = 10 * time.Second @@ -176,7 +176,7 @@ func TestUDPDNSTunnel(t *testing.T) { m1.Id = dns.Id() m1.RecursionDesired = true m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"notexist.google.com.", dns.TypeAAAA, dns.ClassINET} + m1.Question[0] = dns.Question{Name: "notexist.google.com.", Qtype: dns.TypeAAAA, Qclass: dns.ClassINET} c := new(dns.Client) in, _, err := c.Exchange(m1, "127.0.0.1:"+strconv.Itoa(int(serverPort))) @@ -253,7 +253,7 @@ func TestTCPDNSTunnel(t *testing.T) { m1.Id = dns.Id() m1.RecursionDesired = true m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"google.com.", dns.TypeA, dns.ClassINET} + m1.Question[0] = dns.Question{Name: "google.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET} c := &dns.Client{ Net: "tcp", @@ -343,7 +343,7 @@ func TestUDP2TCPDNSTunnel(t *testing.T) { m1.Id = dns.Id() m1.RecursionDesired = true m1.Question = make([]dns.Question, 1) - m1.Question[0] = dns.Question{"google.com.", dns.TypeA, dns.ClassINET} + m1.Question[0] = dns.Question{Name: "google.com.", Qtype: dns.TypeA, Qclass: dns.ClassINET} c := &dns.Client{ Net: "tcp", diff --git a/proxy/dokodemo/config.pb.go b/proxy/dokodemo/config.pb.go index bd3848a357..66054cbda4 100644 --- a/proxy/dokodemo/config.pb.go +++ b/proxy/dokodemo/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/dokodemo/config.proto + package dokodemo import ( @@ -43,7 +49,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_dokodemo_config_proto_msgTypes[0] + mi := &file_proxy_dokodemo_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -56,7 +62,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_dokodemo_config_proto_msgTypes[0] + mi := &file_proxy_dokodemo_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -69,7 +75,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescGZIP(), []int{0} + return file_proxy_dokodemo_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetAddress() *net.IPOrDomain { @@ -123,67 +129,65 @@ func (x *Config) GetUserLevel() uint32 { return 0 } -var File_v2ray_com_core_proxy_dokodemo_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_dokodemo_config_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x19, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, - 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0xc6, 0x02, 0x0a, 0x06, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x49, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x47, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6f, 0x6b, 0x6f, 0x64, - 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x08, 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0xaa, - 0x02, 0x19, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x19, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xc6, 0x02, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x49, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3a, 0x0a, 0x08, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x5c, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6f, + 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x1d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, + 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x19, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_proxy_dokodemo_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescData = file_v2ray_com_core_proxy_dokodemo_config_proto_rawDesc + file_proxy_dokodemo_config_proto_rawDescOnce sync.Once + file_proxy_dokodemo_config_proto_rawDescData = file_proxy_dokodemo_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_dokodemo_config_proto_rawDescData) +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_v2ray_com_core_proxy_dokodemo_config_proto_rawDescData + return file_proxy_dokodemo_config_proto_rawDescData } -var file_v2ray_com_core_proxy_dokodemo_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_proxy_dokodemo_config_proto_goTypes = []interface{}{ +var file_proxy_dokodemo_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_proxy_dokodemo_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.proxy.dokodemo.Config (*net.IPOrDomain)(nil), // 1: v2ray.core.common.net.IPOrDomain (*net.NetworkList)(nil), // 2: v2ray.core.common.net.NetworkList (net.Network)(0), // 3: v2ray.core.common.net.Network } -var file_v2ray_com_core_proxy_dokodemo_config_proto_depIdxs = []int32{ +var file_proxy_dokodemo_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.proxy.dokodemo.Config.address:type_name -> v2ray.core.common.net.IPOrDomain 2, // 1: v2ray.core.proxy.dokodemo.Config.network_list:type_name -> v2ray.core.common.net.NetworkList 3, // 2: v2ray.core.proxy.dokodemo.Config.networks:type_name -> v2ray.core.common.net.Network @@ -194,13 +198,13 @@ var file_v2ray_com_core_proxy_dokodemo_config_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_dokodemo_config_proto_init() } -func file_v2ray_com_core_proxy_dokodemo_config_proto_init() { - if File_v2ray_com_core_proxy_dokodemo_config_proto != nil { +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_v2ray_com_core_proxy_dokodemo_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_dokodemo_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -217,18 +221,18 @@ func file_v2ray_com_core_proxy_dokodemo_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_dokodemo_config_proto_rawDesc, + RawDescriptor: file_proxy_dokodemo_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_dokodemo_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_dokodemo_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_dokodemo_config_proto_msgTypes, + GoTypes: file_proxy_dokodemo_config_proto_goTypes, + DependencyIndexes: file_proxy_dokodemo_config_proto_depIdxs, + MessageInfos: file_proxy_dokodemo_config_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_dokodemo_config_proto = out.File - file_v2ray_com_core_proxy_dokodemo_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_dokodemo_config_proto_goTypes = nil - file_v2ray_com_core_proxy_dokodemo_config_proto_depIdxs = nil + 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/proxy/dokodemo/config.proto b/proxy/dokodemo/config.proto index ce1563a76e..43d6992dbd 100644 --- a/proxy/dokodemo/config.proto +++ b/proxy/dokodemo/config.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.proxy.dokodemo; option csharp_namespace = "V2Ray.Core.Proxy.Dokodemo"; -option go_package = "dokodemo"; +option go_package = "v2ray.com/core/proxy/dokodemo"; option java_package = "com.v2ray.core.proxy.dokodemo"; option java_multiple_files = true; -import "v2ray.com/core/common/net/address.proto"; -import "v2ray.com/core/common/net/network.proto"; +import "common/net/address.proto"; +import "common/net/network.proto"; message Config { v2ray.core.common.net.IPOrDomain address = 1; @@ -22,4 +22,4 @@ message Config { uint32 timeout = 4 [deprecated = true]; bool follow_redirect = 5; uint32 user_level = 6; -} \ No newline at end of file +} diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index 33930cc416..0333eb28cc 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -2,7 +2,7 @@ package dokodemo -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -12,6 +12,7 @@ import ( "v2ray.com/core" "v2ray.com/core/common" "v2ray.com/core/common/buf" + "v2ray.com/core/common/log" "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" "v2ray.com/core/common/session" @@ -26,7 +27,7 @@ func init() { common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { d := new(DokodemoDoor) err := core.RequireFeatures(ctx, func(pm policy.Manager) error { - return d.Init(config.(*Config), pm) + return d.Init(config.(*Config), pm, session.SockoptFromContext(ctx)) }) return d, err })) @@ -37,10 +38,11 @@ type DokodemoDoor struct { config *Config address net.Address port net.Port + sockopt *session.Sockopt } // Init initializes the DokodemoDoor instance with necessary parameters. -func (d *DokodemoDoor) Init(config *Config, pm policy.Manager) error { +func (d *DokodemoDoor) Init(config *Config, pm policy.Manager, sockopt *session.Sockopt) error { if (config.NetworkList == nil || len(config.NetworkList.Network) == 0) && len(config.Networks) == 0 { return newError("no network specified") } @@ -48,6 +50,7 @@ func (d *DokodemoDoor) Init(config *Config, pm policy.Manager) error { d.address = config.GetPredefinedAddress() d.port = net.Port(config.Port) d.policyManager = pm + d.sockopt = sockopt return nil } @@ -106,6 +109,14 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in } } + ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{ + From: conn.RemoteAddr(), + To: dest, + Status: log.AccessAccepted, + Reason: "", + }) + newError("received request for ", conn.RemoteAddr()).WriteToLog(session.ExportIDToError(ctx)) + plcy := d.policy() ctx, cancel := context.WithCancel(ctx) timer := signal.CancelAfterInactivity(ctx, cancel, plcy.Timeouts.ConnectionIdle) @@ -156,6 +167,9 @@ func (d *DokodemoDoor) Process(ctx context.Context, network net.Network, conn in sockopt.BindAddress = dest.Address.IP() sockopt.BindPort = uint32(dest.Port) } + if d.sockopt != nil { + sockopt.Mark = d.sockopt.Mark + } tConn, err := internet.DialSystem(ctx, net.DestinationFromAddr(conn.RemoteAddr()), sockopt) if err != nil { return err diff --git a/proxy/freedom/config.pb.go b/proxy/freedom/config.pb.go index 38b6102878..bff5453017 100644 --- a/proxy/freedom/config.pb.go +++ b/proxy/freedom/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/freedom/config.proto + package freedom import ( @@ -56,11 +62,11 @@ func (x Config_DomainStrategy) String() string { } func (Config_DomainStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_proxy_freedom_config_proto_enumTypes[0].Descriptor() + return file_proxy_freedom_config_proto_enumTypes[0].Descriptor() } func (Config_DomainStrategy) Type() protoreflect.EnumType { - return &file_v2ray_com_core_proxy_freedom_config_proto_enumTypes[0] + return &file_proxy_freedom_config_proto_enumTypes[0] } func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { @@ -69,7 +75,7 @@ func (x Config_DomainStrategy) Number() protoreflect.EnumNumber { // Deprecated: Use Config_DomainStrategy.Descriptor instead. func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_freedom_config_proto_rawDescGZIP(), []int{1, 0} + return file_proxy_freedom_config_proto_rawDescGZIP(), []int{1, 0} } type DestinationOverride struct { @@ -83,7 +89,7 @@ type DestinationOverride struct { func (x *DestinationOverride) Reset() { *x = DestinationOverride{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_freedom_config_proto_msgTypes[0] + mi := &file_proxy_freedom_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -96,7 +102,7 @@ func (x *DestinationOverride) String() string { func (*DestinationOverride) ProtoMessage() {} func (x *DestinationOverride) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_freedom_config_proto_msgTypes[0] + mi := &file_proxy_freedom_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -109,7 +115,7 @@ func (x *DestinationOverride) ProtoReflect() protoreflect.Message { // Deprecated: Use DestinationOverride.ProtoReflect.Descriptor instead. func (*DestinationOverride) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_freedom_config_proto_rawDescGZIP(), []int{0} + return file_proxy_freedom_config_proto_rawDescGZIP(), []int{0} } func (x *DestinationOverride) GetServer() *protocol.ServerEndpoint { @@ -134,7 +140,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_freedom_config_proto_msgTypes[1] + mi := &file_proxy_freedom_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -147,7 +153,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_freedom_config_proto_msgTypes[1] + mi := &file_proxy_freedom_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -160,7 +166,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_freedom_config_proto_rawDescGZIP(), []int{1} + return file_proxy_freedom_config_proto_rawDescGZIP(), []int{1} } func (x *Config) GetDomainStrategy() Config_DomainStrategy { @@ -192,71 +198,70 @@ func (x *Config) GetUserLevel() uint32 { return 0 } -var File_v2ray_com_core_proxy_freedom_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_freedom_config_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x18, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, - 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x59, 0x0a, 0x13, 0x44, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x42, - 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xc4, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x58, 0x0a, - 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x60, 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, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x22, 0x41, 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, 0x42, 0x44, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x50, 0x01, 0x5a, 0x07, 0x66, 0x72, 0x65, - 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, - 0x65, 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 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, 0x18, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x59, 0x0a, 0x13, 0x44, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, + 0x12, 0x42, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xc4, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x58, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x67, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x60, 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, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x22, 0x41, 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, 0x42, 0x59, 0x0a, 0x1c, 0x63, + 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x50, 0x01, 0x5a, 0x1c, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x18, 0x56, 0x32, + 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x46, + 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_freedom_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_freedom_config_proto_rawDescData = file_v2ray_com_core_proxy_freedom_config_proto_rawDesc + file_proxy_freedom_config_proto_rawDescOnce sync.Once + file_proxy_freedom_config_proto_rawDescData = file_proxy_freedom_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_freedom_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_freedom_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_freedom_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_freedom_config_proto_rawDescData) +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_v2ray_com_core_proxy_freedom_config_proto_rawDescData + return file_proxy_freedom_config_proto_rawDescData } -var file_v2ray_com_core_proxy_freedom_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_proxy_freedom_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_proxy_freedom_config_proto_goTypes = []interface{}{ +var file_proxy_freedom_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proxy_freedom_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_proxy_freedom_config_proto_goTypes = []interface{}{ (Config_DomainStrategy)(0), // 0: v2ray.core.proxy.freedom.Config.DomainStrategy (*DestinationOverride)(nil), // 1: v2ray.core.proxy.freedom.DestinationOverride (*Config)(nil), // 2: v2ray.core.proxy.freedom.Config (*protocol.ServerEndpoint)(nil), // 3: v2ray.core.common.protocol.ServerEndpoint } -var file_v2ray_com_core_proxy_freedom_config_proto_depIdxs = []int32{ +var file_proxy_freedom_config_proto_depIdxs = []int32{ 3, // 0: v2ray.core.proxy.freedom.DestinationOverride.server:type_name -> v2ray.core.common.protocol.ServerEndpoint 0, // 1: v2ray.core.proxy.freedom.Config.domain_strategy:type_name -> v2ray.core.proxy.freedom.Config.DomainStrategy 1, // 2: v2ray.core.proxy.freedom.Config.destination_override:type_name -> v2ray.core.proxy.freedom.DestinationOverride @@ -267,13 +272,13 @@ var file_v2ray_com_core_proxy_freedom_config_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_freedom_config_proto_init() } -func file_v2ray_com_core_proxy_freedom_config_proto_init() { - if File_v2ray_com_core_proxy_freedom_config_proto != nil { +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_v2ray_com_core_proxy_freedom_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_freedom_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DestinationOverride); i { case 0: return &v.state @@ -285,7 +290,7 @@ func file_v2ray_com_core_proxy_freedom_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_freedom_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_freedom_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -302,19 +307,19 @@ func file_v2ray_com_core_proxy_freedom_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_freedom_config_proto_rawDesc, + RawDescriptor: file_proxy_freedom_config_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_freedom_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_freedom_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_proxy_freedom_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_proxy_freedom_config_proto_msgTypes, + 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_v2ray_com_core_proxy_freedom_config_proto = out.File - file_v2ray_com_core_proxy_freedom_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_freedom_config_proto_goTypes = nil - file_v2ray_com_core_proxy_freedom_config_proto_depIdxs = nil + 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/proxy/freedom/config.proto b/proxy/freedom/config.proto index 3b8f426d25..1fcc80c4ee 100644 --- a/proxy/freedom/config.proto +++ b/proxy/freedom/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.proxy.freedom; option csharp_namespace = "V2Ray.Core.Proxy.Freedom"; -option go_package = "freedom"; +option go_package = "v2ray.com/core/proxy/freedom"; option java_package = "com.v2ray.core.proxy.freedom"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/server_spec.proto"; +import "common/protocol/server_spec.proto"; message DestinationOverride { v2ray.core.common.protocol.ServerEndpoint server = 1; diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index b968a036fc..0ac95466ce 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -2,7 +2,7 @@ package freedom -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -39,12 +39,12 @@ func init() { type Handler struct { policyManager policy.Manager dns dns.Client - config Config + config *Config } // Init initializes the Handler with necessary parameters. func (h *Handler) Init(config *Config, pm policy.Manager, d dns.Client) error { - h.config = *config + h.config = config h.policyManager = pm h.dns = d diff --git a/proxy/http/client.go b/proxy/http/client.go index 5dd2d7c074..745ddcfd9c 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -16,6 +16,7 @@ import ( "v2ray.com/core" "v2ray.com/core/common" "v2ray.com/core/common/buf" + "v2ray.com/core/common/bytespool" "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" "v2ray.com/core/common/retry" @@ -47,7 +48,7 @@ var ( func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) { serverList := protocol.NewServerList() for _, rec := range config.Server { - s, err := protocol.NewServerSpecFromPB(*rec) + s, err := protocol.NewServerSpecFromPB(rec) if err != nil { return nil, newError("failed to get server spec").Base(err) } @@ -71,6 +72,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return newError("target not specified.") } target := outbound.Target + targetAddr := target.NetAddr() if target.Network == net.Network_UDP { return newError("UDP is not supported by HTTP outbound") @@ -79,13 +81,21 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter var user *protocol.MemoryUser var conn internet.Connection + mbuf, _ := link.Reader.ReadMultiBuffer() + len := mbuf.Len() + firstPayload := bytespool.Alloc(len) + mbuf, _ = buf.SplitBytes(mbuf, firstPayload) + firstPayload = firstPayload[:len] + + buf.ReleaseMulti(mbuf) + defer bytespool.Free(firstPayload) + if err := retry.ExponentialBackoff(5, 100).On(func() error { server := c.serverPicker.PickServer() dest := server.Destination() user = server.PickUser() - targetAddr := target.NetAddr() - netConn, err := setUpHttpTunnel(ctx, dest, targetAddr, user, dialer) + netConn, err := setUpHTTPTunnel(ctx, dest, targetAddr, user, dialer, firstPayload) if netConn != nil { conn = internet.Connection(netConn) } @@ -125,26 +135,23 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter return nil } -// setUpHttpTunnel will create a socket tunnel via HTTP CONNECT method -func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, user *protocol.MemoryUser, dialer internet.Dialer) (net.Conn, error) { - req := (&http.Request{ - Method: "CONNECT", +// setUpHTTPTunnel will create a socket tunnel via HTTP CONNECT method +func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, user *protocol.MemoryUser, dialer internet.Dialer, firstPayload []byte) (net.Conn, error) { + req := &http.Request{ + Method: http.MethodConnect, URL: &url.URL{Host: target}, Header: make(http.Header), Host: target, - }).WithContext(ctx) + } if user != nil && user.Account != nil { account := user.Account.(*Account) auth := account.GetUsername() + ":" + account.GetPassword() req.Header.Set("Proxy-Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(auth))) } - req.Header.Set("Proxy-Connection", "Keep-Alive") - connectHttp1 := func(rawConn net.Conn) (net.Conn, error) { - req.Proto = "HTTP/1.1" - req.ProtoMajor = 1 - req.ProtoMinor = 1 + connectHTTP1 := func(rawConn net.Conn) (net.Conn, error) { + req.Header.Set("Proxy-Connection", "Keep-Alive") err := req.Write(rawConn) if err != nil { @@ -152,6 +159,11 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u return nil, err } + if _, err := rawConn.Write(firstPayload); err != nil { + rawConn.Close() + return nil, err + } + resp, err := http.ReadResponse(bufio.NewReader(rawConn), req) if err != nil { rawConn.Close() @@ -165,41 +177,51 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u return rawConn, nil } - connectHttp2 := func(rawConn net.Conn, h2clientConn *http2.ClientConn) (net.Conn, error) { - req.Proto = "HTTP/2.0" - req.ProtoMajor = 2 - req.ProtoMinor = 0 + connectHTTP2 := func(rawConn net.Conn, h2clientConn *http2.ClientConn) (net.Conn, error) { pr, pw := io.Pipe() req.Body = pr + var pErr error + var wg sync.WaitGroup + wg.Add(1) + + go func() { + _, pErr = pw.Write(firstPayload) + wg.Done() + }() + resp, err := h2clientConn.RoundTrip(req) if err != nil { rawConn.Close() return nil, err } + wg.Wait() + if pErr != nil { + rawConn.Close() + return nil, pErr + } + if resp.StatusCode != http.StatusOK { rawConn.Close() return nil, newError("Proxy responded with non 200 code: " + resp.Status) } - return newHttp2Conn(rawConn, pw, resp.Body), nil + return newHTTP2Conn(rawConn, pw, resp.Body), nil } cachedH2Mutex.Lock() - defer cachedH2Mutex.Unlock() - - if cachedConn, found := cachedH2Conns[dest]; found { - if cachedConn.rawConn != nil && cachedConn.h2Conn != nil { - rc := cachedConn.rawConn - cc := cachedConn.h2Conn - if cc.CanTakeNewRequest() { - proxyConn, err := connectHttp2(rc, cc) - if err != nil { - return nil, err - } - - return proxyConn, nil + cachedConn, cachedConnFound := cachedH2Conns[dest] + cachedH2Mutex.Unlock() + + if cachedConnFound { + rc, cc := cachedConn.rawConn, cachedConn.h2Conn + if cc.CanTakeNewRequest() { + proxyConn, err := connectHTTP2(rc, cc) + if err != nil { + return nil, err } + + return proxyConn, nil } } @@ -208,8 +230,13 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u return nil, err } + iConn := rawConn + if statConn, ok := iConn.(*internet.StatCouterConnection); ok { + iConn = statConn.Connection + } + nextProto := "" - if tlsConn, ok := rawConn.(*tls.Conn); ok { + if tlsConn, ok := iConn.(*tls.Conn); ok { if err := tlsConn.Handshake(); err != nil { rawConn.Close() return nil, err @@ -218,10 +245,8 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u } switch nextProto { - case "": - fallthrough - case "http/1.1": - return connectHttp1(rawConn) + case "", "http/1.1": + return connectHTTP1(rawConn) case "h2": t := http2.Transport{} h2clientConn, err := t.NewClientConn(rawConn) @@ -230,12 +255,13 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u return nil, err } - proxyConn, err := connectHttp2(rawConn, h2clientConn) + proxyConn, err := connectHTTP2(rawConn, h2clientConn) if err != nil { rawConn.Close() return nil, err } + cachedH2Mutex.Lock() if cachedH2Conns == nil { cachedH2Conns = make(map[net.Destination]h2Conn) } @@ -244,6 +270,7 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u rawConn: rawConn, h2Conn: h2clientConn, } + cachedH2Mutex.Unlock() return proxyConn, err default: @@ -251,7 +278,7 @@ func setUpHttpTunnel(ctx context.Context, dest net.Destination, target string, u } } -func newHttp2Conn(c net.Conn, pipedReqBody *io.PipeWriter, respBody io.ReadCloser) net.Conn { +func newHTTP2Conn(c net.Conn, pipedReqBody *io.PipeWriter, respBody io.ReadCloser) net.Conn { return &http2Conn{Conn: c, in: pipedReqBody, out: respBody} } @@ -274,18 +301,6 @@ func (h *http2Conn) Close() error { return h.out.Close() } -func (h *http2Conn) CloseConn() error { - return h.Conn.Close() -} - -func (h *http2Conn) CloseWrite() error { - return h.in.Close() -} - -func (h *http2Conn) CloseRead() error { - return h.out.Close() -} - func init() { common.Must(common.RegisterConfig((*ClientConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { return NewClient(ctx, config.(*ClientConfig)) diff --git a/proxy/http/config.pb.go b/proxy/http/config.pb.go index 562baedb88..7a6c2c7de4 100644 --- a/proxy/http/config.pb.go +++ b/proxy/http/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/http/config.proto + package http import ( @@ -32,7 +38,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[0] + mi := &file_proxy_http_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +51,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[0] + mi := &file_proxy_http_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -58,7 +64,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_http_config_proto_rawDescGZIP(), []int{0} + return file_proxy_http_config_proto_rawDescGZIP(), []int{0} } func (x *Account) GetUsername() string { @@ -91,7 +97,7 @@ type ServerConfig struct { func (x *ServerConfig) Reset() { *x = ServerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[1] + mi := &file_proxy_http_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -104,7 +110,7 @@ func (x *ServerConfig) String() string { func (*ServerConfig) ProtoMessage() {} func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[1] + mi := &file_proxy_http_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -117,7 +123,7 @@ func (x *ServerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_http_config_proto_rawDescGZIP(), []int{1} + return file_proxy_http_config_proto_rawDescGZIP(), []int{1} } // Deprecated: Do not use. @@ -162,7 +168,7 @@ type ClientConfig struct { func (x *ClientConfig) Reset() { *x = ClientConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[2] + mi := &file_proxy_http_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -175,7 +181,7 @@ func (x *ClientConfig) String() string { func (*ClientConfig) ProtoMessage() {} func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_http_config_proto_msgTypes[2] + mi := &file_proxy_http_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -188,7 +194,7 @@ func (x *ClientConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_http_config_proto_rawDescGZIP(), []int{2} + return file_proxy_http_config_proto_rawDescGZIP(), []int{2} } func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { @@ -198,70 +204,69 @@ func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { return nil } -var File_v2ray_com_core_proxy_http_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_http_config_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x1a, - 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 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, 0x84, 0x02, 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, 0x4d, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x52, 0x0a, 0x0c, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x42, - 0x3b, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x04, - 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, - 0x65, 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 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, 0x15, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x84, 0x02, 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, 0x4d, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, + 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, + 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x42, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, + 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x15, 0x56, 0x32, + 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, + 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_http_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_http_config_proto_rawDescData = file_v2ray_com_core_proxy_http_config_proto_rawDesc + file_proxy_http_config_proto_rawDescOnce sync.Once + file_proxy_http_config_proto_rawDescData = file_proxy_http_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_http_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_http_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_http_config_proto_rawDescData) +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_v2ray_com_core_proxy_http_config_proto_rawDescData + return file_proxy_http_config_proto_rawDescData } -var file_v2ray_com_core_proxy_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_v2ray_com_core_proxy_http_config_proto_goTypes = []interface{}{ +var file_proxy_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_proxy_http_config_proto_goTypes = []interface{}{ (*Account)(nil), // 0: v2ray.core.proxy.http.Account (*ServerConfig)(nil), // 1: v2ray.core.proxy.http.ServerConfig (*ClientConfig)(nil), // 2: v2ray.core.proxy.http.ClientConfig nil, // 3: v2ray.core.proxy.http.ServerConfig.AccountsEntry (*protocol.ServerEndpoint)(nil), // 4: v2ray.core.common.protocol.ServerEndpoint } -var file_v2ray_com_core_proxy_http_config_proto_depIdxs = []int32{ +var file_proxy_http_config_proto_depIdxs = []int32{ 3, // 0: v2ray.core.proxy.http.ServerConfig.accounts:type_name -> v2ray.core.proxy.http.ServerConfig.AccountsEntry 4, // 1: v2ray.core.proxy.http.ClientConfig.server:type_name -> v2ray.core.common.protocol.ServerEndpoint 2, // [2:2] is the sub-list for method output_type @@ -271,13 +276,13 @@ var file_v2ray_com_core_proxy_http_config_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_http_config_proto_init() } -func file_v2ray_com_core_proxy_http_config_proto_init() { - if File_v2ray_com_core_proxy_http_config_proto != nil { +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_v2ray_com_core_proxy_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -289,7 +294,7 @@ func file_v2ray_com_core_proxy_http_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerConfig); i { case 0: return &v.state @@ -301,7 +306,7 @@ func file_v2ray_com_core_proxy_http_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proxy_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientConfig); i { case 0: return &v.state @@ -318,18 +323,18 @@ func file_v2ray_com_core_proxy_http_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_http_config_proto_rawDesc, + RawDescriptor: file_proxy_http_config_proto_rawDesc, NumEnums: 0, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_http_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_http_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_http_config_proto_msgTypes, + GoTypes: file_proxy_http_config_proto_goTypes, + DependencyIndexes: file_proxy_http_config_proto_depIdxs, + MessageInfos: file_proxy_http_config_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_http_config_proto = out.File - file_v2ray_com_core_proxy_http_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_http_config_proto_goTypes = nil - file_v2ray_com_core_proxy_http_config_proto_depIdxs = nil + 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/proxy/http/config.proto b/proxy/http/config.proto index 7ab5d85823..4ad274f51d 100644 --- a/proxy/http/config.proto +++ b/proxy/http/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.proxy.http; option csharp_namespace = "V2Ray.Core.Proxy.Http"; -option go_package = "http"; +option go_package = "v2ray.com/core/proxy/http"; option java_package = "com.v2ray.core.proxy.http"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/server_spec.proto"; +import "common/protocol/server_spec.proto"; message Account { string username = 1; diff --git a/proxy/http/http.go b/proxy/http/http.go index cb8ad4e922..f2305b871a 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/proxy/mtproto/auth.go b/proxy/mtproto/auth.go index b0c53998af..2c025ea7e0 100644 --- a/proxy/mtproto/auth.go +++ b/proxy/mtproto/auth.go @@ -83,7 +83,7 @@ func generateRandomBytes(random []byte, connType [4]byte) { continue } - if 0x00000000 == (uint32(random[7])<<24)|(uint32(random[6])<<16)|(uint32(random[5])<<8)|uint32(random[4]) { + if (uint32(random[7])<<24)|(uint32(random[6])<<16)|(uint32(random[5])<<8)|uint32(random[4]) == 0x00000000 { continue } diff --git a/proxy/mtproto/config.pb.go b/proxy/mtproto/config.pb.go index ab75b805eb..cb397c832a 100644 --- a/proxy/mtproto/config.pb.go +++ b/proxy/mtproto/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/mtproto/config.proto + package mtproto import ( @@ -31,7 +37,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[0] + mi := &file_proxy_mtproto_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +50,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[0] + mi := &file_proxy_mtproto_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +63,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_mtproto_config_proto_rawDescGZIP(), []int{0} + return file_proxy_mtproto_config_proto_rawDescGZIP(), []int{0} } func (x *Account) GetSecret() []byte { @@ -73,14 +79,15 @@ type ServerConfig struct { unknownFields protoimpl.UnknownFields // User is a list of users that allowed to connect to this inbound. - // Although this is a repeated field, only the first user is effective for now. + // Although this is a repeated field, only the first user is effective for + // now. User []*protocol.User `protobuf:"bytes,1,rep,name=user,proto3" json:"user,omitempty"` } func (x *ServerConfig) Reset() { *x = ServerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[1] + mi := &file_proxy_mtproto_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -93,7 +100,7 @@ func (x *ServerConfig) String() string { func (*ServerConfig) ProtoMessage() {} func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[1] + mi := &file_proxy_mtproto_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -106,7 +113,7 @@ func (x *ServerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_mtproto_config_proto_rawDescGZIP(), []int{1} + return file_proxy_mtproto_config_proto_rawDescGZIP(), []int{1} } func (x *ServerConfig) GetUser() []*protocol.User { @@ -125,7 +132,7 @@ type ClientConfig struct { func (x *ClientConfig) Reset() { *x = ClientConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[2] + mi := &file_proxy_mtproto_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -138,7 +145,7 @@ func (x *ClientConfig) String() string { func (*ClientConfig) ProtoMessage() {} func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[2] + mi := &file_proxy_mtproto_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -151,54 +158,53 @@ func (x *ClientConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_mtproto_config_proto_rawDescGZIP(), []int{2} + return file_proxy_mtproto_config_proto_rawDescGZIP(), []int{2} } -var File_v2ray_com_core_proxy_mtproto_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_mtproto_config_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x6d, 0x74, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x21, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x22, 0x44, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x0e, 0x0a, 0x0c, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x44, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x07, 0x6d, 0x74, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x18, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, - 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_proxy_mtproto_config_proto protoreflect.FileDescriptor + +var file_proxy_mtproto_config_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x6d, + 0x74, 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, 0x21, 0x0a, 0x07, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0x44, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x0e, 0x0a, 0x0c, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x59, 0x0a, 0x1c, 0x63, + 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1c, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x18, 0x56, 0x32, + 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4d, + 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_mtproto_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_mtproto_config_proto_rawDescData = file_v2ray_com_core_proxy_mtproto_config_proto_rawDesc + file_proxy_mtproto_config_proto_rawDescOnce sync.Once + file_proxy_mtproto_config_proto_rawDescData = file_proxy_mtproto_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_mtproto_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_mtproto_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_mtproto_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_mtproto_config_proto_rawDescData) +func file_proxy_mtproto_config_proto_rawDescGZIP() []byte { + file_proxy_mtproto_config_proto_rawDescOnce.Do(func() { + file_proxy_mtproto_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_proxy_mtproto_config_proto_rawDescData) }) - return file_v2ray_com_core_proxy_mtproto_config_proto_rawDescData + return file_proxy_mtproto_config_proto_rawDescData } -var file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_proxy_mtproto_config_proto_goTypes = []interface{}{ +var file_proxy_mtproto_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proxy_mtproto_config_proto_goTypes = []interface{}{ (*Account)(nil), // 0: v2ray.core.proxy.mtproto.Account (*ServerConfig)(nil), // 1: v2ray.core.proxy.mtproto.ServerConfig (*ClientConfig)(nil), // 2: v2ray.core.proxy.mtproto.ClientConfig (*protocol.User)(nil), // 3: v2ray.core.common.protocol.User } -var file_v2ray_com_core_proxy_mtproto_config_proto_depIdxs = []int32{ +var file_proxy_mtproto_config_proto_depIdxs = []int32{ 3, // 0: v2ray.core.proxy.mtproto.ServerConfig.user:type_name -> v2ray.core.common.protocol.User 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type @@ -207,13 +213,13 @@ var file_v2ray_com_core_proxy_mtproto_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_mtproto_config_proto_init() } -func file_v2ray_com_core_proxy_mtproto_config_proto_init() { - if File_v2ray_com_core_proxy_mtproto_config_proto != nil { +func init() { file_proxy_mtproto_config_proto_init() } +func file_proxy_mtproto_config_proto_init() { + if File_proxy_mtproto_config_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_mtproto_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -225,7 +231,7 @@ func file_v2ray_com_core_proxy_mtproto_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_mtproto_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerConfig); i { case 0: return &v.state @@ -237,7 +243,7 @@ func file_v2ray_com_core_proxy_mtproto_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proxy_mtproto_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientConfig); i { case 0: return &v.state @@ -254,18 +260,18 @@ func file_v2ray_com_core_proxy_mtproto_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_mtproto_config_proto_rawDesc, + RawDescriptor: file_proxy_mtproto_config_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_mtproto_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_mtproto_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_mtproto_config_proto_msgTypes, + GoTypes: file_proxy_mtproto_config_proto_goTypes, + DependencyIndexes: file_proxy_mtproto_config_proto_depIdxs, + MessageInfos: file_proxy_mtproto_config_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_mtproto_config_proto = out.File - file_v2ray_com_core_proxy_mtproto_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_mtproto_config_proto_goTypes = nil - file_v2ray_com_core_proxy_mtproto_config_proto_depIdxs = nil + File_proxy_mtproto_config_proto = out.File + file_proxy_mtproto_config_proto_rawDesc = nil + file_proxy_mtproto_config_proto_goTypes = nil + file_proxy_mtproto_config_proto_depIdxs = nil } diff --git a/proxy/mtproto/config.proto b/proxy/mtproto/config.proto index 2d0d959199..1eba687085 100644 --- a/proxy/mtproto/config.proto +++ b/proxy/mtproto/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.proxy.mtproto; option csharp_namespace = "V2Ray.Core.Proxy.Mtproto"; -option go_package = "mtproto"; +option go_package = "v2ray.com/core/proxy/mtproto"; option java_package = "com.v2ray.core.proxy.mtproto"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/user.proto"; +import "common/protocol/user.proto"; message Account { bytes secret = 1; @@ -14,10 +14,9 @@ message Account { message ServerConfig { // User is a list of users that allowed to connect to this inbound. - // Although this is a repeated field, only the first user is effective for now. + // Although this is a repeated field, only the first user is effective for + // now. repeated v2ray.core.common.protocol.User user = 1; } -message ClientConfig { - -} +message ClientConfig {} diff --git a/proxy/mtproto/mtproto.go b/proxy/mtproto/mtproto.go index 75629fe729..c89a224a34 100644 --- a/proxy/mtproto/mtproto.go +++ b/proxy/mtproto/mtproto.go @@ -1,3 +1,3 @@ package mtproto -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index ab5619c5e3..012e595f1f 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -29,7 +29,7 @@ type Client struct { func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) { serverList := protocol.NewServerList() for _, rec := range config.Server { - s, err := protocol.NewServerSpecFromPB(*rec) + s, err := protocol.NewServerSpecFromPB(rec) if err != nil { return nil, newError("failed to parse server spec").Base(err) } @@ -90,16 +90,12 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter } user := server.PickUser() - account, ok := user.Account.(*MemoryAccount) + _, ok := user.Account.(*MemoryAccount) if !ok { return newError("user account is not valid") } request.User = user - if account.OneTimeAuth == Account_Auto || account.OneTimeAuth == Account_Enabled { - request.Option |= RequestOptionOneTimeAuth - } - sessionPolicy := c.policyManager.ForLevel(user.Level) ctx, cancel := context.WithCancel(ctx) timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) diff --git a/proxy/shadowsocks/config.go b/proxy/shadowsocks/config.go index 0bcdcac3b8..0b59d391e6 100644 --- a/proxy/shadowsocks/config.go +++ b/proxy/shadowsocks/config.go @@ -19,9 +19,8 @@ import ( // MemoryAccount is an account type converted from Account. type MemoryAccount struct { - Cipher Cipher - Key []byte - OneTimeAuth Account_OneTimeAuth + Cipher Cipher + Key []byte } // Equals implements protocol.Account.Equals(). @@ -88,9 +87,8 @@ func (a *Account) AsAccount() (protocol.Account, error) { return nil, newError("failed to get cipher").Base(err) } return &MemoryAccount{ - Cipher: cipher, - Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), - OneTimeAuth: a.Ota, + Cipher: cipher, + Key: passwordToCipherKey([]byte(a.Password), cipher.KeySize()), }, nil } diff --git a/proxy/shadowsocks/config.pb.go b/proxy/shadowsocks/config.pb.go index 51ddd33e74..1cd19a513f 100644 --- a/proxy/shadowsocks/config.pb.go +++ b/proxy/shadowsocks/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/shadowsocks/config.proto + package shadowsocks import ( @@ -72,11 +78,11 @@ func (x CipherType) String() string { } func (CipherType) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes[0].Descriptor() + return file_proxy_shadowsocks_config_proto_enumTypes[0].Descriptor() } func (CipherType) Type() protoreflect.EnumType { - return &file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes[0] + return &file_proxy_shadowsocks_config_proto_enumTypes[0] } func (x CipherType) Number() protoreflect.EnumNumber { @@ -85,56 +91,7 @@ func (x CipherType) Number() protoreflect.EnumNumber { // Deprecated: Use CipherType.Descriptor instead. func (CipherType) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} -} - -type Account_OneTimeAuth int32 - -const ( - Account_Auto Account_OneTimeAuth = 0 - Account_Disabled Account_OneTimeAuth = 1 - Account_Enabled Account_OneTimeAuth = 2 -) - -// Enum value maps for Account_OneTimeAuth. -var ( - Account_OneTimeAuth_name = map[int32]string{ - 0: "Auto", - 1: "Disabled", - 2: "Enabled", - } - Account_OneTimeAuth_value = map[string]int32{ - "Auto": 0, - "Disabled": 1, - "Enabled": 2, - } -) - -func (x Account_OneTimeAuth) Enum() *Account_OneTimeAuth { - p := new(Account_OneTimeAuth) - *p = x - return p -} - -func (x Account_OneTimeAuth) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Account_OneTimeAuth) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes[1].Descriptor() -} - -func (Account_OneTimeAuth) Type() protoreflect.EnumType { - return &file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes[1] -} - -func (x Account_OneTimeAuth) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Account_OneTimeAuth.Descriptor instead. -func (Account_OneTimeAuth) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0, 0} + return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} } type Account struct { @@ -142,15 +99,14 @@ type Account struct { 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=v2ray.core.proxy.shadowsocks.CipherType" json:"cipher_type,omitempty"` - Ota Account_OneTimeAuth `protobuf:"varint,3,opt,name=ota,proto3,enum=v2ray.core.proxy.shadowsocks.Account_OneTimeAuth" json:"ota,omitempty"` + 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=v2ray.core.proxy.shadowsocks.CipherType" json:"cipher_type,omitempty"` } func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[0] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +119,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[0] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +132,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} + return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{0} } func (x *Account) GetPassword() string { @@ -193,13 +149,6 @@ func (x *Account) GetCipherType() CipherType { return CipherType_UNKNOWN } -func (x *Account) GetOta() Account_OneTimeAuth { - if x != nil { - return x.Ota - } - return Account_Auto -} - type ServerConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -217,7 +166,7 @@ type ServerConfig struct { func (x *ServerConfig) Reset() { *x = ServerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[1] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -230,7 +179,7 @@ func (x *ServerConfig) String() string { func (*ServerConfig) ProtoMessage() {} func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[1] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -243,7 +192,7 @@ func (x *ServerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{1} + return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{1} } // Deprecated: Do not use. @@ -279,7 +228,7 @@ type ClientConfig struct { func (x *ClientConfig) Reset() { *x = ClientConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[2] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +241,7 @@ func (x *ClientConfig) String() string { func (*ClientConfig) ProtoMessage() {} func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[2] + mi := &file_proxy_shadowsocks_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,7 +254,7 @@ func (x *ClientConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{2} + return file_proxy_shadowsocks_config_proto_rawDescGZIP(), []int{2} } func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { @@ -315,115 +264,103 @@ func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { return nil } -var File_v2ray_com_core_proxy_shadowsocks_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDesc = []byte{ - 0x0a, 0x2d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, - 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x27, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 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, 0xe9, 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, 0x49, 0x0a, 0x0b, 0x63, - 0x69, 0x70, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x0a, 0x03, 0x6f, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, +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, 0x1c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x70, 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, 0x49, + 0x0a, 0x0b, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, - 0x6b, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x4f, 0x6e, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x03, 0x6f, 0x74, 0x61, 0x22, 0x32, 0x0a, 0x0b, 0x4f, - 0x6e, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x75, - 0x74, 0x6f, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, - 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x10, 0x02, 0x22, - 0xa3, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x23, 0x0a, 0x0b, 0x75, 0x64, 0x70, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x75, 0x64, 0x70, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x38, 0x0a, 0x07, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x9f, 0x01, 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, 0x43, 0x46, 0x42, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, - 0x36, 0x5f, 0x43, 0x46, 0x42, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x48, 0x41, 0x43, 0x48, - 0x41, 0x32, 0x30, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, - 0x30, 0x5f, 0x49, 0x45, 0x54, 0x46, 0x10, 0x04, 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, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x50, 0x0a, 0x20, 0x63, - 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, - 0x01, 0x5a, 0x0b, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, - 0x1c, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, + 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, 0x22, 0xa3, 0x01, 0x0a, 0x0c, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0b, 0x75, 0x64, + 0x70, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x02, 0x18, 0x01, 0x52, 0x0a, 0x75, 0x64, 0x70, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, + 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x38, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, + 0x52, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x42, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x9f, 0x01, 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, 0x43, 0x46, 0x42, 0x10, 0x01, + 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x43, 0x46, 0x42, 0x10, + 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x10, 0x03, 0x12, + 0x11, 0x0a, 0x0d, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x49, 0x45, 0x54, 0x46, + 0x10, 0x04, 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, 0x08, 0x0a, 0x04, 0x4e, + 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x65, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, + 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x20, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x1c, + 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescData = file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDesc + file_proxy_shadowsocks_config_proto_rawDescOnce sync.Once + file_proxy_shadowsocks_config_proto_rawDescData = file_proxy_shadowsocks_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescData) +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_v2ray_com_core_proxy_shadowsocks_config_proto_rawDescData + return file_proxy_shadowsocks_config_proto_rawDescData } -var file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_proxy_shadowsocks_config_proto_goTypes = []interface{}{ +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: v2ray.core.proxy.shadowsocks.CipherType - (Account_OneTimeAuth)(0), // 1: v2ray.core.proxy.shadowsocks.Account.OneTimeAuth - (*Account)(nil), // 2: v2ray.core.proxy.shadowsocks.Account - (*ServerConfig)(nil), // 3: v2ray.core.proxy.shadowsocks.ServerConfig - (*ClientConfig)(nil), // 4: v2ray.core.proxy.shadowsocks.ClientConfig - (*protocol.User)(nil), // 5: v2ray.core.common.protocol.User - (net.Network)(0), // 6: v2ray.core.common.net.Network - (*protocol.ServerEndpoint)(nil), // 7: v2ray.core.common.protocol.ServerEndpoint -} -var file_v2ray_com_core_proxy_shadowsocks_config_proto_depIdxs = []int32{ + (*Account)(nil), // 1: v2ray.core.proxy.shadowsocks.Account + (*ServerConfig)(nil), // 2: v2ray.core.proxy.shadowsocks.ServerConfig + (*ClientConfig)(nil), // 3: v2ray.core.proxy.shadowsocks.ClientConfig + (*protocol.User)(nil), // 4: v2ray.core.common.protocol.User + (net.Network)(0), // 5: v2ray.core.common.net.Network + (*protocol.ServerEndpoint)(nil), // 6: v2ray.core.common.protocol.ServerEndpoint +} +var file_proxy_shadowsocks_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.proxy.shadowsocks.Account.cipher_type:type_name -> v2ray.core.proxy.shadowsocks.CipherType - 1, // 1: v2ray.core.proxy.shadowsocks.Account.ota:type_name -> v2ray.core.proxy.shadowsocks.Account.OneTimeAuth - 5, // 2: v2ray.core.proxy.shadowsocks.ServerConfig.user:type_name -> v2ray.core.common.protocol.User - 6, // 3: v2ray.core.proxy.shadowsocks.ServerConfig.network:type_name -> v2ray.core.common.net.Network - 7, // 4: v2ray.core.proxy.shadowsocks.ClientConfig.server:type_name -> v2ray.core.common.protocol.ServerEndpoint - 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_v2ray_com_core_proxy_shadowsocks_config_proto_init() } -func file_v2ray_com_core_proxy_shadowsocks_config_proto_init() { - if File_v2ray_com_core_proxy_shadowsocks_config_proto != nil { + 4, // 1: v2ray.core.proxy.shadowsocks.ServerConfig.user:type_name -> v2ray.core.common.protocol.User + 5, // 2: v2ray.core.proxy.shadowsocks.ServerConfig.network:type_name -> v2ray.core.common.net.Network + 6, // 3: v2ray.core.proxy.shadowsocks.ClientConfig.server:type_name -> v2ray.core.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_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_shadowsocks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -435,7 +372,7 @@ func file_v2ray_com_core_proxy_shadowsocks_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_shadowsocks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerConfig); i { case 0: return &v.state @@ -447,7 +384,7 @@ func file_v2ray_com_core_proxy_shadowsocks_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proxy_shadowsocks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientConfig); i { case 0: return &v.state @@ -464,19 +401,19 @@ func file_v2ray_com_core_proxy_shadowsocks_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDesc, - NumEnums: 2, + RawDescriptor: file_proxy_shadowsocks_config_proto_rawDesc, + NumEnums: 1, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_shadowsocks_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_shadowsocks_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_proxy_shadowsocks_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_proxy_shadowsocks_config_proto_msgTypes, + 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_v2ray_com_core_proxy_shadowsocks_config_proto = out.File - file_v2ray_com_core_proxy_shadowsocks_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_shadowsocks_config_proto_goTypes = nil - file_v2ray_com_core_proxy_shadowsocks_config_proto_depIdxs = nil + 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/proxy/shadowsocks/config.proto b/proxy/shadowsocks/config.proto index 9e77a7efd3..967c21a933 100644 --- a/proxy/shadowsocks/config.proto +++ b/proxy/shadowsocks/config.proto @@ -2,23 +2,17 @@ syntax = "proto3"; package v2ray.core.proxy.shadowsocks; option csharp_namespace = "V2Ray.Core.Proxy.Shadowsocks"; -option go_package = "shadowsocks"; +option go_package = "v2ray.com/core/proxy/shadowsocks"; option java_package = "com.v2ray.core.proxy.shadowsocks"; option java_multiple_files = true; -import "v2ray.com/core/common/net/network.proto"; -import "v2ray.com/core/common/protocol/user.proto"; -import "v2ray.com/core/common/protocol/server_spec.proto"; +import "common/net/network.proto"; +import "common/protocol/user.proto"; +import "common/protocol/server_spec.proto"; message Account { - enum OneTimeAuth { - Auto = 0; - Disabled = 1; - Enabled = 2; - } string password = 1; CipherType cipher_type = 2; - OneTimeAuth ota = 3; } enum CipherType { diff --git a/proxy/shadowsocks/ota.go b/proxy/shadowsocks/ota.go deleted file mode 100644 index 33daa9fd52..0000000000 --- a/proxy/shadowsocks/ota.go +++ /dev/null @@ -1,132 +0,0 @@ -// +build !confonly - -package shadowsocks - -import ( - "bytes" - "crypto/hmac" - "crypto/sha1" - "encoding/binary" - "io" - - "v2ray.com/core/common" - "v2ray.com/core/common/buf" - "v2ray.com/core/common/bytespool" - "v2ray.com/core/common/serial" -) - -const ( - // AuthSize is the number of extra bytes for Shadowsocks OTA. - AuthSize = 10 -) - -type KeyGenerator func() []byte - -type Authenticator struct { - key KeyGenerator -} - -func NewAuthenticator(keygen KeyGenerator) *Authenticator { - return &Authenticator{ - key: keygen, - } -} - -func (v *Authenticator) Authenticate(data []byte, dest []byte) { - hasher := hmac.New(sha1.New, v.key()) - common.Must2(hasher.Write(data)) - res := hasher.Sum(nil) - copy(dest, res[:AuthSize]) -} - -func HeaderKeyGenerator(key []byte, iv []byte) func() []byte { - return func() []byte { - newKey := make([]byte, 0, len(key)+len(iv)) - newKey = append(newKey, iv...) - newKey = append(newKey, key...) - return newKey - } -} - -func ChunkKeyGenerator(iv []byte) func() []byte { - chunkID := uint32(0) - return func() []byte { - newKey := make([]byte, len(iv)+4) - copy(newKey, iv) - binary.BigEndian.PutUint32(newKey[len(iv):], chunkID) - chunkID++ - return newKey - } -} - -type ChunkReader struct { - reader io.Reader - auth *Authenticator -} - -func NewChunkReader(reader io.Reader, auth *Authenticator) *ChunkReader { - return &ChunkReader{ - reader: reader, - auth: auth, - } -} - -func (v *ChunkReader) ReadMultiBuffer() (buf.MultiBuffer, error) { - size, err := serial.ReadUint16(v.reader) - if err != nil { - return nil, newError("failed to read size").Base(err) - } - size += AuthSize - - buffer := bytespool.Alloc(int32(size)) - defer bytespool.Free(buffer) - - if _, err := io.ReadFull(v.reader, buffer[:size]); err != nil { - return nil, err - } - - authBytes := buffer[:AuthSize] - payload := buffer[AuthSize:size] - - actualAuthBytes := make([]byte, AuthSize) - v.auth.Authenticate(payload, actualAuthBytes) - if !bytes.Equal(authBytes, actualAuthBytes) { - return nil, newError("invalid auth") - } - - mb := buf.MergeBytes(nil, payload) - - return mb, nil -} - -type ChunkWriter struct { - writer io.Writer - auth *Authenticator - buffer []byte -} - -func NewChunkWriter(writer io.Writer, auth *Authenticator) *ChunkWriter { - return &ChunkWriter{ - writer: writer, - auth: auth, - buffer: make([]byte, 32*1024), - } -} - -// WriteMultiBuffer implements buf.Writer. -func (w *ChunkWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { - defer buf.ReleaseMulti(mb) - - for { - mb, payloadLen := buf.SplitBytes(mb, w.buffer[2+AuthSize:]) - binary.BigEndian.PutUint16(w.buffer, uint16(payloadLen)) - w.auth.Authenticate(w.buffer[2+AuthSize:2+AuthSize+payloadLen], w.buffer[2:]) - if err := buf.WriteAllBytes(w.writer, w.buffer[:2+AuthSize+payloadLen]); err != nil { - return err - } - if mb.IsEmpty() { - break - } - } - return nil -} diff --git a/proxy/shadowsocks/ota_test.go b/proxy/shadowsocks/ota_test.go deleted file mode 100644 index 28ac416fd3..0000000000 --- a/proxy/shadowsocks/ota_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package shadowsocks_test - -import ( - "testing" - - "github.com/google/go-cmp/cmp" - - "v2ray.com/core/common" - "v2ray.com/core/common/buf" - . "v2ray.com/core/proxy/shadowsocks" -) - -func TestNormalChunkReading(t *testing.T) { - buffer := buf.New() - buffer.Write([]byte{0, 8, 39, 228, 69, 96, 133, 39, 254, 26, 201, 70, 11, 12, 13, 14, 15, 16, 17, 18}) - reader := NewChunkReader(buffer, NewAuthenticator(ChunkKeyGenerator( - []byte{21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}))) - payload, err := reader.ReadMultiBuffer() - common.Must(err) - - if diff := cmp.Diff(payload[0].Bytes(), []byte{11, 12, 13, 14, 15, 16, 17, 18}); diff != "" { - t.Error(diff) - } -} - -func TestNormalChunkWriting(t *testing.T) { - buffer := buf.New() - writer := NewChunkWriter(buffer, NewAuthenticator(ChunkKeyGenerator( - []byte{21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36}))) - - b := buf.New() - b.Write([]byte{11, 12, 13, 14, 15, 16, 17, 18}) - common.Must(writer.WriteMultiBuffer(buf.MultiBuffer{b})) - if diff := cmp.Diff(buffer.Bytes(), []byte{0, 8, 39, 228, 69, 96, 133, 39, 254, 26, 201, 70, 11, 12, 13, 14, 15, 16, 17, 18}); diff != "" { - t.Error(diff) - } -} diff --git a/proxy/shadowsocks/protocol.go b/proxy/shadowsocks/protocol.go index 7dd432bce3..4d4fc414d5 100644 --- a/proxy/shadowsocks/protocol.go +++ b/proxy/shadowsocks/protocol.go @@ -3,20 +3,23 @@ package shadowsocks import ( - "bytes" + "crypto/hmac" "crypto/rand" + "crypto/sha256" + "hash" + "hash/crc32" "io" + "io/ioutil" + "v2ray.com/core/common/dice" "v2ray.com/core/common" - "v2ray.com/core/common/bitmask" "v2ray.com/core/common/buf" "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" ) const ( - Version = 1 - RequestOptionOneTimeAuth bitmask.Byte = 0x01 + Version = 1 ) var addrParser = protocol.NewAddressParser( @@ -32,6 +35,18 @@ var addrParser = protocol.NewAddressParser( func ReadTCPSession(user *protocol.MemoryUser, reader io.Reader) (*protocol.RequestHeader, buf.Reader, error) { account := user.Account.(*MemoryAccount) + hashkdf := hmac.New(func() hash.Hash { return sha256.New() }, []byte("SSBSKDF")) + hashkdf.Write(account.Key) + + behaviorSeed := crc32.ChecksumIEEE(hashkdf.Sum(nil)) + + behaviorRand := dice.NewDeterministicDice(int64(behaviorSeed)) + BaseDrainSize := behaviorRand.Roll(3266) + RandDrainMax := behaviorRand.Roll(64) + 1 + RandDrainRolled := dice.Roll(RandDrainMax) + DrainSize := BaseDrainSize + 16 + 38 + RandDrainRolled + readSizeRemain := DrainSize + buffer := buf.New() defer buffer.Release() @@ -39,6 +54,8 @@ func ReadTCPSession(user *protocol.MemoryUser, reader io.Reader) (*protocol.Requ var iv []byte if ivLen > 0 { if _, err := buffer.ReadFullFrom(reader, ivLen); err != nil { + readSizeRemain -= int(buffer.Len()) + DrainConnN(reader, readSizeRemain) return nil, nil, newError("failed to read IV").Base(err) } @@ -47,67 +64,43 @@ func ReadTCPSession(user *protocol.MemoryUser, reader io.Reader) (*protocol.Requ r, err := account.Cipher.NewDecryptionReader(account.Key, iv, reader) if err != nil { + readSizeRemain -= int(buffer.Len()) + DrainConnN(reader, readSizeRemain) return nil, nil, newError("failed to initialize decoding stream").Base(err).AtError() } br := &buf.BufferedReader{Reader: r} - authenticator := NewAuthenticator(HeaderKeyGenerator(account.Key, iv)) request := &protocol.RequestHeader{ Version: Version, User: user, Command: protocol.RequestCommandTCP, } + readSizeRemain -= int(buffer.Len()) buffer.Clear() addr, port, err := addrParser.ReadAddressPort(buffer, br) if err != nil { + readSizeRemain -= int(buffer.Len()) + DrainConnN(reader, readSizeRemain) return nil, nil, newError("failed to read address").Base(err) } request.Address = addr request.Port = port - if !account.Cipher.IsAEAD() { - if (buffer.Byte(0) & 0x10) == 0x10 { - request.Option.Set(RequestOptionOneTimeAuth) - } - - if request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Disabled { - return nil, nil, newError("rejecting connection with OTA enabled, while server disables OTA") - } - - if !request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Enabled { - return nil, nil, newError("rejecting connection with OTA disabled, while server enables OTA") - } - } - - if request.Option.Has(RequestOptionOneTimeAuth) { - actualAuth := make([]byte, AuthSize) - authenticator.Authenticate(buffer.Bytes(), actualAuth) - - _, err := buffer.ReadFullFrom(br, AuthSize) - if err != nil { - return nil, nil, newError("Failed to read OTA").Base(err) - } - - if !bytes.Equal(actualAuth, buffer.BytesFrom(-AuthSize)) { - return nil, nil, newError("invalid OTA") - } - } - if request.Address == nil { + readSizeRemain -= int(buffer.Len()) + DrainConnN(reader, readSizeRemain) return nil, nil, newError("invalid remote address.") } - var chunkReader buf.Reader - if request.Option.Has(RequestOptionOneTimeAuth) { - chunkReader = NewChunkReader(br, NewAuthenticator(ChunkKeyGenerator(iv))) - } else { - chunkReader = buf.NewReader(br) - } + return request, br, nil +} - return request, chunkReader, nil +func DrainConnN(reader io.Reader, n int) error { + _, err := io.CopyN(ioutil.Discard, reader, int64(n)) + return err } // WriteTCPRequest writes Shadowsocks request into the given writer, and returns a writer for body. @@ -115,10 +108,6 @@ func WriteTCPRequest(request *protocol.RequestHeader, writer io.Writer) (buf.Wri user := request.User account := user.Account.(*MemoryAccount) - if account.Cipher.IsAEAD() { - request.Option.Clear(RequestOptionOneTimeAuth) - } - var iv []byte if account.Cipher.IVSize() > 0 { iv = make([]byte, account.Cipher.IVSize()) @@ -139,27 +128,11 @@ func WriteTCPRequest(request *protocol.RequestHeader, writer io.Writer) (buf.Wri return nil, newError("failed to write address").Base(err) } - if request.Option.Has(RequestOptionOneTimeAuth) { - header.SetByte(0, header.Byte(0)|0x10) - - authenticator := NewAuthenticator(HeaderKeyGenerator(account.Key, iv)) - authPayload := header.Bytes() - authBuffer := header.Extend(AuthSize) - authenticator.Authenticate(authPayload, authBuffer) - } - if err := w.WriteMultiBuffer(buf.MultiBuffer{header}); err != nil { return nil, newError("failed to write header").Base(err) } - var chunkWriter buf.Writer - if request.Option.Has(RequestOptionOneTimeAuth) { - chunkWriter = NewChunkWriter(w.(io.Writer), NewAuthenticator(ChunkKeyGenerator(iv))) - } else { - chunkWriter = w - } - - return chunkWriter, nil + return w, nil } func ReadTCPResponse(user *protocol.MemoryUser, reader io.Reader) (buf.Reader, error) { @@ -201,7 +174,6 @@ func EncodeUDPPacket(request *protocol.RequestHeader, payload []byte) (*buf.Buff if ivLen > 0 { common.Must2(buffer.ReadFullFrom(rand.Reader, ivLen)) } - iv := buffer.Bytes() if err := addrParser.WriteAddressPort(buffer, request.Address, request.Port); err != nil { return nil, newError("failed to write address").Base(err) @@ -209,14 +181,6 @@ func EncodeUDPPacket(request *protocol.RequestHeader, payload []byte) (*buf.Buff buffer.Write(payload) - if !account.Cipher.IsAEAD() && request.Option.Has(RequestOptionOneTimeAuth) { - authenticator := NewAuthenticator(HeaderKeyGenerator(account.Key, iv)) - buffer.SetByte(ivLen, buffer.Byte(ivLen)|0x10) - - authPayload := buffer.BytesFrom(ivLen) - authBuffer := buffer.Extend(AuthSize) - authenticator.Authenticate(authPayload, authBuffer) - } if err := account.Cipher.EncodePacket(account.Key, buffer); err != nil { return nil, newError("failed to encrypt UDP payload").Base(err) } @@ -244,34 +208,6 @@ func DecodeUDPPacket(user *protocol.MemoryUser, payload *buf.Buffer) (*protocol. Command: protocol.RequestCommandUDP, } - if !account.Cipher.IsAEAD() { - if (payload.Byte(0) & 0x10) == 0x10 { - request.Option |= RequestOptionOneTimeAuth - } - - if request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Disabled { - return nil, nil, newError("rejecting packet with OTA enabled, while server disables OTA").AtWarning() - } - - if !request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Enabled { - return nil, nil, newError("rejecting packet with OTA disabled, while server enables OTA").AtWarning() - } - - if request.Option.Has(RequestOptionOneTimeAuth) { - payloadLen := payload.Len() - AuthSize - authBytes := payload.BytesFrom(payloadLen) - - authenticator := NewAuthenticator(HeaderKeyGenerator(account.Key, iv)) - actualAuth := make([]byte, AuthSize) - authenticator.Authenticate(payload.BytesTo(payloadLen), actualAuth) - if !bytes.Equal(actualAuth, authBytes) { - return nil, nil, newError("invalid OTA") - } - - payload.Resize(0, payloadLen) - } - } - payload.SetByte(0, payload.Byte(0)&0x0F) addr, port, err := addrParser.ReadAddressPort(nil, payload) diff --git a/proxy/shadowsocks/protocol_test.go b/proxy/shadowsocks/protocol_test.go index e6a28ba6e4..60630e29c4 100644 --- a/proxy/shadowsocks/protocol_test.go +++ b/proxy/shadowsocks/protocol_test.go @@ -29,7 +29,6 @@ func TestUDPEncoding(t *testing.T) { Account: toAccount(&Account{ Password: "shadowsocks-password", CipherType: CipherType_AES_128_CFB, - Ota: Account_Disabled, }), }, } @@ -61,7 +60,6 @@ func TestTCPRequest(t *testing.T) { Version: Version, Command: protocol.RequestCommandTCP, Address: net.LocalHostIP, - Option: RequestOptionOneTimeAuth, Port: 1234, User: &protocol.MemoryUser{ Email: "love@v2ray.com", @@ -78,7 +76,6 @@ func TestTCPRequest(t *testing.T) { Version: Version, Command: protocol.RequestCommandTCP, Address: net.LocalHostIPv6, - Option: RequestOptionOneTimeAuth, Port: 1234, User: &protocol.MemoryUser{ Email: "love@v2ray.com", @@ -95,7 +92,6 @@ func TestTCPRequest(t *testing.T) { Version: Version, Command: protocol.RequestCommandTCP, Address: net.DomainAddress("v2ray.com"), - Option: RequestOptionOneTimeAuth, Port: 1234, User: &protocol.MemoryUser{ Email: "love@v2ray.com", @@ -157,7 +153,6 @@ func TestUDPReaderWriter(t *testing.T) { Address: net.DomainAddress("v2ray.com"), Port: 123, User: user, - Option: RequestOptionOneTimeAuth, }, }} diff --git a/proxy/shadowsocks/server.go b/proxy/shadowsocks/server.go index 20aebdb3ec..fdfa1d9fa3 100644 --- a/proxy/shadowsocks/server.go +++ b/proxy/shadowsocks/server.go @@ -23,7 +23,7 @@ import ( ) type Server struct { - config ServerConfig + config *ServerConfig user *protocol.MemoryUser policyManager policy.Manager } @@ -41,7 +41,7 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) { v := core.MustFromContext(ctx) s := &Server{ - config: *config, + config: config, user: mUser, policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager), } @@ -90,7 +90,6 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection conn.Write(data.Bytes()) }) - account := s.user.Account.(*MemoryAccount) inbound := session.InboundFromContext(ctx) if inbound == nil { panic("no inbound metadata") @@ -120,18 +119,6 @@ func (s *Server) handlerUDPPayload(ctx context.Context, conn internet.Connection continue } - if request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Disabled { - newError("client payload enables OTA but server doesn't allow it").WriteToLog(session.ExportIDToError(ctx)) - payload.Release() - continue - } - - if !request.Option.Has(RequestOptionOneTimeAuth) && account.OneTimeAuth == Account_Enabled { - newError("client payload disables OTA but server forces it").WriteToLog(session.ExportIDToError(ctx)) - payload.Release() - continue - } - currentPacketCtx := ctx dest := request.Destination() if inbound.Source.IsValid() { diff --git a/proxy/shadowsocks/shadowsocks.go b/proxy/shadowsocks/shadowsocks.go index c74184413c..a401063bde 100644 --- a/proxy/shadowsocks/shadowsocks.go +++ b/proxy/shadowsocks/shadowsocks.go @@ -2,15 +2,7 @@ // // Shadowsocks client and server are implemented as outbound and inbound respectively in V2Ray's term. // -// Shadowsocks OTA is fully supported. By default both client and server enable OTA, but it can be optionally disabled. -// -// Supperted Ciphers: -// * AES-256-CFB -// * AES-128-CFB -// * Chacha20 -// * Chacha20-IEFT -// // R.I.P Shadowsocks package shadowsocks -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/proxy/socks/client.go b/proxy/socks/client.go index e303e5b32c..a6a345b273 100644 --- a/proxy/socks/client.go +++ b/proxy/socks/client.go @@ -30,7 +30,7 @@ type Client struct { func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) { serverList := protocol.NewServerList() for _, rec := range config.Server { - s, err := protocol.NewServerSpecFromPB(*rec) + s, err := protocol.NewServerSpecFromPB(rec) if err != nil { return nil, newError("failed to get server spec").Base(err) } diff --git a/proxy/socks/config.pb.go b/proxy/socks/config.pb.go index 8e33fc1bdf..4d82bf55e4 100644 --- a/proxy/socks/config.pb.go +++ b/proxy/socks/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/socks/config.proto + package socks import ( @@ -54,11 +60,11 @@ func (x AuthType) String() string { } func (AuthType) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_proxy_socks_config_proto_enumTypes[0].Descriptor() + return file_proxy_socks_config_proto_enumTypes[0].Descriptor() } func (AuthType) Type() protoreflect.EnumType { - return &file_v2ray_com_core_proxy_socks_config_proto_enumTypes[0] + return &file_proxy_socks_config_proto_enumTypes[0] } func (x AuthType) Number() protoreflect.EnumNumber { @@ -67,7 +73,7 @@ func (x AuthType) Number() protoreflect.EnumNumber { // Deprecated: Use AuthType.Descriptor instead. func (AuthType) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_socks_config_proto_rawDescGZIP(), []int{0} + return file_proxy_socks_config_proto_rawDescGZIP(), []int{0} } // Account represents a Socks account. @@ -83,7 +89,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[0] + mi := &file_proxy_socks_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -96,7 +102,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[0] + mi := &file_proxy_socks_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -109,7 +115,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_socks_config_proto_rawDescGZIP(), []int{0} + return file_proxy_socks_config_proto_rawDescGZIP(), []int{0} } func (x *Account) GetUsername() string { @@ -144,7 +150,7 @@ type ServerConfig struct { func (x *ServerConfig) Reset() { *x = ServerConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[1] + mi := &file_proxy_socks_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -157,7 +163,7 @@ func (x *ServerConfig) String() string { func (*ServerConfig) ProtoMessage() {} func (x *ServerConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[1] + mi := &file_proxy_socks_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -170,7 +176,7 @@ func (x *ServerConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerConfig.ProtoReflect.Descriptor instead. func (*ServerConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_socks_config_proto_rawDescGZIP(), []int{1} + return file_proxy_socks_config_proto_rawDescGZIP(), []int{1} } func (x *ServerConfig) GetAuthType() AuthType { @@ -229,7 +235,7 @@ type ClientConfig struct { func (x *ClientConfig) Reset() { *x = ClientConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[2] + mi := &file_proxy_socks_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -242,7 +248,7 @@ func (x *ClientConfig) String() string { func (*ClientConfig) ProtoMessage() {} func (x *ClientConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_socks_config_proto_msgTypes[2] + mi := &file_proxy_socks_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -255,7 +261,7 @@ func (x *ClientConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientConfig.ProtoReflect.Descriptor instead. func (*ClientConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_socks_config_proto_rawDescGZIP(), []int{2} + return file_proxy_socks_config_proto_rawDescGZIP(), []int{2} } func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { @@ -265,76 +271,75 @@ func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint { return nil } -var File_v2ray_com_core_proxy_socks_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_socks_config_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x16, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, - 0x73, 0x1a, 0x27, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 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, 0x30, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, - 0xf5, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x3d, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, - 0x4e, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x42, 0x3e, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x73, - 0x50, 0x01, 0x5a, 0x05, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x16, 0x56, 0x32, 0x52, 0x61, - 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x16, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xf5, 0x02, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x3d, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x4e, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x3b, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x52, 0x0a, 0x0c, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x42, 0x53, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, + 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, + 0x73, 0xaa, 0x02, 0x16, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_socks_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_socks_config_proto_rawDescData = file_v2ray_com_core_proxy_socks_config_proto_rawDesc + file_proxy_socks_config_proto_rawDescOnce sync.Once + file_proxy_socks_config_proto_rawDescData = file_proxy_socks_config_proto_rawDesc ) -func file_v2ray_com_core_proxy_socks_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_socks_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_socks_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_socks_config_proto_rawDescData) +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_v2ray_com_core_proxy_socks_config_proto_rawDescData + return file_proxy_socks_config_proto_rawDescData } -var file_v2ray_com_core_proxy_socks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_proxy_socks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_v2ray_com_core_proxy_socks_config_proto_goTypes = []interface{}{ +var file_proxy_socks_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proxy_socks_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_proxy_socks_config_proto_goTypes = []interface{}{ (AuthType)(0), // 0: v2ray.core.proxy.socks.AuthType (*Account)(nil), // 1: v2ray.core.proxy.socks.Account (*ServerConfig)(nil), // 2: v2ray.core.proxy.socks.ServerConfig @@ -343,7 +348,7 @@ var file_v2ray_com_core_proxy_socks_config_proto_goTypes = []interface{}{ (*net.IPOrDomain)(nil), // 5: v2ray.core.common.net.IPOrDomain (*protocol.ServerEndpoint)(nil), // 6: v2ray.core.common.protocol.ServerEndpoint } -var file_v2ray_com_core_proxy_socks_config_proto_depIdxs = []int32{ +var file_proxy_socks_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.proxy.socks.ServerConfig.auth_type:type_name -> v2ray.core.proxy.socks.AuthType 4, // 1: v2ray.core.proxy.socks.ServerConfig.accounts:type_name -> v2ray.core.proxy.socks.ServerConfig.AccountsEntry 5, // 2: v2ray.core.proxy.socks.ServerConfig.address:type_name -> v2ray.core.common.net.IPOrDomain @@ -355,13 +360,13 @@ var file_v2ray_com_core_proxy_socks_config_proto_depIdxs = []int32{ 0, // [0:4] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_socks_config_proto_init() } -func file_v2ray_com_core_proxy_socks_config_proto_init() { - if File_v2ray_com_core_proxy_socks_config_proto != nil { +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_v2ray_com_core_proxy_socks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_socks_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -373,7 +378,7 @@ func file_v2ray_com_core_proxy_socks_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_socks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_proxy_socks_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ServerConfig); i { case 0: return &v.state @@ -385,7 +390,7 @@ func file_v2ray_com_core_proxy_socks_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_socks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_proxy_socks_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientConfig); i { case 0: return &v.state @@ -402,19 +407,19 @@ func file_v2ray_com_core_proxy_socks_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_socks_config_proto_rawDesc, + RawDescriptor: file_proxy_socks_config_proto_rawDesc, NumEnums: 1, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_socks_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_socks_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_proxy_socks_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_proxy_socks_config_proto_msgTypes, + 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_v2ray_com_core_proxy_socks_config_proto = out.File - file_v2ray_com_core_proxy_socks_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_socks_config_proto_goTypes = nil - file_v2ray_com_core_proxy_socks_config_proto_depIdxs = nil + 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/proxy/socks/config.proto b/proxy/socks/config.proto index 94fee102f5..873dd2b551 100644 --- a/proxy/socks/config.proto +++ b/proxy/socks/config.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.proxy.socks; option csharp_namespace = "V2Ray.Core.Proxy.Socks"; -option go_package = "socks"; +option go_package = "v2ray.com/core/proxy/socks"; option java_package = "com.v2ray.core.proxy.socks"; option java_multiple_files = true; -import "v2ray.com/core/common/net/address.proto"; -import "v2ray.com/core/common/protocol/server_spec.proto"; +import "common/net/address.proto"; +import "common/protocol/server_spec.proto"; // Account represents a Socks account. message Account { diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index ac2da5a4a8..d3be1059fa 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -1,4 +1,4 @@ // Package socks provides implements of Socks protocol 4, 4a and 5. package socks -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/proxy/trojan/client.go b/proxy/trojan/client.go new file mode 100644 index 0000000000..bd2758b150 --- /dev/null +++ b/proxy/trojan/client.go @@ -0,0 +1,146 @@ +// +build !confonly + +package trojan + +import ( + "context" + "time" + + "v2ray.com/core" + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/retry" + "v2ray.com/core/common/session" + "v2ray.com/core/common/signal" + "v2ray.com/core/common/task" + "v2ray.com/core/features/policy" + "v2ray.com/core/transport" + "v2ray.com/core/transport/internet" +) + +// Client is a inbound handler for trojan protocol +type Client struct { + serverPicker protocol.ServerPicker + policyManager policy.Manager +} + +// NewClient create a new trojan client. +func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) { + serverList := protocol.NewServerList() + for _, rec := range config.Server { + s, err := protocol.NewServerSpecFromPB(rec) + if err != nil { + return nil, newError("failed to parse server spec").Base(err) + } + serverList.AddServer(s) + } + if serverList.Size() == 0 { + return nil, newError("0 server") + } + + v := core.MustFromContext(ctx) + client := &Client{ + serverPicker: protocol.NewRoundRobinServerPicker(serverList), + policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager), + } + return client, nil +} + +// Process implements OutboundHandler.Process(). +func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error { // nolint: funlen + outbound := session.OutboundFromContext(ctx) + if outbound == nil || !outbound.Target.IsValid() { + return newError("target not specified") + } + destination := outbound.Target + network := destination.Network + + var server *protocol.ServerSpec + var conn internet.Connection + + err := retry.ExponentialBackoff(5, 100).On(func() error { // nolint: gomnd + server = c.serverPicker.PickServer() + rawConn, err := dialer.Dial(ctx, server.Destination()) + if err != nil { + return err + } + + conn = rawConn + return nil + }) + if err != nil { + return newError("failed to find an available destination").AtWarning().Base(err) + } + newError("tunneling request to ", destination, " via ", server.Destination()).WriteToLog(session.ExportIDToError(ctx)) + + defer conn.Close() + + user := server.PickUser() + account, ok := user.Account.(*MemoryAccount) + if !ok { + return newError("user account is not valid") + } + + sessionPolicy := c.policyManager.ForLevel(user.Level) + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + + postRequest := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + + var bodyWriter buf.Writer + bufferWriter := buf.NewBufferedWriter(buf.NewWriter(conn)) + connWriter := &ConnWriter{Writer: bufferWriter, Target: destination, Account: account} + + if destination.Network == net.Network_UDP { + bodyWriter = &PacketWriter{Writer: connWriter, Target: destination} + } else { + bodyWriter = connWriter + } + + // write some request payload to buffer + if err = buf.CopyOnceTimeout(link.Reader, bodyWriter, time.Millisecond*100); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout { // nolint: lll,gomnd + return newError("failed to write A reqeust payload").Base(err).AtWarning() + } + + // Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer + if err = bufferWriter.SetBuffered(false); err != nil { + return newError("failed to flush payload").Base(err).AtWarning() + } + + if err = buf.Copy(link.Reader, bodyWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer request payload").Base(err).AtInfo() + } + + return nil + } + + getResponse := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + + var reader buf.Reader + if network == net.Network_UDP { + reader = &PacketReader{ + Reader: conn, + } + } else { + reader = buf.NewReader(conn) + } + return buf.Copy(reader, link.Writer, buf.UpdateActivity(timer)) + } + + var responseDoneAndCloseWriter = task.OnSuccess(getResponse, task.Close(link.Writer)) + if err := task.Run(ctx, postRequest, responseDoneAndCloseWriter); err != nil { + return newError("connection ends").Base(err) + } + + return nil +} + +func init() { + common.Must(common.RegisterConfig((*ClientConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { // nolint: lll + return NewClient(ctx, config.(*ClientConfig)) + })) +} diff --git a/proxy/trojan/config.go b/proxy/trojan/config.go new file mode 100644 index 0000000000..817358d4f9 --- /dev/null +++ b/proxy/trojan/config.go @@ -0,0 +1,50 @@ +package trojan + +import ( + "crypto/sha256" + "encoding/hex" + fmt "fmt" + + "v2ray.com/core/common" + "v2ray.com/core/common/protocol" +) + +// MemoryAccount is an account type converted from Account. +type MemoryAccount struct { + Password string + Key []byte +} + +// AsAccount implements protocol.AsAccount. +func (a *Account) AsAccount() (protocol.Account, error) { + password := a.GetPassword() + key := hexSha224(password) + return &MemoryAccount{ + Password: password, + Key: key, + }, nil +} + +// Equals implements protocol.Account.Equals(). +func (a *MemoryAccount) Equals(another protocol.Account) bool { + if account, ok := another.(*MemoryAccount); ok { + return a.Password == account.Password + } + return false +} + +func hexSha224(password string) []byte { + buf := make([]byte, 56) + hash := sha256.New224() + common.Must2(hash.Write([]byte(password))) + hex.Encode(buf, hash.Sum(nil)) + return buf +} + +func hexString(data []byte) string { + str := "" + for _, v := range data { + str += fmt.Sprintf("%02x", v) + } + return str +} diff --git a/proxy/trojan/config.pb.go b/proxy/trojan/config.pb.go new file mode 100644 index 0000000000..79e7bb4ded --- /dev/null +++ b/proxy/trojan/config.pb.go @@ -0,0 +1,404 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/trojan/config.proto + +package trojan + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + protocol "v2ray.com/core/common/protocol" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +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 + + Alpn string `protobuf:"bytes,1,opt,name=alpn,proto3" json:"alpn,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Dest string `protobuf:"bytes,4,opt,name=dest,proto3" json:"dest,omitempty"` + Xver uint64 `protobuf:"varint,5,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) 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,3,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, 0x17, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6e, 0x0a, 0x08, 0x46, 0x61, + 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x76, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x78, 0x76, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x0c, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x06, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x87, + 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x36, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3f, 0x0a, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, + 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x56, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x1b, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x17, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 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: v2ray.core.proxy.trojan.Account + (*Fallback)(nil), // 1: v2ray.core.proxy.trojan.Fallback + (*ClientConfig)(nil), // 2: v2ray.core.proxy.trojan.ClientConfig + (*ServerConfig)(nil), // 3: v2ray.core.proxy.trojan.ServerConfig + (*protocol.ServerEndpoint)(nil), // 4: v2ray.core.common.protocol.ServerEndpoint + (*protocol.User)(nil), // 5: v2ray.core.common.protocol.User +} +var file_proxy_trojan_config_proto_depIdxs = []int32{ + 4, // 0: v2ray.core.proxy.trojan.ClientConfig.server:type_name -> v2ray.core.common.protocol.ServerEndpoint + 5, // 1: v2ray.core.proxy.trojan.ServerConfig.users:type_name -> v2ray.core.common.protocol.User + 1, // 2: v2ray.core.proxy.trojan.ServerConfig.fallbacks:type_name -> v2ray.core.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/proxy/trojan/config.proto b/proxy/trojan/config.proto new file mode 100644 index 0000000000..cfac0b0e8b --- /dev/null +++ b/proxy/trojan/config.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package v2ray.core.proxy.trojan; +option csharp_namespace = "V2Ray.Core.Proxy.Trojan"; +option go_package = "v2ray.com/core/proxy/trojan"; +option java_package = "com.v2ray.core.proxy.trojan"; +option java_multiple_files = true; + +import "common/protocol/user.proto"; +import "common/protocol/server_spec.proto"; + +message Account { + string password = 1; +} + +message Fallback { + string alpn = 1; + string path = 2; + string type = 3; + string dest = 4; + uint64 xver = 5; +} + +message ClientConfig { + repeated v2ray.core.common.protocol.ServerEndpoint server = 1; +} + +message ServerConfig { + repeated v2ray.core.common.protocol.User users = 1; + repeated Fallback fallbacks = 3; +} diff --git a/proxy/trojan/errors.generated.go b/proxy/trojan/errors.generated.go new file mode 100644 index 0000000000..d15be699ea --- /dev/null +++ b/proxy/trojan/errors.generated.go @@ -0,0 +1,9 @@ +package trojan + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/proxy/trojan/protocol.go b/proxy/trojan/protocol.go new file mode 100644 index 0000000000..d8007563db --- /dev/null +++ b/proxy/trojan/protocol.go @@ -0,0 +1,282 @@ +package trojan + +import ( + "encoding/binary" + "io" + + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" +) + +var ( + crlf = []byte{'\r', '\n'} + + addrParser = protocol.NewAddressParser( + protocol.AddressFamilyByte(0x01, net.AddressFamilyIPv4), // nolint: gomnd + protocol.AddressFamilyByte(0x04, net.AddressFamilyIPv6), // nolint: gomnd + protocol.AddressFamilyByte(0x03, net.AddressFamilyDomain), // nolint: gomnd + ) +) + +const ( + maxLength = 8192 + + commandTCP byte = 1 + commandUDP byte = 3 +) + +// ConnWriter is TCP Connection Writer Wrapper for trojan protocol +type ConnWriter struct { + io.Writer + Target net.Destination + Account *MemoryAccount + headerSent bool +} + +// Write implements io.Writer +func (c *ConnWriter) Write(p []byte) (n int, err error) { + if !c.headerSent { + if err := c.writeHeader(); err != nil { + return 0, newError("failed to write request header").Base(err) + } + } + + return c.Writer.Write(p) +} + +// WriteMultiBuffer implements buf.Writer +func (c *ConnWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { + defer buf.ReleaseMulti(mb) + + for _, b := range mb { + if !b.IsEmpty() { + if _, err := c.Write(b.Bytes()); err != nil { + return err + } + } + } + + return nil +} + +func (c *ConnWriter) writeHeader() error { + buffer := buf.StackNew() + defer buffer.Release() + + command := commandTCP + if c.Target.Network == net.Network_UDP { + command = commandUDP + } + + if _, err := buffer.Write(c.Account.Key); err != nil { + return err + } + if _, err := buffer.Write(crlf); err != nil { + return err + } + if err := buffer.WriteByte(command); err != nil { + return err + } + if err := addrParser.WriteAddressPort(&buffer, c.Target.Address, c.Target.Port); err != nil { + return err + } + if _, err := buffer.Write(crlf); err != nil { + return err + } + + _, err := c.Writer.Write(buffer.Bytes()) + if err == nil { + c.headerSent = true + } + + return err +} + +// PacketWriter UDP Connection Writer Wrapper for trojan protocol +type PacketWriter struct { + io.Writer + Target net.Destination +} + +// WriteMultiBuffer implements buf.Writer +func (w *PacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { + b := make([]byte, maxLength) + for !mb.IsEmpty() { + var length int + mb, length = buf.SplitBytes(mb, b) + if _, err := w.writePacket(b[:length], w.Target); err != nil { + buf.ReleaseMulti(mb) + return err + } + } + + return nil +} + +// WriteMultiBufferWithMetadata writes udp packet with destination specified +func (w *PacketWriter) WriteMultiBufferWithMetadata(mb buf.MultiBuffer, dest net.Destination) error { + b := make([]byte, maxLength) + for !mb.IsEmpty() { + var length int + mb, length = buf.SplitBytes(mb, b) + if _, err := w.writePacket(b[:length], dest); err != nil { + buf.ReleaseMulti(mb) + return err + } + } + + return nil +} + +func (w *PacketWriter) writePacket(payload []byte, dest net.Destination) (int, error) { // nolint: unparam + buffer := buf.StackNew() + defer buffer.Release() + + length := len(payload) + lengthBuf := [2]byte{} + binary.BigEndian.PutUint16(lengthBuf[:], uint16(length)) + if err := addrParser.WriteAddressPort(&buffer, dest.Address, dest.Port); err != nil { + return 0, err + } + if _, err := buffer.Write(lengthBuf[:]); err != nil { + return 0, err + } + if _, err := buffer.Write(crlf); err != nil { + return 0, err + } + if _, err := buffer.Write(payload); err != nil { + return 0, err + } + _, err := w.Write(buffer.Bytes()) + if err != nil { + return 0, err + } + + return length, nil +} + +// ConnReader is TCP Connection Reader Wrapper for trojan protocol +type ConnReader struct { + io.Reader + Target net.Destination + headerParsed bool +} + +// ParseHeader parses the trojan protocol header +func (c *ConnReader) ParseHeader() error { + var crlf [2]byte + var command [1]byte + var hash [56]byte + if _, err := io.ReadFull(c.Reader, hash[:]); err != nil { + return newError("failed to read user hash").Base(err) + } + + if _, err := io.ReadFull(c.Reader, crlf[:]); err != nil { + return newError("failed to read crlf").Base(err) + } + + if _, err := io.ReadFull(c.Reader, command[:]); err != nil { + return newError("failed to read command").Base(err) + } + + network := net.Network_TCP + if command[0] == commandUDP { + network = net.Network_UDP + } + + addr, port, err := addrParser.ReadAddressPort(nil, c.Reader) + if err != nil { + return newError("failed to read address and port").Base(err) + } + c.Target = net.Destination{Network: network, Address: addr, Port: port} + + if _, err := io.ReadFull(c.Reader, crlf[:]); err != nil { + return newError("failed to read crlf").Base(err) + } + + c.headerParsed = true + return nil +} + +// Read implements io.Reader +func (c *ConnReader) Read(p []byte) (int, error) { + if !c.headerParsed { + if err := c.ParseHeader(); err != nil { + return 0, err + } + } + + return c.Reader.Read(p) +} + +// ReadMultiBuffer implements buf.Reader +func (c *ConnReader) ReadMultiBuffer() (buf.MultiBuffer, error) { + b := buf.New() + _, err := b.ReadFrom(c) + return buf.MultiBuffer{b}, err +} + +// PacketPayload combines udp payload and destination +type PacketPayload struct { + Target net.Destination + Buffer buf.MultiBuffer +} + +// PacketReader is UDP Connection Reader Wrapper for trojan protocol +type PacketReader struct { + io.Reader +} + +// ReadMultiBuffer implements buf.Reader +func (r *PacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) { + p, err := r.ReadMultiBufferWithMetadata() + if p != nil { + return p.Buffer, err + } + return nil, err +} + +// ReadMultiBufferWithMetadata reads udp packet with destination +func (r *PacketReader) ReadMultiBufferWithMetadata() (*PacketPayload, error) { + addr, port, err := addrParser.ReadAddressPort(nil, r) + if err != nil { + return nil, newError("failed to read address and port").Base(err) + } + + var lengthBuf [2]byte + if _, err := io.ReadFull(r, lengthBuf[:]); err != nil { + return nil, newError("failed to read payload length").Base(err) + } + + remain := int(binary.BigEndian.Uint16(lengthBuf[:])) + if remain > maxLength { + return nil, newError("oversize payload") + } + + var crlf [2]byte + if _, err := io.ReadFull(r, crlf[:]); err != nil { + return nil, newError("failed to read crlf").Base(err) + } + + dest := net.UDPDestination(addr, port) + var mb buf.MultiBuffer + for remain > 0 { + length := buf.Size + if remain < length { + length = remain + } + + b := buf.New() + mb = append(mb, b) + n, err := b.ReadFullFrom(r, int32(length)) + if err != nil { + buf.ReleaseMulti(mb) + return nil, newError("failed to read payload").Base(err) + } + + remain -= int(n) + } + + return &PacketPayload{Target: dest, Buffer: mb}, nil +} diff --git a/proxy/trojan/protocol_test.go b/proxy/trojan/protocol_test.go new file mode 100644 index 0000000000..c30eabef63 --- /dev/null +++ b/proxy/trojan/protocol_test.go @@ -0,0 +1,91 @@ +package trojan_test + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + . "v2ray.com/core/proxy/trojan" +) + +func toAccount(a *Account) protocol.Account { + account, err := a.AsAccount() + common.Must(err) + return account +} + +func TestTCPRequest(t *testing.T) { + user := &protocol.MemoryUser{ + Email: "love@v2ray.com", + Account: toAccount(&Account{ + Password: "password", + }), + } + payload := []byte("test string") + data := buf.New() + common.Must2(data.Write(payload)) + + buffer := buf.New() + defer buffer.Release() + + destination := net.Destination{Network: net.Network_TCP, Address: net.LocalHostIP, Port: 1234} + writer := &ConnWriter{Writer: buffer, Target: destination, Account: user.Account.(*MemoryAccount)} + common.Must(writer.WriteMultiBuffer(buf.MultiBuffer{data})) + + reader := &ConnReader{Reader: buffer} + common.Must(reader.ParseHeader()) + + if r := cmp.Diff(reader.Target, destination); r != "" { + t.Error("destination: ", r) + } + + decodedData, err := reader.ReadMultiBuffer() + common.Must(err) + if r := cmp.Diff(decodedData[0].Bytes(), payload); r != "" { + t.Error("data: ", r) + } +} + +func TestUDPRequest(t *testing.T) { + user := &protocol.MemoryUser{ + Email: "love@v2ray.com", + Account: toAccount(&Account{ + Password: "password", + }), + } + payload := []byte("test string") + data := buf.New() + common.Must2(data.Write(payload)) + + buffer := buf.New() + defer buffer.Release() + + destination := net.Destination{Network: net.Network_UDP, Address: net.LocalHostIP, Port: 1234} + writer := &PacketWriter{Writer: &ConnWriter{Writer: buffer, Target: destination, Account: user.Account.(*MemoryAccount)}, Target: destination} + common.Must(writer.WriteMultiBuffer(buf.MultiBuffer{data})) + + connReader := &ConnReader{Reader: buffer} + common.Must(connReader.ParseHeader()) + + packetReader := &PacketReader{Reader: connReader} + p, err := packetReader.ReadMultiBufferWithMetadata() + common.Must(err) + + if p.Buffer.IsEmpty() { + t.Error("no request data") + } + + if r := cmp.Diff(p.Target, destination); r != "" { + t.Error("destination: ", r) + } + + mb, decoded := buf.SplitFirst(p.Buffer) + buf.ReleaseMulti(mb) + + if r := cmp.Diff(decoded.Bytes(), payload); r != "" { + t.Error("data: ", r) + } +} diff --git a/proxy/trojan/server.go b/proxy/trojan/server.go new file mode 100644 index 0000000000..d1248d6f21 --- /dev/null +++ b/proxy/trojan/server.go @@ -0,0 +1,427 @@ +// +build !confonly + +package trojan + +import ( + "context" + "crypto/tls" + "io" + "strconv" + "time" + + "v2ray.com/core" + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/errors" + "v2ray.com/core/common/log" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + udp_proto "v2ray.com/core/common/protocol/udp" + "v2ray.com/core/common/retry" + "v2ray.com/core/common/session" + "v2ray.com/core/common/signal" + "v2ray.com/core/common/task" + "v2ray.com/core/features/policy" + "v2ray.com/core/features/routing" + "v2ray.com/core/transport/internet" + "v2ray.com/core/transport/internet/udp" + "v2ray.com/core/transport/internet/xtls" +) + +func init() { + common.Must(common.RegisterConfig((*ServerConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { // nolint: lll + return NewServer(ctx, config.(*ServerConfig)) + })) +} + +// Server is an inbound connection handler that handles messages in trojan protocol. +type Server struct { + policyManager policy.Manager + validator *Validator + fallbacks map[string]map[string]*Fallback // or nil +} + +// NewServer creates a new trojan inbound handler. +func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) { + validator := new(Validator) + for _, user := range config.Users { + u, err := user.ToMemoryUser() + if err != nil { + return nil, newError("failed to get trojan user").Base(err).AtError() + } + + if err := validator.Add(u); err != nil { + return nil, newError("failed to add user").Base(err).AtError() + } + } + + v := core.MustFromContext(ctx) + server := &Server{ + policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager), + validator: validator, + } + + if config.Fallbacks != nil { + server.fallbacks = make(map[string]map[string]*Fallback) + for _, fb := range config.Fallbacks { + if server.fallbacks[fb.Alpn] == nil { + server.fallbacks[fb.Alpn] = make(map[string]*Fallback) + } + server.fallbacks[fb.Alpn][fb.Path] = fb + } + if server.fallbacks[""] != nil { + for alpn, pfb := range server.fallbacks { + if alpn != "" { // && alpn != "h2" { + for path, fb := range server.fallbacks[""] { + if pfb[path] == nil { + pfb[path] = fb + } + } + } + } + } + } + + return server, nil +} + +// Network implements proxy.Inbound.Network(). +func (s *Server) Network() []net.Network { + return []net.Network{net.Network_TCP} +} + +// Process implements proxy.Inbound.Process(). +func (s *Server) Process(ctx context.Context, network net.Network, conn internet.Connection, dispatcher routing.Dispatcher) error { // nolint: funlen,lll + + sid := session.ExportIDToError(ctx) + + iConn := conn + if statConn, ok := iConn.(*internet.StatCouterConnection); ok { + iConn = statConn.Connection + } + + sessionPolicy := s.policyManager.ForLevel(0) + if err := conn.SetReadDeadline(time.Now().Add(sessionPolicy.Timeouts.Handshake)); err != nil { + return newError("unable to set read deadline").Base(err).AtWarning() + } + + first := buf.New() + defer first.Release() + + firstLen, err := first.ReadFrom(conn) + if err != nil { + return newError("failed to read first request").Base(err) + } + newError("firstLen = ", firstLen).AtInfo().WriteToLog(sid) + + bufferedReader := &buf.BufferedReader{ + Reader: buf.NewReader(conn), + Buffer: buf.MultiBuffer{first}, + } + + var user *protocol.MemoryUser + + apfb := s.fallbacks + isfb := apfb != nil + + shouldFallback := false + if firstLen < 58 || first.Byte(56) != '\r' { // nolint: gomnd + // invalid protocol + err = newError("not trojan protocol") + log.Record(&log.AccessMessage{ + From: conn.RemoteAddr(), + To: "", + Status: log.AccessRejected, + Reason: err, + }) + + shouldFallback = true + } else { + user = s.validator.Get(hexString(first.BytesTo(56))) // nolint: gomnd + if user == nil { + // invalid user, let's fallback + err = newError("not a valid user") + log.Record(&log.AccessMessage{ + From: conn.RemoteAddr(), + To: "", + Status: log.AccessRejected, + Reason: err, + }) + + shouldFallback = true + } + } + + if isfb && shouldFallback { + return s.fallback(ctx, sid, err, sessionPolicy, conn, iConn, apfb, first, firstLen, bufferedReader) + } else if shouldFallback { + return newError("invalid protocol or invalid user") + } + + clientReader := &ConnReader{Reader: bufferedReader} + if err := clientReader.ParseHeader(); err != nil { + log.Record(&log.AccessMessage{ + From: conn.RemoteAddr(), + To: "", + Status: log.AccessRejected, + Reason: err, + }) + return newError("failed to create request from: ", conn.RemoteAddr()).Base(err) + } + + destination := clientReader.Target + if err := conn.SetReadDeadline(time.Time{}); err != nil { + return newError("unable to set read deadline").Base(err).AtWarning() + } + + inbound := session.InboundFromContext(ctx) + if inbound == nil { + panic("no inbound metadata") + } + inbound.User = user + sessionPolicy = s.policyManager.ForLevel(user.Level) + + if destination.Network == net.Network_UDP { // handle udp request + return s.handleUDPPayload(ctx, &PacketReader{Reader: clientReader}, &PacketWriter{Writer: conn}, dispatcher) + } + + // handle tcp request + + ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{ + From: conn.RemoteAddr(), + To: destination, + Status: log.AccessAccepted, + Reason: "", + Email: user.Email, + }) + + newError("received request for ", destination).WriteToLog(sid) + return s.handleConnection(ctx, sessionPolicy, destination, clientReader, buf.NewWriter(conn), dispatcher) +} + +func (s *Server) handleUDPPayload(ctx context.Context, clientReader *PacketReader, clientWriter *PacketWriter, dispatcher routing.Dispatcher) error { // nolint: lll + udpServer := udp.NewDispatcher(dispatcher, func(ctx context.Context, packet *udp_proto.Packet) { + common.Must(clientWriter.WriteMultiBufferWithMetadata(buf.MultiBuffer{packet.Payload}, packet.Source)) + }) + + inbound := session.InboundFromContext(ctx) + user := inbound.User + + for { + select { + case <-ctx.Done(): + return nil + default: + p, err := clientReader.ReadMultiBufferWithMetadata() + if err != nil { + if errors.Cause(err) != io.EOF { + return newError("unexpected EOF").Base(err) + } + return nil + } + + ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{ + From: inbound.Source, + To: p.Target, + Status: log.AccessAccepted, + Reason: "", + Email: user.Email, + }) + newError("tunnelling request to ", p.Target).WriteToLog(session.ExportIDToError(ctx)) + + for _, b := range p.Buffer { + udpServer.Dispatch(ctx, p.Target, b) + } + } + } +} + +func (s *Server) handleConnection(ctx context.Context, sessionPolicy policy.Session, + destination net.Destination, + clientReader buf.Reader, + clientWriter buf.Writer, dispatcher routing.Dispatcher) error { + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer) + + link, err := dispatcher.Dispatch(ctx, destination) + if err != nil { + return newError("failed to dispatch request to ", destination).Base(err) + } + + requestDone := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + + if err := buf.Copy(clientReader, link.Writer, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer request").Base(err) + } + return nil + } + + responseDone := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + + if err := buf.Copy(link.Reader, clientWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to write response").Base(err) + } + return nil + } + + var requestDonePost = task.OnSuccess(requestDone, task.Close(link.Writer)) + if err := task.Run(ctx, requestDonePost, responseDone); err != nil { + common.Must(common.Interrupt(link.Reader)) + common.Must(common.Interrupt(link.Writer)) + return newError("connection ends").Base(err) + } + + return nil +} + +func (s *Server) fallback(ctx context.Context, sid errors.ExportOption, err error, sessionPolicy policy.Session, connection internet.Connection, iConn internet.Connection, apfb map[string]map[string]*Fallback, first *buf.Buffer, firstLen int64, reader buf.Reader) error { // nolint: lll + if err := connection.SetReadDeadline(time.Time{}); err != nil { + newError("unable to set back read deadline").Base(err).AtWarning().WriteToLog(sid) + } + newError("fallback starts").Base(err).AtInfo().WriteToLog(sid) + + alpn := "" + if len(apfb) > 1 || apfb[""] == nil { + if tlsConn, ok := iConn.(*tls.Conn); ok { + alpn = tlsConn.ConnectionState().NegotiatedProtocol + newError("realAlpn = " + alpn).AtInfo().WriteToLog(sid) + } else if xtlsConn, ok := iConn.(*xtls.Conn); ok { + alpn = xtlsConn.ConnectionState().NegotiatedProtocol + newError("realAlpn = " + alpn).AtInfo().WriteToLog(sid) + } + if apfb[alpn] == nil { + alpn = "" + } + } + pfb := apfb[alpn] + if pfb == nil { + return newError(`failed to find the default "alpn" config`).AtWarning() + } + + path := "" + if len(pfb) > 1 || pfb[""] == nil { + if firstLen >= 18 && first.Byte(4) != '*' { // not h2c + firstBytes := first.Bytes() + for i := 4; i <= 8; i++ { // 5 -> 9 + if firstBytes[i] == '/' && firstBytes[i-1] == ' ' { + search := len(firstBytes) + if search > 64 { + search = 64 // up to about 60 + } + for j := i + 1; j < search; j++ { + k := firstBytes[j] + if k == '\r' || k == '\n' { // avoid logging \r or \n + break + } + if k == ' ' { + path = string(firstBytes[i:j]) + newError("realPath = " + path).AtInfo().WriteToLog(sid) + if pfb[path] == nil { + path = "" + } + break + } + } + break + } + } + } + } + fb := pfb[path] + if fb == nil { + return newError(`failed to find the default "path" config`).AtWarning() + } + + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer) + + var conn net.Conn + if err := retry.ExponentialBackoff(5, 100).On(func() error { + var dialer net.Dialer + conn, err = dialer.DialContext(ctx, fb.Type, fb.Dest) + if err != nil { + return err + } + return nil + }); err != nil { + return newError("failed to dial to " + fb.Dest).Base(err).AtWarning() + } + defer conn.Close() + + serverReader := buf.NewReader(conn) + serverWriter := buf.NewWriter(conn) + + postRequest := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + if fb.Xver != 0 { + remoteAddr, remotePort, err := net.SplitHostPort(connection.RemoteAddr().String()) + if err != nil { + return err + } + localAddr, localPort, err := net.SplitHostPort(connection.LocalAddr().String()) + if err != nil { + return err + } + ipv4 := true + for i := 0; i < len(remoteAddr); i++ { + if remoteAddr[i] == ':' { + ipv4 = false + break + } + } + pro := buf.New() + defer pro.Release() + switch fb.Xver { + case 1: + if ipv4 { + common.Must2(pro.Write([]byte("PROXY TCP4 " + remoteAddr + " " + localAddr + " " + remotePort + " " + localPort + "\r\n"))) + } else { + common.Must2(pro.Write([]byte("PROXY TCP6 " + remoteAddr + " " + localAddr + " " + remotePort + " " + localPort + "\r\n"))) + } + case 2: + common.Must2(pro.Write([]byte("\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A\x21"))) // signature + v2 + PROXY + if ipv4 { + common.Must2(pro.Write([]byte("\x11\x00\x0C"))) // AF_INET + STREAM + 12 bytes + common.Must2(pro.Write(net.ParseIP(remoteAddr).To4())) + common.Must2(pro.Write(net.ParseIP(localAddr).To4())) + } else { + common.Must2(pro.Write([]byte("\x21\x00\x24"))) // AF_INET6 + STREAM + 36 bytes + common.Must2(pro.Write(net.ParseIP(remoteAddr).To16())) + common.Must2(pro.Write(net.ParseIP(localAddr).To16())) + } + p1, _ := strconv.ParseUint(remotePort, 10, 16) + p2, _ := strconv.ParseUint(localPort, 10, 16) + common.Must2(pro.Write([]byte{byte(p1 >> 8), byte(p1), byte(p2 >> 8), byte(p2)})) + } + if err := serverWriter.WriteMultiBuffer(buf.MultiBuffer{pro}); err != nil { + return newError("failed to set PROXY protocol v", fb.Xver).Base(err).AtWarning() + } + } + if err := buf.Copy(reader, serverWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to fallback request payload").Base(err).AtInfo() + } + return nil + } + + writer := buf.NewWriter(connection) + + getResponse := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + if err := buf.Copy(serverReader, writer, buf.UpdateActivity(timer)); err != nil { + return newError("failed to deliver response payload").Base(err).AtInfo() + } + return nil + } + + if err := task.Run(ctx, task.OnSuccess(postRequest, task.Close(serverWriter)), task.OnSuccess(getResponse, task.Close(writer))); err != nil { + common.Must(common.Interrupt(serverReader)) + common.Must(common.Interrupt(serverWriter)) + return newError("fallback ends").Base(err).AtInfo() + } + + return nil +} diff --git a/proxy/trojan/trojan.go b/proxy/trojan/trojan.go new file mode 100644 index 0000000000..73b3154fb1 --- /dev/null +++ b/proxy/trojan/trojan.go @@ -0,0 +1 @@ +package trojan diff --git a/proxy/trojan/validator.go b/proxy/trojan/validator.go new file mode 100644 index 0000000000..1c7926e3ac --- /dev/null +++ b/proxy/trojan/validator.go @@ -0,0 +1,28 @@ +package trojan + +import ( + "sync" + + "v2ray.com/core/common/protocol" +) + +// Validator stores valid trojan users +type Validator struct { + users sync.Map +} + +// Add a trojan user +func (v *Validator) Add(u *protocol.MemoryUser) error { + user := u.Account.(*MemoryAccount) + v.users.Store(hexString(user.Key), u) + return nil +} + +// Get user with hashed key, nil if user doesn't exist. +func (v *Validator) Get(hash string) *protocol.MemoryUser { + u, _ := v.users.Load(hash) + if u != nil { + return u.(*protocol.MemoryUser) + } + return nil +} diff --git a/proxy/vless/account.go b/proxy/vless/account.go new file mode 100644 index 0000000000..0357fa8036 --- /dev/null +++ b/proxy/vless/account.go @@ -0,0 +1,40 @@ +// +build !confonly + +package vless + +import ( + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/uuid" +) + +// AsAccount implements protocol.Account.AsAccount(). +func (a *Account) AsAccount() (protocol.Account, error) { + id, err := uuid.ParseString(a.Id) + if err != nil { + return nil, newError("failed to parse ID").Base(err).AtError() + } + return &MemoryAccount{ + ID: protocol.NewID(id), + Flow: a.Flow, // needs parser here? + Encryption: a.Encryption, // needs parser here? + }, nil +} + +// MemoryAccount is an in-memory form of VLess account. +type MemoryAccount struct { + // ID of the account. + ID *protocol.ID + // Flow of the account. May be "xtls-rprx-origin". + Flow string + // Encryption of the account. Used for client connections, and only accepts "none" for now. + Encryption string +} + +// Equals implements protocol.Account.Equals(). +func (a *MemoryAccount) Equals(account protocol.Account) bool { + vlessAccount, ok := account.(*MemoryAccount) + if !ok { + return false + } + return a.ID.Equals(vlessAccount.ID) +} diff --git a/proxy/vless/account.pb.go b/proxy/vless/account.pb.go new file mode 100644 index 0000000000..a851457274 --- /dev/null +++ b/proxy/vless/account.pb.go @@ -0,0 +1,174 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vless/account.proto + +package vless + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +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-origin". + 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, 0x16, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, + 0x50, 0x01, 0x5a, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, + 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0xaa, 0x02, + 0x16, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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: v2ray.core.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/proxy/vless/account.proto b/proxy/vless/account.proto new file mode 100644 index 0000000000..35e7ae1d08 --- /dev/null +++ b/proxy/vless/account.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package v2ray.core.proxy.vless; +option csharp_namespace = "V2Ray.Core.Proxy.Vless"; +option go_package = "v2ray.com/core/proxy/vless"; +option java_package = "com.v2ray.core.proxy.vless"; +option java_multiple_files = true; + +message Account { + // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + string id = 1; + // Flow settings. May be "xtls-rprx-origin". + string flow = 2; + // Encryption settings. Only applies to client side, and only accepts "none" for now. + string encryption = 3; +} diff --git a/proxy/vless/encoding/addons.go b/proxy/vless/encoding/addons.go new file mode 100644 index 0000000000..459cabf8c8 --- /dev/null +++ b/proxy/vless/encoding/addons.go @@ -0,0 +1,211 @@ +// +build !confonly + +package encoding + +import ( + "io" + + "github.com/golang/protobuf/proto" + + "v2ray.com/core/common/buf" + "v2ray.com/core/common/protocol" + "v2ray.com/core/proxy/vless" +) + +func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error { + + switch addons.Flow { + case vless.XRO, vless.XRD: + + bytes, err := proto.Marshal(addons) + if err != nil { + return newError("failed to marshal addons protobuf value").Base(err) + } + if err := buffer.WriteByte(byte(len(bytes))); err != nil { + return newError("failed to write addons protobuf length").Base(err) + } + if _, err := buffer.Write(bytes); err != nil { + return newError("failed to write addons protobuf value").Base(err) + } + + default: + + if err := buffer.WriteByte(0); err != nil { + return newError("failed to write addons protobuf length").Base(err) + } + + } + + return nil + +} + +func DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) { + + addons := new(Addons) + + buffer.Clear() + if _, err := buffer.ReadFullFrom(reader, 1); err != nil { + return nil, newError("failed to read addons protobuf length").Base(err) + } + + if length := int32(buffer.Byte(0)); length != 0 { + + buffer.Clear() + if _, err := buffer.ReadFullFrom(reader, length); err != nil { + return nil, newError("failed to read addons protobuf value").Base(err) + } + + if err := proto.Unmarshal(buffer.Bytes(), addons); err != nil { + return nil, newError("failed to unmarshal addons protobuf value").Base(err) + } + + // Verification. + switch addons.Flow { + default: + + } + + } + + return addons, nil + +} + +// EncodeBodyAddons returns a Writer that auto-encrypt content written by caller. +func EncodeBodyAddons(writer io.Writer, request *protocol.RequestHeader, addons *Addons) buf.Writer { + + switch addons.Flow { + default: + + if request.Command == protocol.RequestCommandUDP { + return NewMultiLengthPacketWriter(writer.(buf.Writer)) + } + + } + + return buf.NewWriter(writer) + +} + +// DecodeBodyAddons returns a Reader from which caller can fetch decrypted body. +func DecodeBodyAddons(reader io.Reader, request *protocol.RequestHeader, addons *Addons) buf.Reader { + + switch addons.Flow { + default: + + if request.Command == protocol.RequestCommandUDP { + return NewLengthPacketReader(reader) + } + + } + + return buf.NewReader(reader) + +} + +func NewMultiLengthPacketWriter(writer buf.Writer) *MultiLengthPacketWriter { + return &MultiLengthPacketWriter{ + Writer: writer, + } +} + +type MultiLengthPacketWriter struct { + buf.Writer +} + +func (w *MultiLengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { + defer buf.ReleaseMulti(mb) + mb2Write := make(buf.MultiBuffer, 0, len(mb)+1) + for _, b := range mb { + length := b.Len() + if length == 0 || length+2 > buf.Size { + continue + } + eb := buf.New() + if err := eb.WriteByte(byte(length >> 8)); err != nil { + eb.Release() + continue + } + if err := eb.WriteByte(byte(length)); err != nil { + eb.Release() + continue + } + if _, err := eb.Write(b.Bytes()); err != nil { + eb.Release() + continue + } + mb2Write = append(mb2Write, eb) + } + if mb2Write.IsEmpty() { + return nil + } + return w.Writer.WriteMultiBuffer(mb2Write) +} + +func NewLengthPacketWriter(writer io.Writer) *LengthPacketWriter { + return &LengthPacketWriter{ + Writer: writer, + cache: make([]byte, 0, 65536), + } +} + +type LengthPacketWriter struct { + io.Writer + cache []byte +} + +func (w *LengthPacketWriter) WriteMultiBuffer(mb buf.MultiBuffer) error { + length := mb.Len() // none of mb is nil + //fmt.Println("Write", length) + if length == 0 { + return nil + } + defer func() { + w.cache = w.cache[:0] + }() + w.cache = append(w.cache, byte(length>>8), byte(length)) + for i, b := range mb { + w.cache = append(w.cache, b.Bytes()...) + b.Release() + mb[i] = nil + } + if _, err := w.Write(w.cache); err != nil { + return newError("failed to write a packet").Base(err) + } + return nil +} + +func NewLengthPacketReader(reader io.Reader) *LengthPacketReader { + return &LengthPacketReader{ + Reader: reader, + cache: make([]byte, 2), + } +} + +type LengthPacketReader struct { + io.Reader + cache []byte +} + +func (r *LengthPacketReader) ReadMultiBuffer() (buf.MultiBuffer, error) { + if _, err := io.ReadFull(r.Reader, r.cache); err != nil { // maybe EOF + return nil, newError("failed to read packet length").Base(err) + } + length := int32(r.cache[0])<<8 | int32(r.cache[1]) + //fmt.Println("Read", length) + mb := make(buf.MultiBuffer, 0, length/buf.Size+1) + for length > 0 { + size := length + if size > buf.Size { + size = buf.Size + } + length -= size + b := buf.New() + if _, err := b.ReadFullFrom(r.Reader, size); err != nil { + return nil, newError("failed to read packet payload").Base(err) + } + mb = append(mb, b) + } + return mb, nil +} diff --git a/proxy/vless/encoding/addons.pb.go b/proxy/vless/encoding/addons.pb.go new file mode 100644 index 0000000000..dcf6a9d71a --- /dev/null +++ b/proxy/vless/encoding/addons.pb.go @@ -0,0 +1,383 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: proxy/vless/encoding/addons.proto + +package encoding + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Addons struct { + Flow string `protobuf:"bytes,1,opt,name=Flow,proto3" json:"Flow,omitempty"` + Seed []byte `protobuf:"bytes,2,opt,name=Seed,proto3" json:"Seed,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Addons) Reset() { *m = Addons{} } +func (m *Addons) String() string { return proto.CompactTextString(m) } +func (*Addons) ProtoMessage() {} +func (*Addons) Descriptor() ([]byte, []int) { + return fileDescriptor_75ab671b0ca8b1cc, []int{0} +} +func (m *Addons) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Addons) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Addons.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Addons) XXX_Merge(src proto.Message) { + xxx_messageInfo_Addons.Merge(m, src) +} +func (m *Addons) XXX_Size() int { + return m.Size() +} +func (m *Addons) XXX_DiscardUnknown() { + xxx_messageInfo_Addons.DiscardUnknown(m) +} + +var xxx_messageInfo_Addons proto.InternalMessageInfo + +func (m *Addons) GetFlow() string { + if m != nil { + return m.Flow + } + return "" +} + +func (m *Addons) GetSeed() []byte { + if m != nil { + return m.Seed + } + return nil +} + +func init() { + proto.RegisterType((*Addons)(nil), "v2ray.core.proxy.vless.encoding.Addons") +} + +func init() { proto.RegisterFile("proxy/vless/encoding/addons.proto", fileDescriptor_75ab671b0ca8b1cc) } + +var fileDescriptor_75ab671b0ca8b1cc = []byte{ + // 186 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x28, 0xca, 0xaf, + 0xa8, 0xd4, 0x2f, 0xcb, 0x49, 0x2d, 0x2e, 0xd6, 0x4f, 0xcd, 0x4b, 0xce, 0x4f, 0xc9, 0xcc, 0x4b, + 0xd7, 0x4f, 0x4c, 0x49, 0xc9, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x2f, + 0x33, 0x2a, 0x4a, 0xac, 0xd4, 0x4b, 0xce, 0x2f, 0x4a, 0xd5, 0x03, 0xab, 0xd6, 0x03, 0xab, 0xd6, + 0x83, 0xa9, 0x56, 0x32, 0xe0, 0x62, 0x73, 0x04, 0x6b, 0x10, 0x12, 0xe2, 0x62, 0x71, 0xcb, 0xc9, + 0x2f, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x41, 0x62, 0xc1, 0xa9, 0xa9, 0x29, + 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, 0x60, 0xb6, 0x53, 0xdd, 0x89, 0x47, 0x72, 0x8c, 0x17, + 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x72, 0x72, 0x7e, + 0xae, 0x1e, 0x01, 0x8b, 0x02, 0x18, 0xa3, 0x94, 0x61, 0x4a, 0x72, 0xf5, 0x41, 0xca, 0xf4, 0xb1, + 0xb9, 0x7e, 0x15, 0x93, 0x7c, 0x98, 0x51, 0x50, 0x62, 0xa5, 0x9e, 0x33, 0xc8, 0xa0, 0x00, 0xb0, + 0x41, 0x61, 0x60, 0x83, 0x5c, 0xa1, 0x2a, 0x92, 0xd8, 0xc0, 0x3e, 0x33, 0x06, 0x04, 0x00, 0x00, + 0xff, 0xff, 0x36, 0x32, 0x14, 0x7c, 0xfe, 0x00, 0x00, 0x00, +} + +func (m *Addons) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Addons) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Addons) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Seed) > 0 { + i -= len(m.Seed) + copy(dAtA[i:], m.Seed) + i = encodeVarintAddons(dAtA, i, uint64(len(m.Seed))) + i-- + dAtA[i] = 0x12 + } + if len(m.Flow) > 0 { + i -= len(m.Flow) + copy(dAtA[i:], m.Flow) + i = encodeVarintAddons(dAtA, i, uint64(len(m.Flow))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAddons(dAtA []byte, offset int, v uint64) int { + offset -= sovAddons(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Addons) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Flow) + if l > 0 { + n += 1 + l + sovAddons(uint64(l)) + } + l = len(m.Seed) + if l > 0 { + n += 1 + l + sovAddons(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovAddons(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAddons(x uint64) (n int) { + return sovAddons(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Addons) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAddons + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Addons: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Addons: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Flow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAddons + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAddons + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAddons + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Flow = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Seed", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAddons + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAddons + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAddons + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Seed = append(m.Seed[:0], dAtA[iNdEx:postIndex]...) + if m.Seed == nil { + m.Seed = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAddons(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthAddons + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthAddons + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAddons(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAddons + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAddons + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAddons + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAddons + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAddons + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAddons + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAddons = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAddons = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAddons = fmt.Errorf("proto: unexpected end of group") +) diff --git a/proxy/vless/encoding/addons.proto b/proxy/vless/encoding/addons.proto new file mode 100644 index 0000000000..cacd00d66c --- /dev/null +++ b/proxy/vless/encoding/addons.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package v2ray.core.proxy.vless.encoding; +option csharp_namespace = "V2Ray.Core.Proxy.Vless.Encoding"; +option go_package = "v2ray.com/core/proxy/vless/encoding"; +option java_package = "com.v2ray.core.proxy.vless.encoding"; +option java_multiple_files = true; + +message Addons { + string Flow = 1; + bytes Seed = 2; +} diff --git a/proxy/vless/encoding/encoding.go b/proxy/vless/encoding/encoding.go new file mode 100644 index 0000000000..ec6ecff6c9 --- /dev/null +++ b/proxy/vless/encoding/encoding.go @@ -0,0 +1,179 @@ +// +build !confonly + +package encoding + +//go:generate go run v2ray.com/core/common/errors/errorgen + +import ( + "io" + + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/proxy/vless" +) + +const ( + Version = byte(0) +) + +var addrParser = protocol.NewAddressParser( + protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv4), net.AddressFamilyIPv4), + protocol.AddressFamilyByte(byte(protocol.AddressTypeDomain), net.AddressFamilyDomain), + protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv6), net.AddressFamilyIPv6), + protocol.PortThenAddress(), +) + +// EncodeRequestHeader writes encoded request header into the given writer. +func EncodeRequestHeader(writer io.Writer, request *protocol.RequestHeader, requestAddons *Addons) error { + + buffer := buf.StackNew() + defer buffer.Release() + + if err := buffer.WriteByte(request.Version); err != nil { + return newError("failed to write request version").Base(err) + } + + if _, err := buffer.Write(request.User.Account.(*vless.MemoryAccount).ID.Bytes()); err != nil { + return newError("failed to write request user id").Base(err) + } + + if err := EncodeHeaderAddons(&buffer, requestAddons); err != nil { + return newError("failed to encode request header addons").Base(err) + } + + if err := buffer.WriteByte(byte(request.Command)); err != nil { + return newError("failed to write request command").Base(err) + } + + if request.Command != protocol.RequestCommandMux { + if err := addrParser.WriteAddressPort(&buffer, request.Address, request.Port); err != nil { + return newError("failed to write request address and port").Base(err) + } + } + + if _, err := writer.Write(buffer.Bytes()); err != nil { + return newError("failed to write request header").Base(err) + } + + return nil +} + +// DecodeRequestHeader decodes and returns (if successful) a RequestHeader from an input stream. +func DecodeRequestHeader(isfb bool, first *buf.Buffer, reader io.Reader, validator *vless.Validator) (*protocol.RequestHeader, *Addons, error, bool) { + + buffer := buf.StackNew() + defer buffer.Release() + + request := new(protocol.RequestHeader) + + if isfb { + request.Version = first.Byte(0) + } else { + if _, err := buffer.ReadFullFrom(reader, 1); err != nil { + return nil, nil, newError("failed to read request version").Base(err), false + } + request.Version = buffer.Byte(0) + } + + switch request.Version { + case 0: + + var id [16]byte + + if isfb { + copy(id[:], first.BytesRange(1, 17)) + } else { + buffer.Clear() + if _, err := buffer.ReadFullFrom(reader, 16); err != nil { + return nil, nil, newError("failed to read request user id").Base(err), false + } + copy(id[:], buffer.Bytes()) + } + + if request.User = validator.Get(id); request.User == nil { + return nil, nil, newError("invalid request user id"), isfb + } + + if isfb { + first.Advance(17) + } + + requestAddons, err := DecodeHeaderAddons(&buffer, reader) + if err != nil { + return nil, nil, newError("failed to decode request header addons").Base(err), false + } + + buffer.Clear() + if _, err := buffer.ReadFullFrom(reader, 1); err != nil { + return nil, nil, newError("failed to read request command").Base(err), false + } + + request.Command = protocol.RequestCommand(buffer.Byte(0)) + switch request.Command { + case protocol.RequestCommandMux: + request.Address = net.DomainAddress("v1.mux.cool") + request.Port = 0 + case protocol.RequestCommandTCP, protocol.RequestCommandUDP: + if addr, port, err := addrParser.ReadAddressPort(&buffer, reader); err == nil { + request.Address = addr + request.Port = port + } + } + + if request.Address == nil { + return nil, nil, newError("invalid request address"), false + } + + return request, requestAddons, nil, false + + default: + + return nil, nil, newError("invalid request version"), isfb + + } + +} + +// EncodeResponseHeader writes encoded response header into the given writer. +func EncodeResponseHeader(writer io.Writer, request *protocol.RequestHeader, responseAddons *Addons) error { + + buffer := buf.StackNew() + defer buffer.Release() + + if err := buffer.WriteByte(request.Version); err != nil { + return newError("failed to write response version").Base(err) + } + + if err := EncodeHeaderAddons(&buffer, responseAddons); err != nil { + return newError("failed to encode response header addons").Base(err) + } + + if _, err := writer.Write(buffer.Bytes()); err != nil { + return newError("failed to write response header").Base(err) + } + + return nil +} + +// DecodeResponseHeader decodes and returns (if successful) a ResponseHeader from an input stream. +func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*Addons, error) { + + buffer := buf.StackNew() + defer buffer.Release() + + if _, err := buffer.ReadFullFrom(reader, 1); err != nil { + return nil, newError("failed to read response version").Base(err) + } + + if buffer.Byte(0) != request.Version { + return nil, newError("unexpected response version. Expecting ", int(request.Version), " but actually ", int(buffer.Byte(0))) + } + + responseAddons, err := DecodeHeaderAddons(&buffer, reader) + if err != nil { + return nil, newError("failed to decode response header addons").Base(err) + } + + return responseAddons, nil +} diff --git a/proxy/vless/encoding/encoding_test.go b/proxy/vless/encoding/encoding_test.go new file mode 100644 index 0000000000..12c9e2b57a --- /dev/null +++ b/proxy/vless/encoding/encoding_test.go @@ -0,0 +1,126 @@ +package encoding_test + +import ( + "testing" + + "github.com/google/go-cmp/cmp" + + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/uuid" + "v2ray.com/core/proxy/vless" + . "v2ray.com/core/proxy/vless/encoding" +) + +func toAccount(a *vless.Account) protocol.Account { + account, err := a.AsAccount() + common.Must(err) + return account +} + +func TestRequestSerialization(t *testing.T) { + user := &protocol.MemoryUser{ + Level: 0, + Email: "test@v2fly.org", + } + id := uuid.New() + account := &vless.Account{ + Id: id.String(), + } + user.Account = toAccount(account) + + expectedRequest := &protocol.RequestHeader{ + Version: Version, + User: user, + Command: protocol.RequestCommandTCP, + Address: net.DomainAddress("www.v2fly.org"), + Port: net.Port(443), + } + expectedAddons := &Addons{} + + buffer := buf.StackNew() + common.Must(EncodeRequestHeader(&buffer, expectedRequest, expectedAddons)) + + Validator := new(vless.Validator) + Validator.Add(user) + + actualRequest, actualAddons, err, _ := DecodeRequestHeader(false, nil, &buffer, Validator) + common.Must(err) + + if r := cmp.Diff(actualRequest, expectedRequest, cmp.AllowUnexported(protocol.ID{})); r != "" { + t.Error(r) + } + if r := cmp.Diff(actualAddons, expectedAddons); r != "" { + t.Error(r) + } +} + +func TestInvalidRequest(t *testing.T) { + user := &protocol.MemoryUser{ + Level: 0, + Email: "test@v2fly.org", + } + id := uuid.New() + account := &vless.Account{ + Id: id.String(), + } + user.Account = toAccount(account) + + expectedRequest := &protocol.RequestHeader{ + Version: Version, + User: user, + Command: protocol.RequestCommand(100), + Address: net.DomainAddress("www.v2fly.org"), + Port: net.Port(443), + } + expectedAddons := &Addons{} + + buffer := buf.StackNew() + common.Must(EncodeRequestHeader(&buffer, expectedRequest, expectedAddons)) + + Validator := new(vless.Validator) + Validator.Add(user) + + _, _, err, _ := DecodeRequestHeader(false, nil, &buffer, Validator) + if err == nil { + t.Error("nil error") + } +} + +func TestMuxRequest(t *testing.T) { + user := &protocol.MemoryUser{ + Level: 0, + Email: "test@v2fly.org", + } + id := uuid.New() + account := &vless.Account{ + Id: id.String(), + } + user.Account = toAccount(account) + + expectedRequest := &protocol.RequestHeader{ + Version: Version, + User: user, + Command: protocol.RequestCommandMux, + Address: net.DomainAddress("v1.mux.cool"), + } + expectedAddons := &Addons{} + + buffer := buf.StackNew() + common.Must(EncodeRequestHeader(&buffer, expectedRequest, expectedAddons)) + + Validator := new(vless.Validator) + Validator.Add(user) + + actualRequest, actualAddons, err, _ := DecodeRequestHeader(false, nil, &buffer, Validator) + common.Must(err) + + if r := cmp.Diff(actualRequest, expectedRequest, cmp.AllowUnexported(protocol.ID{})); r != "" { + t.Error(r) + } + if r := cmp.Diff(actualAddons, expectedAddons); r != "" { + t.Error(r) + } +} diff --git a/proxy/vless/encoding/errors.generated.go b/proxy/vless/encoding/errors.generated.go new file mode 100644 index 0000000000..6fb682106f --- /dev/null +++ b/proxy/vless/encoding/errors.generated.go @@ -0,0 +1,9 @@ +package encoding + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/proxy/vless/errors.generated.go b/proxy/vless/errors.generated.go new file mode 100644 index 0000000000..79734c109a --- /dev/null +++ b/proxy/vless/errors.generated.go @@ -0,0 +1,9 @@ +package vless + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/proxy/vless/inbound/config.go b/proxy/vless/inbound/config.go new file mode 100644 index 0000000000..039be43378 --- /dev/null +++ b/proxy/vless/inbound/config.go @@ -0,0 +1,3 @@ +// +build !confonly + +package inbound diff --git a/proxy/vless/inbound/config.pb.go b/proxy/vless/inbound/config.pb.go new file mode 100644 index 0000000000..e4b927353b --- /dev/null +++ b/proxy/vless/inbound/config.pb.go @@ -0,0 +1,287 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vless/inbound/config.proto + +package inbound + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + protocol "v2ray.com/core/common/protocol" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Fallback struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Alpn string `protobuf:"bytes,1,opt,name=alpn,proto3" json:"alpn,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + Dest string `protobuf:"bytes,4,opt,name=dest,proto3" json:"dest,omitempty"` + Xver uint64 `protobuf:"varint,5,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) 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, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6e, + 0x0a, 0x08, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x6c, + 0x70, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x6c, 0x70, 0x6e, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, + 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x76, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x78, 0x76, 0x65, 0x72, 0x22, 0xac, + 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x07, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x46, 0x0a, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, + 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6b, 0x0a, + 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, + 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 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, 0x1e, 0x56, 0x32, 0x52, 0x61, + 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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: v2ray.core.proxy.vless.inbound.Fallback + (*Config)(nil), // 1: v2ray.core.proxy.vless.inbound.Config + (*protocol.User)(nil), // 2: v2ray.core.common.protocol.User +} +var file_proxy_vless_inbound_config_proto_depIdxs = []int32{ + 2, // 0: v2ray.core.proxy.vless.inbound.Config.clients:type_name -> v2ray.core.common.protocol.User + 0, // 1: v2ray.core.proxy.vless.inbound.Config.fallbacks:type_name -> v2ray.core.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/proxy/vless/inbound/config.proto b/proxy/vless/inbound/config.proto new file mode 100644 index 0000000000..21afccc96e --- /dev/null +++ b/proxy/vless/inbound/config.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package v2ray.core.proxy.vless.inbound; +option csharp_namespace = "V2Ray.Core.Proxy.Vless.Inbound"; +option go_package = "v2ray.com/core/proxy/vless/inbound"; +option java_package = "com.v2ray.core.proxy.vless.inbound"; +option java_multiple_files = true; + +import "common/protocol/user.proto"; + +message Fallback { + string alpn = 1; + string path = 2; + string type = 3; + string dest = 4; + uint64 xver = 5; +} + +message Config { + repeated v2ray.core.common.protocol.User clients = 1; + // Decryption settings. Only applies to server side, and only accepts "none" + // for now. + string decryption = 2; + repeated Fallback fallbacks = 3; +} diff --git a/proxy/vless/inbound/errors.generated.go b/proxy/vless/inbound/errors.generated.go new file mode 100644 index 0000000000..90d805b1e7 --- /dev/null +++ b/proxy/vless/inbound/errors.generated.go @@ -0,0 +1,9 @@ +package inbound + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go new file mode 100644 index 0000000000..db5a599f22 --- /dev/null +++ b/proxy/vless/inbound/inbound.go @@ -0,0 +1,489 @@ +// +build !confonly + +package inbound + +//go:generate go run v2ray.com/core/common/errors/errorgen + +import ( + "context" + "io" + "strconv" + "time" + + "v2ray.com/core" + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/errors" + "v2ray.com/core/common/log" + "v2ray.com/core/common/net" + "v2ray.com/core/common/platform" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/retry" + "v2ray.com/core/common/session" + "v2ray.com/core/common/signal" + "v2ray.com/core/common/task" + "v2ray.com/core/features/dns" + feature_inbound "v2ray.com/core/features/inbound" + "v2ray.com/core/features/policy" + "v2ray.com/core/features/routing" + "v2ray.com/core/proxy/vless" + "v2ray.com/core/proxy/vless/encoding" + "v2ray.com/core/transport/internet" + "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" +) + +var ( + xtls_show = false +) + +func init() { + common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { + var dc dns.Client + if err := core.RequireFeatures(ctx, func(d dns.Client) error { + dc = d + return nil + }); err != nil { + return nil, err + } + return New(ctx, config.(*Config), dc) + })) + + const defaultFlagValue = "NOT_DEFINED_AT_ALL" + + xtlsShow := platform.NewEnvFlag("v2ray.vless.xtls.show").GetValue(func() string { return defaultFlagValue }) + if xtlsShow == "true" { + xtls_show = true + } +} + +// Handler is an inbound connection handler that handles messages in VLess protocol. +type Handler struct { + inboundHandlerManager feature_inbound.Manager + policyManager policy.Manager + validator *vless.Validator + dns dns.Client + fallbacks map[string]map[string]*Fallback // or nil + //regexps map[string]*regexp.Regexp // or nil +} + +// New creates a new VLess inbound handler. +func New(ctx context.Context, config *Config, dc dns.Client) (*Handler, error) { + + v := core.MustFromContext(ctx) + handler := &Handler{ + inboundHandlerManager: v.GetFeature(feature_inbound.ManagerType()).(feature_inbound.Manager), + policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager), + validator: new(vless.Validator), + dns: dc, + } + + for _, user := range config.Clients { + u, err := user.ToMemoryUser() + if err != nil { + return nil, newError("failed to get VLESS user").Base(err).AtError() + } + if err := handler.AddUser(ctx, u); err != nil { + return nil, newError("failed to initiate user").Base(err).AtError() + } + } + + if config.Fallbacks != nil { + handler.fallbacks = make(map[string]map[string]*Fallback) + //handler.regexps = make(map[string]*regexp.Regexp) + for _, fb := range config.Fallbacks { + if handler.fallbacks[fb.Alpn] == nil { + handler.fallbacks[fb.Alpn] = make(map[string]*Fallback) + } + handler.fallbacks[fb.Alpn][fb.Path] = fb + /* + if fb.Path != "" { + if r, err := regexp.Compile(fb.Path); err != nil { + return nil, newError("invalid path regexp").Base(err).AtError() + } else { + handler.regexps[fb.Path] = r + } + } + */ + } + if handler.fallbacks[""] != nil { + for alpn, pfb := range handler.fallbacks { + if alpn != "" { // && alpn != "h2" { + for path, fb := range handler.fallbacks[""] { + if pfb[path] == nil { + pfb[path] = fb + } + } + } + } + } + } + + return handler, nil +} + +// Close implements common.Closable.Close(). +func (h *Handler) Close() error { + return errors.Combine(common.Close(h.validator)) +} + +// AddUser implements proxy.UserManager.AddUser(). +func (h *Handler) AddUser(ctx context.Context, u *protocol.MemoryUser) error { + return h.validator.Add(u) +} + +// RemoveUser implements proxy.UserManager.RemoveUser(). +func (h *Handler) RemoveUser(ctx context.Context, e string) error { + return h.validator.Del(e) +} + +// Network implements proxy.Inbound.Network(). +func (*Handler) Network() []net.Network { + return []net.Network{net.Network_TCP} +} + +// Process implements proxy.Inbound.Process(). +func (h *Handler) Process(ctx context.Context, network net.Network, connection internet.Connection, dispatcher routing.Dispatcher) error { + + sid := session.ExportIDToError(ctx) + + iConn := connection + if statConn, ok := iConn.(*internet.StatCouterConnection); ok { + iConn = statConn.Connection + } + + sessionPolicy := h.policyManager.ForLevel(0) + if err := connection.SetReadDeadline(time.Now().Add(sessionPolicy.Timeouts.Handshake)); err != nil { + return newError("unable to set read deadline").Base(err).AtWarning() + } + + first := buf.New() + defer first.Release() + + firstLen, _ := first.ReadFrom(connection) + newError("firstLen = ", firstLen).AtInfo().WriteToLog(sid) + + reader := &buf.BufferedReader{ + Reader: buf.NewReader(connection), + Buffer: buf.MultiBuffer{first}, + } + + var request *protocol.RequestHeader + var requestAddons *encoding.Addons + var err error + + apfb := h.fallbacks + isfb := apfb != nil + + if isfb && firstLen < 18 { + err = newError("fallback directly") + } else { + request, requestAddons, err, isfb = encoding.DecodeRequestHeader(isfb, first, reader, h.validator) + } + + if err != nil { + + if isfb { + if err := connection.SetReadDeadline(time.Time{}); err != nil { + newError("unable to set back read deadline").Base(err).AtWarning().WriteToLog(sid) + } + newError("fallback starts").Base(err).AtInfo().WriteToLog(sid) + + alpn := "" + if len(apfb) > 1 || apfb[""] == nil { + if tlsConn, ok := iConn.(*tls.Conn); ok { + alpn = tlsConn.ConnectionState().NegotiatedProtocol + newError("realAlpn = " + alpn).AtInfo().WriteToLog(sid) + } else if xtlsConn, ok := iConn.(*xtls.Conn); ok { + alpn = xtlsConn.ConnectionState().NegotiatedProtocol + newError("realAlpn = " + alpn).AtInfo().WriteToLog(sid) + } + if apfb[alpn] == nil { + alpn = "" + } + } + pfb := apfb[alpn] + if pfb == nil { + return newError(`failed to find the default "alpn" config`).AtWarning() + } + + path := "" + if len(pfb) > 1 || pfb[""] == nil { + /* + if lines := bytes.Split(firstBytes, []byte{'\r', '\n'}); len(lines) > 1 { + if s := bytes.Split(lines[0], []byte{' '}); len(s) == 3 { + if len(s[0]) < 8 && len(s[1]) > 0 && len(s[2]) == 8 { + newError("realPath = " + string(s[1])).AtInfo().WriteToLog(sid) + for _, fb := range pfb { + if fb.Path != "" && h.regexps[fb.Path].Match(s[1]) { + path = fb.Path + break + } + } + } + } + } + */ + if firstLen >= 18 && first.Byte(4) != '*' { // not h2c + firstBytes := first.Bytes() + for i := 4; i <= 8; i++ { // 5 -> 9 + if firstBytes[i] == '/' && firstBytes[i-1] == ' ' { + search := len(firstBytes) + if search > 64 { + search = 64 // up to about 60 + } + for j := i + 1; j < search; j++ { + k := firstBytes[j] + if k == '\r' || k == '\n' { // avoid logging \r or \n + break + } + if k == ' ' { + path = string(firstBytes[i:j]) + newError("realPath = " + path).AtInfo().WriteToLog(sid) + if pfb[path] == nil { + path = "" + } + break + } + } + break + } + } + } + } + fb := pfb[path] + if fb == nil { + return newError(`failed to find the default "path" config`).AtWarning() + } + + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer) + + var conn net.Conn + if err := retry.ExponentialBackoff(5, 100).On(func() error { + var dialer net.Dialer + conn, err = dialer.DialContext(ctx, fb.Type, fb.Dest) + if err != nil { + return err + } + return nil + }); err != nil { + return newError("failed to dial to " + fb.Dest).Base(err).AtWarning() + } + defer conn.Close() // nolint: errcheck + + serverReader := buf.NewReader(conn) + serverWriter := buf.NewWriter(conn) + + postRequest := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + if fb.Xver != 0 { + remoteAddr, remotePort, err := net.SplitHostPort(connection.RemoteAddr().String()) + if err != nil { + return err + } + localAddr, localPort, err := net.SplitHostPort(connection.LocalAddr().String()) + if err != nil { + return err + } + ipv4 := true + for i := 0; i < len(remoteAddr); i++ { + if remoteAddr[i] == ':' { + ipv4 = false + break + } + } + pro := buf.New() + defer pro.Release() + switch fb.Xver { + case 1: + if ipv4 { + pro.Write([]byte("PROXY TCP4 " + remoteAddr + " " + localAddr + " " + remotePort + " " + localPort + "\r\n")) + } else { + pro.Write([]byte("PROXY TCP6 " + remoteAddr + " " + localAddr + " " + remotePort + " " + localPort + "\r\n")) + } + case 2: + pro.Write([]byte("\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A\x21")) // signature + v2 + PROXY + if ipv4 { + pro.Write([]byte("\x11\x00\x0C")) // AF_INET + STREAM + 12 bytes + pro.Write(net.ParseIP(remoteAddr).To4()) + pro.Write(net.ParseIP(localAddr).To4()) + } else { + pro.Write([]byte("\x21\x00\x24")) // AF_INET6 + STREAM + 36 bytes + pro.Write(net.ParseIP(remoteAddr).To16()) + pro.Write(net.ParseIP(localAddr).To16()) + } + p1, _ := strconv.ParseUint(remotePort, 10, 16) + p2, _ := strconv.ParseUint(localPort, 10, 16) + pro.Write([]byte{byte(p1 >> 8), byte(p1), byte(p2 >> 8), byte(p2)}) + } + if err := serverWriter.WriteMultiBuffer(buf.MultiBuffer{pro}); err != nil { + return newError("failed to set PROXY protocol v", fb.Xver).Base(err).AtWarning() + } + } + if err := buf.Copy(reader, serverWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to fallback request payload").Base(err).AtInfo() + } + return nil + } + + writer := buf.NewWriter(connection) + + getResponse := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + if err := buf.Copy(serverReader, writer, buf.UpdateActivity(timer)); err != nil { + return newError("failed to deliver response payload").Base(err).AtInfo() + } + return nil + } + + if err := task.Run(ctx, task.OnSuccess(postRequest, task.Close(serverWriter)), task.OnSuccess(getResponse, task.Close(writer))); err != nil { + common.Interrupt(serverReader) + common.Interrupt(serverWriter) + return newError("fallback ends").Base(err).AtInfo() + } + return nil + } + + if errors.Cause(err) != io.EOF { + log.Record(&log.AccessMessage{ + From: connection.RemoteAddr(), + To: "", + Status: log.AccessRejected, + Reason: err, + }) + err = newError("invalid request from ", connection.RemoteAddr()).Base(err).AtWarning() + } + return err + } + + if err := connection.SetReadDeadline(time.Time{}); err != nil { + newError("unable to set back read deadline").Base(err).AtWarning().WriteToLog(sid) + } + newError("received request for ", request.Destination()).AtInfo().WriteToLog(sid) + + inbound := session.InboundFromContext(ctx) + if inbound == nil { + panic("no inbound metadata") + } + inbound.User = request.User + + account := request.User.Account.(*vless.MemoryAccount) + + responseAddons := &encoding.Addons{ + //Flow: requestAddons.Flow, + } + + switch requestAddons.Flow { + case vless.XRO, vless.XRD: + if account.Flow == requestAddons.Flow { + switch request.Command { + case protocol.RequestCommandMux: + return newError(requestAddons.Flow + " doesn't support Mux").AtWarning() + case protocol.RequestCommandUDP: + return newError(requestAddons.Flow + " doesn't support UDP").AtWarning() + case protocol.RequestCommandTCP: + if xtlsConn, ok := iConn.(*xtls.Conn); ok { + xtlsConn.RPRX = true + xtlsConn.SHOW = xtls_show + xtlsConn.MARK = "XTLS" + if requestAddons.Flow == vless.XRD { + xtlsConn.DirectMode = true + } + } else { + return newError(`failed to use ` + requestAddons.Flow + `, maybe "security" is not "xtls"`).AtWarning() + } + } + } else { + return newError(account.ID.String() + " is not able to use " + requestAddons.Flow).AtWarning() + } + case "": + default: + return newError("unknown request flow " + requestAddons.Flow).AtWarning() + } + + if request.Command != protocol.RequestCommandMux { + ctx = log.ContextWithAccessMessage(ctx, &log.AccessMessage{ + From: connection.RemoteAddr(), + To: request.Destination(), + Status: log.AccessAccepted, + Reason: "", + Email: request.User.Email, + }) + } + + sessionPolicy = h.policyManager.ForLevel(request.User.Level) + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer) + + link, err := dispatcher.Dispatch(ctx, request.Destination()) + if err != nil { + return newError("failed to dispatch request to ", request.Destination()).Base(err).AtWarning() + } + + serverReader := link.Reader // .(*pipe.Reader) + serverWriter := link.Writer // .(*pipe.Writer) + + postRequest := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + + // default: clientReader := reader + clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons) + + // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer + if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer request payload").Base(err).AtInfo() + } + + return nil + } + + getResponse := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + + bufferWriter := buf.NewBufferedWriter(buf.NewWriter(connection)) + if err := encoding.EncodeResponseHeader(bufferWriter, request, responseAddons); err != nil { + return newError("failed to encode response header").Base(err).AtWarning() + } + + // default: clientWriter := bufferWriter + clientWriter := encoding.EncodeBodyAddons(bufferWriter, request, responseAddons) + { + multiBuffer, err := serverReader.ReadMultiBuffer() + if err != nil { + return err // ... + } + if err := clientWriter.WriteMultiBuffer(multiBuffer); err != nil { + return err // ... + } + } + + // Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer + if err := bufferWriter.SetBuffered(false); err != nil { + return newError("failed to write A response payload").Base(err).AtWarning() + } + + // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer + if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer response payload").Base(err).AtInfo() + } + + // Indicates the end of response payload. + switch responseAddons.Flow { + default: + + } + + return nil + } + + if err := task.Run(ctx, task.OnSuccess(postRequest, task.Close(serverWriter)), getResponse); err != nil { + common.Interrupt(serverReader) + common.Interrupt(serverWriter) + return newError("connection ends").Base(err).AtInfo() + } + + return nil +} diff --git a/proxy/vless/outbound/config.go b/proxy/vless/outbound/config.go new file mode 100644 index 0000000000..35bf561b66 --- /dev/null +++ b/proxy/vless/outbound/config.go @@ -0,0 +1,3 @@ +// +build !confonly + +package outbound diff --git a/proxy/vless/outbound/config.pb.go b/proxy/vless/outbound/config.pb.go new file mode 100644 index 0000000000..ea4d0b4728 --- /dev/null +++ b/proxy/vless/outbound/config.pb.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vless/outbound/config.proto + +package outbound + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + protocol "v2ray.com/core/common/protocol" +) + +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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +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, 0x1f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x40, 0x0a, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6e, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, + 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x23, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x1f, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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: v2ray.core.proxy.vless.outbound.Config + (*protocol.ServerEndpoint)(nil), // 1: v2ray.core.common.protocol.ServerEndpoint +} +var file_proxy_vless_outbound_config_proto_depIdxs = []int32{ + 1, // 0: v2ray.core.proxy.vless.outbound.Config.vnext:type_name -> v2ray.core.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/proxy/vless/outbound/config.proto b/proxy/vless/outbound/config.proto new file mode 100644 index 0000000000..3604b72d59 --- /dev/null +++ b/proxy/vless/outbound/config.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package v2ray.core.proxy.vless.outbound; +option csharp_namespace = "V2Ray.Core.Proxy.Vless.Outbound"; +option go_package = "v2ray.com/core/proxy/vless/outbound"; +option java_package = "com.v2ray.core.proxy.vless.outbound"; +option java_multiple_files = true; + +import "common/protocol/server_spec.proto"; + +message Config { + repeated v2ray.core.common.protocol.ServerEndpoint vnext = 1; +} diff --git a/proxy/vless/outbound/errors.generated.go b/proxy/vless/outbound/errors.generated.go new file mode 100644 index 0000000000..37e984d875 --- /dev/null +++ b/proxy/vless/outbound/errors.generated.go @@ -0,0 +1,9 @@ +package outbound + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go new file mode 100644 index 0000000000..b7d7d65df3 --- /dev/null +++ b/proxy/vless/outbound/outbound.go @@ -0,0 +1,226 @@ +// +build !confonly + +package outbound + +//go:generate go run v2ray.com/core/common/errors/errorgen + +import ( + "context" + "time" + + "v2ray.com/core" + "v2ray.com/core/common" + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" + "v2ray.com/core/common/platform" + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/retry" + "v2ray.com/core/common/session" + "v2ray.com/core/common/signal" + "v2ray.com/core/common/task" + "v2ray.com/core/features/policy" + "v2ray.com/core/proxy/vless" + "v2ray.com/core/proxy/vless/encoding" + "v2ray.com/core/transport" + "v2ray.com/core/transport/internet" + "v2ray.com/core/transport/internet/xtls" +) + +var ( + xtls_show = false +) + +func init() { + common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) { + return New(ctx, config.(*Config)) + })) + + const defaultFlagValue = "NOT_DEFINED_AT_ALL" + + xtlsShow := platform.NewEnvFlag("v2ray.vless.xtls.show").GetValue(func() string { return defaultFlagValue }) + if xtlsShow == "true" { + xtls_show = true + } +} + +// Handler is an outbound connection handler for VLess protocol. +type Handler struct { + serverList *protocol.ServerList + serverPicker protocol.ServerPicker + policyManager policy.Manager +} + +// New creates a new VLess outbound handler. +func New(ctx context.Context, config *Config) (*Handler, error) { + + serverList := protocol.NewServerList() + for _, rec := range config.Vnext { + s, err := protocol.NewServerSpecFromPB(rec) + if err != nil { + return nil, newError("failed to parse server spec").Base(err).AtError() + } + serverList.AddServer(s) + } + + v := core.MustFromContext(ctx) + handler := &Handler{ + serverList: serverList, + serverPicker: protocol.NewRoundRobinServerPicker(serverList), + policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager), + } + + return handler, nil +} + +// Process implements proxy.Outbound.Process(). +func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error { + + var rec *protocol.ServerSpec + var conn internet.Connection + + if err := retry.ExponentialBackoff(5, 200).On(func() error { + rec = h.serverPicker.PickServer() + var err error + conn, err = dialer.Dial(ctx, rec.Destination()) + if err != nil { + return err + } + return nil + }); err != nil { + return newError("failed to find an available destination").Base(err).AtWarning() + } + defer conn.Close() // nolint: errcheck + + iConn := conn + if statConn, ok := iConn.(*internet.StatCouterConnection); ok { + iConn = statConn.Connection + } + + outbound := session.OutboundFromContext(ctx) + if outbound == nil || !outbound.Target.IsValid() { + return newError("target not specified").AtError() + } + + target := outbound.Target + newError("tunneling request to ", target, " via ", rec.Destination()).AtInfo().WriteToLog(session.ExportIDToError(ctx)) + + command := protocol.RequestCommandTCP + if target.Network == net.Network_UDP { + command = protocol.RequestCommandUDP + } + if target.Address.Family().IsDomain() && target.Address.Domain() == "v1.mux.cool" { + command = protocol.RequestCommandMux + } + + request := &protocol.RequestHeader{ + Version: encoding.Version, + User: rec.PickUser(), + Command: command, + Address: target.Address, + Port: target.Port, + } + + account := request.User.Account.(*vless.MemoryAccount) + + requestAddons := &encoding.Addons{ + Flow: account.Flow, + } + + allowUDP443 := false + switch requestAddons.Flow { + case vless.XRO + "-udp443", vless.XRD + "-udp443": + allowUDP443 = true + requestAddons.Flow = requestAddons.Flow[:16] + fallthrough + case vless.XRO, vless.XRD: + switch request.Command { + case protocol.RequestCommandMux: + return newError(requestAddons.Flow + " doesn't support Mux").AtWarning() + case protocol.RequestCommandUDP: + if !allowUDP443 && request.Port == 443 { + return newError(requestAddons.Flow + " stopped UDP/443").AtInfo() + } + requestAddons.Flow = "" + case protocol.RequestCommandTCP: + if xtlsConn, ok := iConn.(*xtls.Conn); ok { + xtlsConn.RPRX = true + xtlsConn.SHOW = xtls_show + xtlsConn.MARK = "XTLS" + if requestAddons.Flow == vless.XRD { + xtlsConn.DirectMode = true + } + } else { + return newError(`failed to use ` + requestAddons.Flow + `, maybe "security" is not "xtls"`).AtWarning() + } + } + default: + if _, ok := iConn.(*xtls.Conn); ok { + panic(`To avoid misunderstanding, you must fill in VLESS "flow" when using XTLS.`) + } + } + + sessionPolicy := h.policyManager.ForLevel(request.User.Level) + ctx, cancel := context.WithCancel(ctx) + timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) + + clientReader := link.Reader // .(*pipe.Reader) + clientWriter := link.Writer // .(*pipe.Writer) + + postRequest := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.DownlinkOnly) + + bufferWriter := buf.NewBufferedWriter(buf.NewWriter(conn)) + if err := encoding.EncodeRequestHeader(bufferWriter, request, requestAddons); err != nil { + return newError("failed to encode request header").Base(err).AtWarning() + } + + // default: serverWriter := bufferWriter + serverWriter := encoding.EncodeBodyAddons(bufferWriter, request, requestAddons) + if err := buf.CopyOnceTimeout(clientReader, serverWriter, time.Millisecond*100); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout { + return err // ... + } + + // Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer + if err := bufferWriter.SetBuffered(false); err != nil { + return newError("failed to write A request payload").Base(err).AtWarning() + } + + // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer + if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer request payload").Base(err).AtInfo() + } + + // Indicates the end of request payload. + switch requestAddons.Flow { + default: + + } + + return nil + } + + getResponse := func() error { + defer timer.SetTimeout(sessionPolicy.Timeouts.UplinkOnly) + + responseAddons, err := encoding.DecodeResponseHeader(conn, request) + if err != nil { + return newError("failed to decode response header").Base(err).AtWarning() + } + + // default: serverReader := buf.NewReader(conn) + serverReader := encoding.DecodeBodyAddons(conn, request, responseAddons) + + // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer + if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil { + return newError("failed to transfer response payload").Base(err).AtInfo() + } + + return nil + } + + if err := task.Run(ctx, postRequest, task.OnSuccess(getResponse, task.Close(clientWriter))); err != nil { + return newError("connection ends").Base(err).AtInfo() + } + + return nil +} diff --git a/proxy/vless/validator.go b/proxy/vless/validator.go new file mode 100644 index 0000000000..a19cc6323c --- /dev/null +++ b/proxy/vless/validator.go @@ -0,0 +1,50 @@ +// +build !confonly + +package vless + +import ( + "strings" + "sync" + + "v2ray.com/core/common/protocol" + "v2ray.com/core/common/uuid" +) + +type Validator struct { + // Considering email's usage here, map + sync.Mutex/RWMutex may have better performance. + email sync.Map + users sync.Map +} + +func (v *Validator) Add(u *protocol.MemoryUser) error { + if u.Email != "" { + _, loaded := v.email.LoadOrStore(strings.ToLower(u.Email), u) + if loaded { + return newError("User ", u.Email, " already exists.") + } + } + v.users.Store(u.Account.(*MemoryAccount).ID.UUID(), u) + return nil +} + +func (v *Validator) Del(e string) error { + if e == "" { + return newError("Email must not be empty.") + } + le := strings.ToLower(e) + u, _ := v.email.Load(le) + if u == nil { + return newError("User ", e, " not found.") + } + v.email.Delete(le) + v.users.Delete(u.(*protocol.MemoryUser).Account.(*MemoryAccount).ID.UUID()) + return nil +} + +func (v *Validator) Get(id uuid.UUID) *protocol.MemoryUser { + u, _ := v.users.Load(id) + if u != nil { + return u.(*protocol.MemoryUser) + } + return nil +} diff --git a/proxy/vless/vless.go b/proxy/vless/vless.go new file mode 100644 index 0000000000..84972306f0 --- /dev/null +++ b/proxy/vless/vless.go @@ -0,0 +1,13 @@ +// Package vless contains the implementation of VLess protocol and transportation. +// +// VLess contains both inbound and outbound connections. VLess inbound is usually used on servers +// together with 'freedom' to talk to final destination, while VLess outbound is usually used on +// clients with 'socks' for proxying. +package vless + +//go:generate go run v2ray.com/core/common/errors/errorgen + +const ( + XRO = "xtls-rprx-origin" + XRD = "xtls-rprx-direct" +) diff --git a/proxy/vmess/account.go b/proxy/vmess/account.go index 0f77a51ef1..eff55debb7 100644 --- a/proxy/vmess/account.go +++ b/proxy/vmess/account.go @@ -16,8 +16,6 @@ type MemoryAccount struct { AlterIDs []*protocol.ID // Security type of the account. Used for client connections. Security protocol.SecurityType - - TestsEnabled string } // AnyValidID returns an ID that is either the main ID or one of the alternative IDs if any. @@ -46,9 +44,8 @@ func (a *Account) AsAccount() (protocol.Account, error) { } protoID := protocol.NewID(id) return &MemoryAccount{ - ID: protoID, - AlterIDs: protocol.NewAlterIDs(protoID, uint16(a.AlterId)), - Security: a.SecuritySettings.GetSecurityType(), - TestsEnabled: a.TestsEnabled, + ID: protoID, + AlterIDs: protocol.NewAlterIDs(protoID, uint16(a.AlterId)), + Security: a.SecuritySettings.GetSecurityType(), }, nil } diff --git a/proxy/vmess/account.pb.go b/proxy/vmess/account.pb.go index 0dd053b0ec..f4d5da1630 100644 --- a/proxy/vmess/account.pb.go +++ b/proxy/vmess/account.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vmess/account.proto + package vmess import ( @@ -25,7 +31,8 @@ type Account struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + // 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"` // Number of alternative IDs. Client and server must share the same number. AlterId uint32 `protobuf:"varint,2,opt,name=alter_id,json=alterId,proto3" json:"alter_id,omitempty"` @@ -38,7 +45,7 @@ type Account struct { func (x *Account) Reset() { *x = Account{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_vmess_account_proto_msgTypes[0] + mi := &file_proxy_vmess_account_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -51,7 +58,7 @@ func (x *Account) String() string { func (*Account) ProtoMessage() {} func (x *Account) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_vmess_account_proto_msgTypes[0] + mi := &file_proxy_vmess_account_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -64,7 +71,7 @@ func (x *Account) ProtoReflect() protoreflect.Message { // Deprecated: Use Account.ProtoReflect.Descriptor instead. func (*Account) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_vmess_account_proto_rawDescGZIP(), []int{0} + return file_proxy_vmess_account_proto_rawDescGZIP(), []int{0} } func (x *Account) GetId() string { @@ -95,52 +102,52 @@ func (x *Account) GetTestsEnabled() string { return "" } -var File_v2ray_com_core_proxy_vmess_account_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_vmess_account_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x16, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, - 0x73, 0x73, 0x1a, 0x2c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 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, 0xb2, 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, 0x19, 0x0a, 0x08, - 0x61, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, - 0x61, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x57, 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, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, +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, 0x16, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, - 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x05, 0x76, 0x6d, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x16, 0x56, - 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x56, 0x6d, 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 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, 0xb2, 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, 0x19, + 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x57, 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, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x53, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x76, 0x6d, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x1a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, + 0x65, 0x73, 0x73, 0xaa, 0x02, 0x16, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_proxy_vmess_account_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_vmess_account_proto_rawDescData = file_v2ray_com_core_proxy_vmess_account_proto_rawDesc + file_proxy_vmess_account_proto_rawDescOnce sync.Once + file_proxy_vmess_account_proto_rawDescData = file_proxy_vmess_account_proto_rawDesc ) -func file_v2ray_com_core_proxy_vmess_account_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_vmess_account_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_vmess_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_vmess_account_proto_rawDescData) +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_v2ray_com_core_proxy_vmess_account_proto_rawDescData + return file_proxy_vmess_account_proto_rawDescData } -var file_v2ray_com_core_proxy_vmess_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_proxy_vmess_account_proto_goTypes = []interface{}{ +var file_proxy_vmess_account_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_proxy_vmess_account_proto_goTypes = []interface{}{ (*Account)(nil), // 0: v2ray.core.proxy.vmess.Account (*protocol.SecurityConfig)(nil), // 1: v2ray.core.common.protocol.SecurityConfig } -var file_v2ray_com_core_proxy_vmess_account_proto_depIdxs = []int32{ +var file_proxy_vmess_account_proto_depIdxs = []int32{ 1, // 0: v2ray.core.proxy.vmess.Account.security_settings:type_name -> v2ray.core.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 @@ -149,13 +156,13 @@ var file_v2ray_com_core_proxy_vmess_account_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_vmess_account_proto_init() } -func file_v2ray_com_core_proxy_vmess_account_proto_init() { - if File_v2ray_com_core_proxy_vmess_account_proto != nil { +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_v2ray_com_core_proxy_vmess_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_proxy_vmess_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Account); i { case 0: return &v.state @@ -172,18 +179,18 @@ func file_v2ray_com_core_proxy_vmess_account_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_vmess_account_proto_rawDesc, + RawDescriptor: file_proxy_vmess_account_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_vmess_account_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_vmess_account_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_vmess_account_proto_msgTypes, + GoTypes: file_proxy_vmess_account_proto_goTypes, + DependencyIndexes: file_proxy_vmess_account_proto_depIdxs, + MessageInfos: file_proxy_vmess_account_proto_msgTypes, }.Build() - File_v2ray_com_core_proxy_vmess_account_proto = out.File - file_v2ray_com_core_proxy_vmess_account_proto_rawDesc = nil - file_v2ray_com_core_proxy_vmess_account_proto_goTypes = nil - file_v2ray_com_core_proxy_vmess_account_proto_depIdxs = nil + 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/proxy/vmess/account.proto b/proxy/vmess/account.proto index dee0202464..37f7562a2a 100644 --- a/proxy/vmess/account.proto +++ b/proxy/vmess/account.proto @@ -2,14 +2,15 @@ syntax = "proto3"; package v2ray.core.proxy.vmess; option csharp_namespace = "V2Ray.Core.Proxy.Vmess"; -option go_package = "vmess"; +option go_package = "v2ray.com/core/proxy/vmess"; option java_package = "com.v2ray.core.proxy.vmess"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/headers.proto"; +import "common/protocol/headers.proto"; message Account { - // ID of the account, in the form of a UUID, e.g., "66ad4540-b58c-4ad2-9926-ea63445a9b57". + // ID of the account, in the form of a UUID, e.g., + // "66ad4540-b58c-4ad2-9926-ea63445a9b57". string id = 1; // Number of alternative IDs. Client and server must share the same number. uint32 alter_id = 2; diff --git a/proxy/vmess/aead/encrypt.go b/proxy/vmess/aead/encrypt.go index 21bd9467ae..d2d0b1dea7 100644 --- a/proxy/vmess/aead/encrypt.go +++ b/proxy/vmess/aead/encrypt.go @@ -8,6 +8,7 @@ import ( "encoding/binary" "io" "time" + "v2ray.com/core/common" ) @@ -21,8 +22,7 @@ func SealVMessAEADHeader(key [16]byte, data []byte) []byte { aeadPayloadLengthSerializeBuffer := bytes.NewBuffer(nil) - var headerPayloadDataLen uint16 - headerPayloadDataLen = uint16(len(data)) + headerPayloadDataLen := uint16(len(data)) common.Must(binary.Write(aeadPayloadLengthSerializeBuffer, binary.BigEndian, headerPayloadDataLen)) diff --git a/proxy/vmess/aead/encrypt_test.go b/proxy/vmess/aead/encrypt_test.go index 70e9a54038..9e5f7af948 100644 --- a/proxy/vmess/aead/encrypt_test.go +++ b/proxy/vmess/aead/encrypt_test.go @@ -3,9 +3,10 @@ package aead import ( "bytes" "fmt" - "github.com/stretchr/testify/assert" "io" "testing" + + "github.com/stretchr/testify/assert" ) func TestOpenVMessAEADHeader(t *testing.T) { diff --git a/proxy/vmess/encoding/client.go b/proxy/vmess/encoding/client.go index 9ecd74824f..78945532d9 100644 --- a/proxy/vmess/encoding/client.go +++ b/proxy/vmess/encoding/client.go @@ -9,13 +9,9 @@ import ( "crypto/rand" "crypto/sha256" "encoding/binary" - "fmt" "hash" "hash/fnv" "io" - "os" - "strings" - vmessaead "v2ray.com/core/proxy/vmess/aead" "golang.org/x/crypto/chacha20poly1305" @@ -27,6 +23,7 @@ import ( "v2ray.com/core/common/protocol" "v2ray.com/core/common/serial" "v2ray.com/core/proxy/vmess" + vmessaead "v2ray.com/core/proxy/vmess/aead" ) func hashTimestamp(h hash.Hash, t protocol.Timestamp) []byte { @@ -39,6 +36,7 @@ func hashTimestamp(h hash.Hash, t protocol.Timestamp) []byte { // ClientSession stores connection session info for VMess client. type ClientSession struct { + isAEAD bool idHash protocol.IDHash requestBodyKey [16]byte requestBodyIV [16]byte @@ -46,61 +44,39 @@ type ClientSession struct { responseBodyIV [16]byte responseReader io.Reader responseHeader byte - - isAEADRequest bool } // NewClientSession creates a new ClientSession. -func NewClientSession(idHash protocol.IDHash, ctx context.Context) *ClientSession { - randomBytes := make([]byte, 33) // 16 + 16 + 1 - common.Must2(rand.Read(randomBytes)) - - session := &ClientSession{} - - session.isAEADRequest = false - - if ctxValueTestsEnabled := ctx.Value(vmess.TestsEnabled); ctxValueTestsEnabled != nil { - testsEnabled := ctxValueTestsEnabled.(string) - if strings.Contains(testsEnabled, "VMessAEAD") { - session.isAEADRequest = true - } - } - - if vmessexp, vmessexp_found := os.LookupEnv("VMESSAEADEXPERIMENT"); vmessexp_found { - if vmessexp == "y" { - session.isAEADRequest = true - } - if vmessexp == "n" { - session.isAEADRequest = false - } - } +func NewClientSession(isAEAD bool, idHash protocol.IDHash, ctx context.Context) *ClientSession { - if session.isAEADRequest { - fmt.Println("=======VMESSAEADEXPERIMENT ENABLED========") + session := &ClientSession{ + isAEAD: isAEAD, + idHash: idHash, } + randomBytes := make([]byte, 33) // 16 + 16 + 1 + common.Must2(rand.Read(randomBytes)) copy(session.requestBodyKey[:], randomBytes[:16]) copy(session.requestBodyIV[:], randomBytes[16:32]) session.responseHeader = randomBytes[32] - if !session.isAEADRequest { + + if !session.isAEAD { session.responseBodyKey = md5.Sum(session.requestBodyKey[:]) session.responseBodyIV = md5.Sum(session.requestBodyIV[:]) } else { BodyKey := sha256.Sum256(session.requestBodyKey[:]) copy(session.responseBodyKey[:], BodyKey[:16]) - BodyIV := sha256.Sum256(session.requestBodyKey[:]) + BodyIV := sha256.Sum256(session.requestBodyIV[:]) copy(session.responseBodyIV[:], BodyIV[:16]) } - session.idHash = idHash - return session } func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer) error { timestamp := protocol.NewTimestampGenerator(protocol.NowTime(), 30)() account := header.User.Account.(*vmess.MemoryAccount) - if !c.isAEADRequest { + if !c.isAEAD { idHash := c.idHash(account.AnyValidID().Bytes()) common.Must2(serial.WriteUint64(idHash, uint64(timestamp))) common.Must2(writer.Write(idHash.Sum(nil))) @@ -136,7 +112,7 @@ func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writ fnv1a.Sum(hashBytes[:0]) } - if !c.isAEADRequest { + if !c.isAEAD { iv := hashTimestamp(md5.New(), timestamp) aesStream := crypto.NewAesEncryptionStream(account.ID.CmdKey(), iv[:]) aesStream.XORKeyStream(buffer.Bytes(), buffer.Bytes()) @@ -213,7 +189,7 @@ func (c *ClientSession) EncodeRequestBody(request *protocol.RequestHeader, write } func (c *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error) { - if !c.isAEADRequest { + if !c.isAEAD { aesStream := crypto.NewAesDecryptionStream(c.responseBodyKey[:], c.responseBodyIV[:]) c.responseReader = crypto.NewCryptionReader(aesStream, reader) } else { @@ -284,7 +260,7 @@ func (c *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.Respon header.Command = command } } - if c.isAEADRequest { + if c.isAEAD { aesStream := crypto.NewAesDecryptionStream(c.responseBodyKey[:], c.responseBodyIV[:]) c.responseReader = crypto.NewCryptionReader(aesStream, reader) } diff --git a/proxy/vmess/encoding/encoding.go b/proxy/vmess/encoding/encoding.go index f6d0494767..bd601e3aec 100644 --- a/proxy/vmess/encoding/encoding.go +++ b/proxy/vmess/encoding/encoding.go @@ -5,7 +5,7 @@ import ( "v2ray.com/core/common/protocol" ) -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen const ( Version = byte(1) diff --git a/proxy/vmess/encoding/encoding_test.go b/proxy/vmess/encoding/encoding_test.go index bc7eecd33c..c0f938b7d1 100644 --- a/proxy/vmess/encoding/encoding_test.go +++ b/proxy/vmess/encoding/encoding_test.go @@ -43,7 +43,7 @@ func TestRequestSerialization(t *testing.T) { } buffer := buf.New() - client := NewClientSession(protocol.DefaultIDHash, context.TODO()) + client := NewClientSession(true, protocol.DefaultIDHash, context.TODO()) common.Must(client.EncodeRequestHeader(expectedRequest, buffer)) buffer2 := buf.New() @@ -93,7 +93,7 @@ func TestInvalidRequest(t *testing.T) { } buffer := buf.New() - client := NewClientSession(protocol.DefaultIDHash, context.TODO()) + client := NewClientSession(true, protocol.DefaultIDHash, context.TODO()) common.Must(client.EncodeRequestHeader(expectedRequest, buffer)) buffer2 := buf.New() @@ -134,7 +134,7 @@ func TestMuxRequest(t *testing.T) { } buffer := buf.New() - client := NewClientSession(protocol.DefaultIDHash, context.TODO()) + client := NewClientSession(true, protocol.DefaultIDHash, context.TODO()) common.Must(client.EncodeRequestHeader(expectedRequest, buffer)) buffer2 := buf.New() diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index c71c8b3381..680f35ef9f 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -12,19 +12,18 @@ import ( "io/ioutil" "sync" "time" - "v2ray.com/core/common/dice" - vmessaead "v2ray.com/core/proxy/vmess/aead" "golang.org/x/crypto/chacha20poly1305" - "v2ray.com/core/common" "v2ray.com/core/common/bitmask" "v2ray.com/core/common/buf" "v2ray.com/core/common/crypto" + "v2ray.com/core/common/dice" "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" "v2ray.com/core/common/task" "v2ray.com/core/proxy/vmess" + vmessaead "v2ray.com/core/proxy/vmess/aead" ) type sessionId struct { @@ -170,7 +169,7 @@ func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.Request var fixedSizeAuthID [16]byte copy(fixedSizeAuthID[:], buffer.Bytes()) - if foundAEAD == true { + if foundAEAD { vmessAccount = user.Account.(*vmess.MemoryAccount) var fixedSizeCmdKey [16]byte copy(fixedSizeCmdKey[:], vmessAccount.ID.CmdKey()) @@ -375,7 +374,7 @@ func (s *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, wr } else { BodyKey := sha256.Sum256(s.requestBodyKey[:]) copy(s.responseBodyKey[:], BodyKey[:16]) - BodyIV := sha256.Sum256(s.requestBodyKey[:]) + BodyIV := sha256.Sum256(s.requestBodyIV[:]) copy(s.responseBodyIV[:], BodyIV[:16]) } @@ -405,8 +404,7 @@ func (s *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, wr aeadResponseHeaderLengthEncryptionBuffer := bytes.NewBuffer(nil) - var decryptedResponseHeaderLengthBinaryDeserializeBuffer uint16 - decryptedResponseHeaderLengthBinaryDeserializeBuffer = uint16(aeadEncryptedHeaderBuffer.Len()) + decryptedResponseHeaderLengthBinaryDeserializeBuffer := uint16(aeadEncryptedHeaderBuffer.Len()) common.Must(binary.Write(aeadResponseHeaderLengthEncryptionBuffer, binary.BigEndian, decryptedResponseHeaderLengthBinaryDeserializeBuffer)) diff --git a/proxy/vmess/inbound/config.pb.go b/proxy/vmess/inbound/config.pb.go index 6801a920bf..256ce4bcfc 100644 --- a/proxy/vmess/inbound/config.pb.go +++ b/proxy/vmess/inbound/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vmess/inbound/config.proto + package inbound import ( @@ -31,7 +37,7 @@ type DetourConfig struct { func (x *DetourConfig) Reset() { *x = DetourConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[0] + mi := &file_proxy_vmess_inbound_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +50,7 @@ func (x *DetourConfig) String() string { func (*DetourConfig) ProtoMessage() {} func (x *DetourConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[0] + 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 { @@ -57,7 +63,7 @@ func (x *DetourConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use DetourConfig.ProtoReflect.Descriptor instead. func (*DetourConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{0} + return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{0} } func (x *DetourConfig) GetTo() string { @@ -79,7 +85,7 @@ type DefaultConfig struct { func (x *DefaultConfig) Reset() { *x = DefaultConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[1] + mi := &file_proxy_vmess_inbound_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -92,7 +98,7 @@ func (x *DefaultConfig) String() string { func (*DefaultConfig) ProtoMessage() {} func (x *DefaultConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[1] + 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 { @@ -105,7 +111,7 @@ func (x *DefaultConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use DefaultConfig.ProtoReflect.Descriptor instead. func (*DefaultConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{1} + return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{1} } func (x *DefaultConfig) GetAlterId() uint32 { @@ -136,7 +142,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[2] + mi := &file_proxy_vmess_inbound_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -149,7 +155,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[2] + 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 { @@ -162,7 +168,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{2} + return file_proxy_vmess_inbound_config_proto_rawDescGZIP(), []int{2} } func (x *Config) GetUser() []*protocol.User { @@ -193,67 +199,67 @@ func (x *Config) GetSecureEncryptionOnly() bool { return false } -var File_v2ray_com_core_proxy_vmess_inbound_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDesc = []byte{ - 0x0a, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, - 0x64, 0x1a, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 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, 0x40, 0x0a, 0x0d, - 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x07, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x83, - 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, - 0x47, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x44, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x6f, - 0x75, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x12, 0x34, - 0x0a, 0x16, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, - 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x50, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, - 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x07, 0x69, 0x6e, - 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x1e, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x72, 0x65, 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 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, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x40, + 0x0a, 0x0d, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x19, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x07, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, + 0x22, 0x83, 0x02, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x34, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x47, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x44, 0x0a, 0x06, 0x64, 0x65, + 0x74, 0x6f, 0x75, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, + 0x12, 0x34, 0x0a, 0x16, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x14, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x6b, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x22, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x1e, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescData = file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDesc + 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_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescData) +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_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDescData + return file_proxy_vmess_inbound_config_proto_rawDescData } -var file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_v2ray_com_core_proxy_vmess_inbound_config_proto_goTypes = []interface{}{ +var file_proxy_vmess_inbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_proxy_vmess_inbound_config_proto_goTypes = []interface{}{ (*DetourConfig)(nil), // 0: v2ray.core.proxy.vmess.inbound.DetourConfig (*DefaultConfig)(nil), // 1: v2ray.core.proxy.vmess.inbound.DefaultConfig (*Config)(nil), // 2: v2ray.core.proxy.vmess.inbound.Config (*protocol.User)(nil), // 3: v2ray.core.common.protocol.User } -var file_v2ray_com_core_proxy_vmess_inbound_config_proto_depIdxs = []int32{ +var file_proxy_vmess_inbound_config_proto_depIdxs = []int32{ 3, // 0: v2ray.core.proxy.vmess.inbound.Config.user:type_name -> v2ray.core.common.protocol.User 1, // 1: v2ray.core.proxy.vmess.inbound.Config.default:type_name -> v2ray.core.proxy.vmess.inbound.DefaultConfig 0, // 2: v2ray.core.proxy.vmess.inbound.Config.detour:type_name -> v2ray.core.proxy.vmess.inbound.DetourConfig @@ -264,13 +270,13 @@ var file_v2ray_com_core_proxy_vmess_inbound_config_proto_depIdxs = []int32{ 0, // [0:3] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_vmess_inbound_config_proto_init() } -func file_v2ray_com_core_proxy_vmess_inbound_config_proto_init() { - if File_v2ray_com_core_proxy_vmess_inbound_config_proto != nil { +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_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -282,7 +288,7 @@ func file_v2ray_com_core_proxy_vmess_inbound_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -294,7 +300,7 @@ func file_v2ray_com_core_proxy_vmess_inbound_config_proto_init() { return nil } } - file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -311,18 +317,18 @@ func file_v2ray_com_core_proxy_vmess_inbound_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDesc, + RawDescriptor: file_proxy_vmess_inbound_config_proto_rawDesc, NumEnums: 0, NumMessages: 3, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_vmess_inbound_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_vmess_inbound_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_vmess_inbound_config_proto_msgTypes, + 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_v2ray_com_core_proxy_vmess_inbound_config_proto = out.File - file_v2ray_com_core_proxy_vmess_inbound_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_vmess_inbound_config_proto_goTypes = nil - file_v2ray_com_core_proxy_vmess_inbound_config_proto_depIdxs = nil + 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/proxy/vmess/inbound/config.proto b/proxy/vmess/inbound/config.proto index 63caeff811..f4edd7a4cf 100644 --- a/proxy/vmess/inbound/config.proto +++ b/proxy/vmess/inbound/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.proxy.vmess.inbound; option csharp_namespace = "V2Ray.Core.Proxy.Vmess.Inbound"; -option go_package = "inbound"; +option go_package = "v2ray.com/core/proxy/vmess/inbound"; option java_package = "com.v2ray.core.proxy.vmess.inbound"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/user.proto"; +import "common/protocol/user.proto"; message DetourConfig { string to = 1; diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index cf86c87431..9f385be969 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -2,7 +2,7 @@ package inbound -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" diff --git a/proxy/vmess/outbound/config.pb.go b/proxy/vmess/outbound/config.pb.go index 861e41cf0c..0785166891 100644 --- a/proxy/vmess/outbound/config.pb.go +++ b/proxy/vmess/outbound/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: proxy/vmess/outbound/config.proto + package outbound import ( @@ -31,7 +37,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_proxy_vmess_outbound_config_proto_msgTypes[0] + mi := &file_proxy_vmess_outbound_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +50,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_proxy_vmess_outbound_config_proto_msgTypes[0] + 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 { @@ -57,7 +63,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescGZIP(), []int{0} + return file_proxy_vmess_outbound_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetReceiver() []*protocol.ServerEndpoint { @@ -67,49 +73,49 @@ func (x *Config) GetReceiver() []*protocol.ServerEndpoint { return nil } -var File_v2ray_com_core_proxy_vmess_outbound_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 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, 0x50, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x46, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 0x0a, 0x23, 0x63, 0x6f, 0x6d, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x08, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x1f, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x1f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x50, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x46, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x6e, 0x0a, 0x23, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0x50, 0x01, 0x5a, 0x23, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x1f, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescData = file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDesc + 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_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescData) +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_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDescData + return file_proxy_vmess_outbound_config_proto_rawDescData } -var file_v2ray_com_core_proxy_vmess_outbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_proxy_vmess_outbound_config_proto_goTypes = []interface{}{ +var file_proxy_vmess_outbound_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_proxy_vmess_outbound_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.proxy.vmess.outbound.Config (*protocol.ServerEndpoint)(nil), // 1: v2ray.core.common.protocol.ServerEndpoint } -var file_v2ray_com_core_proxy_vmess_outbound_config_proto_depIdxs = []int32{ +var file_proxy_vmess_outbound_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.proxy.vmess.outbound.Config.Receiver:type_name -> v2ray.core.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 @@ -118,13 +124,13 @@ var file_v2ray_com_core_proxy_vmess_outbound_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_proxy_vmess_outbound_config_proto_init() } -func file_v2ray_com_core_proxy_vmess_outbound_config_proto_init() { - if File_v2ray_com_core_proxy_vmess_outbound_config_proto != nil { +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_v2ray_com_core_proxy_vmess_outbound_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -141,18 +147,18 @@ func file_v2ray_com_core_proxy_vmess_outbound_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDesc, + RawDescriptor: file_proxy_vmess_outbound_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_proxy_vmess_outbound_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_proxy_vmess_outbound_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_proxy_vmess_outbound_config_proto_msgTypes, + 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_v2ray_com_core_proxy_vmess_outbound_config_proto = out.File - file_v2ray_com_core_proxy_vmess_outbound_config_proto_rawDesc = nil - file_v2ray_com_core_proxy_vmess_outbound_config_proto_goTypes = nil - file_v2ray_com_core_proxy_vmess_outbound_config_proto_depIdxs = nil + 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/proxy/vmess/outbound/config.proto b/proxy/vmess/outbound/config.proto index 7530988dff..7cbe31a4f6 100644 --- a/proxy/vmess/outbound/config.proto +++ b/proxy/vmess/outbound/config.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.proxy.vmess.outbound; option csharp_namespace = "V2Ray.Core.Proxy.Vmess.Outbound"; -option go_package = "outbound"; +option go_package = "v2ray.com/core/proxy/vmess/outbound"; option java_package = "com.v2ray.core.proxy.vmess.outbound"; option java_multiple_files = true; -import "v2ray.com/core/common/protocol/server_spec.proto"; +import "common/protocol/server_spec.proto"; message Config { repeated v2ray.core.common.protocol.ServerEndpoint Receiver = 1; -} \ No newline at end of file +} diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index 5ab123bb01..8525523977 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -2,7 +2,7 @@ package outbound -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "context" @@ -36,7 +36,7 @@ type Handler struct { func New(ctx context.Context, config *Config) (*Handler, error) { serverList := protocol.NewServerList() for _, rec := range config.Receiver { - s, err := protocol.NewServerSpecFromPB(*rec) + s, err := protocol.NewServerSpecFromPB(rec) if err != nil { return nil, newError("failed to parse server spec").Base(err) } @@ -54,12 +54,12 @@ func New(ctx context.Context, config *Config) (*Handler, error) { } // Process implements proxy.Outbound.Process(). -func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error { +func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error { var rec *protocol.ServerSpec var conn internet.Connection err := retry.ExponentialBackoff(5, 200).On(func() error { - rec = v.serverPicker.PickServer() + rec = h.serverPicker.PickServer() rawConn, err := dialer.Dial(ctx, rec.Destination()) if err != nil { return err @@ -113,10 +113,13 @@ func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer inte input := link.Reader output := link.Writer - ctx = context.WithValue(ctx, vmess.TestsEnabled, user.Account.(*vmess.MemoryAccount).TestsEnabled) + isAEAD := false + if !aead_disabled && len(account.AlterIDs) == 0 { + isAEAD = true + } - session := encoding.NewClientSession(protocol.DefaultIDHash, ctx) - sessionPolicy := v.policyManager.ForLevel(request.User.Level) + session := encoding.NewClientSession(isAEAD, protocol.DefaultIDHash, ctx) + sessionPolicy := h.policyManager.ForLevel(request.User.Level) ctx, cancel := context.WithCancel(ctx) timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) @@ -159,7 +162,7 @@ func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer inte if err != nil { return newError("failed to read header").Base(err) } - v.handleCommand(rec.Destination(), header.Command) + h.handleCommand(rec.Destination(), header.Command) bodyReader := session.DecodeResponseBody(request, reader) @@ -176,6 +179,7 @@ func (v *Handler) Process(ctx context.Context, link *transport.Link, dialer inte var ( enablePadding = false + aead_disabled = false ) func shouldEnablePadding(s protocol.SecurityType) bool { @@ -188,8 +192,14 @@ func init() { })) const defaultFlagValue = "NOT_DEFINED_AT_ALL" + paddingValue := platform.NewEnvFlag("v2ray.vmess.padding").GetValue(func() string { return defaultFlagValue }) if paddingValue != defaultFlagValue { enablePadding = true } + + aeadDisabled := platform.NewEnvFlag("v2ray.vmess.aead.disabled").GetValue(func() string { return defaultFlagValue }) + if aeadDisabled == "true" { + aead_disabled = true + } } diff --git a/proxy/vmess/validator.go b/proxy/vmess/validator.go index 76602c4a43..0bb67854f1 100644 --- a/proxy/vmess/validator.go +++ b/proxy/vmess/validator.go @@ -3,18 +3,21 @@ package vmess import ( + "crypto/hmac" + "crypto/sha256" + "hash" "hash/crc64" "strings" "sync" "sync/atomic" "time" - "v2ray.com/core/common/dice" - "v2ray.com/core/proxy/vmess/aead" "v2ray.com/core/common" + "v2ray.com/core/common/dice" "v2ray.com/core/common/protocol" "v2ray.com/core/common/serial" "v2ray.com/core/common/task" + "v2ray.com/core/proxy/vmess/aead" ) const ( @@ -138,8 +141,10 @@ func (v *TimedUserValidator) Add(u *protocol.MemoryUser) error { v.generateNewHashes(protocol.Timestamp(nowSec), uu) account := uu.user.Account.(*MemoryAccount) - if v.behaviorFused == false { - v.behaviorSeed = crc64.Update(v.behaviorSeed, crc64.MakeTable(crc64.ECMA), account.ID.Bytes()) + if !v.behaviorFused { + hashkdf := hmac.New(func() hash.Hash { return sha256.New() }, []byte("VMESSBSKDF")) + hashkdf.Write(account.ID.Bytes()) + v.behaviorSeed = crc64.Update(v.behaviorSeed, crc64.MakeTable(crc64.ECMA), hashkdf.Sum(nil)) } var cmdkeyfl [16]byte diff --git a/proxy/vmess/vmess.go b/proxy/vmess/vmess.go index 9e22db61d6..6ffb6d46d7 100644 --- a/proxy/vmess/vmess.go +++ b/proxy/vmess/vmess.go @@ -5,4 +5,4 @@ // clients with 'socks' for proxying. package vmess -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/proxy/vmess/vmessCtxInterface.go b/proxy/vmess/vmessCtxInterface.go index edaad06066..5d26f9e5d2 100644 --- a/proxy/vmess/vmessCtxInterface.go +++ b/proxy/vmess/vmessCtxInterface.go @@ -1,3 +1,4 @@ package vmess -const TestsEnabled = "VMessCtxInterface_TestsEnabled" +// example +const AlterID = "VMessCtxInterface_AlterID" diff --git a/release/BUILD b/release/BUILD index d1781878be..24790a95f1 100644 --- a/release/BUILD +++ b/release/BUILD @@ -15,16 +15,11 @@ filegroup( filegroup( name = "systemd", srcs = [ - "config/systemd/v2ray.service", - "config/systemv/v2ray", + "config/systemd/system/v2ray.service", + "config/systemd/system/v2ray@.service", ], ) -filegroup( - name = "doc", - srcs = glob(["doc/*.md"]), -) - filegroup( name = "geodata", srcs = [ @@ -37,343 +32,295 @@ pkg_zip( name = "v2ray_darwin_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_darwin_amd64", - "//infra/control/main:v2ctl_darwin_amd64_sig", "//main:v2ray_darwin_amd64", - "//main:v2ray_darwin_amd64_sig", ], - out = "v2ray-macos.zip", - mappings = gen_mappings("darwin", "amd64"), + out = "v2ray-macos-64.zip", + mappings = gen_mappings("darwin", "amd64", "0"), ) pkg_zip( name = "v2ray_windows_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_windows_amd64", - "//infra/control/main:v2ctl_windows_amd64_sig", "//main:v2ray_windows_amd64", "//main:v2ray_windows_amd64_nowindow", - "//main:v2ray_windows_amd64_nowindow_sig", - "//main:v2ray_windows_amd64_sig", ], out = "v2ray-windows-64.zip", - mappings = gen_mappings("windows", "amd64"), + mappings = gen_mappings("windows", "amd64", "0"), ) pkg_zip( name = "v2ray_windows_x86_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_windows_386", - "//infra/control/main:v2ctl_windows_386_sig", "//main:v2ray_windows_386", "//main:v2ray_windows_386_nowindow", - "//main:v2ray_windows_386_nowindow_sig", - "//main:v2ray_windows_386_sig", ], out = "v2ray-windows-32.zip", - mappings = gen_mappings("windows", "386"), + mappings = gen_mappings("windows", "386", "0"), ) pkg_zip( - name = "v2ray_windows_arm_package", + name = "v2ray_windows_armv7_package", srcs = [ ":config_json", - ":doc", ":geodata", - "//infra/control/main:v2ctl_windows_arm_armv5", - "//infra/control/main:v2ctl_windows_arm_armv5_sig", - "//infra/control/main:v2ctl_windows_arm_armv6", - "//infra/control/main:v2ctl_windows_arm_armv6_sig", - "//infra/control/main:v2ctl_windows_arm_armv7", - "//infra/control/main:v2ctl_windows_arm_armv7_sig", - "//main:v2ray_windows_arm_armv5", - "//main:v2ray_windows_arm_armv5_sig", - "//main:v2ray_windows_arm_armv5_nowindow", - "//main:v2ray_windows_arm_armv5_nowindow_sig", - "//main:v2ray_windows_arm_armv6", - "//main:v2ray_windows_arm_armv6_sig", - "//main:v2ray_windows_arm_armv6_nowindow", - "//main:v2ray_windows_arm_armv6_nowindow_sig", - "//main:v2ray_windows_arm_armv7", - "//main:v2ray_windows_arm_armv7_sig", - "//main:v2ray_windows_arm_armv7_nowindow", - "//main:v2ray_windows_arm_armv7_nowindow_sig", + "//infra/control/main:v2ctl_windows_arm_7", + "//main:v2ray_windows_arm_7", + "//main:v2ray_windows_arm_7_nowindow", ], - out = "v2ray-windows-arm.zip", - mappings = gen_mappings("windows", "arm"), + out = "v2ray-windows-arm32-v7a.zip", + mappings = gen_mappings("windows", "arm", "7"), ) pkg_zip( name = "v2ray_freebsd_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_freebsd_amd64", - "//infra/control/main:v2ctl_freebsd_amd64_sig", "//main:v2ray_freebsd_amd64", - "//main:v2ray_freebsd_amd64_sig", ], out = "v2ray-freebsd-64.zip", - mappings = gen_mappings("freebsd", "amd64"), + mappings = gen_mappings("freebsd", "amd64", "0"), ) pkg_zip( name = "v2ray_freebsd_x86_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_freebsd_386", - "//infra/control/main:v2ctl_freebsd_386_sig", "//main:v2ray_freebsd_386", - "//main:v2ray_freebsd_386_sig", ], out = "v2ray-freebsd-32.zip", - mappings = gen_mappings("freebsd", "386"), + mappings = gen_mappings("freebsd", "386", "0"), ) pkg_zip( name = "v2ray_openbsd_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_openbsd_amd64", - "//infra/control/main:v2ctl_openbsd_amd64_sig", "//main:v2ray_openbsd_amd64", - "//main:v2ray_openbsd_amd64_sig", ], out = "v2ray-openbsd-64.zip", - mappings = gen_mappings("openbsd", "amd64"), + mappings = gen_mappings("openbsd", "amd64", "0"), ) pkg_zip( name = "v2ray_openbsd_x86_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_openbsd_386", - "//infra/control/main:v2ctl_openbsd_386_sig", "//main:v2ray_openbsd_386", - "//main:v2ray_openbsd_386_sig", ], out = "v2ray-openbsd-32.zip", - mappings = gen_mappings("openbsd", "386"), + mappings = gen_mappings("openbsd", "386", "0"), ) pkg_zip( name = "v2ray_dragonfly_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", "//infra/control/main:v2ctl_dragonfly_amd64", - "//infra/control/main:v2ctl_dragonfly_amd64_sig", "//main:v2ray_dragonfly_amd64", - "//main:v2ray_dragonfly_amd64_sig", ], out = "v2ray-dragonfly-64.zip", - mappings = gen_mappings("dragonfly", "amd64"), + mappings = gen_mappings("dragonfly", "amd64", "0"), ) pkg_zip( name = "v2ray_linux_amd64_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_amd64", - "//infra/control/main:v2ctl_linux_amd64_sig", "//main:v2ray_linux_amd64", - "//main:v2ray_linux_amd64_sig", ], out = "v2ray-linux-64.zip", - mappings = gen_mappings("linux", "amd64"), + mappings = gen_mappings("linux", "amd64", "0"), ) pkg_zip( name = "v2ray_linux_x86_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_386", - "//infra/control/main:v2ctl_linux_386_sig", "//main:v2ray_linux_386", - "//main:v2ray_linux_386_sig", ], out = "v2ray-linux-32.zip", - mappings = gen_mappings("linux", "386"), + mappings = gen_mappings("linux", "386", "0"), ) pkg_zip( - name = "v2ray_linux_arm_package", + name = "v2ray_linux_arm64_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", - "//infra/control/main:v2ctl_linux_arm_armv5", - "//infra/control/main:v2ctl_linux_arm_armv5_sig", - "//infra/control/main:v2ctl_linux_arm_armv6", - "//infra/control/main:v2ctl_linux_arm_armv6_sig", - "//infra/control/main:v2ctl_linux_arm_armv7", - "//infra/control/main:v2ctl_linux_arm_armv7_sig", - "//main:v2ray_linux_arm_armv5", - "//main:v2ray_linux_arm_armv5_sig", - "//main:v2ray_linux_arm_armv6", - "//main:v2ray_linux_arm_armv6_sig", - "//main:v2ray_linux_arm_armv7", - "//main:v2ray_linux_arm_armv7_sig", + "//infra/control/main:v2ctl_linux_arm64", + "//main:v2ray_linux_arm64", ], - out = "v2ray-linux-arm.zip", - mappings = gen_mappings("linux", "arm"), + out = "v2ray-linux-arm64-v8a.zip", + mappings = gen_mappings("linux", "arm64", "0"), ) pkg_zip( - name = "v2ray_linux_arm64_package", + name = "v2ray_linux_armv7_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", - "//infra/control/main:v2ctl_linux_arm64", - "//infra/control/main:v2ctl_linux_arm64_sig", - "//main:v2ray_linux_arm64", - "//main:v2ray_linux_arm64_sig", + "//infra/control/main:v2ctl_linux_arm_7", + "//main:v2ray_linux_arm_7", + ], + out = "v2ray-linux-arm32-v7a.zip", + mappings = gen_mappings("linux", "arm", "7"), +) + +pkg_zip( + name = "v2ray_linux_armv6_package", + srcs = [ + ":config_json", + ":geodata", + ":systemd", + "//infra/control/main:v2ctl_linux_arm_6", + "//main:v2ray_linux_arm_6", ], - out = "v2ray-linux-arm64.zip", - mappings = gen_mappings("linux", "arm64"), + out = "v2ray-linux-arm32-v6.zip", + mappings = gen_mappings("linux", "arm", "6"), ) pkg_zip( - name = "v2ray_linux_mips_package", + name = "v2ray_linux_armv5_package", + srcs = [ + ":config_json", + ":geodata", + ":systemd", + "//infra/control/main:v2ctl_linux_arm_5", + "//main:v2ray_linux_arm_5", + ], + out = "v2ray-linux-arm32-v5.zip", + mappings = gen_mappings("linux", "arm", "5"), +) + +pkg_zip( + name = "v2ray_linux_mips32_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_mips", - "//infra/control/main:v2ctl_linux_mips_sig", "//infra/control/main:v2ctl_linux_mips_softfloat", - "//infra/control/main:v2ctl_linux_mips_softfloat_sig", "//main:v2ray_linux_mips", - "//main:v2ray_linux_mips_sig", "//main:v2ray_linux_mips_softfloat", - "//main:v2ray_linux_mips_softfloat_sig", ], - out = "v2ray-linux-mips.zip", - mappings = gen_mappings("linux", "mips"), + out = "v2ray-linux-mips32.zip", + mappings = gen_mappings("linux", "mips", "0"), ) pkg_zip( - name = "v2ray_linux_mipsle_package", + name = "v2ray_linux_mips32le_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_mipsle", - "//infra/control/main:v2ctl_linux_mipsle_sig", "//infra/control/main:v2ctl_linux_mipsle_softfloat", - "//infra/control/main:v2ctl_linux_mipsle_softfloat_sig", "//main:v2ray_linux_mipsle", - "//main:v2ray_linux_mipsle_sig", "//main:v2ray_linux_mipsle_softfloat", - "//main:v2ray_linux_mipsle_softfloat_sig", ], - out = "v2ray-linux-mipsle.zip", - mappings = gen_mappings("linux", "mipsle"), + out = "v2ray-linux-mips32le.zip", + mappings = gen_mappings("linux", "mipsle", "0"), ) pkg_zip( name = "v2ray_linux_mips64_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_mips64", - "//infra/control/main:v2ctl_linux_mips64_sig", "//main:v2ray_linux_mips64", - "//main:v2ray_linux_mips64_sig", ], out = "v2ray-linux-mips64.zip", - mappings = gen_mappings("linux", "mips64"), + mappings = gen_mappings("linux", "mips64", "0"), ) pkg_zip( name = "v2ray_linux_mips64le_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_mips64le", - "//infra/control/main:v2ctl_linux_mips64le_sig", "//main:v2ray_linux_mips64le", - "//main:v2ray_linux_mips64le_sig", ], out = "v2ray-linux-mips64le.zip", - mappings = gen_mappings("linux", "mips64le"), + mappings = gen_mappings("linux", "mips64le", "0"), +) + +pkg_zip( + name = "v2ray_linux_riscv64_package", + srcs = [ + ":config_json", + ":geodata", + ":systemd", + "//infra/control/main:v2ctl_linux_riscv64", + "//main:v2ray_linux_riscv64", + ], + out = "v2ray-linux-riscv64.zip", + mappings = gen_mappings("linux", "riscv64", "0"), ) pkg_zip( name = "v2ray_linux_s390x_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_s390x", - "//infra/control/main:v2ctl_linux_s390x_sig", "//main:v2ray_linux_s390x", - "//main:v2ray_linux_s390x_sig", ], out = "v2ray-linux-s390x.zip", - mappings = gen_mappings("linux", "s390x"), + mappings = gen_mappings("linux", "s390x", "0"), ) pkg_zip( name = "v2ray_linux_ppc64_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_ppc64", - "//infra/control/main:v2ctl_linux_ppc64_sig", "//main:v2ray_linux_ppc64", - "//main:v2ray_linux_ppc64_sig", ], out = "v2ray-linux-ppc64.zip", - mappings = gen_mappings("linux", "ppc64"), + mappings = gen_mappings("linux", "ppc64", "0"), ) pkg_zip( name = "v2ray_linux_ppc64le_package", srcs = [ ":config_json", - ":doc", ":geodata", ":systemd", "//infra/control/main:v2ctl_linux_ppc64le", - "//infra/control/main:v2ctl_linux_ppc64le_sig", "//main:v2ray_linux_ppc64le", - "//main:v2ray_linux_ppc64le_sig", ], out = "v2ray-linux-ppc64le.zip", - mappings = gen_mappings("linux", "ppc64le"), + mappings = gen_mappings("linux", "ppc64le", "0"), ) diff --git a/release/bleedingrelease.sh b/release/bleedingrelease.sh index a2293992f1..1b3c0312da 100755 --- a/release/bleedingrelease.sh +++ b/release/bleedingrelease.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash -RELBODY="https://www.v2ray.com/chapter_00/01_versions.html" +RELBODY="https://github.com/v2fly/v2ray-core/commit/${RELEASE_SHA}" JSON_DATA=$(echo "{}" | jq -c ".tag_name=\"${RELEASE_TAG}\"") JSON_DATA=$(echo ${JSON_DATA} | jq -c ".prerelease=${PRERELEASE}") JSON_DATA=$(echo ${JSON_DATA} | jq -c ".body=\"${RELBODY}\"") @@ -28,26 +28,29 @@ function upload() { uploadfile $DGST } -ART_ROOT=$GOPATH/src/v2ray.com/core/bazel-bin/release +ART_ROOT=${WORKDIR}/bazel-bin/release pushd ${ART_ROOT} { go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen version ${RELEASE_TAG} go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen project "v2flyunstable" - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-macos.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-macos-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-32.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-arm.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-arm32-v7a.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-32.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm64.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm64-v8a.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v7a.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v6.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v5.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64le.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mipsle.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32le.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64le.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-riscv64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-s390x.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-32.zip @@ -65,20 +68,23 @@ pushd ${ART_ROOT} go run github.com/xiaokangwang/V2BuildAssist/v2buildutil post commit "${RELEASE_SHA}" < buildcomment popd -upload ${ART_ROOT}/v2ray-macos.zip +upload ${ART_ROOT}/v2ray-macos-64.zip upload ${ART_ROOT}/v2ray-windows-64.zip upload ${ART_ROOT}/v2ray-windows-32.zip -upload ${ART_ROOT}/v2ray-windows-arm.zip +upload ${ART_ROOT}/v2ray-windows-arm32-v7a.zip upload ${ART_ROOT}/v2ray-linux-64.zip upload ${ART_ROOT}/v2ray-linux-32.zip -upload ${ART_ROOT}/v2ray-linux-arm.zip -upload ${ART_ROOT}/v2ray-linux-arm64.zip +upload ${ART_ROOT}/v2ray-linux-arm64-v8a.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v7a.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v6.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v5.zip upload ${ART_ROOT}/v2ray-linux-mips64.zip upload ${ART_ROOT}/v2ray-linux-mips64le.zip -upload ${ART_ROOT}/v2ray-linux-mips.zip -upload ${ART_ROOT}/v2ray-linux-mipsle.zip +upload ${ART_ROOT}/v2ray-linux-mips32.zip +upload ${ART_ROOT}/v2ray-linux-mips32le.zip upload ${ART_ROOT}/v2ray-linux-ppc64.zip upload ${ART_ROOT}/v2ray-linux-ppc64le.zip +upload ${ART_ROOT}/v2ray-linux-riscv64.zip upload ${ART_ROOT}/v2ray-linux-s390x.zip upload ${ART_ROOT}/v2ray-freebsd-64.zip upload ${ART_ROOT}/v2ray-freebsd-32.zip diff --git a/release/config/geoip.dat b/release/config/geoip.dat index 2c46db7a48..6ac4e5c134 100644 Binary files a/release/config/geoip.dat and b/release/config/geoip.dat differ diff --git a/release/config/geosite.dat b/release/config/geosite.dat index 4713763779..322bf210e3 100644 --- a/release/config/geosite.dat +++ b/release/config/geosite.dat @@ -1,3898 +1,3209 @@ - -HUOBI -hbabit.com -hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com + +BILIPLUS biliplus.com + + BRIDGESTONE bridgestone  bandag.cc +bandag.comblizzak-juken.jpbookmybridgestonetyre.combridgestone-asiapacific.combridgestone-bandag.combridgestone-brand.com#bridgestone-business-service.jpbridgestone-korea.co.krbridgestone-plt-eng.combridgestone-tac-oman.combridgestone.clbridgestone.cn +cnbridgestone.co.crbridgestone.co.idbridgestone.co.inbridgestone.co.jpbridgestone.co.thbridgestone.combridgestone.com.arbridgestone.com.brbridgestone.com.cn +cnbridgestone.com.cobridgestone.com.mxbridgestone.com.sgbridgestone.com.twbridgestone.com.vnbridgestoneamericas.combridgestonearena.combridgestonecntc.combridgestonecomercial.clbridgestonecomercial.co.crbridgestonecomercial.com.arbridgestonecomercial.com.brbridgestonecomercial.com.cobridgestonecomercial.com.mxbridgestonegolf.combridgestonegz.combridgestonela.combridgestonemarketing.combridgestonemerchandise.com bridgestonenationalfleet.combridgestoneperformance.com#bridgestoneperformancemedia.net bridgestonerapiddelivery.combridgestonerewards.combridgestonesyb.combridgestonetire.cabridgestonetire.combridgestonetyre.com.mybridgestonevan.combridgestonewx.combs-adreview.com bs-awh.ne.jp  bsw.co.jp +bsw.jpcarcare-and-tireshop.jpdaytontrucktires.com ecoforme.jp gcrtires.comjsbridgestone.commenshin-channel.com monitrix.net mr-tireman.jpmybridgestoneeducation.com playz.jp +potenza.jpprodrive-japan.comstore-bridgestonesports.com thetread.com tiresplus.com cfna.combastropfirestone.comcrossfitfirestone.com firestone.clfirestone.co.crfirestone.com.arfirestone.com.brfirestone.com.cofirestone.com.mxfirestonebpco.comfirestonecomercial.clfirestonecomercial.co.crfirestonecomercial.com.arfirestonecomercial.com.brfirestonecomercial.com.cofirestonecomercial.com.mx!firestonecompleteautocare.comfirestonedrivestore.comfirestoneip.comfirestonerewards.comfirestonetire.cafirestonetire.comhibdontire.comwheelworks.netnokiantyres.cn +cnnokiantyres.com +B +DISQUS +disqus.com disquscdn.comdisqusservice.com +j +IMPERIALCOLLEGE ic.ac.ukimperial.ac.ukimperialbusiness.schoolimperial.insendi.com +z +LINE +lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net +nhncorp.jp +2 + NEWRELIC-ADS"js-agent.newrelic.com +ads +; +UBERuber-assets.com uber.com ubereats.com +_ +FEDORA getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org + + NBCUNIVERSALdreamworks.com cnbc.com +cnbcfm.com  msnbc.com +nbc.co nbc.com nbcnews.comnbcolympics.com nbcsports.com +nbcuni.comnbcuniversal.com s-nbcnews.com peacocktv.comuniversalorlando.comuniversalpictures.com&"universalpicturesinternational.com!universalstudioshollywood.com +% +NGINX  nginx.com  nginx.org +m +WPS +wps.cn  51dzt.com  iciba.com  docer.com kdocs.cn papocket.com  wpspdf.cn + +1PONDO  1pondo.tv + +CCTV cctv.cn cctv.com cctvpic.com chinaepg.cn chinalive.com citv.net.cn cnms.net.cn cntv.cn cntv.com.cn +cctvlib.cncctvlibrary.cncctvlib.com.cncctvlibrary.com.cn +cctvpro.cncctvpro.com.cn  cntvwb.cn gjgbdszt.cngjgbdszt.com.cngjgbdszt.net.cn  ipanda.cn +ipanda.com ipanda.com.cn +ipanda.net livechina.cn livechina.comolympicchannelchina.cn tvcc.cn tvcc.com.cn%!xn--fiq53l6wcx3kp9bc7joo6apn8a.cn%!xn--fiq53l90et9fpncc7joo6apn8a.cn-)xn--fiq53l6wcx3kp9bc7joo6apn8a.xn--fiqs8s%!xn--kprv4ewxfr9cpxcc7joo6apn8a.cn-)xn--kprv4ewxfr9cpxcc7joo6apn8a.xn--fiqs8s zggbdszt.cnzggbdszt.com.cnzggbdszt.net.cnzygbdszt.net.cn  KINDGIRLS kindgirls.com - -VERISIGN verisign.asia verisign.biz verisign.chverisign.co.inverisign.co.uk verisign.comverisign.com.auverisign.com.brverisign.com.esverisign.com.hkverisign.com.sgverisign.com.twverisign.com.vn verisign.de verisign.dk verisign.es verisign.fr verisign.hk verisign.in verisign.info verisign.jobs verisign.mobi verisign.name verisign.net verisign.org verisign.pro verisign.se verisign.sg verisign.tw verisign.us verisign.vnverisigninc.com -& -XNXX xnxx.com xnxx-cdn.com - - YOUKU-ADSactives.youku.com -@ads!ad.api.3g.youku.com -@ads%ad.api.mobile.youku.com -@ads!ad.mobile.youku.com -@ads)a-dxk.play.api.3g.youku.com -@ads atm.youku.com -@ads$b.smartvideo.youku.com -@adsc.yes.youku.com -@adsdas.api.youku.com -@ads"das.mobile.youku.com -@ads"dev-push.m.youku.com -@adsdl.g.youku.com -@adsdmapp.youku.com -@adse.stat.ykimg.com -@ads$gamex.mobile.youku.com -@ads"guanggaoad.youku.com -@ads!hudong.pl.youku.com -@ads"huodong.pl.youku.com -@ads#huodong.vip.youku.com -@ads hz.youku.com -@adsiyes.youku.com -@ads l.ykimg.com -@adslstat.youku.com -@ads!mobilemsg.youku.com -@ads msg.youku.com -@adsmyes.youku.com -@ads p.l.youku.com -@ads pl.youku.com -@ads$passport-log.youku.com -@adsp-log.ykimg.com -@adspush.m.youku.com -@ads r.l.youku.com -@ads s.p.youku.com -@adssdk.m.youku.com -@adsstat.youku.com -@ads%statis.api.3g.youku.com -@ads'store.tv.api.3g.youku.com -@ads'store.xl.api.3g.youku.com -@adstdrec.youku.com -@ads test.ott.youku.com -@ads"test.sdk.m.youku.com -@ads v.l.youku.com -@adsval.api.youku.com -@ads wan.youku.com -@adsykatr.youku.com -@adsykrec.youku.com -@ads -7 - BOOTSTRAPbootstrapcdn.comgetbootstrap.com -& -CLEARBITJS-ADSx.clearbitjs.com +f + TAYLORFRANCIS tandf.co.uktandfonline.comtaylorandfrancis.comtaylorfrancis.com +o +UNITY  unity.com unity3d.com!unityads.unity3d.com +ads#unityads.unitychina.cn +ads +' + WTEAM-ADS ads.wteam.xyz +ads + + CATEGORY-ADS apilog-web.acfun.cn +ads adcolony.com +ads +adjust.com +ads a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +ads amazon-adsystem.com +adsiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +ads applovin.com +ads +applvn.com +ads atom-data.io +adsanalytics-data.io +ads ironbeast.io +ads a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +adsmcs.snssdk.com +adsx.clearbitjs.com +ads bluekai.com +adsfout.jp +ads gmossp-sp.jp +adsi-mobile.co.jp +ads im-apps.net +ads impact-ad.jp +ads ladsp.com +ads microad.co.jp +ads +microad.jp +ads socdm.com +ads emogi.com +adsdata.flurry.com +ads2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +ads!assets.growingio.com +adsmlog.hiido.com +adsylog.hiido.com +adsstatic.hotjar.com +adsclick.hunantv.com +adsda.hunantv.com +ads da.mgtv.com +adslog.hunantv.com +adslog.v2.hunantv.com +adsres.hunantv.com +adsv2.log.hunantv.com +adsinner-active.mobi +adsa.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +adsads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads log-sdk.gifshow.com +adswlog.kuaishou.com +ads leanplum.com +ads#api.game.letvstore.com +ads ark.letv.com +ads dc.letv.com +adsdev.dc.letv.com +ads fz.letv.com +ads g3.letv.com +adsletv.allyes.com +adsminisite.letv.com +adsmsg.m.letv.com +adsn.mark.letv.com +adsplog.dc.letv.com +adspro.hoye.letv.com +ads pro.letv.com +ads stat.letv.com +ads"static.app.m.letv.com +ads decide.mixpanel.com +ads mopub.com +adsevt.mxplay.com +adsanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads"js-agent.newrelic.com +ads ogury.com +ads +presage.io +adsogury.co +ads onesignal.com +adsOB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ +ads cdn.pocoiq.cn +ads oct.pocoiq.cn +adsads.pubmatic.com +adscdn.segment.com +ads"static.sensorsdata.cn +ads 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +adsadnet.sohu.com +ads ads.sohu.com +ads!adv-sv-show.focus.cn +ads aty.sohu.com +adsdata.vod.itc.cn +adsepro.sogou.com +ads go.sohu.com +adsgolden1.sogou.com +adsimp.optaim.com +adsinte.sogou.com +adsinte.sogoucdn.com +adslu.sogoucdn.com +ads pv.sohu.com +adstheta.sogoucdn.com +adstrack.sohu.com +adsuranus.sogou.com +adsv2.reachmax.cn +ads)e8aeb8bbdbbd7.cdn.sohucs.com +ads)643108e7617ef.cdn.sohucs.com +adssupersonic.com +adssupersonicads.com +ads +ssacdn.com +ads)supersonicads-a.akamaihd.net +ads g1.tagtic.cn +adsxy-log.tagtic.cn +adsssp.api.tappx.com +ads ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads uberads.com +adsalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads!unityads.unity3d.com +ads#unityads.unitychina.cn +ads ads.wteam.xyz +ads#collector.xhamster.com +adsad.intl.xiaomi.com +ads ad.mi.com +ads ad.xiaomi.com +adsadmob.xiaomi.com +adsad1.xiaomi.com +adsmistat.xiaomi.com +adstracking.miui.com +adsadv.sec.miui.com +ads"adv.sec.intl.miui.com +ads"misc.in.duokanbox.com +ads ad.hpplay.cn +adsadeng.hpplay.cn +ads kuyun.com +ads umeng.com +ads ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +adsactives.youku.com +ads ad.api.3g.youku.com +ads$ad.api.mobile.youku.com +ads ad.mobile.youku.com +ads(a-dxk.play.api.3g.youku.com +ads atm.youku.com +ads#b.smartvideo.youku.com +adsc.yes.youku.com +adsdas.api.youku.com +ads!das.mobile.youku.com +ads!dev-push.m.youku.com +adsdl.g.youku.com +adsdmapp.youku.com +adse.stat.ykimg.com +ads#gamex.mobile.youku.com +ads!guanggaoad.youku.com +ads hudong.pl.youku.com +ads!huodong.pl.youku.com +ads"huodong.vip.youku.com +ads hz.youku.com +adsiyes.youku.com +ads l.ykimg.com +adslstat.youku.com +ads mobilemsg.youku.com +ads msg.youku.com +adsmyes.youku.com +ads p.l.youku.com +ads pl.youku.com +ads#passport-log.youku.com +adsp-log.ykimg.com +adspush.m.youku.com +ads r.l.youku.com +ads s.p.youku.com +adssdk.m.youku.com +adsstat.youku.com +ads$statis.api.3g.youku.com +ads&store.tv.api.3g.youku.com +ads&store.xl.api.3g.youku.com +adstdrec.youku.com +adstest.ott.youku.com +ads!test.sdk.m.youku.com +ads v.l.youku.com +adsval.api.youku.com +ads wan.youku.com +adsykatr.youku.com +adsykrec.youku.com +ads cvnad.com +ads +iyoowi.com +ads zynga.com +ads#zyngaplayersupport.com +ads 51y5.net a.adtng.com +aaxads.com +ad-srv.netad.api.moji.comad.wang502.com adbutter.netads.trafficjunky.net adtechus.comcfts1tifqr.comcontentabc.comimg-bss.csdn.net imglnkc.com imglnkd.comja2.gamersky.com jl3.yjaxa.topkepler-37b.com +lqc006.coms4yxaqyq95.comshhs-ydd8x2.yjrmss.cnstatic.javhd.comtrafficfactory.biz adx.36kr.comclick.ali213.netpbmp.ali213.net^pinggai\d\.caixin\.com$adq.chinaso.comstat.chinaso.com toboads.comdn-growing.qbox.me ad.unimhk.comdas-rpt-log.ucloud.cn adxprtz.com exoclick.com +exosrv.comcdn.advertserve.comcdn.banclip.comcdn.tsyndicate.com +: +ESRI +arcgis.comarcgisonline.com esri.com ++ + MXPLAYER-ADSevt.mxplay.com +ads + +NETFLIX fast.com +netflix.ca netflix.com netflix.netnetflixinvestor.comnetflixtechblog.com nflxext.com nflximg.com nflximg.netnflxsearch.net +nflxso.net nflxvideo.net +# +EDX edx.org edx-cdn.org + + MACRUMORS macrumors.com +S +PORNHUB +phncdn.com phprcdn.com pornhub.compornhubpremium.com  -HQPORNER hqporner.com -u - -ATTWATCHTV -att.tv atttvnow.comattwatchtv.com directv.com  dtvce.comnettyinternet.com - -JUPYTER jupyter.org - -GITHUB -git.io github.blog -github.comgithub.community  github.io githubapp.comgithubassets.comgithubstatus.comgithubusercontent.com atom.io/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com -6 - ZYNGA-ADS  zynga.comzyngaplayersupport.com - -BITTREX bittrex.com -^ -CTEXCEL -ctexcel.ca ctexcel.comctexcel.com.hk -ctexcel.fr -ctexcel.us -Q +RIXCLOUD rixcloud.com += + TRANSLATEWIKItranslatewiki.nettranslatewiki.org + +CATEGORY-CRYPTOCURRENCY asproex.comasproexapi.combinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com +bitbank.cc bitcoin.org bitfinex.com bitflyer.com bitflyer.jp +bitmex.com bitquick.co bisq.io bisq.network bitsquare.io bitstamp.net bittrex.com btcbox.co.jp +cex.io coinbase.com coinone.co.krcoinonecore.comcoinonecorp.com dogecoin.com +devcon.orgethereum.foundation ethereum.org +hbabit.com +hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com +kraken.comlocalbitcoins.comlocalbitcoinschain.com okex.com +paxful.com +zb.app +zb.com zb.io zb.live + + IQIYI-ADSa.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +ads +? +MAFENGWO mafengwo.cn mafengwo.com mafengwo.net + +KRAKEN +kraken.com +/ -DUCKDUCKGOduckduckgo.com duck.com -ddg.ggspreadprivacy.com -V - JETBRAINS jetbrains.com jetbrains.net datalore.iokotlinlang.org - -OUPamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com -ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.com - -PATREON patreon.com -. -XUEQIUdanjuanfunds.com -xueqiu.com - - YUNFANJIASU yfcache.com -yfcalc.com yfcloud.com  yfdts.net  yfp2p.net -yfscdn.net yunfancdn.com -] -BUYPASSbuypass-ssl.com buypass.com -buypass.no -buypass.se minid.no +THEINITIUMtheinitium.com  init.shop +/ +ALIBABA alibaba +alipay +taobao tmall a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com +alicdn.com alidayu.com +alidns.comaliyun-inc.comaliyun-iot-share.com +aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to +ele.me elemecdn.com eleme.cnteambition.comteambition.netteambitionapis.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com +uyunad.comwhalecloud.comalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads 25pp.com  56che.com  95095.com 9game.cn +aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.com alifanyi.comalihealth.com.cn alihealth.hk +aliimg.com +alikmd.com alimama.com alimebot.com +alimei.com alios.cn +alipay.comalipayobjects.com aliplus.comaliresearch.com alisoft.com alisports.com alitianji.comaliunicorn.com +aliway.com aliwork.com alixiaomi.comalizhaopin.com alyms.cn +asczwa.comasczxcefsv.com +asmlink.cn atatech.org +b2byao.com  bazai.com  bcvbw.com  cheng.xin cloudeagle.cn damai.cn dayu.com +dfkhgj.com doctoryou.ai doctoryou.cn dongting.com +dratio.com emas-poc.com +gongyi.xin ialicdn.com iconfont.cn +ics.design +jhgtgb.com +kanbox.com +lazada.comliangxinyao.com m-now.cn +maitix.com  mdeer.com mei.commiaostreet.com  mshare.cc nic.xinphilanthropy.xin phpwind.com phpwind.netqingtingtrip.com  rexpos.cn saee.org.cn shenjing.com  shuqi.comshuqireader.com sparenode.com  supet.com  ttpod.com wandoujia.comxinlingshou.cn yowhale.com yunos-inc.com  yunos.comyushanfang.com +zuodao.comaliexpress.com aliexpress.ru sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com +hemaos.com hemashare.cn shyhhema.com 1688.com etao.com juhuasuan.comlingshoujia.com +mashort.cn pailitao.com +taobao.com +taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmall.ru tmalltv.com tmjl.ai alitrip.com  feizhu.cn +feizhu.com +fliggy.com  fliggy.hk +iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net ++ + ONESIGNAL-ADS onesignal.com +ads + +TLD-CNcn citic baidu +unicomsohu +xn--fiqs8s +xn--fiqz9s xn--1qqw23a xn--xhq521b xn--8y0a063a xn--6frz82g +xn--fiq64b xn--estv75g xn--vuq861b xn--zfr164b + + ZOOMINGIN zoomingin.tv +7 + BOOTSTRAPbootstrapcdn.comgetbootstrap.com + + EPICGAMESbattlebreakers.com epicgames.com fortnite.com paragon.complayparagon.comroborecall.comshadowcomplex.com spyjinx.comunrealengine.comunrealtournament.com6*^cdn\d-epicgames-\d+\.file\.myqcloud\.com$ +cn*&^epicgames-download\d\.akamaized\.net$;/^epicgames-download\d-\d+\.file\.myqcloud\.com$ +cn  -CENTOS -centos.org -X -HULU hulu.com -huluad.com -huluim.com -huluqa.comhulustream.com -6 - RULEOFLAWrolfoundation.orgrolsociety.org +TUMBLR +tumblr.com + -TYPEKIT typekit.com typekit.net - - CATEGORY-DEValpinelinux.org amp.devampproject.comampproject.netampproject.org anaconda.com anaconda.org conda.io android.comandroidify.com -apache.org archlinux.orgarchlinuxarm.org atom.iobootstrapcdn.comgetbootstrap.com -centos.orgchocolatey.org clojure.org -cygwin.com -cython.org dart.dev dartlang.org dartpad.dev -debian.org -dotdeb.org  deno.landcompose-spec.io -docker.com  docker.ioelixir-lang.org -elrepo.org -erlang.org fastlane.cifastlane.tools getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org flutter.devflutterapp.comfontawesome.comfortawesome.com freebsd.org -gentoo.orggetcomposer.org gitbook.com -gitbook.iogitbook.zendesk.com +VAPTCHA vaptcha.com vaptcha.net +U + MICROSOFT azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-sphere.comazure-test.netazure.cn +cn  azure.com  azure.netazurecomcdn.netazurecontainer.ioazurecosmos.netazurecosmosdb.comazurecosmosdb.infoazurecosmosdb.netazuredatabricks.netazuredevopslaunch.comazuredigitaltwin.comazuredigitaltwins.comazuredigitaltwins.netazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazureiotcentral.comazureiotsolutions.comazureiotsuite.comazureplanetscale.infoazureplanetscale.netazureserviceprofiler.comazuresmartspaces.netazurestackvalidation.comazurewebsites.netchinacloudapi.cn +cnchinacloudapp.cn +cnchinacloudsites.cn +cn cosmosdb.info cosmosdb.net devopsms.com gotcosmos.commicrosofteca.commicrosoftiotcentral.comserverlesslibrary.nettryfunctions.comwindowsazure.cn +cnwindowsazure.comazure.microsoft.com"azuremarketplace.microsoft.combing bing.com bing.com.cn +cn bing.net bingads.combingagencyawards.combingapistatistics.combingsandbox.combingvisualsearch.com bingworld.combluehatnights.com +dictate.msflipwithsurface.commasalladeloslimites.commicrosoft-give.commicrosoftcloudsummit.commicrosoftdiplomados.commicrosoftlatamholiday.commicrosoftmxfilantropia.com!microsoftpartnersolutions.commsunlimitedcloudsummit.comoffice365love.comoffice365tw.comrenovacionoffice.comsprinklesapp.com cn.bing.com +cn cn.bing.net +cn ditu.live.com +cnbj1.api.bing.com +cnemoi-cncdn.bing.com +cn atom.io  npmjs.com npm.communitydependabot.com git.io github.blog -github.comgithub.community  github.io githubapp.comgithubassets.comgithubstatus.comgithubusercontent.com atom.io/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com -gitlab.com  gitlab.io -gitlab.netgitlab-static.net.*gitlab-assets.oss-cn-hongkong.aliyuncs.com gnu.org go-lang.com go-lang.net go-lang.org -go.dev  godoc.org -golang.com -golang.net -golang.org  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io haskell.orghaskellstack.org stackage.org brew.sh -ius.iojava java.com java.net -jenkins.io jetbrains.com jetbrains.net datalore.iokotlinlang.org  jfrog.com  jfrog.org bintray.com -jquery.comjquerymobile.com jqueryui.com -js.org jupyter.org kali.org -kernel.orgkotlinlang.org kubernetes.io -k8s.io  linux.orglinuxfromscratch.org linuxmint.com lua.org macports.org mariadb.org  mingw.org mongodb.com mongodb.org  mysql.com  nginx.com  nginx.org  nixos.org -nodejs.orgnodesource.comnotepad-plus-plus.org  npmjs.com npm.community openresty.org openssl.org opensuse.org openwrt.orglede-project.org packagist.org pcre.org perl.org cpan.org metacpan.org phantomjs.org php.netpolymer-project.orgpolymerproject.orgpostgresql.org -python.orgpythonhosted.org pypa.io pypi.org qt.ioqt-project.org r-project.orgraspberrypi.org raspbian.orgreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org redis.io redislabs.com remirepo.net rpmfusion.org ruby-lang.org rubygems.orgscala-lang.org scala-sbt.orgscientificlinux.org -sqlite.org askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.comsublimetext.com  swift.org +github.comgithub.community  github.io githubapp.comgithubassets.comgithubhackathon.comgithubstatus.comgithubusercontent.com/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.comadaptivecards.ioapi-extractor.com +apisof.net appcenter.ms +blazor.netbotframework.comcodethemicrobit.comdevopsassessment.net dot.netgamesstack.comgraphengine.ioinsiderdevtour.com +jwt.ms microbit.orgmicrosoftadc.commicrosoftgamestack.commicrosoftiotinsiderlabs.commicrosoftreactor.cn +cn#microsoftreactor.com.cn +cnmicrosoftreactor.infomicrosoftreactor.netmicrosoftreactor.orgmicrosoftsilverlight.commicrosoftsilverlight.orgmicrosoftsilverlight.netmicrosoftsqlserver.com  mmdnn.commono-project.com msdn.commsinnovationchallenge.commspairlift.commsropendata.com  nuget.org nugettest.orgopentranslatorstothings.orgposhtestgallery.compwabuilder.comreactorms.com.cn +cn +sankie.netsqlserveronlinux.comtimelinestoryteller.comuwpcommunitytoolkit.comvisualstudio-staging.comvisualstudio.comvisualstudio.covisualstudio.co.ukvisualstudio.euvisualstudio.net vfsforgit.com vfsforgit.org vsassets.io xamarin.comdeveloper.microsoft.comdtlgalleryint.cloudapp.net poshtestgallery.cloudapp.net"psg-int-centralus.cloudapp.netpsg-int-eastus.cloudapp.netmicrosoftnews.ccmicrosoftnews.cn +cnmicrosoftnews.commicrosoftnews.netmicrosoftnews.orgmicrosoftnewsforkids.commicrosoftnewsforkids.netmicrosoftnewsforkids.orgmicrosoftnewskids.commicrosoftnewskids.netmicrosoftnewskids.org msn.commsnewskids.commsnewskids.netmsnewskids.org msnkids.com 1drv.com 1drv.mslivefilestore.com onedrive.coonedrive.co.uk onedrive.com onedrive.eu onedrive.net onedrive.orgonedrive.live.comstorage.live.com +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.comcallersbane.com minecraft.netminecraftshop.com +mojang.comforzamotorsport.netforzaracingchampionship.com forzarc.comorithegame.comrenovacionxboxlive.comtellmewhygame.com xbox.co xbox.com xbox.eu xbox.org +xbox360.co xbox360.com +xbox360.eu xbox360.org +xboxab.comxboxgamepass.comxboxgamestudios.com xboxlive.cn +cn xboxlive.com +xboxone.co xboxone.com +xboxone.euxboxplayanywhere.comxboxstudios.com +xbx.lv  microsoft azure hotmail +office skype windowsxbox microsoft.az microsoft.be microsoft.by microsoft.ca microsoft.cat microsoft.ch microsoft.cl microsoft.com microsoft.cz microsoft.de microsoft.dk microsoft.ee microsoft.es microsoft.eu microsoft.fi microsoft.ge microsoft.hu microsoft.io microsoft.is microsoft.it microsoft.jp microsoft.lt microsoft.lu microsoft.lv microsoft.md microsoft.pl microsoft.pt microsoft.red microsoft.ro microsoft.rs microsoft.ru microsoft.se microsoft.si microsoft.tv microsoft.ua microsoft.uz microsoft.vnfemalefounderscomp.com +m12.vc +aka.msankarazirvesi2018.comapplicationinsights.ioapplicationinsights.net aria.ms asp.net aspnetcdn.com +binads.com bluehatil.combrazilpartneruniversity.com breakdown.mecentralvalidation.com +ch9.mscharticulator.com cloudapp.netcloudappsecurity.comcortanaanalytics.comcortanaskills.comcrmdynint-gcc.com crmdynint.comcrossborderexpansion.com docs.com dynamics.com efproject.netazuredigitaltwin.comfasttrackreadysupport.comfluidpreview.comgameuxmasterguide.com +gears5.com gearspop.comgearstactics.com +gfx.ms +gigjam.com hololens.com +hotmail.co hotmail.com +hotmail.eu hotmail.net hotmail.orghummingbird.ms +ie8.co ie9.com ie10.com ie11.cominternetexplorer.cointernetexplorer.com imaginecup.pl +ingads.comintunewiki.comiotinactionevents.com +kidgrid.tvlatampartneruniversity.com live.com live.com.au live.eu live.netlivingyourambition.com makecode.orgmanagedmeetingrooms.commeetfasttrack.commeetyourdevices.com mepn.commicrosoft-int.commicrosoft-ppe.commicrosoft-sap-events.commicrosoft-sbs-domains.commicrosoft-smb.cn +cnmicrosoft365.commicrosoftaccountguard.commicrosoftads.commicrosoftadvertising.com*µsoftadvertisingregionalawards.commicrosoftaffiliates.commicrosoftcloud.commicrosoftcloudworkshop.com"microsoftcommunitytraining.commicrosoftedge.commicrosofthouse.commicrosofthouse.netmicrosoftinternetsafety.netmicrosoftlatamaitour.commicrosoftlinc.commicrosoftonline-p.commicrosoftonline.com!microsoftpartnercommunity.commicrosoftready.commicrosoftsiteselection.commicrosoftstore.commicrosoftstore.com.hkmicrosoftstream.commicrosoftteams.commicrosofttradein.commicrosofttranslator.commicrosoftuwp.commomentumms.commorphcharts.commpnevolution.comms-studiosmedia.comms365surfaceoffer.com  msads.net msauth.cn +cn +msauth.netmschallenge2018.com +msecnd.net +msedge.net  msft.info msft.net msftauth.cn +cn msftauth.netmsfteducation.ca msftnet.orgmsgamesresearch.com +msocdn.com +msocsp.com msturing.orgmsudalosti.commymicrosoft.comnextechafrica.net nxta.orgo365weve-dev.como365weve-ppe.com o365weve.com +office.com +office.net office365.com onenote.com onenote.net onestore.msopticsforthecloud.netoutingsapp.com outlook.com passport.net +pixapp.netpowerappscdn.netpowerautomate.com powerbi.compowershellgallery.comprojectmurphy.netprojectsangam.com +pxt.ios-microsoft.com  s-msn.com sfbassets.com sfbassets.net +sfx.ms sharepoint.cn +cnsharepoint.comsharepointonline.com  skype.com  skype.netskypeassets.comskypeassets.net staffhub.mssuccesswithteams.com surface.com sway-cdn.com sway.comsysinternals.comtailwindtraders.com +techhub.ms tfsallin.nettrafficmanager.nettranslatetheweb.comunlocklimitlesslearning.com +userpxt.iovideobreakdown.comvideoindexer.aivirtualearth.net vsallin.net +wbd.ms what-fan.netwindows-int.net windows.com windows.net +windows.nl windows8.hkwindowscommunity.netwindowsmarketplace.comwindowsphone-int.comwindowsphone.comwindowssearch.comwindowsupdate.com +winhec.com +winhec.net +yammer.comcdn.office.net +cn(dl.delivery.mp.microsoft.com +cn&download.windowsupdate.com +cn'bg.v4.a.dl.ws.microsoft.com +cn(bg4.v4.a.dl.ws.microsoft.com +cn2&cdn.marketplaceimages.windowsphone.com +cn cn.windowssearch.com +cn#ctldl.windowsupdate.com +cn#developer.microsoft.com +cndocs.microsoft.com +cn"download.microsoft.com +cn/#download.visualstudio.microsoft.com +cnfs.microsoft.com +cn(msgr.dlservice.microsoft.com +cn, msgruser.dlservice.microsoft.com +cn#officecdn.microsoft.com +cn&qh.dlservice.microsoft.com +cnsdx.microsoft.com +cn/#silverlight.dlservice.microsoft.com +cn, slupdate.dlservice.microsoft.com +cn, storeedgefd.dsx.mp.microsoft.com +cn&wl.dlservice.microsoft.com +cn&wscont1.apps.microsoft.com +cn&wscont2.apps.microsoft.com +cnwww.microsoft.com +cn&xb.dlservice.microsoft.com +cn/+img-prod-cms-rt-microsoft-com.akamaized.netimg-s-msn-com.akamaized.netmwf-service.akamaized.net)%officecdn-microsoft-com.akamaized.net3/statics-marketingsites-eus-ms-com.akamaized.net40statics-marketingsites-wcus-ms-com.akamaized.net +" + RASPBERRYPIraspberrypi.org + +RUANMEI 6655.com cooldock.com +ithome.com lapin365.com ruanmei.com +saayaa.com win7china.com win8china.com + +AVN avn.com + +CATEGORY-ANTICENSORSHIP ahmia.fi akasha.worldbrowserleaks.combypasscensorship.org citizenlab.cadat.foundationdemocracy.earth eff.orgepicbrowser.com ffprofile.comfreenetproject.org fteproxy.org  gfw.press +gfw.report greatfire.orgguardianproject.infohaveibeenpwned.compwnedpasswords.com +geti2p.net ipfs.io  jitsi.orggetlantern.org +lantern.io  ntc.partyonionshare.org ooni.org openvpn.netprivacytools.io psiphon3.comshadowsocks.org softether.orgsoftether-download.com stunnel.org telex.cctorproject.org tribler.org tunsafe.comtwister.net.co +uproxy.org  v2ray.com +v2ray.cool  v2fly.org vuvuzela.io +whonix.org wikileaks.org wireguard.com +zeronet.io + +CNN cnn.com +cnn.io cnnarabic.com cnnlabs.com cnnmoney.ch cnnmoney.comcnnmoneystream.comcnnpolitics.com +% +IMGIX  imgix.com  imgix.net += +LANDIAN +lancdn.comlandiannews.com  wsoso.com + +TOR onion +/ +XVIDEOS xvideos.comxvideos-cdn.com + + +INFRAPEDIAinfrapedia.com +" + SOUNDOFHOPEsoundofhope.org +0 + COWTRANSFER c-t.workcowtransfer.com + +ELECTRONelectronjs.org + +ALI213 +ali213.net + + CANONICAL launchpad.netlaunchpadlibrarian.comlaunchpadlibrarian.netlaunchpadlibrarian.org snapcraft.io snapstore.io ubuntu.com -ubuntu.netubuntuforums.org  unity.com unity3d.com"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads  unpkg.com -v8.dev v8project.org vim.org wireshark.org x.orgxda-developers.com xda-cdn.com xposed.info yarnpkg.com +ubuntu.netubuntuforums.org canonical.com $ - LOCALPRESSHKlocalpresshk.com - -PHP php.net + FREECODECAMPfreecodecamp.org +W +HAINANAIRLINEShainanairlines.com hnacargo.com  hnair.com 10044.cn +2 +INNER-ACTIVE-ADSinner-active.mobi +ads +' +CODING  coding.me +coding.net  -WEBFLOW webflow.com -? - BONGACAMS bongacams.com -bcicdn.com bcrncdn.com +HKCNEWS hkcnews.com + +0X0 +0x0.st + +CTYUN ctyun.online  PINTEREST pin.it pinimg.com pinterest.at pinterest.be pinterest.ca pinterest.ch pinterest.cl pinterest.copinterest.co.atpinterest.co.inpinterest.co.krpinterest.co.nzpinterest.co.uk pinterest.compinterest.com.aupinterest.com.bopinterest.com.ecpinterest.com.mxpinterest.com.pepinterest.com.pypinterest.com.uypinterest.com.vn pinterest.de pinterest.dk pinterest.ecpinterest.engineering pinterest.es pinterest.fr pinterest.hu pinterest.id pinterest.ie pinterest.inpinterest.info pinterest.it pinterest.jp pinterest.kr pinterest.mx pinterest.nl pinterest.nz pinterest.pe pinterest.ph pinterest.pt pinterest.ru pinterest.se pinterest.th pinterest.tw pinterest.uk pinterest.vnpinterestmail.com - + +SYOSETU syosetu.com +! +MIAOPASIxn--i2ru8q2qg.com + + SONYPICTURESimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com +wwtbam.comyourfantasybeginsnow.com +F -REALVISIONrealvision.com -j -HP -hp.comhpstore-china.com hpstore.com www8-hp.comhpstore.corpmerchandise.com -@ -JQUERY -jquery.comjquerymobile.com jqueryui.com -: -POLYMERpolymer-project.orgpolymerproject.org +TAGTIC-ADS g1.tagtic.cn +adsxy-log.tagtic.cn +ads +9 +ABCabc-studios.com abc.com edgedatg.com +B + APPLOVIN-ADS applovin.com +ads +applvn.com +ads + +DMM-ADS bluekai.com +adsfout.jp +ads gmossp-sp.jp +adsi-mobile.co.jp +ads im-apps.net +ads impact-ad.jp +ads ladsp.com +ads microad.co.jp +ads +microad.jp +ads socdm.com +ads  -EVERNOTE evernote.com +FREENODE freenode.net + +OOKLA-SPEEDTEST  cdnst.net cellmaps.com ekahau.cloud +ekahau.com  ookla.comooklaserver.net pingtest.net speedtest.co speedtest.netspeedtestcustom.com webtest.netOB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ +ads + +PASTEBIN pastebin.com + +TELEGRAM contest.com  graph.orgquiz.directoryt.me tdesktop.com +telega.one +telegra.ph telegram.dog telegram.me telegram.orgtelegram.space +telesco.pe +tg.dev tx.meusercontent.dev +: +WEIPHONE feng.com fengimg.com wfdata.club +2 +ZOOM zoom.com zoom.com.cn zoom.us + +3DM 3dmgame.com ( -GLOBALSECURITYglobalsecurity.org - +DEBIAN +debian.org +dotdeb.org +@ +HAVEIBEENPWNEDhaveibeenpwned.compwnedpasswords.com + -GLOBALSIGNglobalsign-media.com globalsign.be globalsign.chglobalsign.co.ukglobalsign.comglobalsign.com.auglobalsign.com.hkglobalsign.com.sg globalsign.es globalsign.eu globalsign.frglobalsign.net globalsign.nl -~ -HUAWEI hicloud.com hihonor.com honor.cn -huawei.comhuaweicloud.com  vmall.com vmallres.com - -INTEL intel intc.com intel.ca intel.co.id intel.co.il intel.co.jp intel.co.kr intel.co.uk intel.co.za  intel.com intel.com.au intel.com.br intel.com.tr intel.com.tw intel.de intel.es intel.eu intel.fr intel.ie intel.in intel.it intel.la intel.me intel.ph intel.pl intel.ru intel.se intel.sg intel.vnintelrealsense.comresearchintel.com -? -LIEPIN -liepin.com -lietou.comlietou-static.com - -MACPORTS macports.org -{ - STARBUCKS starbucks.castarbucks.co.uk starbucks.com starbucks.de starbucks.fr starbucks.ie - -AHMIA ahmia.fi - -CANON canon c-ij.com canon-cee.comcanon-cmos-sensors.com canon-cna.comcanon-ebm.com.hkcanon-emea.comcanon-emirates.aecanon-europa.comcanon-europe.com canon-me.com canon-ois.qacanon-se.com.tw canon.am canon.at canon.az canon.ba canon.be canon.bg canon.ca canon.ch canon.co.il canon.co.uk canon.co.za  canon.com canon.com.al canon.com.au canon.com.by canon.com.cy canon.com.hk canon.com.mk canon.com.mt canon.com.my canon.com.tr canon.com.tw canon.cz canon.de canon.dk canon.ee canon.es canon.fi canon.fr canon.ge canon.gr canon.hr canon.hu canon.ie canon.it canon.kz canon.lt canon.lu canon.lv canon.me  canon.net canon.nl canon.no canon.pl canon.pt canon.ro canon.rs canon.ru canon.se canon.si canon.sk canon.tj canon.ua canon.uzcanonfoundation.orgcanonproprinters.com - -CATEGORY-CRYPTOCURRENCY asproex.comasproexapi.combinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com -bitbank.cc bitcoin.org bitfinex.com bitflyer.com bitflyer.jp -bitmex.com bitquick.co bisq.io bisq.network bitsquare.io bitstamp.net bittrex.com btcbox.co.jp -cex.io coinbase.com coinone.co.krcoinonecore.comcoinonecorp.com -devcon.orgethereum.foundation ethereum.org -hbabit.com -hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com -kraken.comlocalbitcoins.comlocalbitcoinschain.com okex.com -paxful.com -zb.app -zb.com zb.io zb.live -/ - STARTPAGE startpage.com ixquick.com +VISUALARTS abow.jp angelbeats.jp +anigema.jpcharlotte-anime.jpclannad-movie.jpheaven-burns-red.comkamisama-day.jpkamisama-maeda-lab.com koubaibu.jplitbus-anime.com product.co.jprewrite-anime.tvvisualarts.gr.jpvisual-arts.jp +# +QT qt.ioqt-project.org + +TENCENT dns.pub  dnsapi.cn  dnspod.cn +dnspod.com dnspod.com.cn +dnspod.net +dnspod.org  dnsv1.com  dnsv2.com  dnsv3.com  dnsv4.com  dnsv5.com doh.pub ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads +yuewen.com hongxiu.com lrts.me qdmm.com +qidian.com readnovel.com tingbook.com webnovel.com +xs8.cn xxsy.net +apcdns.net  cdn-go.cn cdntips.com foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn idqqimg.com imqq.com  myapp.com myqcloud.com +qcloud.com qcloudimg.com qlogo.cn qpic.cn +qq.com +qqmail.com  qzone.com +rtx.com.cnservicewechat.com smtcdns.com smtcdns.net +tencent.cn tencent.comtencent.com.cntencent.com.hktencent.net.cntencent-cloud.comtencentmusic.comtencentyun.com +tenpay.com +wechat.com +wegame.com wegame.com.cn +weiyun.com alloyteam.com imweb.io ivweb.io +7 + +LONDONREALfreedomplatform.tv londonreal.tv + +UBI ubi.com ubisoft.com  uplay.com,(ubisoft-uplay-savegames.s3.amazonaws.com,(ubisoft-orbit-savegames.s3.amazonaws.com)uplaypc-s-ubisoft.cdn.ubi.com +cn  - MANMANBUY manmanbuy.com - -CLOJURE clojure.org -f -COURSERAcoursera-for-business.orgcoursera.community coursera.help coursera.org -D -ICBCicbc icbc-ltd.com icbc-us.com icbc.com.cn - -UN -un.org + LARACASTS laracasts.com + +MAYING  maying.co + + SITEPOINT sitepoint.com +M + +STRIKINGLYmystrikingly.comstrikingly.comstrikinglycdn.com + +BITFINEX bitfinex.com 8 - KINGKONGLIVEkingkong.com.twkingkongapp.com - -KNOVEL -knovel.com -m -SUPERSONIC-ADSsupersonic.comsupersonicads.com -ssacdn.com supersonicads-a.akamaihd.net -p -ONEPLUS oneplus.com -oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com -( -DEBIAN -debian.org -dotdeb.org +DMM dmm.com  dmm.co.jpdmm-extension.com + +QMAP qmap.pub + +THESUNdreamteamfc.com  page3.comsunbingo.co.uk talksport.comthescottishsun.co.uk thesun.co.uk  thesun.ie + +XPOSED xposed.info + +AZURE azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-sphere.comazure-test.netazure.cn +cn  azure.com  azure.netazurecomcdn.netazurecontainer.ioazurecosmos.netazurecosmosdb.comazurecosmosdb.infoazurecosmosdb.netazuredatabricks.netazuredevopslaunch.comazuredigitaltwin.comazuredigitaltwins.comazuredigitaltwins.netazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazureiotcentral.comazureiotsolutions.comazureiotsuite.comazureplanetscale.infoazureplanetscale.netazureserviceprofiler.comazuresmartspaces.netazurestackvalidation.comazurewebsites.netchinacloudapi.cn +cnchinacloudapp.cn +cnchinacloudsites.cn +cn cosmosdb.info cosmosdb.net devopsms.com gotcosmos.commicrosofteca.commicrosoftiotcentral.comserverlesslibrary.nettryfunctions.comwindowsazure.cn +cnwindowsazure.comazure.microsoft.com"azuremarketplace.microsoft.com +? + BONGACAMS bongacams.com +bcicdn.com bcrncdn.com +# + DATFOUNDATIONdat.foundation +Z +PICSEE pics.ee  picsee.co +picsee.pro pise.pw pros.ee +pse.is + +ZEETV +z5.app +z5.com zee5.com zee5.in zee5.tvzeebioskop.com zeetv.co.uk  zeetv.com  zeeuk.com +% + +ADJUST-ADS +adjust.com +ads + +BIGHEAD bighead.group + + NEURALINK neuralink.com +6 +UDN udn.com +udn.com.twudnfunlife.com +7 +AMD amd.comamdfanstore.com +radeon.com +8 + +CYBERTRUSTcybertrust.co.jpcybertrust.ne.jp +2 +KU6 ku6.com +ku6cdn.com +ku6img.com  FFPROFILE ffprofile.com - -NIKEnike nike.com nike.com.br nike.com.hk nikecdn.com nikecloud.comnikestore.com.auniketracking.comstatic-nike.com swoo.sh -swoosh.com +w +JWPLAYER +jwpcdn.comjwplatform.com jwplayer.com +jwpltx.com +jwpsrv.comlongtailvideo.com +6 + NORDSTROM nordstrom.comnordstrommedia.com +L +APKPURE apkpure.com cdnpure.com pureapk.com +winudf.com + +LYSOL lizol.co.in lysol.ca lysol.cllysol.cn +cn lysol.co.cr  lysol.com lysol.com.cn +cn lysol.com.mx  lysol.net +- +SURFLITE surflite.co surflite.net + + +TORPROJECTtorproject.org +$ +CSDN csdn.net +csdnimg.cn +< +DOCKERcompose-spec.io +docker.com  docker.io +< +QUIP quip-cdn.com quip.comquipelements.com + +RENZHE renzhe.cloud + +VILAVPN vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz + +DOGECOIN dogecoin.com +! +FREENETfreenetproject.org  -MOOV moov.hk - - BLINKLOADblinkload.zone +GEPH geph.io +L +JSDELIVR jsdelivr.net jsdelivr.comcdn.jsdelivr.net +cn + +YANDEXxn--d1acpjx3f.xn--p1ai  yandex.az  yandex.by yandex.co.il +yandex.com yandex.com.am yandex.com.ge yandex.com.tr  yandex.ee  yandex.kg  yandex.kz  yandex.lt  yandex.lv  yandex.md +yandex.net  yandex.ru  yandex.st  yandex.sx  yandex.tj  yandex.tm  yandex.ua  yandex.uzyandexcloud.net yastatic.net +yandex  -CYTHON -cython.org +NODEJS +nodejs.org + +WTO wto.org  -GCORES -gcores.com - - INMEDIAHK inmediahk.net - -ISGD is.gdv.gd -, - TAPPX-ADSssp.api.tappx.com -@ads - -CNKI cnki.net - -GITV gitv.cn gitv.tv -U -GOOGLE amp.devampproject.comampproject.netampproject.org android.comandroidify.com blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn dart.dev dartlang.org dartpad.dev fastlane.cifastlane.tools flutter.devflutterapp.com go-lang.com go-lang.net go-lang.org -go.dev  godoc.org -golang.com -golang.net -golang.org  admob.com adsense.comadservice.google.comadvertisercommunity.comadvertiserscommunity.comadwords-community.com adwords.comadwordsexpress.comapp-measurement.comclickserver.googleads.comdoubleclick.comdoubleclick.netgoogle-analytics.comgoogleadapis.comgoogleadservices.comgoogleanalytics.comgoogleoptimize.comgooglesyndication.comgoogletagmanager.comgoogletagservices.comgoogletraveladservices.com -urchin.compolymer-project.orgpolymerproject.org -v8.dev v8project.org  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com youtube.comyoutubeeducation.comyoutubegaming.comyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.comand -chromedclkgbizgle gmailgoogoog -googleguge hangout nexus xn--qcka1pmc  google.ad  google.ae  google.al  google.am  google.as  google.at  google.az  google.ba  google.be  google.bf  google.bg  google.bi  google.bj  google.bs  google.bt  google.by  google.ca -google.cat  google.cd  google.cf  google.cg  google.ch  google.ci  google.cl  google.cm google.co.ao google.co.bw google.co.ck google.co.cr google.co.id google.co.il google.co.in google.co.jp google.co.ke google.co.kr google.co.ls google.co.ma google.co.mz google.co.nz google.co.th google.co.tz google.co.ug google.co.uk google.co.uz google.co.ve google.co.vi google.co.za google.co.zm google.co.zw -google.com google.com.af google.com.ag google.com.ai google.com.ar google.com.au google.com.bd google.com.bh google.com.bn google.com.bo google.com.br google.com.bz google.com.co google.com.cu google.com.cy google.com.do google.com.ec google.com.eg google.com.et google.com.fj google.com.gh google.com.gi google.com.gt google.com.hk google.com.jm google.com.kh google.com.kw google.com.lb google.com.ly google.com.mm google.com.mt google.com.mx google.com.my google.com.na google.com.ng google.com.ni google.com.np google.com.om google.com.pa google.com.pe google.com.pg google.com.ph google.com.pk google.com.pr google.com.py google.com.qa google.com.sa google.com.sb google.com.sg google.com.sl google.com.sv google.com.tj google.com.tr google.com.tw google.com.ua google.com.uy google.com.vc google.com.vn  google.cv  google.cz  google.de  google.dj  google.dk  google.dm  google.dz  google.ee  google.es  google.fi  google.fm  google.fr  google.ga  google.ge  google.gg  google.gl  google.gm  google.gr  google.gy  google.hn  google.hr  google.ht  google.hu  google.ie  google.im  google.iq  google.is  google.it  google.je  google.jo  google.kg  google.ki  google.kz  google.la  google.li  google.lk  google.lt  google.lu  google.lv  google.md  google.me  google.mg  google.mk  google.ml  google.mn  google.ms  google.mu  google.mv  google.mw  google.ne  google.nl  google.no  google.nr  google.nu  google.pl  google.pn  google.ps  google.pt  google.ro  google.rs  google.ru  google.rw  google.sc  google.se  google.sh  google.si  google.sk  google.sm  google.sn  google.so  google.sr  google.st  google.td  google.tg  google.tl  google.tm  google.tn  google.to  google.tt  google.vg  google.vu  google.ws 0emm.com  1e100.net  1ucrs.com -466453.com abc.xyz adgoogle.net -admeld.comangulardart.org -api.ai -apigee.com appbridge.ca appbridge.io appbridge.it appspot.com -apture.com area120.com -asp-cc.com autodraw.com bandpage.combaselinestudy.combaselinestudy.org bazel.build bdn.devbeatthatquote.com  blink.org blogblog.com blogger.combrocaproject.com -brotli.org bumpshare.com -bumptop.ca bumptop.com bumptop.net bumptop.org bumptunes.comcampuslondon.com certificate-transparency.org chat.gle -chrome.comchromebook.comchromecast.com chromium.orgcloudburstresearch.comcloudfunctions.netcloudrobotics.comcobrasearch.com codespot.com conscrypt.com conscrypt.orgcookiechoices.org  coova.com  coova.net  coova.orgcrossmediapanel.com crr.com  cs4hs.comdartsearch.netdataliberation.org  debug.comdebugproject.com deepmind.comdevsitetest.howdialogflow.comdigitalassetlinks.org episodic.comfeedburner.com -fflick.comfinanceleadsonline.comfirebaseapp.com -foofle.com froogle.com fuchsia.dev  g-tun.comg.co g.dev -g.pagegerritcodereview.comgetbumptop.com ggoogle.com gipscorp.com globaledu.org  gmail.com gmodules.com  gogle.com -gogole.comgonglchuangl.net -goo.gl -googel.com -googil.com  googl.comgoogle-syndication.com google.berlin -google.dev -google.net -google.orggoogle.ventures"googleacquisitionmigration.comgoogleapis.comgoogleapps.comgooglearth.comgoogleblog.com googlebot.comgooglecapital.comgooglecert.netgooglecode.comgooglecommerce.comgooglecompare.co.ukgoogledanmark.comgoogledomains.comgoogledrive.com googlee.comgoogleearth.comgooglefiber.netgooglefinland.comgooglemail.comgooglemaps.comgooglepagecreator.comgooglephotos.comgoogleplay.comgoogleplus.comgooglescholar.comgooglesource.comgooglestore.comgooglesverige.comgoogleusercontent.comgoogleventures.com -googlr.com -goolge.com gooogle.com gridaware.app gsrc.io gstatic.com -gsuite.com -gv.com gvt0.com gvt1.com gvt2.com gvt3.com gvt5.com gvt6.com gvt7.com gvt9.comhdrplusdata.org hey.gle hindiweb.comhowtogetmo.co.ukhtml5rocks.com hwgo.comiamremarkable.org igoogle.com impermium.com -j2objc.orgjibemobile.com keyhole.comkeytransparency.comkeytransparency.fookeytransparency.org lanternal.com like.commadewithcode.com material.io mdialog.com meet.newmfg-inspector.commobileview.pagemoodstocks.com near.by nest.com nomulus.foo -oauthz.com -ok.gle on.here on2.comonefifteen.netonefifteen.orgoneworldmanystories.com openthread.io openweave.io orbitera.com  page.linkpagespeedmobilizer.com pageview.mobi panoramio.compartylikeits1986.orgpaxlicense.org -picasa.com picasaweb.com picasaweb.net picasaweb.org -picnik.com pittpatt.com postini.comprojectara.comprojectbaseline.compublishproxy.comquestvisual.comquickoffice.com quiksee.com recaptcha.net -revolv.comridepenguin.com run.appsavethedate.foo -saynow.com schemer.comscreenwisetrends.comscreenwisetrendspanel.com snapseed.com solveforx.com -stadia.devstcroixmosquito.comstcroixmosquitoproject.comstudywatchbyverily.comstudywatchbyverily.orgstxmosquito.comstxmosquitoproject.comstxmosquitoproject.netstxmosquitoproject.org synergyse.comtensorflow.org  tfhub.devthecleversense.comthegooglestore.comthinkquarterly.co.ukthinkquarterly.comthinkwithgoogle.com tiltbrush.com txcloud.net  txvia.comunfiltered.news useplannr.comusvimosquito.comusvimosquitoproject.comvelostrata.com -verily.comverilylifesciences.comverilystudyhub.comverilystudywatch.comverilystudywatch.org -wallet.com  waymo.com waze.com web.appwebappfieldguide.comwebmproject.orgwebpkgcache.com -webrtc.orgweltweitwachsen.dewhatbrowser.org widevine.comwithgoogle.com womenwill.comwomenwill.com.br womenwill.id womenwill.in womenwill.mx  x.company -x.team xn--9kr7l.comxn--9trs65b.comxn--flw351e.com xplr.cozukunftswerkstatt.de +APACHE +apache.org  -REMIREPO remirepo.net - -SOHU-ADSadnet.sohu.com -@ads ads.sohu.com -@ads aty.sohu.com -@adsdata.vod.itc.cn -@adsepro.sogou.com -@ads go.sohu.com -@adsgolden1.sogou.com -@adsimp.optaim.com -@adsinte.sogou.com -@adsinte.sogoucdn.com -@adslu.sogoucdn.com -@ads theta.sogoucdn.com -@adsuranus.sogou.com -@adsv2.reachmax.cn -@ads*e8aeb8bbdbbd7.cdn.sohucs.com -@ads*643108e7617ef.cdn.sohucs.com -@ads -( -UDEMY  udemy.com udemycdn.com - -DISNEYadventuresbydisney.com -babble.com -dilcdn.comdisney-plus.net  disney.ca -disney.com disney.com.br  disney.iodisneyaulani.comdisneybaby.comdisneyjunior.comdisneylatino.comdisneymovieinsiders.comdisneyplus.com disneynow.comdisneyredirects.comdisneystore.com -dssott.com -go.commoviesanywhere.complaymation.comshopdisney.com starwars.comthestationbymaker.comthisispolaris.com +CHIPHELL chiphell.com + +DOOM9  doom9.org + + +GLOBALSIGNglobalsign-media.com globalsign.be globalsign.chglobalsign.co.ukglobalsign.comglobalsign.com.auglobalsign.com.hkglobalsign.com.sg globalsign.es globalsign.eu globalsign.frglobalsign.net globalsign.nl!secure.globalsign.com +cnocsp.globalsign.com +cn ocsp2.globalsign.com +cn + +HK01 hk01.com +4 +PERL perl.org cpan.org metacpan.org +T + +PROTONMAIL protonmail.chprotonmail.comprotonstatus.com pm.me + +FFMPEG +ffmpeg.org +# + MOPUB-ADS mopub.com +ads +" + THEPORNDUDEtheporndude.com + +UN +un.org  - LARACASTS laracasts.com -, -MATTERS matters.news matters.one - - HASHICORP  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io -e -METART -metart.commetartnetwork.com metcams.comnaiadsystems.com  nsimg.net + W3SCHOOLS w3schools.com + + MEGAPHONE megaphone.fm +9 +MOGUJIE mogu.com mogucdn.com mogujie.com  -PCRE pcre.org - -BITQUICK bitquick.co +OKEX okex.com +k +SLING dishworld.comslinginternational.com  sling.commovenetworks.com +movetv.com < -DOCKERcompose-spec.io -docker.com  docker.io -J -FLICKR -flickr -flickr.com -flickr.netstaticflickr.com - -MOZILLAmozilla.community mozilla.net mozilla.org bugzilla.org getpocket.comseamonkey-project.orgthunderbird.net firefox.comdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud rust-lang.org  rustup.rs  crates.io docs.rs -% -NGINX  nginx.com  nginx.org -g - ATLASSIAN atlassian.com bitbucket.org statuspage.io -trello.com trellocdn.com -/ -CATEGORY-MEDIA 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au -mi9.com.au -mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au afp.com afpforum.com -ajplus.net aljazeera.com aljazeera.netpalestineremix.comsarajevopodopsadom.comsrebrenica360.com syhacked.comamericasvoice.news -ap.org -apnews.comappledaily.comappledaily.com.hkappledaily.com.tw appledaily.hkapplefruity.comapplehealth.com.hk -atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.com bbc.com  bbc.co.uk -bbci.co.uk bbgwatch.com  boxun.combowenpress.com breitbart.comcabletv.com.hk i-cable.comcaijinglengyan.comchinadecoding.comchinadigitaltimes.net cnbc.com -cnbcfm.com -nbcuni.comnbcudigitaladops.com cnn.com -cnn.io cnnarabic.com cnnlabs.com cnnmoney.ch cnnmoney.comcnnmoneystream.comcnnpolitics.com -cup.com.hk d100.net  anm.co.uk  dailym.aidailymail.co.uk dailymail.comdailymail.com.au dailymail.dkdailymailonline.comdmgmediaprivacy.co.ukmailhealth.commailonline.co.ukmailonline.commailonsunday.co.ukmailonsunday.ie metro.co.uk -mol.imthisismoney.co.uk -thismon.ee -dw.com dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.czfox fox.comfoxbusiness.comfoxcorporation.com -foxdcg.com foxdoua.com -foxfdm.com -foxinc.com -foxneo.comfoxneodigital.com foxnews.com fxnetwork.com foxnewsplayer-a.akamaihd.netfreebeacon.comglobalvoices.orgglobalvoicesonline.org  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com hk01.com hkcnews.com hkopentv.com fantv.hkhongkongfp.comhuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com inmediahk.net jfengtime.com landofhope.tvlocalpresshk.com -ltn.com.tw yes123.com.tw matters.news matters.one -medium.com -myradio.hkmyradio.com.hk newyorker.com -nikkei.com  nikkei.jp nikkei.co.jp now.com -now.com.hk nowe.com -now-tv.comnow-ashare.com ntd.com  ntdtv.com nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.compassiontimes.hk qmap.pubrealvision.com reuters.com -reuters.tvreutersmedia.net rfa.org -rfi.fr rsf.org etvonline.hk rthk.hk scmp.com -i-scmp.comshuziyimin.orgsinoinsider.comsoundofhope.orgtheinitium.com  init.shopthestandnews.com udn.com -udn.com.twudnfunlife.com  unwire.hkamerikaninsesi.comamerikaninsesi.orgamerikaovozi.comamerikayidzayn.comamerikiskhma.com bbg.govdandalinvoa.com darivoa.comdengeamerika.comdengiamerika.comglasamerike.netgolos-ameriki.ru insidevoa.com pashtovoa.com persagg.comradiyoyacuvoa.com urduvoa.com voa.govvoaafaanoromoo.comvoaafrique.comvoabambara.com voabangla.comvoacambodia.comvoacantonese.comvoachinese.comvoadeewanews.comvoadeewaradio.com voahausa.comvoaindonesia.com voakorea.comvoalingala.comvoandebele.com voanews.com -voanews.euvoanoticias.com voanouvel.comvoaportugues.com voashona.com voasomali.comvoaswahili.com voathai.comvoatibetan.comvoatibetanenglish.comvoatiengviet.com voatour.comvoazimbabwe.comzeriamerikes.com cstatic.net -curbed.com  eater.comfunnyordie.com meridian.net polygon.com -racked.com -recode.net sbnation.com theverge.com vox-cdn.com vox.comvoxcreative.comvoxfieldguide.com voxmedia.com -voxops.net warroom.orgwashingtonpost.com watchout.tw -waa.tw -wenzhao.ca -zaobao.com zaobao.com.sg  zaobao.sg zerohedge.com zoomingin.tv - -JAVBUS -javbus.com + YYETS-ADS cvnad.com +ads +iyoowi.com +ads + +CASTRO  castro.fm +' +MOJI moji.com mojichina.com  -SSPLIVE -ssplive.pw - -VOANEWSamerikaninsesi.comamerikaninsesi.orgamerikaovozi.comamerikayidzayn.comamerikiskhma.com bbg.govdandalinvoa.com darivoa.comdengeamerika.comdengiamerika.comglasamerike.netgolos-ameriki.ru insidevoa.com pashtovoa.com persagg.comradiyoyacuvoa.com urduvoa.com voa.govvoaafaanoromoo.comvoaafrique.comvoabambara.com voabangla.comvoacambodia.comvoacantonese.comvoachinese.comvoadeewanews.comvoadeewaradio.com voahausa.comvoaindonesia.com voakorea.comvoalingala.comvoandebele.com voanews.com -voanews.euvoanoticias.com voanouvel.comvoaportugues.com voashona.com voasomali.comvoaswahili.com voathai.comvoatibetan.comvoatibetanenglish.comvoatiengviet.com voatour.comvoazimbabwe.comzeriamerikes.com -/ -ALIBABA alibaba -alipay -taobao tmall a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com -alicdn.com alidayu.com -alidns.comaliyun-inc.comaliyun-iot-share.com -aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to -ele.me elemecdn.com eleme.cnteambition.comteambition.netteambitionapis.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads 25pp.com  56che.com  95095.com 9game.cn -aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.comaliexpress.com alifanyi.comalihealth.com.cn alihealth.hk -aliimg.com -alikmd.com alimama.com alimebot.com -alimei.com alios.cn -alipay.comalipayobjects.com aliplus.comaliresearch.com alisoft.com alisports.com alitianji.comaliunicorn.com -aliway.com aliwork.com alixiaomi.comalizhaopin.com alyms.cn -asczwa.comasczxcefsv.com -asmlink.cn atatech.org -b2byao.com  bazai.com  bcvbw.com  cheng.xin cloudeagle.cn damai.cn dayu.com -dfkhgj.com doctoryou.ai doctoryou.cn dongting.com -dratio.com emas-poc.com -gongyi.xin ialicdn.com iconfont.cn -ics.design -jhgtgb.com -kanbox.com -lazada.comliangxinyao.com m-now.cn -maitix.com  mdeer.com mei.commiaostreet.com  mshare.cc nic.xinphilanthropy.xin phpwind.com phpwind.netqingtingtrip.com  rexpos.cn saee.org.cn shenjing.com  shuqi.comshuqireader.com sparenode.com  supet.com  ttpod.com wandoujia.comxinlingshou.cn yowhale.com yunos-inc.com  yunos.comyushanfang.com -zuodao.com sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com -hemaos.com hemashare.cn shyhhema.com 1688.com etao.com juhuasuan.comlingshoujia.com -mashort.cn pailitao.com -taobao.com -taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmalltv.com tmjl.ai alitrip.com  feizhu.cn -feizhu.com -fliggy.com  fliggy.hk -iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net +SHIELDS +shields.io +. +XDAxda-developers.com xda-cdn.com + +JITSI  jitsi.org + + +LANDOFHOPE landofhope.tv + +SFACG  sfacg.com + +ZOHO zoho.com zoho.com.au zoho.eu zoho.in zohocdn.comzohomeetups.comzohomerchandise.comzohopublic.comzohoschools.comzohostatic.com zohostatic.inzohouniversity.comzohowebstatic.com + +MARIADB mariadb.org + +MOZILLA firefox.comdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud rust-lang.org  rustup.rs  crates.io docs.rsmozilla.community mozilla.net mozilla.org bugzilla.org getpocket.comseamonkey-project.orgthunderbird.net  BITCOIN bitcoin.org - - CHINATELECOM + +VERCEL +now.shvercel-dns.comvercel-status.com +vercel.app +vercel.comzeit-world.co.ukzeit-world.comzeit-world.netzeit-world.org zeit.co zeit.sh zeitworld.com +P +AEROGARDaerogard.com.auaerogard.com.cn +cnaerogardcn.com + +ELSEVIER els-cdn.comelsevier-ae.com elsevier.com elsevier.ioengineeringvillage.com  evise.com +scopus.com +? +GEETEST geetest.com#geetest.datasink.sensorsdata.cn + +HULU +112263.com callhulu.comfindyourlimits.com freehulu.com  hooloo.tv  hoolu.com hoolu.tv hu1u.com huloo.cc huloo.tv hulu.com hulu.tv hulu.ushuluaction.com +huluad.com huluapp.com huluasks.com hulucall.com hulufree.com hulugans.comhulugermany.com +hulugo.com +huluim.comhuluinstantmessenger.com huluitaly.com hulunet.comhulunetwork.com huluplus.comhulupremium.comhulupurchase.com +huluqa.comhulurussia.com huluspain.comhulusports.comhulustream.com huluteam.com +hulutv.com huluusa.comjoinmaidez.com mushymush.tv +myhulu.comoriginalhulu.com payhulu.comregisterhulu.comthehulubraintrust.comwwwhuluplus.com +- +LANTERNgetlantern.org +lantern.io +' +WATCHOUT watchout.tw +waa.tw + +ZDNS zcmbc.com.cn zdns.cn zdns.net.cn zdns.org.cn zdnscloud.biz zdnscloud.cn zdnscloud.comzdnscloud.com.cnzdnscloud.info zdnscloud.netzdnscloud.net.cnzdnscloud.org.cn + +AVGLE  avgle.com +* +DUOWAN +duowan.com dwstatic.com +) +EASYLIST easylist.to lanik.us +, +JAVAjava java.com java.net +| +MEITUAN dianping.com +maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com +* +PAYPALaccount-paypal.infoaccount-paypal.netaccount-paypal.orgaccountpaypal.comaccountpaypal.netaccountpaypal.org anfutong.cn +cn anfutong.comanfutong.com.cn +cn beibao.cn +cn +beibao.com beibao.com.cn +cn bill-safe.combillmelater.combillmelater.infobillmelater.net bml.infobuyfast-paysmart.net cashify.comdevtools-paypal.comexperiencebillmelater.comfundpaypal.com +gmoney.org +i-o-u.infologin-paypal.comlogin-paypal.infomywaytopay.infomywaytopay.net +pa9pal.com paaypal.com  paily.net  paily.org +paipal.com +pavpal.com paydiant.com paylike.com +paypa1.com +paypa1.org paypaal.compaypal-activate.compaypal-activate.infopaypal-activate.orgpaypal-apac.compaypal-apps.compaypal-biz.compaypal-brandcentral.compaypal-business.compaypal-business.netpaypal-business.orgpaypal-cardcash.compaypal-cash.compaypal-center.compaypal-center.infopaypal-center.netpaypal-center.orgpaypal-communication.compaypal-communications.compaypal-communications.netpaypal-community.compaypal-community.netpaypal-comunidad.compaypal-corp.compaypal-database.compaypal-database.uspaypal-donations.compaypal-dynamic.compaypal-engineering.compaypal-europe.compaypal-excelinvoicing.compaypal-exchanges.compaypal-forward.compaypal-galactic.compaypal-gift.compaypal-gifts.compaypal-gpplus.compaypal-here.compaypal-hrsystem.compaypal-innovationlab.compaypal-integration.compaypal-japan.compaypal-knowledge.compaypal-labs.compaypal-latam.compaypal-learning.compaypal-login.compaypal-login.infopaypal-login.orgpaypal-login.uspaypal-luxury.compaypal-mainstreet.netpaypal-marketing.compaypal-media.compaypal-merchantloyalty.compaypal-mobilemoney.compaypal-network.orgpaypal-notice.compaypal-notify.compaypal-online.infopaypal-online.netpaypal-online.orgpaypal-optimizer.compaypal-pages.compaypal-photocard.compaypal-plaza.compaypal-portal.compaypal-prepagata.compaypal-prepagata.netpaypal-prepaid.compaypal-profile.compaypal-proserv.compaypal-qrshopping.orgpaypal-recargacelular.compaypal-redeem.compaypal-referral.compaypal-retail.compaypal-scoop.compaypal-search.compaypal-secure.netpaypal-secure.orgpaypal-security.netpaypal-security.orgpaypal-service.orgpaypal-signin.compaypal-signin.uspaypal-special.compaypal-specialoffers.compaypal-sptam.compaypal-support.compaypal-survey.compaypal-survey.orgpaypal-status.compaypal-team.compaypal-viewpoints.net  paypal.ca +paypal.com paypal.com.cn +cn paypal.com.hk paypal.com.sg  paypal.hk paypal.info  paypal.jp  paypal.me paypal.net.cn +cn paypal.org.cn +cn  paypal.so  paypal.uspaypalbeacon.compaypalbenefits.compaypalbrasil.compaypalcommunity.cn +cnpaypalcommunity.compaypalcommunity.netpaypalcommunity.orgpaypalcorp.compaypalcredit.compaypalcreditcard.compaypalgivingfund.org paypalhere.cn +cnpaypalhere.compaypalhere.com.cn +cnpaypalhere.infopaypalhere.netpaypalhere.org paypalhere.tv paypali.net paypalinc.compaypalindia.compaypalinsuranceservices.org paypall.compaypallabs.com paypalme.com paypalnet.net paypalnet.orgpaypalnetwork.infopaypalnetwork.netpaypalnetwork.orgpaypalobjects.compaypalonline.netpaypalonline.orgpaypalprepagata.compaypalprepagata.netpaypalservice.compaypalshopping.compaypalshopping.netpaypalsurvey.com paypalx.com paypaly.com payppal.com payypal.compdncommunity.com +pp-soc.com ppaypal.com  pppds.com pypl.com  pypl.info pypl.net pypl.tvsecure-paypal.infosecurepaypal.info sslpaypal.orgthepaypalshop.comtheshoppingexpresslane.netwww-paypal.info www-paypal.usxn--bnq297cix3a.cn +cnbraintreegateway.combraintreegateway.tvbraintreepayments.combraintreepayments.infobraintreepayments.orgbraintreepayments.tv!braintreepaymentsolutions.combraintreeps.combriantreepayments.netbriantreepayments.tv card.iogetbraintree.com krakenjs.comloanbuilder.comswiftcapital.com simility.com cashify.netswiftbank.info swiftbank.usswiftfinancial.comswiftfinancial.infoswiftfinancial.netvenmo-touch.com  venmo.com +venmo.info  venmo.net  venmo.org  cash2.comfilipino-music.net +s-xoom.comwebmoneyinfo.com2.wiremoneytoirelandwithxoomeasierandcheaper.com wwwxoom.comxoom-experience.com xoom.com xoom.io xoom.net.cn +cn xoom.us xoomcom.comvenmo.s3.amazonaws.com + +ADDTOANY addtoany.com +, +PAOFUYUN paofu.cloud paofuyun.me + +WIKIHOW wikihow.com + + 4PARADIGM 4paradigm.com + +CYTHON +cython.org + +SECTIGO sectigo.comenterprisessl.comhackerguardian.cominstantssl.comoptimumssl.compositivessl.com + +BLUBRRY blubrry.com +C + SCIENCEDIRECTsciencedirect.comsciencedirectassets.com + +UDACITY udacity.com +* +BOXUN  boxun.combowenpress.com +Q + BANDWAGONHOSTbandwagonhost.com bwh1.net bwh8.net  bwh88.net + +CATEGORY-ADS-ALL7box.vip +adsad-delivery.net +ads adinplay.com +ads adnxs.com +ads!ads.trafficjunky.net +adsadvertserve.com +adscasalemedia.com +ads!contextual.media.net +ads cpmstar.com +ads +demdex.net +ads httpool.com +ads lijit.com +ads1rx.io +ads mfadsrvr.com +adsmgid.com +adsns1p.net +ads openx.net +ads pubmatic.com +adsspotxchange.com +ads +unimhk.com +ads upapi.net +ads taboola.com apilog-web.acfun.cn +ads adcolony.com +ads +adjust.com +ads a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +ads amazon-adsystem.com +adsiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +ads applovin.com +ads +applvn.com +ads atom-data.io +adsanalytics-data.io +ads ironbeast.io +ads a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +adsmcs.snssdk.com +adsx.clearbitjs.com +ads bluekai.com +adsfout.jp +ads gmossp-sp.jp +adsi-mobile.co.jp +ads im-apps.net +ads impact-ad.jp +ads ladsp.com +ads microad.co.jp +ads +microad.jp +ads socdm.com +ads emogi.com +adsdata.flurry.com +ads2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +ads!assets.growingio.com +adsmlog.hiido.com +adsylog.hiido.com +adsstatic.hotjar.com +adsclick.hunantv.com +adsda.hunantv.com +ads da.mgtv.com +adslog.hunantv.com +adslog.v2.hunantv.com +adsres.hunantv.com +adsv2.log.hunantv.com +adsinner-active.mobi +adsa.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +adsads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads log-sdk.gifshow.com +adswlog.kuaishou.com +ads leanplum.com +ads#api.game.letvstore.com +ads ark.letv.com +ads dc.letv.com +adsdev.dc.letv.com +ads fz.letv.com +ads g3.letv.com +adsletv.allyes.com +adsminisite.letv.com +adsmsg.m.letv.com +adsn.mark.letv.com +adsplog.dc.letv.com +adspro.hoye.letv.com +ads pro.letv.com +ads stat.letv.com +ads"static.app.m.letv.com +ads decide.mixpanel.com +ads mopub.com +adsevt.mxplay.com +adsanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads"js-agent.newrelic.com +ads ogury.com +ads +presage.io +adsogury.co +ads onesignal.com +adsOB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ +ads cdn.pocoiq.cn +ads oct.pocoiq.cn +adsads.pubmatic.com +adscdn.segment.com +ads"static.sensorsdata.cn +ads 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +adsadnet.sohu.com +ads ads.sohu.com +ads!adv-sv-show.focus.cn +ads aty.sohu.com +adsdata.vod.itc.cn +adsepro.sogou.com +ads go.sohu.com +adsgolden1.sogou.com +adsimp.optaim.com +adsinte.sogou.com +adsinte.sogoucdn.com +adslu.sogoucdn.com +ads pv.sohu.com +adstheta.sogoucdn.com +adstrack.sohu.com +adsuranus.sogou.com +adsv2.reachmax.cn +ads)e8aeb8bbdbbd7.cdn.sohucs.com +ads)643108e7617ef.cdn.sohucs.com +adssupersonic.com +adssupersonicads.com +ads +ssacdn.com +ads)supersonicads-a.akamaihd.net +ads g1.tagtic.cn +adsxy-log.tagtic.cn +adsssp.api.tappx.com +ads ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads uberads.com +adsalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads!unityads.unity3d.com +ads#unityads.unitychina.cn +ads ads.wteam.xyz +ads#collector.xhamster.com +adsad.intl.xiaomi.com +ads ad.mi.com +ads ad.xiaomi.com +adsadmob.xiaomi.com +adsad1.xiaomi.com +adsmistat.xiaomi.com +adstracking.miui.com +adsadv.sec.miui.com +ads"adv.sec.intl.miui.com +ads"misc.in.duokanbox.com +ads ad.hpplay.cn +adsadeng.hpplay.cn +ads kuyun.com +ads umeng.com +ads ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +adsactives.youku.com +ads ad.api.3g.youku.com +ads$ad.api.mobile.youku.com +ads ad.mobile.youku.com +ads(a-dxk.play.api.3g.youku.com +ads atm.youku.com +ads#b.smartvideo.youku.com +adsc.yes.youku.com +adsdas.api.youku.com +ads!das.mobile.youku.com +ads!dev-push.m.youku.com +adsdl.g.youku.com +adsdmapp.youku.com +adse.stat.ykimg.com +ads#gamex.mobile.youku.com +ads!guanggaoad.youku.com +ads hudong.pl.youku.com +ads!huodong.pl.youku.com +ads"huodong.vip.youku.com +ads hz.youku.com +adsiyes.youku.com +ads l.ykimg.com +adslstat.youku.com +ads mobilemsg.youku.com +ads msg.youku.com +adsmyes.youku.com +ads p.l.youku.com +ads pl.youku.com +ads#passport-log.youku.com +adsp-log.ykimg.com +adspush.m.youku.com +ads r.l.youku.com +ads s.p.youku.com +adssdk.m.youku.com +adsstat.youku.com +ads$statis.api.3g.youku.com +ads&store.tv.api.3g.youku.com +ads&store.xl.api.3g.youku.com +adstdrec.youku.com +adstest.ott.youku.com +ads!test.sdk.m.youku.com +ads v.l.youku.com +adsval.api.youku.com +ads wan.youku.com +adsykatr.youku.com +adsykrec.youku.com +ads cvnad.com +ads +iyoowi.com +ads zynga.com +ads#zyngaplayersupport.com +ads 51y5.net a.adtng.com +aaxads.com +ad-srv.netad.api.moji.comad.wang502.com adbutter.netads.trafficjunky.net adtechus.comcfts1tifqr.comcontentabc.comimg-bss.csdn.net imglnkc.com imglnkd.comja2.gamersky.com jl3.yjaxa.topkepler-37b.com +lqc006.coms4yxaqyq95.comshhs-ydd8x2.yjrmss.cnstatic.javhd.comtrafficfactory.biz adx.36kr.comclick.ali213.netpbmp.ali213.net^pinggai\d\.caixin\.com$adq.chinaso.comstat.chinaso.com toboads.comdn-growing.qbox.me ad.unimhk.comdas-rpt-log.ucloud.cn adxprtz.com exoclick.com +exosrv.comcdn.advertserve.comcdn.banclip.comcdn.tsyndicate.com + + INOREADER inoreader.com + + STCSERVERstc-server.com + +DGTLE  dgtle.com +. +KUAIKAN kkmh.comkuaikanmanhua.com + +REURL reurl.cc + +STUNNEL stunnel.org + +BETHESDA +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.com +s +BMWmini4myminicard.comaboutyourmini.comatlantaminidealers.comgreatergothammini.com!midatlanticbmwmotorcycles.commini-abudhabi.commini-antilles.frmini-bahrain.commini-bosnia.com mini-clubs-international.commini-connected.atmini-connected.bemini-connected.chmini-connected.co.ukmini-connected.commini-connected.czmini-connected.demini-connected.dkmini-connected.eemini-connected.esmini-connected.fimini-connected.frmini-connected.iemini-connected.itmini-connected.ltmini-connected.lumini-connected.lvmini-connected.nlmini-connected.nomini-connected.plmini-connected.ptmini-connected.semini-corporate-sales.com mini-coupe.camini-dubai.com +mini-e.commini-egypt.commini-georgia.commini-grouparchiv.demini-grouparchive.commini-jordan.com mini-ksa.commini-kuwait.commini-lebanon.com mini-me.com mini-oman.commini-qatar.commini-srilanka.commini-stjohns.camini-stjohns.commini-tahiti.commini-vietnam.commini-windsor.camini-windsor.com mini.am mini.at mini.be mini.bg mini.by mini.ca mini.cc mini.ch mini.cl +mini.co.cr +mini.co.id +mini.co.il +mini.co.kr +mini.co.me +mini.co.th +mini.co.uk +mini.co.za mini.com mini.com.ar mini.com.bn mini.com.br mini.com.co mini.com.cy mini.com.do mini.com.ec mini.com.gr mini.com.gt mini.com.hr mini.com.mk mini.com.mo mini.com.mt mini.com.mx mini.com.pa mini.com.pe mini.com.ph mini.com.pl mini.com.py mini.com.sg mini.com.tr mini.com.tw mini.com.uy mini.cz mini.de mini.dk mini.dz mini.es mini.fi mini.fr mini.gp mini.hu mini.ie mini.in mini.is mini.it mini.jp mini.kz mini.lu mini.ma mini.md mini.mq mini.mu mini.my mini.nc mini.nl mini.no mini.pt mini.re mini.ro mini.rs mini.ru mini.se mini.si mini.sk mini.tm mini.tn mini.ua +mini101.caminiargentina.comminibrossard.caminibrossard.com minicanada.caminicaribbean.com miniccrc.ca minicooper.caminidealer.comminidealernet.comminidowntown.caminidowntown.com minidrivingexperienceusa.com minidurham.caminidurham.com  minie.com +minifs.comminigeorgian.caminigrandriver.comminihalifax.caminihalifax.com +minihk.comminiinvasion.caminiitalianjob.comminikelowna.caminikelowna.comminilangley.caminilangley.com minilat.com minilaval.ca minilaval.com minilondon.ca minilondon.cominimarkham.caminimarkham.comminimoncton.caminimoncton.comminimontrealcentre.caminimontroyal.caminimontroyal.comminimotoringrewards.comminimotoringschool.comminimotorsport.commininanaimo.camininanaimo.comminioakville.comminiofmonrovia.comminipetfriendly.comminirichmond.caminirichmond.comminisaskatoon.caminisaskatoon.com minishop.ca minispace.comminispecialoffers.caminispygear.comministcatharines.caministeagathe.comministjohns.caminitakesthestates.comminitoronto.caminitroisrivieres.ca miniusa.comminiusaservice.comminiusatires.comminivalueservice.comminivancouver.caminivaughanwest.caminivaughanwest.comminivictoria.caminivictoria.comminivilledequebec.caminivilledequebec.comminiwholesaleconnect.com miniwidget.caminiwindsor.comminiworkshop.comminiyaletown.capugetsoundmini.comshopminiusa.comsouthfloridamini.com +trmini.comtroisrivieresmini.comyours-customised.mini.combmwapprovedusedbmw.combaltimorebmw.combayareabmw.combmw-abudhabi.combmw-adventskalender.combmw-albania.combmw-antilles.frbmw-art-journey.combmw-arts-design.com bmw-asia.com bmw-auslieferungszentrum.combmw-authority-vehicles.combmw-bahrain.combmw-businessdrive.combmw-calgary.ca bmw-carit.debmw-classic.combmw-clubs-international.combmw-connected-drive.combmw-connecteddrive.aebmw-connecteddrive.atbmw-connecteddrive.bebmw-connecteddrive.bgbmw-connecteddrive.cabmw-connecteddrive.chbmw-connecteddrive.co.nzbmw-connecteddrive.co.ukbmw-connecteddrive.co.zabmw-connecteddrive.combmw-connecteddrive.com.aubmw-connecteddrive.com.brbmw-connecteddrive.com.cybmw-connecteddrive.com.hrbmw-connecteddrive.com.kwbmw-connecteddrive.com.mtbmw-connecteddrive.czbmw-connecteddrive.debmw-connecteddrive.dkbmw-connecteddrive.eebmw-connecteddrive.esbmw-connecteddrive.fibmw-connecteddrive.frbmw-connecteddrive.grbmw-connecteddrive.hubmw-connecteddrive.iebmw-connecteddrive.itbmw-connecteddrive.jpbmw-connecteddrive.krbmw-connecteddrive.ltbmw-connecteddrive.lubmw-connecteddrive.lvbmw-connecteddrive.mxbmw-connecteddrive.mybmw-connecteddrive.nlbmw-connecteddrive.nobmw-connecteddrive.plbmw-connecteddrive.ptbmw-connecteddrive.robmw-connecteddrive.rubmw-connecteddrive.sebmw-connecteddrive.sgbmw-connecteddrive.sibmw-connecteddrive.skbmw-connecteddrive.twbmw-corporate-sales.combmw-diplomatic-sales.combmw-driving-center.co.krbmw-drivingexperience.com bmw-dubai.com +bmw-eg.com bmw-fleet.net bmw-ghana.combmw-golfsport.com bmw-group.com bmw-group.netbmw-grouparchiv.debmw-grouparchives.com +bmw-gta.cabmw-i-pure-impulse.com bmw-i.jp bmw-int1.com bmw-iraq.combmw-jordan.combmw-konzernarchiv.de bmw-ksa.combmw-kuwait.com +bmw-lao.labmw-lebanon.combmw-m-safetycar.com  bmw-m.combmw-mdrivetour.com +bmw-me.combmw-military-sales.combmw-motorcycle.combmw-motorcycles.vnbmw-motorrad-abudhabi.com bmw-motorrad-authorities.combmw-motorrad-dubai.combmw-motorrad-motorsport.com!bmw-motorrad-now-or-never.com&"bmw-motorrad-service-inclusive.combmw-motorrad-test-ride.combmw-motorrad.atbmw-motorrad.bebmw-motorrad.bgbmw-motorrad.bhbmw-motorrad.bobmw-motorrad.cabmw-motorrad.chbmw-motorrad.clbmw-motorrad.cobmw-motorrad.co.idbmw-motorrad.co.krbmw-motorrad.co.nzbmw-motorrad.co.thbmw-motorrad.co.ukbmw-motorrad.co.zabmw-motorrad.combmw-motorrad.com.arbmw-motorrad.com.aubmw-motorrad.com.brbmw-motorrad.com.dobmw-motorrad.com.hrbmw-motorrad.com.mxbmw-motorrad.com.mybmw-motorrad.com.pebmw-motorrad.com.pybmw-motorrad.com.trbmw-motorrad.crbmw-motorrad.czbmw-motorrad.debmw-motorrad.dkbmw-motorrad.dzbmw-motorrad.ecbmw-motorrad.eebmw-motorrad.esbmw-motorrad.fibmw-motorrad.frbmw-motorrad.grbmw-motorrad.gtbmw-motorrad.hubmw-motorrad.inbmw-motorrad.itbmw-motorrad.jpbmw-motorrad.lubmw-motorrad.mabmw-motorrad.nlbmw-motorrad.nobmw-motorrad.pabmw-motorrad.plbmw-motorrad.ptbmw-motorrad.robmw-motorrad.rsbmw-motorrad.rubmw-motorrad.sabmw-motorrad.sebmw-motorrad.sibmw-motorrad.skbmw-motorrad.svbmw-motorrad.twbmw-motorrad.uabmw-motorrad.uybmw-motorsport.combmw-mountains.combmw-museum.combmw-museum.netbmw-nigeria.com bmw-oman.com bmw-ottawa.cabmw-pakistan.combmw-plant-munich.combmw-pma.com.sgbmw-powertrain.combmw-product-highlights.com bmw-qatar.combmw-routes.com +bmw-rp.combmw-rrdays.combmw-saudiarabia.combmw-security-vehicles.combmw-special-sales.combmw-sports.com bmw-sudan.combmw-tahiti.combmw-tunisia.combmw-vancouver.ca bmw-voli.me bmw-welt.com bmw-welt.net bmw-welt.tvbmw-werk-berlin.de bmw-world.com bmw-world.net bmw-world.tvbmw-worldfinal.combmw-yachtsport.com +bmw-yeg.ca bmw-yemen.com +bmw.am +bmw.at +bmw.az +bmw.ba +bmw.bb +bmw.be +bmw.bg +bmw.bm +bmw.bs +bmw.by +bmw.ca +bmw.cc +bmw.ch +bmw.cl  bmw.co.ao  bmw.co.cr  bmw.co.id  bmw.co.il  bmw.co.jp  bmw.co.ke  bmw.co.kr  bmw.co.nz  bmw.co.th  bmw.co.uk  bmw.co.za bmw.com +bmw.com.ar +bmw.com.au +bmw.com.bd +bmw.com.bn +bmw.com.bo +bmw.com.br +bmw.com.cn +cn +bmw.com.co +bmw.com.cy +bmw.com.do +bmw.com.ec +bmw.com.ge +bmw.com.gt +bmw.com.kh +bmw.com.ky +bmw.com.mk +bmw.com.mo +bmw.com.mt +bmw.com.mx +bmw.com.my +bmw.com.ni +bmw.com.pa +bmw.com.pe +bmw.com.ph +bmw.com.py +bmw.com.sg +bmw.com.sv +bmw.com.tr +bmw.com.tw +bmw.com.uy +bmw.com.ve +bmw.cw +bmw.cz +bmw.de +bmw.dk +bmw.dz +bmw.ee +bmw.es +bmw.fi +bmw.fr +bmw.gp +bmw.gr +bmw.hn +bmw.hr +bmw.ht +bmw.hu +bmw.ie +bmw.in +bmw.is +bmw.it +bmw.kg +bmw.kz +bmw.lc +bmw.lk +bmw.lt +bmw.lu +bmw.lv +bmw.ly +bmw.ma +bmw.md +bmw.mn +bmw.mq +bmw.mu +bmw.nc +bmw.nl +bmw.no +bmw.pl +bmw.ps +bmw.pt +bmw.re +bmw.ro +bmw.rs +bmw.se +bmw.si +bmw.sk +bmw.sn +bmw.tm +bmw.tt +bmw.ua +bmw.uz +bmw.vn bmwarchiv.at bmwarchiv.debmwartjourney.com bmwasia.combmwauslieferungszentrum.com bmwbikes.com  bmwbkk.de +bmwccrc.cabmwcenternet.combmwchampionship.combmwchampionshipusa.combmwcharitygolf.combmwcitychallenge.combmwclassic.combmwcolorado.combmwconnecteddrive.combmwcustomapparel.com bmwdcsnet.netbmwdealercareers.combmwdealerdirect.combmwdelawarevalley.com bmwfilms.combmwgroup-classic-heart.combmwgroup-classic.combmwgroup-gaad.combmwgroup-plants.combmwgroup-posdigital.combmwgroup-werke.com bmwgroup.at bmwgroup.com bmwgroup.net bmwgroup.jobsbmwgroupclassic.combmwgroupdesignworks.combmwgroupdirect.combmwgroupfs.combmwgroupinfobahn.combmwgroupna.com  bmwhk.com bmwi.ca bmwi.jpbmwiventures.combmwjamaica.com +bmwlat.combmwlifestyle.ca bmwm.combmwmagazine.combmwmagazine.de bmwmass.com bmwmass.net  bmwmc.netbmwmontreal.cabmwmotorcycles.combmwmotorcycleusa.combmwmotorrad.co.krbmwmotorrad.com.aubmwmotorrad.com.phbmwmotorrad.com.sgbmwmotorradhk.combmwmotorshowblog.combmwmotorsport.combmwmperformance.com bmwmuseum.netbmwmyanmar.combmwofannapolis.combmwofcentralpa.combmwoftulsa.combmwondemandusa.com bmworegon.combmwperformancecenter.combmwpittsburgh.combmwproductnews.com bmwsafari.com +bmwsfl.com +bmwsfl.net +bmwshop.cabmwspecialoffers.ca bmwsports.combmwstartupgarage.com bmwstep.combmwstepconnections.combmwsummerschool.combmwtampabay.com +bmwusa.combmwusatires.combmwusaservice.combmwusfactory.combmwusrideracademy.combmwvalueservice.combmwwholesaleconnect.com bmwworld.com bmwworld.net bmwworld.tvbmwzentrum.combrand-protection-team.comcencoastbmw.com chargenow.comchargenowusa.comchicagolandbmw.comconnected-drive.com daytonbmw.comdealerspeed.net desertbmw.com dreambmw.ca grupobmw.com guambmw.comhackthedrive.com hawaiibmw.com iaablog.comlasvegasbmw.com m-power.comminneapolisbmw.comminneapolisbmw.netmotorshowblog.com mybmw.ca  mybmw.comnewhampshirebmw.com  nmbmw.comocbmwdealers.comoffresspecialesbmw.ca park-now.com parkinfo.com +pdxbmw.com +phxbmw.compre-bmwgroup.jobspugetsoundbmw.com rentaride.com rentaride.derhodeislandbmw.comsdcountybmw.comshopbmwmotorcycles.comshopbmwusa.com socalbmw.comstlouisbmw.netthe-m-festival.comtristatebmw.comvancouverbmwretailers.cawashingtondcbmw.com alfera.com.hk alfera.com.my  alfera.in  alfera.myalphera-finance.co.inalphera-finance.com.hkalphera-finance.in +alphera.ca alphera.co.in alphera.co.nz alphera.comalphera.com.esalphera.com.hkalphera.com.my +alphera.de +alphera.es +alphera.ie +alphera.in +alphera.my alphera.netalpherafinance.com.hkalpherafinancialservices.esalpherafinancialservices.in alpherafs.caalpherafs.co.nzalpherafs.com.hkalpherafs.com.my alpherafs.ie alpherafs.in alpherafs.my premiumfs.de alphabet.asia alphabet.at alphabet.be alphabet.biz alphabet.chalphabet.co.hualphabet.co.ukalphabet.co.za alphabet.comalphabet.com.cn +cnalphabet.com.esalphabet.com.lvalphabet.com.mxalphabet.com.plalphabet.com.pt alphabet.cz alphabet.de alphabet.es alphabet.eu alphabet.fr alphabet.info alphabet.jp alphabet.lt alphabet.lu alphabet.lv alphabet.mxalphabet.net.cn +cn alphabet.noalphabet.org.uk alphabet.pl alphabet.pt alphabet.uk alphabet.usalphabetfinance.netelectricluxury.comrolls-roycecullinan.comrolls-roycemotorcars.comrolls-roycemotorcarsna.com  rrtis.comspiritofecstasy.com +^ +CTEXCEL ctexcel.ca ctexcel.comctexcel.com.hk ctexcel.fr -ctexcel.us -189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com -chntel.com +ctexcel.us +. +NETLIFY netlify.combitballoon.com +f +PHOENIX  ifeng.com ifengimg.comphoenixcenter.cn fengedu.comifengweekly.com +H +ACFUN acfun.cn aixifan.com apilog-web.acfun.cn +ads +B +HASKELL haskell.orghaskellstack.org stackage.org + +HBO cinemax.comforthethrone.com hbo.com hboasia.com  hbogo.com hbogoasia.com hbogoasia.hk +hbomax.com +hbonow.com  maxgo.com + +JINJIANG  jjwxc.net + + HELLOFONT hellofont.cnhellowebfont.com0,hellofontpreview.oss-cn-beijing.aliyuncs.com-)hellowebfonts.oss-cn-beijing.aliyuncs.com +4 + ARCHLINUX archlinux.orgarchlinuxarm.org + + CATEGORY-ORGS aomedia.org archive.org  atypi.org +change.org ccstatic.orgcreativecommons.orgcreativecommons.engineeringlicensebuttons.net csis.orgcsis-prod.s3.amazonaws.comemojipedia.orgworldemojiawards.comworldemojiday.com xn--yt8h.laglobalsecurity.org ieee.org ieee.tvtryengineering.org ieee-ccnc.org ieee-ecce.org ieeemce.orgstandardsuniversity.orgieee-region6.org ieee.ca ieeer10.org +ieeer5.org +ieeer8.org ieeeusa.orgieeefoundation.orgieee-into-focus.org ieee-vics.org ieeeday.orgdatasheets360.comglobalspec.com ieee-isto.orgtechstreet.com computer.org +comsoc.org embs.org emcs.org grss-ieee.org ieee-aess.org ieee-cas.org ieee-ceda.orgieee-edusociety.org ieee-ies.org ieee-ims.org ieee-npss.org ieee-pels.org ieee-pes.org ieee-ras.orgieee-sensors.org ieee-tems.org ieee-uffc.org ieeeaps.org ieeecsc.org ieeecss.org ieeedeis.orgieeemagnetics.org ieeenano.org ieeeoes.org ieeesmc.orgieeesystemscouncil.org  itsoc.org mtt.orgphotonicssociety.orgsignalprocessingsociety.orgtechnologyandsociety.org vtsociety.org ietf.org itu.int nist.gov time.gov openmaps.orgopenstreetmap.comopenstreetmap.netopenstreetmap.orgopenstreetmaps.org osm.orgosmfoundation.orgstateofthemap.comstateofthemap.orgrolfoundation.orgrolsociety.org  smpte.org +un.org +w3.org who.int wto.org +u +CREATIVECOMMONS ccstatic.orgcreativecommons.orgcreativecommons.engineeringlicensebuttons.net +% +DEMOCRACYEARTHdemocracy.earth + +EPOCHMEDIAGROUP dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.cz + +LG +lg.com lgappstv.com  lge.co.kr lge.comlgecareers.com +lghvac.comlghvacstory.comlgrecyclingprogram.comlgsalesportal.comlgelectronics.122.2o7.net +. +SXL mysxl.cn +sxl.cn  sxlcdn.cn + +XHAMSTER xhamster.comxhamsterlive.com  xhcdn.comwidgets.stripst.com#collector.xhamster.com +ads +& + CHINADECODINGchinadecoding.com +5 +V2RAY  v2ray.com +v2ray.cool  v2fly.org +4 +ZB +zb.app +zb.com zb.io zb.live +% +ZHIHU  zhihu.com  zhimg.com +( +CAIJINGLENGYANcaijinglengyan.com + +CDNJS  cdnjs.com + +DISCORD +discord.co discord.com +discord.gg discord.gift discord.gifts discord.media discord.newdiscordapp.comdiscordapp.net + +GITEE  gitee.com +o +IFANR coolbuy.com  ifanr.com ifanr.inifanrusercontent.com +ifanrx.com +minapp.com +& + STEAMUNLOCKEDsteamunlocked.net +R +UPAI  aicdn.com upai.com upaiyun.com  upcdn.net  upyun.com + +GFYCAT +gfycat.com + +LINUX  linux.org +9 +NIKKEI +nikkei.com  nikkei.jp nikkei.co.jp + +GITHUB atom.io  npmjs.com npm.communitydependabot.com +git.io github.blog +github.comgithub.community  github.io githubapp.comgithubassets.comgithubhackathon.comgithubstatus.comgithubusercontent.com/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com + +MARVEL +marvel.commarvel10thanniversary.commarveldimensionofheroes.commarvelparty.netmarvelpinball.commarvelsdoubleagent.commarvelspotlightplays.com marvelsuperheroseptember.commarvelsuperwar.comthemarvelexperiencetour.com +w +NYTIMES nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.com +g + READTHEDOCSreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org + +SOHU-ADSadnet.sohu.com +ads ads.sohu.com +ads!adv-sv-show.focus.cn +ads aty.sohu.com +adsdata.vod.itc.cn +adsepro.sogou.com +ads go.sohu.com +adsgolden1.sogou.com +adsimp.optaim.com +adsinte.sogou.com +adsinte.sogoucdn.com +adslu.sogoucdn.com +ads pv.sohu.com +adstheta.sogoucdn.com +adstrack.sohu.com +adsuranus.sogou.com +adsv2.reachmax.cn +ads)e8aeb8bbdbbd7.cdn.sohucs.com +ads)643108e7617ef.cdn.sohucs.com +ads  -NETFLAV netflav.com - -TIPDM -tipdim.org -6 -UDN udn.com -udn.com.twudnfunlife.com -- -MYRADIO -myradio.hkmyradio.com.hk -3 -PPTV  pplive.cn -pplive.com pptv.com +TRIBLER tribler.org + +UPROXY +uproxy.org  4399 3304399.net 4399.com 4399api.com 4399dmw.com 4399er.com4399youpai.com 5054399.com img4399.com +% + +CHINAPOWERchinapower.csis.org +B + LOCALBITCOINSlocalbitcoins.comlocalbitcoinschain.com + +YYETS cvnad.com +ads +iyoowi.com +ads +got001.com +got002.com jstucdn.com playcvn.com rrys.tv rrys2019.com rrys2020.com rrysapp.com  yyets.com +zimuzu.com  zimuzu.tv zmz2019.com +zmzapi.com +A +ACERacer-group.com acer.com acer.com.cn +cn -AP -ap.org -apnews.com -( -IMGUR  imgur.com imgurinc.com -n -TWITCH ext-twitch.tv  jtvnw.net  ttvnw.net  twitch.tv twitchcdn.net twitchsvc.net - -BITSTAMP bitstamp.net -F -COINONE coinone.co.krcoinonecore.comcoinonecorp.com -# -QT qt.ioqt-project.org - -SSRPASS -ssrpass.pw + +FANHAODIANfanhaodian.com + +GITV gitv.cn gitv.tv 1 - STACKPATH stackpath.com stackpath.dev - -GNU gnu.org - -I2P -geti2p.net -. -NETLIFY netlify.combitballoon.com -@ -REUTERS reuters.com -reuters.tvreutersmedia.net - -BINANCEbinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com - -GEOLOCATION-CN 3304399.net 4399.com 4399api.com 4399dmw.com -4399er.com4399youpai.com 5054399.com img4399.com  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn -58.com  58.com.cn 5858.com  58che.com 58xueche.com -anjuke.comanjukestatic.com chinahr.com -daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com acfun.cn aixifan.com!apilog-web.acfun.cn -@ads -acplay.netdandanplay.com alibaba -alipay -taobao tmall a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com -alicdn.com alidayu.com -alidns.comaliyun-inc.comaliyun-iot-share.com -aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to -ele.me elemecdn.com eleme.cnteambition.comteambition.netteambitionapis.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads 25pp.com  56che.com  95095.com 9game.cn -aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.comaliexpress.com alifanyi.comalihealth.com.cn alihealth.hk -aliimg.com -alikmd.com alimama.com alimebot.com -alimei.com alios.cn -alipay.comalipayobjects.com aliplus.comaliresearch.com alisoft.com alisports.com alitianji.comaliunicorn.com -aliway.com aliwork.com alixiaomi.comalizhaopin.com alyms.cn -asczwa.comasczxcefsv.com -asmlink.cn atatech.org -b2byao.com  bazai.com  bcvbw.com  cheng.xin cloudeagle.cn damai.cn dayu.com -dfkhgj.com doctoryou.ai doctoryou.cn dongting.com -dratio.com emas-poc.com -gongyi.xin ialicdn.com iconfont.cn -ics.design -jhgtgb.com -kanbox.com -lazada.comliangxinyao.com m-now.cn -maitix.com  mdeer.com mei.commiaostreet.com  mshare.cc nic.xinphilanthropy.xin phpwind.com phpwind.netqingtingtrip.com  rexpos.cn saee.org.cn shenjing.com  shuqi.comshuqireader.com sparenode.com  supet.com  ttpod.com wandoujia.comxinlingshou.cn yowhale.com yunos-inc.com  yunos.comyushanfang.com -zuodao.com sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com -hemaos.com hemashare.cn shyhhema.com 1688.com etao.com juhuasuan.comlingshoujia.com -mashort.cn pailitao.com -taobao.com -taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmalltv.com tmjl.ai alitrip.com  feizhu.cn -feizhu.com -fliggy.com  fliggy.hk -iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net baidu -91.com -aipage.com apollo.auto baidu.cn  baidu.com baidu.com.cn baidubce.combaiducontent.com baidupcs.combaidustatic.com -baifae.com baifubao.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn -bdydns.net chuanke.com  dlnel.com  dlnel.org -duapps.com -dwz.cn -hao123.com hao123img.com -hao222.com -haokan.com jomocdn.net jomodns.com -mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@ads zuoyebang.cc zuoyebang.com -zybang.com -acg.tv acgvideo.com -b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com -mincdn.com$ upos-hz-mirrorakam.akamaized.net -bytecdn.cn bytedance.com bytedance.net bytedns.net byteimg.com -douyin.com huaxiong.comjokecommunity.comneihanshequ.com -pstatp.com -snssdk.com toutiao.comtoutiaocdn.comtoutiaocloud.comtoutiaohao.comtoutiaohao.net toutiaoimg.cntoutiaoimg.comtoutiaoimg.nettoutiaopage.com -wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com -ixigua.com ixgvideo.com  365yg.com -csdl.ac.cn  las.ac.cn cctv.cn cctv.com cctvpic.com chinalive.com cntv.cn cntv.com.cn  cntvwb.cn  ipanda.cn -ipanda.com ipanda.com.cn -ipanda.net livechina.cn livechina.comolympicchannelchina.cn 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn -cmvideo.cn miguvideo.com andfx.cn  andfx.net -cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com -ctexcel.ca ctexcel.comctexcel.com.hk -ctexcel.fr -ctexcel.us -189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com -chntel.com  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cn cnki.net  coding.me -coding.net coolapk.comcoolapkmarket.comcoolapkmarket.net c-t.workcowtransfer.com csdn.net -csdnimg.cn c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn -skysea.com  suanya.cn -suanya.com -tieyou.com -toptown.cn toursbms.com trip.com tripcdn.com -vipdlt.com biji.com -ddmogo.com -igetget.cn igetget.com luojilab.com  mogoo.com -sao.cn saolife.com  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com -ele.me elemecdn.com eleme.cn erji.net cebbank.com ceblease.com -eb-ind.com ebasset.com ebchina.comebchinaintl.com -ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com  ganji.comganjistatic1.com -gcores.com gitv.cn gitv.tv hicloud.com hihonor.com honor.cn -huawei.comhuaweicloud.com  vmall.com vmallres.com hupu.com hupucdn.com huya.com msstatic.comicbc icbc-ltd.com icbc-us.com icbc.com.cn coolbuy.com  ifanr.com ifanr.inifanrusercontent.com -ifanrx.com -minapp.com 71.am  iqiyi.com iqiyipic.com -pps.tv -ppsimg.com qiyi.com qiyipic.com -qy.net -71edge.coma.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@ads3.cn  300hu.com -360buy.com 360buyimg.com -360top.com -7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn -dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com -jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com -jd-app.com  jd-ex.com jd.cn jd.co.th -jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com -jingxi.com -jkcsjd.com -joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn -paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com -vg.com wangyin.com  wdfok.com yhd.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads -42r.cn -5566ua.com aurorapush.cn -e0n.cn japps.cn jchat.io -jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com -jsurvey.cn  jvoice.cn -kc9.cn -n0q.cn pushcfg.com -s0n.cn jiemian.comjiemian.com.cnjinrishici.com jinshuju.netjinshujucdn.com jsdelivr.net jsdelivr.com gotokeep.com keepcdn.com gifshow.com ksapisrv.com kuaishou.com -yximgs.com!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads  lagou.com lgstatic.com -lancdn.comlandiannews.com  wsoso.com baidupan.com -lanzou.com lanzous.com woozooo.com -liepin.com -lietou.comlietou-static.com mafengwo.cn mafengwo.com mafengwo.net manmanbuy.com  meitu.com meitudata.com dianping.com -maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com flyme.cn meizu.cn  meizu.com  mzres.com -mihoyo.com bh3.com 126.com 126.link 126.net 127.net 163.com163industry.com 163mail.com 163qiyukf.com -163yun.com 166.net -haowu.linkicourse163.org  kaola.com -lofter.com  nease.netnetease-inc.com netease.com -netease.im -qiyukf.com ydstatic.com yeah.net -youdao.com g.163.com -@ads -nga.cn 178.com -ngabbs.com ngacn.cc oneplus.com -oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com coloros.com finzfin.com h2os.com -heytap.com heytapcs.comheytapdownload.comheytapimage.com -myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobi  oppoer.meoppomobile.com oppopay.com opposhop.cn -realme.com realmebbs.comrealmemobile.com -pddpic.com pinduoduo.com yangkeduo.com  pplive.cn -pplive.com pptv.com -360.cn 360.com -360-jr.com 360chou.com360daikuan.com360huzhubao.com -360jie.com360jinrong.net -360kan.com 360kuai.com  360os.com 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com -haosou.com haosou.com.cn -haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com qihucdn.com  qihoo.com qikucdn.com -so.com sou.comxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com -youhua.com 6655.com cooldock.com -ithome.com lapin365.com ruanmei.com -saayaa.com win7china.com win8china.com  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.com sf-saas.comsf-tech.com.cn sffix.cn sfgy.org  sfacg.com  97973.com sina.com -sinaimg.cn sina.com.cn  sinajs.cn sina.cn sinaapp.com sinaedge.com sinaimg.com -sinajs.com  weibo.com weibo.com.cn weibo.cn weibocdn.com xhaiwai.com 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@adssinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com -go2map.com sogo.com  sogou.com sogoucdn.com saraba1st.com cnsuning.com -suning.comsuningcloud.comsuningestate.comsuningholdings.com taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.com -tapimg.com -taptap.com -apcdns.net foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn imqq.com  myapp.com myqcloud.com -qcloud.com qcloudimg.com qlogo.cn qpic.cn -qq.com -qqmail.com  qzone.comservicewechat.com smtcdns.com -tencent.cn tencent.comtencent.com.cntencent.com.hktencent.net.cntencent-cloud.comtencentmusic.comtencentyun.com -tenpay.com -wechat.com -wegame.com -weiyun.com ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads tiancity.comtiancitycdn.com -tipdim.org tmtpost.com chaindd.com -72whys.com checkzeit.com -tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com 40017.cn -17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com -ly.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads  95516.com unionpay.comunionpayintl.comunionpaysecure.comwanfangdata.com.cn -sojump.com -wjx.cn wjx.com wjx.top -mi.com -mi-img.com  mifile.cn miui.com -miwifi.com  xiaomi.cn -xiaomi.com -xiaomi.netxiaomiyoupin.com ximalaya.com  xmcdn.com speiyou.com -xesimg.com xueersi.comdanjuanfunds.com -xueqiu.com  00cdn.com  88cdn.com -sandai.netthunderurl.com -xunlei.com ynet.cn ynet.com ynet.com.cn -kumiao.com  youku.com  ykimg.com -mmstat.com soku.com -cibntv.net -youzan.com yzcdn.cn youzanyun.com banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com yfcache.com -yfcalc.com yfcloud.com  yfdts.net  yfp2p.net -yfscdn.net yunfancdn.com  zhihu.com  zhimg.com zhihuishu.com -ziroom.comziroomapartment.com  ksyun.com ksyungslb.com ourdvsss.com abchina.com -boc.cn  whccb.com moji.com mojichina.com0123456789.com 0379home.com -055110.com  05sun.com 0759job.com  100bt.com 100offer.com  11467.com -114chn.com 114piaowu.com 114shouji.com 115.com -119you.com 123juzi.com 123juzi.net 123u.com 1637.com  16888.com 16rd.com  17173.com 178linux.com  17989.com  17cdn.com 17house.com  18183.com 188.com 1905.com  19yxw.com 1nongjing.com  1ting.com 1zhe.com 21cn.com 2265.com 2288.org 2345.com 258.com 263.net 289.com 2cto.com 3000.com -310win.com -315che.com 3234.com 32r.com 3322.org 3387.com 33lc.com 3454.com 3456.cc -35.com 3533.com 360aiyi.com -360doc.com  360jq.com 360zhyx.com -365azw.com -365dmp.com 36kr.com -37.com 3733.com 3839.com -39.net 3conline.com 3d66.com 3dmgame.com -3elife.net 3h3.com 3yx.com  40407.com 4paradigm.com 500.com 500d.me -50bang.org -51.com 51.la -510you.com 51credit.com  51cto.com 51eshop.com 51gaifang.com 51hejia.com51jingying.com 51meishu.com -51sole.com 51wendang.com  51yes.com 5253.com  52hxw.com -52miji.com 52pk.com 52z.com 53kf.com -55.com -56.com 5577.com  55bbs.com  58pic.com  5bite.com 5fun.com 5gzm.net 5khouse.com 5you.com 66wz.com 68h5.com -6rooms.com 71.am 714.com 7230.com -72byte.com  7down.com 7k7k.com  7moor.com 7po.com -7x24cc.com -7xdown.com  818ps.com  84399.com  8686c.com 885.com  88cdn.com -900.la 917.com 91danji.com 91yunxiao.com 9553.com 962.net 9718.com  99166.com 998.com 999d.com 99danji.com 9ht.com -9xgame.com 9xu.com a9vg.com -aardio.com -adxvip.com -afzhan.com agrantsem.com  aicdn.com  aiemy.com aiketour.com  aiops.com  aipai.comairchangan.com airguilin.com aisee.tv aiskycn.com aiyunxiao.com -aizhan.com -ali213.netalittle-tea.com -allyes.com anfensi.com -anquan.org -anruan.com -antutu.com -aotrip.net  aoyou.com apk3.com apk8.com appchina.com -appinn.com  arpun.com babytree.combabytreeimg.com baidufree.combaifendian.com  baihe.com  baike.com baixing.com baixing.netbamenzhushou.combangongziyuan.com bankcomm.combankofchina.com baofeng.com baomitu.combaoxianshichang.com bcy.net bearychat.com beihaidc.combeijing-lipin.com bengbeng.com  benmi.com  berui.combestopview.com biancheng.net bianews.com bibaodao.com bidchance.com biddingx.com bihu.com -bio360.net  bio4p.com bio-equip.combiodiscover.com bishijie.com bitauto.combitautoimg.com bitecoin.com biyehome.net bjcathay.com bobo.com bojianger.com -bokecc.com  boosj.com bootcss.com btcfans.com btgtravel.com bthhotels.com  btime.comcabbagebox.com caijingwu.com -caixin.com -caiyun.com caiyunapp.com cang.comcankaoxiaoxi.comcardbaobao.com -carnoc.com ccb.com  cdn20.com  cecdc.com cecport.com centanet.com cerambath.org -ch.com chachaba.com changba.com chashebao.comchazhengla.com -che168.comchina-chair.comchina-nengyuan.com  china.comchinacache.comchinacache.netchinachugui.comchinadongchu.com chinafph.comchinakaoyan.comchinalawedu.com chinanews.com chinapay.com chinapp.netchinapubmed.net chinasspp.comchinatranslation.net chinaunix.netchinaweiyu.comchinawutong.com -chinaz.com -chinaz.net chinazns.com chiphell.comchongdiantou.com -chouti.com chuangxin.com chuansong.mechuansongme.com -chushou.tv chuyu.me  city8.com cjol.com clouddn.com cloudxns.com cmbchina.com cn.bing.com cnanzhi.com -cnbeta.com cnbetacdn.com cnblogs.com -cnepub.com  cnfol.com  cnlaw.net cnstock.com cnzz.com cocodiy.com code666.com -cofeed.com -cofool.com coindog.comcontentchina.com  cpppf.org  cqvip.com  cr173.com  crsky.com  csbew.com -csmjzs.com csslcloud.net -ctfile.com ctiforum.com ctoutiao.com  ctsbw.com -cubead.com  cwxzx.com -cyagen.com  cybtc.com cyol.com cyts.com cztv.com cztvcloud.com dadajiasu.com dadighost.com daguzhe.com dajiabao.com  dajie.com dajieimg.com dalongyun.com dangbei.com dangdang.com danji100.com -danji6.com daocloud.io daovoice.iodayukaoshi.com dazijia.com  dbank.com -dcdkjx.com  dd373.com  ddooo.com dedecms.com develenv.com -dginfo.comdgphospital.com  dgtle.comdianchacha.com diandian.comdiandianqi.comdianwannan.comdidichuxing.comdingxiang-inc.com -diopic.net diyiyou.com dj99.com dmzj.com  docin.com dockerone.com -dockone.io dogedoge.com -donews.com -dongao.comdongguantoday.com dopa.com -douban.com  douban.fm doubanio.com -douxie.com -downcc.com downxia.com -downyi.com -dpfile.comdreams-travel.comdrivergenius.com -dui.ai duiopen.com duoduocdn.com duokanbox.com -duomai.com duoshuo.com  duote.com -duowan.com dxpmedia.com -dxycdn.com  dyhjw.com dzsc.com dzw3.com  dzwww.com easesale.com  easiu.com eastday.com eastmoney.com eastsoo.com -eayyou.com  ebico.com  ebrun.com -ecitic.com ecjobhome.com -edu.cn  eduei.com eeyy.com eflycloud.com elecfans.com emarbox.com -emumax.com enterdesk.comeoeandroid.com excelhome.net expreview.comf.cx  faloo.com famulei.com  fanli.comfangxiaoer.com fanxian.com fastapi.net -feihuo.com feiniaomy.com feng.comfengkongcloud.com fengniao.comfengxian110.com  fenxi.com -fhldns.com  fimmu.com finchina.com fixdown.com  fqjob.net freebuf.com fugetech.com fuwj.com fxxz.com fyxz.com game234.com gameabc.com gamemei.com gamersky.com -gaodun.comgaoshouyou.comgaoxiaojob.com -gdjdxy.comgdliontech.com gdrc.com geekpark.net geetest.com geilicdn.comgenelinkout.com  getui.com -gezida.com gfan.com -giocdn.com  gitee.com globrand.com gm86.com gmallbio.com  gmz88.comgobasearcher.com gold678.com  golue.comgongxiangcj.com goosail.com  goufw.com gree.comgreenxiazai.com growingio.com  gtags.net  guabu.com guaiguai.comguanaitong.comguanhaobio.com gucheng.com  guigu.org  guokr.com guoxinmac.com  gupzs.com gushiwen.orgguzhangting.com -gwdang.comgxairlines.com -gxb.io gzwanju.com h5uc.com hack520.com hackhome.com haishun.com hanboshi.com handanjob.comhangjiayun.com haolietou.com  haote.comhaoyouyinxiang.com hefei.cc -heisha.net  henha.com henkuai.com herostart.com  hexun.com -heytea.com  hiido.com hitv.com hiyd.com hktheone.com hn-cbec.com  hnair.com -hnrcsc.com hntv.tv hnyuyuhui.com hollycrm.com homeinns.com homekoo.comhongsanban.com hongxiu.com -houdao.comhouyuantuan.com hteacher.net huanqiu.comhuashengdaili.com  huatu.com  huize.com  hujia.org hujiang.com hunantv.comhuochepiao.com huocheso.com  huxiu.com hxfy888.com hxsd.com iask.com -ibaotu.com ibuychem.com icaidao.com ichangtou.com  iciba.com idongdong.com idqqimg.com  ifeng.com ifengimg.com iflytek.com  igao7.com -iheima.com ijiandao.com ijinshan.com -ikafan.com im2maker.com  im-cc.com -imedao.com imgo.tv  imooc.com indienova.com  infoq.cominfoqstatic.com -ip-cdn.com  ip138.com ipinyou.com ipip.net iranshao.com  irs01.com ishumei.com  it165.net  it168.com  it610.com  iteye.com -itjuzi.com  itmop.com  iyiou.com iyunxiao.com -izuche.com -jandan.net jb51.com  jdair.net jia.com jiameng.com jianbihua.com jianshu.com -jianshu.io jianzhi8.com jiaodong.net jiaoyimao.com jiasuhui.com jiasule.com jiathis.com jiayuan.com jiazhao.com jiemeng8.comjikexueyuan.com jinianbi.comjinrongren.net  jinse.com  jinti.comjiqizhixin.com jisuanke.com jisuxia.com jiuzhilan.com jj20.com  jjwxc.net jkbl.com jmstatic.com job5588.com -job910.com  jobjm.com jsbc.com -jsrdgg.com jstv.com  jsyks.com juefeng.com -julive.com  jumei.com  juwan.com  juxia.com  jyimg.com k366.com kaifubiao.com kaixin001.com kameng98.com -kanimg.com kankanews.com kantianqi.net kanzhun.com kaopu001.comkeboyunxiao.com  kejet.net kf5.com  kgimg.com -kimiss.com kingdee.com kkzj.com -kongfz.com koolearn.com -kouclo.com -koudai.com koudai8.com kq7.com  ksord.com ku6.com -ku6cdn.com -ku6img.com  kuaaa.com kuaidi100.com kuaihou.comkuaikanmanhua.com kuaizhan.com  kugou.com  kuqin.com -kuyiso.com lady8844.com laomaotao.net laomaotao.org  lascn.net  lawxp.com -le.com leanote.com ledu.comleetcode-cn.com leikeji.com leiphone.com leiting.com leju.com leturich.org letv.com letvcdn.com letvimg.com lianjia.com lianmishu.com -liantu.com  liantu.me lianzhuli.comliaoxuefeng.com liba.com libaclub.comlieyunwang.com lightonus.com -likuso.com lingkou.com linkvans.com  linsn.com linuxidc.com liulanqi.net liuxiaoer.com live800.com liweijia.com lixinger.com lkkbrand.com longhoo.net -longre.comlongtugame.com longzhu.com  lotpc.com -loupan.com lrts.me -lu.com luckyair.net  lufax.com lufaxcdn.com lunwengo.net luyouqi.com -lvmama.comlvsexitong.com  lxdns.com  lxway.com -magedu.com maisanqi.com -mamecn.com manhuatai.com manmankan.com -mapbar.com mayi.com -mayihr.com -mcbang.com  mdpda.com mechina.org -mediav.com meifang.com meika360.com meilishuo.commeimingteng.com -meiqia.commeishichina.com meishij.netmengtuoshi.wang mgtv.commiaobolive.com miaopai.com miaozhen.com -miercn.com mikecrm.comminhangshi.com miusi.co mjia.cc -mmbang.com mmbang.info moegirl.org -mofang.com mofazhu.com mogu.com mogucdn.com mogujie.com -mokahr.com moleecel.commoocollege.com mop.com msanjia.com -mscbsc.com mukewang.com -mumayi.com -muomou.com muzhiwan.com -mydown.com mydrivers.com myshow360.net myyx618.com myzaker.com mzstatic.com naixuecha.com netbian.com -newasp.netnewbandeng.com  newyx.net nowcoder.com nowscore.com  nruan.com ntalker.com nvsheng.com  nzbdw.com oadz.com  oeeee.com  offcn.com officese.com -oicq88.com  okooo.com -ol-cdn.com -ol-img.com oldboyedu.com -oneapm.com onegreen.net -oneyac.comonlinedown.netonlinesjtu.com onlylady.com -opdown.com oray.com oschina.net  ottcn.com -oupeng.com -p2peye.com p5w.net -paipai.compaipaibang.com paopaoche.net pc6.com -pcbeta.com -pchome.net  pcpop.com  peccn.com pgzs.compharmacodia.com piaoliang.com -pingan.compingplusplus.com pingwest.com -pingxx.com pintu360.com  pipaw.com  pipaw.net pptbest.com psbc.com -pubyun.com qbox.me  qc188.com qcc.com qcds.com qd8.com qd-metro.com qdmm.com qh24.com qiangbus.com qianjia.com qianlima.com qianzhan.comqiaobutang.com qichacha.com -qidian.com -qie.tv qifeiye.comqijiayoudao.net qingcloud.comqingdaochina.orgqingdaonews.com qingting.fmqingsongchou.com  qiniu.com qiniucdn.com qiniudn.com qiniudns.com qiumibao.com qizuang.com  qqddc.comqqgexingqianming.com qqrizhi.comqqshuoshuo.com -qschou.com -qtmojo.com -qudong.com -qugame.com  qunar.com qunarzz.com qyer.com readnovel.com -renren.comrenren-inc.com rfchost.comrockyenglish.com rong360.com rtbasia.com  ruan8.comruby-china.org -runoob.com rzrc114.com  saibo.com sanguosha.com -sanwen.net  scdng.com scoregg.com -sczsxx.com sdo.com sec-wiki.comsegmentfault.com -sencdn.com seniverse.comsenlinjimore.com -sgamer.com shang360.com -shangc.netshanghairc.com shangzhibo.tvshanshuihotel.com sharejs.com shebiaotm.comshelter-china.comshelterdome.netshengdaosoft.comshenmayouxi.com  sheui.com shijiexia.com shixiseng.com shmetro.comshoujihuifu.comshouyoubus.com shrbank.comshuidichou.comshuidihuzhu.com shumensy.comshuoshuokong.com -shutcm.com -simei8.com simuwang.com sinesafe.com  sjwyx.com  skycn.com sllssrq.com  smzdm.com -snimay.com  sobot.com sofreight.com softwhy.com sohu.com -sohucs.com -sojson.com -somode.com soso.com souqian.comsouthmoney.comsparkletour.comspringtour.com  sspai.com ssports.com starbaby.cc starbaby.comstaticfile.org stockstar.com sun0769.com -sunrtb.com supermap.comsupermapcloud.com -sys321.com szfw.org szhk.com szzfgjj.com t1y5.com  taihe.comtaihuoniao.com tangeche.com tanx.com -tao123.com -taoche.com te5.com tenxcloud.com  tgbus.comtianjimedia.comtianjin-air.comtianlailive.com -tianqi.com tietuku.com -tiexue.net timedoo.com tingyun.com titanar.com tjjt360.com  tmcdn.net -tobosu.com tom.com tongdun.net topthink.com touqikan.com travelsky.com trunktech.comtrustexporter.com trustutn.org  tudou.com tudouui.com tuer123.com tuicool.com -tuiwen.net  tujia.com  tuniu.com tutuapp.com  tuwan.com tuwanjun.com u.tools u17.com  ucbug.com -uggame.com uoko.com upaiyun.com  upyun.com urselect.comurumqi-air.com  useso.com uuu9.com uzzf.com  v5875.com value500.com vamaker.com  vancl.com vanclimg.com  vcimg.com vdolady.com veryhuo.com veryzhun.com -vgtime.com  vic18.com videojj.com  vijos.org vip.com  vobao.com -vpgame.comwallstreetcn.comwangyangyang.vipwannianli8.com wanplus.com wanwushuo.com wanyiwang.com  wanyx.com -wdjimg.com wdzj.com  weand.com webterren.com weicaifu.com weidian.comweilaicaijing.comweilaiyunxiao.com weiphone.com weiphone.net weixing.com weiyangx.comwelltrend-edu.com wenjuan.comwhlovehome.com wicresoft.com -win007.com win8.netwindows10zj.comwindows7en.com windowszj.com winwin7.com wishdown.com  wmzhe.com wnhuifu.com wodingche.com  womai.com wonnder.com -wooyun.org worktile.comwoyaogexing.com  woyoo.com  wqiis.com wrating.com -wscdns.com  wtown.com  wumii.com -wuming.comwuximediaglobal.com  wywyx.com xafc.com  xbiao.com  xdwan.com -xfdown.com -xhscdn.comxiachufang.comxiaobaixitong.comxiaoe-tech.com xiaogouh5.comxiaohongshu.com  xiaoka.tv xiaokaxiu.comxiaomingtaiji.comxiaoxiongxitong.comxiaoyuxitong.com  xiayx.com xiazaiba.com ximalaya.com xingjiesj.com xinhuanet.comxinrenxinshi.com xinshipu.comxingtan001.com xitong8.com xitu.com xiu8.com -xiucai.com xiziwang.net xmhouse.com  xnpic.com xoyo.com  xpgod.com -xsa239.comxuanchuanyi.com  xue51.com xuekanba.com xuexicha.com xundupdf.com xxsy.net  xycdn.com xywy.com -xzking.com yahui.cc -yaolan.com  yaoyl.com  yaozh.com  yccdn.com -ycgame.com -yeepay.com -yeshen.com  yesky.com yh31.com yhd.com  yicai.com  yigao.com yigoonet.com yihaodian.comyihaodianimg.com yihedoors.comyikaochacha.com yikexue.comyingjia360.comyinhang123.net yinxiang.com yinyuetai.comyinzhaowang.com -yiqifa.com -yiqifa.org yisu.com yitaifang.com  yiwan.com yixi.tv yizhibo.com  yjbys.com ynhr.com -yocajr.com -youboy.com youjiao.com youke.co youlian.fun youshang.com youxiake.com youxihezi.net youxila.com youxiniao.com youxigt.com  youzu.com yoyojie.com  yoyou.com  ypppt.com -yslyhr.com  ysten.com -yuewen.com  yunaq.com yunba.io yundaex.com yundasys.com -yundun.com yunqishi.net yunshipei.com yunxiao.com yunzhijia.com  yupoo.com  yuzua.com  yxbao.com -yxdown.com -yy.com -yytcdn.com -zampda.net zampdsp.com zastatic.com -zbjimg.com zczj.com -zdfans.com -zdmimg.com zgjm.org -zgjsks.com  zglxw.com  zgzcw.com zhanbuba.comzhangyoubao.com  zhanqi.tv zhanzhang.net zhaodanji.com zhaopin.com zhcw.com -zhenai.com  zhibo8.cc  zhidx.com zhifang.com -zhipin.com zhiziyun.com zhongkao.comzhuangjiba.comzhuanyewanjia.comzhuayoukong.com zhubajie.com zhugeapi.net zhugeio.com  zimuzu.io zixiaomao.com zixuntop.com  zjstv.com zmengzhu.com zongheng.com -zpb365.com -zrblog.net zsxq.com  zuche.com zuchecdn.com zuhaowan.com zuidaima.com zuowen8.comzuowenwang.net jindidata.comtianyancha.comzhuanxiandai.com -fm3838.comlarsonlimited.com runsheng.com vzuu.com -zoom3g.com -zoomyou.cn chaoxing.com chaoxing.cc - -JD-ADSads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads - - EMOGI-ADS  emogi.com - -TMTPOST tmtpost.com chaindd.com -72whys.com checkzeit.com -tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com - -YAHOO yahoo -myguide.hkyahoo-news.com.hk yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cm yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yimg.com  ymail.com -flickr -flickr.com -flickr.netstaticflickr.com ads.yahoo.com -@adsgemini.yahoo.com -@ads - - -JD3.cn  300hu.com -360buy.com 360buyimg.com -360top.com -7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn -dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com -jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com -jd-app.com  jd-ex.com jd.cn jd.co.th -jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com -jingxi.com -jkcsjd.com -joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn -paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com -vg.com wangyin.com  wdfok.com yhd.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads - -MINGW  mingw.org -J - ATOM-DATA-ADS atom-data.ioanalytics-data.io ironbeast.io -. - CLOUDCONE -cloudc.one cloudcone.com - - -CODECADEMYcodecademy.com - -CODE code.org - -OVERCAST overcast.fm - -IBMibmweatherchannel weather bluemix.com bluemix.net ibm.com -ibm.eu ibm.net -ibm.us s-bluemix.net s81c.com - - JFENGTIME jfengtime.com -" - LETSENCRYPTletsencrypt.org - -FREEBSD freebsd.org -4 -PERL perl.org cpan.org metacpan.org - -TABOOLA taboola.com - -9NEWS 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au -mi9.com.au -mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au - - BREITBART breitbart.com -h -FASTLY -fastly.com -fastly.netfastlylabs.com fastlylb.netfastly-terrarium.com - - -FREEBEACONfreebeacon.com - -YANDEXxn--d1acpjx3f.xn--p1ai  yandex.az  yandex.by yandex.co.il -yandex.com yandex.com.am yandex.com.ge yandex.com.tr  yandex.ee  yandex.kg  yandex.kz  yandex.lt  yandex.lv  yandex.md -yandex.net  yandex.ru  yandex.st  yandex.sx  yandex.tj  yandex.tm  yandex.ua  yandex.uzyandexcloud.net yastatic.net -yandex -Z -XUNLEI  00cdn.com  88cdn.com -sandai.netthunderurl.com -xunlei.com -s -EHENTAI e-hentai.org ehgt.org ehtracker.org -ehwiki.org exhentai.orghentaiverse.org - -NODEJS -nodejs.org - - -TORPROJECTtorproject.org -z -LINE -lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net -nhncorp.jp -# - PASSIONTIMESpassiontimes.hk - -RUANMEI 6655.com cooldock.com -ithome.com lapin365.com ruanmei.com -saayaa.com win7china.com win8china.com -" - SHADOWSOCKSshadowsocks.org - -XPOSED xposed.info - - -CLOUDFLAREcloudflare-dns.comcloudflare-ipfs.comcloudflare.comcloudflareapps.comcloudflareinsights.comcloudflareok.comcloudflaressl.comcloudflarestatus.comcloudflarestream.comcloudflaretest.com one.one.onetrycloudflare.comvideodelivery.net workers.dev -4 -CSIS csis.orgcsis-prod.s3.amazonaws.com -) -KEEP gotokeep.com keepcdn.com - -SFACG  sfacg.com - -YOUTUBE  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com youtube.comyoutubeeducation.comyoutubegaming.comyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.com -4 - KHANACADEMYkhanacademy.org kastatic.org -( -LAGOU  lagou.com lgstatic.com - - -LANDOFHOPE landofhope.tv - - -ONIONSHAREonionshare.org -D -RUST rust-lang.org  rustup.rs  crates.io docs.rs -# -V8 -v8.dev v8project.org - -X-ORG x.org - - ZEROHEDGE zerohedge.com -1 -BBC bbc.com  bbc.co.uk -bbci.co.uk -7 - FONTAWESOMEfontawesome.comfortawesome.com -F - IDENTRUST identrust.comidentrust.co.uk identrust.net -, -LINUXFROMSCRATCHlinuxfromscratch.org - -MAYING  maying.co -) -NPMJS  npmjs.com npm.community -" - RASPBERRYPIraspberrypi.org -: - SOFTETHER softether.orgsoftether-download.com -4 - ARCHLINUX archlinux.orgarchlinuxarm.org - -HKCNEWS hkcnews.com -w -JWPLAYER -jwpcdn.comjwplatform.com jwplayer.com -jwpltx.com -jwpsrv.comlongtailvideo.com - -WESTERNDIGITALg-technology.com -sandisk.ae -sandisk.it sandisk.co.jp sandisk.co.kr sandisk.co.uk sandisk.comsandisk.com.ausandisk.com.brsandisk.com.trsandisk.com.tw -sandisk.de -sandisk.es -sandisk.fr -sandisk.hk -sandisk.id -sandisk.in -sandisk.nl -sandisk.sg -wd.com wdc.comwesterndigital.com -' - MIXPANEL-ADSdecide.mixpanel.com - -NETFLIX fast.com -netflix.ca netflix.com netflix.netnetflixinvestor.com nflxext.com nflximg.com nflximg.netnflxsearch.net -nflxso.net nflxvideo.net - -SHOPEE shopee.co.id shopee.co.th -shopee.com shopee.com.br shopee.com.my  shopee.ph  shopee.sg  shopee.tw  shopee.vnshopeemobile.com -shp.ee - - XIAOMITV-ADS ad.intl.xiaomi.com -@ads ad.mi.com -@ads ad.xiaomi.com -@adsadmob.xiaomi.com -@adsad1.xiaomi.com -@adsmistat.xiaomi.com -@adstracking.miui.com -@adsadv.sec.miui.com -@ads#adv.sec.intl.miui.com -@ads#misc.in.duokanbox.com -@ads ad.hpplay.cn -@adsadeng.hpplay.cn -@ads atianqi.com -@ads kuyun.com -@ads umeng.com -@ads - -AKASHA akasha.world -. -CABLETVcabletv.com.hk i-cable.com -/ -FASTLANE fastlane.cifastlane.tools - -EBAY e-bay.it ebay-us.com ebay.at ebay.be ebay.ca ebay.ch ebay.cn -ebay.co.nz -ebay.co.uk -ebay.co.ve -ebay.co.za ebay.com ebay.com.ar ebay.com.au ebay.com.ec ebay.com.hk ebay.com.mt ebay.com.ph ebay.com.sg ebay.de ebay.es ebay.fr ebay.ie ebay.in ebay.it ebay.lt ebay.nl ebay.ph ebay.pk ebay.pl ebaycdn.net ebayimg.com ebayinc.comebaymainstreet.comebayprivacycenter.com ebayrtm.comebaystatic.com - -TRIBLER tribler.org -E -PIXIV  pixiv.net  pixiv.org pixiv.co.jp  pximg.net -< -SHOWTIMEANYTIMEshowtimeanytime.com showtime.com - - STACKEXCHANGE askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.com - -CONAIR  conair.me - -DROPBOX db.ttdropbox-dns.com dropbox.com dropbox.techdropboxapi.comdropboxbusiness.comdropboxcaptcha.comdropboxforum.comdropboxforums.comdropboxinsiders.comdropboxmail.comdropboxpartners.comdropboxstatic.comdropboxusercontent.comgetdropbox.com&"paper-attachments.s3.amazonaws.com - -JIGUANG -42r.cn -5566ua.com aurorapush.cn -e0n.cn japps.cn jchat.io -jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com -jsurvey.cn  jvoice.cn -kc9.cn -n0q.cn pushcfg.com -s0n.cn -# -MEGA -mega.co.nz mega.nz -! -MIAOPASIxn--i2ru8q2qg.com -H -BTTZYW -btt804.com -btt904.com -bttzyw.com -bttzyw.net - -CEX -cex.io -e - CLARIVATEnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.com - -OKEX okex.com -& - STEAMUNLOCKEDsteamunlocked.net -B -MITmit mit.edu mit.netmitpressjournals.org - -VOXMEDIA cstatic.net -curbed.com  eater.comfunnyordie.com meridian.net polygon.com -racked.com -recode.net sbnation.com theverge.com vox-cdn.com vox.comvoxcreative.comvoxfieldguide.com voxmedia.com -voxops.net -c -COMODO -comodo.com comodoca.com comodoca2.com comodoca3.com comodoca4.com -# -DCARD dcard.io dcard.tw -+ -LINKEDIN linkedin.com  licdn.com -" - MOCLOUDPLUSmocloudplus.com -4 -SCInewisiknowledge.comisiknowledge.com -m -SUNING cnsuning.com -suning.comsuningcloud.comsuningestate.comsuningholdings.com - -ZOHO zoho.com zoho.com.au zoho.eu zoho.in zohocdn.comzohomeetups.comzohomerchandise.comzohopublic.comzohoschools.comzohostatic.com zohostatic.inzohouniversity.comzohowebstatic.com -. -FLUTTER flutter.devflutterapp.com - -KRAKEN -kraken.com - -MARIADB mariadb.org -+ -RUBY ruby-lang.org rubygems.org -4 -ZB -zb.app -zb.com zb.io zb.live - -ZERONET -zeronet.io -@ - ZUOYEBANG zuoyebang.cc zuoyebang.com -zybang.com -m - INSTAGRAMcdninstagram.com  igcdn.com igsonar.com instagram.cominstagram-press.com -1 -N3RO n3ro.fun  n3ro.live n3ro.net - -NTC  ntc.party - - CHINAUNICOM  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cn -# -EDX edx.org edx-cdn.org - -PAXFUL -paxful.com -* -HKOPENTV hkopentv.com fantv.hk -g - READTHEDOCSreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org - -VIM vim.org -D - -LIVEJASMINlivejasmin.com dditsadn.com dditscdn.com -| -MEITUAN dianping.com -maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com -? -STRIPE -stripe.comstripe.network stripecdn.com -, -ACPLAY -acplay.netdandanplay.com -C -DELLdelldell-brand.com dell.com dellcdn.com - -EGGHEAD -egghead.io -% -RTHK etvonline.hk rthk.hk -t - CAMBRIDGE cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.org - -CISCO cisco  cisco.commediafiles-cisco.comstatic-cisco.comcisco.evergage.comciscolivehls-i.akamaihd.net - -MYSQL  mysql.com - -ATOM atom.io - -UDACITY udacity.com -1 -ZIROOM -ziroom.comziroomapartment.com -9 -SHADOWSOCKSCOMshadowsocks.comshadowsocks.nl - - SONYPICTURESimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com -wwtbam.comyourfantasybeginsnow.com -L - -TEAMBITIONteambition.comteambition.netteambitionapis.com - -UMENG mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads - -VIMEO -vhx.tv -vhxqa1.com -vhxqa2.com -vhxqa3.com -vhxqa4.com -vhxqa6.comvimeo-staging.comvimeo-staging2.com  vimeo.com vimeo.frvimeobusiness.com vimeocdn.comvimeogoods.comvimeoondemand.comvimeostatus.comlivestream.com -, -BANDCAMP bandcamp.com -bcbits.com - -CATEGORY-SCHOLAR-!CN apa.orgpsyccareers.com cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.orgnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.com doi.org doi.infoengineeringvillage.com -scopus.comscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.skmit mit.edu mit.netmitpressjournals.orgamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com -ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.comsciencedirect.comsciencedirectassets.com -apress.com springer.comspringerlink.comspringernature.com tandf.co.uktaylorandfrancis.comtaylorfrancis.comtaylorandfrancis.com -aclweb.org acm.organalytictech.comannualreviews.org  arxiv.org asha.org berkeley.edu biorxiv.org  brill.com cell.comcomputingreviews.com degruyter.comdentalhypotheses.comelifesciences.orgfrontiersin.org hindawi.com ieee.orgisca-speech.org jmlr.org jneurosci.org  jstor.org mdpi.com -nature.com nejm.org neurology.org ovid.com  peerj.comphysiology.org plos.org pnas.org princeton.eduresearchgate.netroutledgehandbooks.comroyalsocietypublishing.org sagepub.comscholarpedia.orgsciencemag.orgscientificamerican.com scitation.orgspiedigitallibrary.orgstatsmakemecry.com thelancet.com uchicago.edu ucla.edu  umass.edu  wiley.com yale.edu - -REURL reurl.cc - - W3SCHOOLS w3schools.com - - CATEGORY-ADS!apilog-web.acfun.cn -@ads adcolony.com -@ads -adjust.com a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@ads!amazon-adsystem.com -@adsiadsdk.apple.com -@ads iad.apple.com -@ads qwapi.com -@ads applovin.com -@ads -applvn.com -@ads atom-data.ioanalytics-data.io ironbeast.io a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@adsx.clearbitjs.com bluekai.com -@adsfout.jp -@ads gmossp-sp.jp -@adsi-mobile.co.jp -@ads im-apps.net -@ads impact-ad.jp -@ads ladsp.com -@ads microad.co.jp -@ads -microad.jp -@ads socdm.com -@ads  emogi.comdata.flurry.com  admob.com adsense.comadservice.google.comadvertisercommunity.comadvertiserscommunity.comadwords-community.com adwords.comadwordsexpress.comapp-measurement.comclickserver.googleads.comdoubleclick.comdoubleclick.netgoogle-analytics.comgoogleadapis.comgoogleadservices.comgoogleanalytics.comgoogleoptimize.comgooglesyndication.comgoogletagmanager.comgoogletagservices.comgoogletraveladservices.com -urchin.comclick.hunantv.com -@adsda.hunantv.com -@ads da.mgtv.com -@adslog.hunantv.com -@ads log.v2.hunantv.com -@adsres.hunantv.com -@ads v2.log.hunantv.com -@adsinner-active.mobi -@adsa.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@adsads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads leanplum.com$api.game.letvstore.com -@ads ark.letv.com -@ads dc.letv.com -@adsdev.dc.letv.com -@ads fz.letv.com -@ads g3.letv.com -@adsletv.allyes.com -@adsminisite.letv.com -@adsmsg.m.letv.com -@adsn.mark.letv.com -@adsplog.dc.letv.com -@adspro.hoye.letv.com -@ads pro.letv.com -@ads stat.letv.com -@ads#static.app.m.letv.com -@adsdecide.mixpanel.com mopub.com -@adsevt.mxplay.com -@ads g.163.com -@ads  ogury.com -presage.io ogury.co onesignal.comPB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ -@adsads.pubmatic.com -@adscdn.segment.com 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@adsadnet.sohu.com -@ads ads.sohu.com -@ads aty.sohu.com -@adsdata.vod.itc.cn -@adsepro.sogou.com -@ads go.sohu.com -@adsgolden1.sogou.com -@adsimp.optaim.com -@adsinte.sogou.com -@adsinte.sogoucdn.com -@adslu.sogoucdn.com -@ads theta.sogoucdn.com -@adsuranus.sogou.com -@adsv2.reachmax.cn -@ads*e8aeb8bbdbbd7.cdn.sohucs.com -@ads*643108e7617ef.cdn.sohucs.com -@adssupersonic.comsupersonicads.com -ssacdn.com supersonicads-a.akamaihd.netssp.api.tappx.com -@ads ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads uberads.com -@adsalog.umeng.com -@ads!alog.umengcloud.com -@ads"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads ads.wteam.xyz ad.intl.xiaomi.com -@ads ad.mi.com -@ads ad.xiaomi.com -@adsadmob.xiaomi.com -@adsad1.xiaomi.com -@adsmistat.xiaomi.com -@adstracking.miui.com -@adsadv.sec.miui.com -@ads#adv.sec.intl.miui.com -@ads#misc.in.duokanbox.com -@ads ad.hpplay.cn -@adsadeng.hpplay.cn -@ads atianqi.com -@ads kuyun.com -@ads umeng.com -@ads ads.yahoo.com -@adsgemini.yahoo.com -@adsactives.youku.com -@ads!ad.api.3g.youku.com -@ads%ad.api.mobile.youku.com -@ads!ad.mobile.youku.com -@ads)a-dxk.play.api.3g.youku.com -@ads atm.youku.com -@ads$b.smartvideo.youku.com -@adsc.yes.youku.com -@adsdas.api.youku.com -@ads"das.mobile.youku.com -@ads"dev-push.m.youku.com -@adsdl.g.youku.com -@adsdmapp.youku.com -@adse.stat.ykimg.com -@ads$gamex.mobile.youku.com -@ads"guanggaoad.youku.com -@ads!hudong.pl.youku.com -@ads"huodong.pl.youku.com -@ads#huodong.vip.youku.com -@ads hz.youku.com -@adsiyes.youku.com -@ads l.ykimg.com -@adslstat.youku.com -@ads!mobilemsg.youku.com -@ads msg.youku.com -@adsmyes.youku.com -@ads p.l.youku.com -@ads pl.youku.com -@ads$passport-log.youku.com -@adsp-log.ykimg.com -@adspush.m.youku.com -@ads r.l.youku.com -@ads s.p.youku.com -@adssdk.m.youku.com -@adsstat.youku.com -@ads%statis.api.3g.youku.com -@ads'store.tv.api.3g.youku.com -@ads'store.xl.api.3g.youku.com -@adstdrec.youku.com -@ads test.ott.youku.com -@ads"test.sdk.m.youku.com -@ads v.l.youku.com -@adsval.api.youku.com -@ads wan.youku.com -@adsykatr.youku.com -@adsykrec.youku.com -@ads cvnad.com -@ads -iyoowi.com -@ads  zynga.comzyngaplayersupport.com 51y5.net a.adtng.com -aaxads.com -ad-srv.netad.api.moji.comad.wang502.com adbutter.netads.trafficjunky.net adtechus.comcfts1tifqr.comcontentabc.comimg-bss.csdn.net imglnkc.com imglnkd.comja2.gamersky.com jl3.yjaxa.topkepler-37b.com -lqc006.coms4yxaqyq95.comshhs-ydd8x2.yjrmss.cnstatic.javhd.comtrafficfactory.biz toboads.com ad.unimhk.com ysm.yahoo.com adxprtz.com exoclick.com -exosrv.comcdn.advertserve.comcdn.banclip.comcdn.tsyndicate.com -@ -HAVEIBEENPWNEDhaveibeenpwned.compwnedpasswords.com - - TENCENT-ADS ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads -, -HITUN hitun.ioxn--90wwvt03e.com -3 -QUORA  quora.com quoracdn.net qr.ae -( -LTN -ltn.com.tw yes123.com.tw - - ALIBABACLOUDalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.com -F - -DEVIANTARTdeviantart.comdeviantart.net da-files.com -, -GANJI  ganji.comganjistatic1.com - -NIXOS  nixos.org -" - SUBLIMETEXTsublimetext.com -& - VAGINACONTESTvaginacontest.com -$ - BROWSERLEAKSbrowserleaks.com -O -GUO  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com - -MRAY  mray.club -. -CHINADIGITALTIMESchinadigitaltimes.net - -ELIXIRelixir-lang.org -& -HUYA huya.com msstatic.com -) -LINGUEE linguee.com  deepl.com -$ -NOTEPADnotepad-plus-plus.org -$ -AFP afp.com afpforum.com - -APACHE -apache.org - -CATEGORY-ADS-ALLadvertserve.com httpool.com mgid.com -unimhk.com taboola.com!apilog-web.acfun.cn -@ads adcolony.com -@ads -adjust.com a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@ads!amazon-adsystem.com -@adsiadsdk.apple.com -@ads iad.apple.com -@ads qwapi.com -@ads applovin.com -@ads -applvn.com -@ads atom-data.ioanalytics-data.io ironbeast.io a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@adsx.clearbitjs.com bluekai.com -@adsfout.jp -@ads gmossp-sp.jp -@adsi-mobile.co.jp -@ads im-apps.net -@ads impact-ad.jp -@ads ladsp.com -@ads microad.co.jp -@ads -microad.jp -@ads socdm.com -@ads  emogi.comdata.flurry.com  admob.com adsense.comadservice.google.comadvertisercommunity.comadvertiserscommunity.comadwords-community.com adwords.comadwordsexpress.comapp-measurement.comclickserver.googleads.comdoubleclick.comdoubleclick.netgoogle-analytics.comgoogleadapis.comgoogleadservices.comgoogleanalytics.comgoogleoptimize.comgooglesyndication.comgoogletagmanager.comgoogletagservices.comgoogletraveladservices.com -urchin.comclick.hunantv.com -@adsda.hunantv.com -@ads da.mgtv.com -@adslog.hunantv.com -@ads log.v2.hunantv.com -@adsres.hunantv.com -@ads v2.log.hunantv.com -@adsinner-active.mobi -@adsa.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@adsads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads leanplum.com$api.game.letvstore.com -@ads ark.letv.com -@ads dc.letv.com -@adsdev.dc.letv.com -@ads fz.letv.com -@ads g3.letv.com -@adsletv.allyes.com -@adsminisite.letv.com -@adsmsg.m.letv.com -@adsn.mark.letv.com -@adsplog.dc.letv.com -@adspro.hoye.letv.com -@ads pro.letv.com -@ads stat.letv.com -@ads#static.app.m.letv.com -@adsdecide.mixpanel.com mopub.com -@adsevt.mxplay.com -@ads g.163.com -@ads  ogury.com -presage.io ogury.co onesignal.comPB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ -@adsads.pubmatic.com -@adscdn.segment.com 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@adsadnet.sohu.com -@ads ads.sohu.com -@ads aty.sohu.com -@adsdata.vod.itc.cn -@adsepro.sogou.com -@ads go.sohu.com -@adsgolden1.sogou.com -@adsimp.optaim.com -@adsinte.sogou.com -@adsinte.sogoucdn.com -@adslu.sogoucdn.com -@ads theta.sogoucdn.com -@adsuranus.sogou.com -@adsv2.reachmax.cn -@ads*e8aeb8bbdbbd7.cdn.sohucs.com -@ads*643108e7617ef.cdn.sohucs.com -@adssupersonic.comsupersonicads.com -ssacdn.com supersonicads-a.akamaihd.netssp.api.tappx.com -@ads ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads uberads.com -@adsalog.umeng.com -@ads!alog.umengcloud.com -@ads"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads ads.wteam.xyz ad.intl.xiaomi.com -@ads ad.mi.com -@ads ad.xiaomi.com -@adsadmob.xiaomi.com -@adsad1.xiaomi.com -@adsmistat.xiaomi.com -@adstracking.miui.com -@adsadv.sec.miui.com -@ads#adv.sec.intl.miui.com -@ads#misc.in.duokanbox.com -@ads ad.hpplay.cn -@adsadeng.hpplay.cn -@ads atianqi.com -@ads kuyun.com -@ads umeng.com -@ads ads.yahoo.com -@adsgemini.yahoo.com -@adsactives.youku.com -@ads!ad.api.3g.youku.com -@ads%ad.api.mobile.youku.com -@ads!ad.mobile.youku.com -@ads)a-dxk.play.api.3g.youku.com -@ads atm.youku.com -@ads$b.smartvideo.youku.com -@adsc.yes.youku.com -@adsdas.api.youku.com -@ads"das.mobile.youku.com -@ads"dev-push.m.youku.com -@adsdl.g.youku.com -@adsdmapp.youku.com -@adse.stat.ykimg.com -@ads$gamex.mobile.youku.com -@ads"guanggaoad.youku.com -@ads!hudong.pl.youku.com -@ads"huodong.pl.youku.com -@ads#huodong.vip.youku.com -@ads hz.youku.com -@adsiyes.youku.com -@ads l.ykimg.com -@adslstat.youku.com -@ads!mobilemsg.youku.com -@ads msg.youku.com -@adsmyes.youku.com -@ads p.l.youku.com -@ads pl.youku.com -@ads$passport-log.youku.com -@adsp-log.ykimg.com -@adspush.m.youku.com -@ads r.l.youku.com -@ads s.p.youku.com -@adssdk.m.youku.com -@adsstat.youku.com -@ads%statis.api.3g.youku.com -@ads'store.tv.api.3g.youku.com -@ads'store.xl.api.3g.youku.com -@adstdrec.youku.com -@ads test.ott.youku.com -@ads"test.sdk.m.youku.com -@ads v.l.youku.com -@adsval.api.youku.com -@ads wan.youku.com -@adsykatr.youku.com -@adsykrec.youku.com -@ads cvnad.com -@ads -iyoowi.com -@ads  zynga.comzyngaplayersupport.com 51y5.net a.adtng.com -aaxads.com -ad-srv.netad.api.moji.comad.wang502.com adbutter.netads.trafficjunky.net adtechus.comcfts1tifqr.comcontentabc.comimg-bss.csdn.net imglnkc.com imglnkd.comja2.gamersky.com jl3.yjaxa.topkepler-37b.com -lqc006.coms4yxaqyq95.comshhs-ydd8x2.yjrmss.cnstatic.javhd.comtrafficfactory.biz toboads.com ad.unimhk.com ysm.yahoo.com adxprtz.com exoclick.com -exosrv.comcdn.advertserve.comcdn.banclip.comcdn.tsyndicate.com - -SHORTURL shorturl.at - - OPENRESTY openresty.org - - PACKAGIST packagist.org - -UNPKG  unpkg.com +TIANCITY tiancity.comtiancitycdn.com  -DEDAO biji.com -ddmogo.com -igetget.cn igetget.com luojilab.com  mogoo.com -sao.cn saolife.com - - HUNANTV-ADSclick.hunantv.com -@adsda.hunantv.com -@ads da.mgtv.com -@adslog.hunantv.com -@ads log.v2.hunantv.com -@adsres.hunantv.com -@ads v2.log.hunantv.com -@ads -. -JSDELIVR jsdelivr.net jsdelivr.com -" - ONESIGNAL-ADS onesignal.com - -QIHOO360 -360.cn 360.com -360-jr.com 360chou.com360daikuan.com360huzhubao.com -360jie.com360jinrong.net -360kan.com 360kuai.com  360os.com 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com -haosou.com haosou.com.cn -haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com qihucdn.com  qihoo.com qikucdn.com -so.com sou.comxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com -youhua.com - -TLD-CNcn citic baidu -unicomsohu -xn--fiqs8s -xn--fiqz9s xn--1qqw23a xn--xhq521b xn--8y0a063a xn--6frz82g -xn--fiq64b xn--estv75g xn--vuq861b xn--zfr164b - -WHO who.int - -WTO wto.org -L -APKPURE apkpure.com cdnpure.com pureapk.com -winudf.com - -DINGTALK ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to -& - NETEASE-ADS g.163.com -@ads -% -FONTS  fonts.com  fonts.net - -MEDIUM -medium.com - -MZED mzed.com -E -WIX wix.com  wixmp.com wixsite.com wixstatic.com -( - BAIDU-ADS a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@ads - - -CHOCOLATEYchocolatey.org + TONGCHENG 40017.cn +17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com +ly.com  EPORNER eporner.com -k -DOUYU  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com -+ -GUARDIANPROJECTguardianproject.info - -SECTIGO sectigo.comenterprisessl.comhackerguardian.cominstantssl.comoptimumssl.compositivessl.com - -PIGAV  pigav.com - -TUMBLR -tumblr.com - -COINBASE coinbase.com - -HEROKU  heroku.co -heroku.com  heroku.me herokuapp.com herokucdn.comherokucharge.com herokussl.comheroku-app.comheroku-charge.com codei.sh -codeish.co -codeish.io - - PHANTOMJS phantomjs.org - - INOREADER inoreader.com +E +HCAPTCHA botstop.com hcaptcha.comhcaptchastatus.com  -PORNHD -pornhd.com - -STAGE1ST saraba1st.com -* -BETTEREXPLAINEDbetterexplained.com +KERNEL +kernel.org +} +SHOPIFY myshopify.com shopify.com shopify.devshopifycdn.comshopifystatus.comshopifysvc.com ( -CAIJINGLENGYANcaijinglengyan.com -6 -ELSEVIERengineeringvillage.com -scopus.com - -REDTUBE redtube.com - +WASHINGTONPOSTwashingtonpost.com + +ATOM atom.io +q +CATEGORY-HOSPITAL-CN  fuwai.com pkuh6.cn puh3.net.cnhospital.pku.edu.cnss.bjmu.edu.cn +2 +REABBLE +reabble.cn +cn reabble.com +L -ADJUST-ADS -adjust.com -3 -ELEME -ele.me elemecdn.com eleme.cn -= - JAVFINDER javfinder.sh findercdn.me o0-2.com - -MUNCLOUD muncloud.dog - -UNWIRE  unwire.hk -' -CODING  coding.me -coding.net -6 -JFROG  jfrog.com  jfrog.org bintray.com - -KALI kali.org - -CTRIP c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn -skysea.com  suanya.cn -suanya.com -tieyou.com -toptown.cn toursbms.com trip.com tripcdn.com -vipdlt.com -R - KUAISHOU-ADS!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads - -TUBE8  tube8.com +TEAMBITIONteambition.comteambition.netteambitionapis.com + +VIU +viu.tvapi.viu.now.com^ewcdn[0-9]{2}\.nowe\.com$ viu.com dfp6rglgjqszk.cloudfront.net!d1k2us671qcoau.cloudfront.net!d2anahhhmp1ffz.cloudfront.net  -STEEMIT steemit.com -) -UBER uber.comuber-assets.com - -HBO cinemax.comforthethrone.com hbo.com hboasia.com  hbogo.com hbogoasia.com hbogoasia.hk -hbomax.com -hbonow.com  maxgo.com - - -HONGKONGFPhongkongfp.com -. -SCALAscala-lang.org scala-sbt.org -! - -FLURRY-ADSdata.flurry.com - -JAVHD  javhd.com - -SIGNAL -signal.org +WEBTYPE webtype.com + +9NEWS 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au +mi9.com.au +mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au  -CITIZENLAB citizenlab.ca - -DW -dw.com - -EPOCHMEDIAGROUP dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.cz -! -WANFANGwanfangdata.com.cn - -XHAMSTER xhamster.com -; -XUEERSI speiyou.com -xesimg.com xueersi.com -. -ANDROID android.comandroidify.com - - -JAVLIBRARYjavlibrary.com -) - REBRANDLY rb.gy rebrandly.com -- -LANTERNgetlantern.org -lantern.io - -RSF rsf.org +CITIZENLAB citizenlab.ca  - WTEAM-ADS ads.wteam.xyz - -GIGABYTE  aorus.com gigabyte.comgigabyte2.azureedge.netsa78gs.wpc.edgecastcdn.net"sni1dcb6gl.wpc.edgecastcdn.net -1 -GODADDY godaddy.comx.co godaddy - -KERNEL -kernel.org - -HOMEBREW brew.sh -1 -TIANCITY tiancity.comtiancitycdn.com - -ADDTOANY addtoany.com - -AMAZON!amazon-adsystem.com -@adsaws -amazonimdb -kindle xn--cckwcxetdxn--jlq480n2rg yamaxun -zappos  amazon.ae  amazon.ca amazon.co.jp amazon.co.uk -amazon.com amazon.com.au amazon.com.br amazon.com.mx amazon.com.tr  amazon.de  amazon.es  amazon.fr  amazon.in  amazon.it amazon.jobs  amazon.jp  amazon.nl  amazon.sgamazontrust.com amzn.commedia-amazon.comssl-images-amazon.com amazonaws.comamplifyapp.com awsstatic.com awstrust.comcloudfront.netelasticbeanstalk.comamazonvideo.comprimevideo.com - -CNN cnn.com -cnn.io cnnarabic.com cnnlabs.com cnnmoney.ch cnnmoney.comcnnmoneystream.comcnnpolitics.com -5 -V2RAY  v2ray.com -v2ray.cool  v2fly.org - -YANDE yande.re + PHANTOMJS phantomjs.org 8 - OGURY-ADS  ogury.com -presage.io ogury.co - -OOKLA-SPEEDTEST  cdnst.net cellmaps.com ekahau.cloud -ekahau.com  ookla.com pingtest.net speedtest.co speedtest.netspeedtestcustom.com webtest.netPB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ -@ads +TARGET +target +target.comtargetimg1.com +Z +XUNLEI  00cdn.com  88cdn.com +sandai.netthunderurl.com +xunlei.com +O +COSTCOcostco-static.com +costco.comcostcobusinessdelivery.com +r + LAUNCHPAD launchpad.netlaunchpadlibrarian.comlaunchpadlibrarian.netlaunchpadlibrarian.org + +OPENJSFOUNDATION amp.devampproject.comampproject.netampproject.orgcdn.ampproject.org +cnamp.akamaized.netelectronjs.org +jquery.comjquerymobile.com jqueryui.com mochajs.org +nodejs.org openjsf.org + + HASHICORP  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io + +RASPBIAN raspbian.org + +SLACKslack-edge.comslack-imgs.com  slack.com +slackb.comslackcertified.com slackdemo.com slackhq.com j PLAYSTATION playstationplaystation.complaystation.net sonyentertainmentnetwork.com +F +COINONE coinone.co.krcoinonecore.comcoinonecorp.com +( +LTN +ltn.com.tw yes123.com.tw +D + +POCOIQ-ADS cdn.pocoiq.cn +ads oct.pocoiq.cn +ads + + HUNANTV-ADSclick.hunantv.com +adsda.hunantv.com +ads da.mgtv.com +adslog.hunantv.com +adslog.v2.hunantv.com +adsres.hunantv.com +adsv2.log.hunantv.com +ads + +ITU itu.int +B +MITmit mit.edu mit.netmitpressjournals.org -JINRISHICIjinrishici.com - -OPENVPN openvpn.net -" - THEPORNDUDEtheporndude.com - -CTYUN ctyun.online - - GREATFIRE greatfire.org - -ITUNES!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.com itun.es  itunes.co itunes.co.th -itunes.com  itunes.mx -itunes.org -itunes.rioitunesessentials.comitunesfestivals.comituneslatino.comituneslogin.netitunesmatch.comitunesradio.rioitunesstore.co itunesu.comitunes-apple.com.akadns.net - -PINCONG pincong.rocks - -PSIPHON psiphon3.com +ONIONSHAREonionshare.org +/ +ADGUARDadguard-vpn.com adguard.com +C +BOOKING +booking.cn +cn booking.com bstatic.com +H +BTTZYW +btt804.com +btt904.com +bttzyw.com +bttzyw.net k - TAYLORFRANCIS tandf.co.uktaylorandfrancis.comtaylorfrancis.comtaylorandfrancis.com - -ALIYUNalibabadns.com -alicdn.com alidayu.com -alidns.comaliyun-inc.comaliyun-iot-share.com -aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com -{ -BESTBUYbbycastatic.ca bbystatic.combestbuy-jobs.com -bestbuy.ca bestbuy.combestbuy.com.mx + CHEETAHMOBILE cmcm.com cmcmcdn.com  liebao.cn duba.com duba.net ijinshan.com + +GOOGLE-SCHOLARscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.sk +Q +NEWSMAXandysparis.com newsmax.com +newsmax.in newsmaxtv.com + +DOI doi.org doi.info  ORACLE oracle oracle.comoraclecloud.comoraclefoundation.org oracleimg.comateam-oracle.com bronto.comcovid19-rx.org covid19rx.org sun.com addthis.comaddthiscdn.comaddthisedge.comjava java.com java.net -< -ANACONDA anaconda.com anaconda.org conda.io - -CATEGORY-VPNSERVICES 928.plus -zind.cloud aaex.uk amytele.com -ark.tobaicaonetwork.com bighead.groupblinkload.zone boslife.biz boslife.net  cloudn.me  conair.me cordcloud.org ctyun.online -cylink.procylink0122.icu dlercloud.com dlercloud.org dlercloud.me dleris.best duyaoss.com duyaossr.com hitun.ioxn--90wwvt03e.comjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net  maying.coxn--i2ru8q2qg.commocloudplus.com  mray.club muncloud.dog n3ro.fun  n3ro.live n3ro.net nexitally.comnexitallysafe.com nexitcore.com paofu.cloud paofuyun.me renzhe.cloud rixcloud.comshadowsocks.comshadowsocks.nlsquirrelvpn.comsquirrelgroup.net -ssplive.pwchina-internet-exchange.com cxkcloud.com ssrcloud.com ssrcloud.org -ssrpass.pwstc-server.com surflite.co surflite.net vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz - - SPANKBANG spankbang.com - -VERCEL -now.shvercel-dns.comvercel-status.com -vercel.app -vercel.comzeit-world.co.ukzeit-world.comzeit-world.netzeit-world.org zeit.co zeit.sh zeitworld.com -a - APPLE-ADSiadsdk.apple.com -@ads iad.apple.com -@ads qwapi.com -@ads -C -GITBOOK gitbook.com -gitbook.iogitbook.zendesk.com -P -PUBMATIC pubmatic.compubmatic.co.jpads.pubmatic.com -@ads -$ -SCMP scmp.com -i-scmp.com - -YOUPORN youporn.com - -AMYTELE amytele.com - -MDNdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud - -OONI ooni.org - -SINA  97973.com sina.com -sinaimg.cn sina.com.cn  sinajs.cn sina.cn sinaapp.com sinaedge.com sinaimg.com -sinajs.com  weibo.com weibo.com.cn weibo.cn weibocdn.com xhaiwai.com 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@ads + + STARBUCKS starbucks.castarbucks.co.uk starbucks.comstarbucks.com.cn +cn starbucks.de starbucks.fr starbucks.ie + +3TYPE 3type.cn + +BINGbing bing.com bing.com.cn +cn bing.net bingads.combingagencyawards.combingapistatistics.combingsandbox.combingvisualsearch.com bingworld.combluehatnights.com +dictate.msflipwithsurface.commasalladeloslimites.commicrosoft-give.commicrosoftcloudsummit.commicrosoftdiplomados.commicrosoftlatamholiday.commicrosoftmxfilantropia.com!microsoftpartnersolutions.commsunlimitedcloudsummit.comoffice365love.comoffice365tw.comrenovacionoffice.comsprinklesapp.com cn.bing.com +cn cn.bing.net +cn ditu.live.com +cnbj1.api.bing.com +cnemoi-cncdn.bing.com +cn + +CATEGORY-BANK-CN +boc.cnbankofchina.combocaviation.com  boccfc.cn  bocgi.com bocgins.com  bochk.com bocichina.com bocigroup.com  bocim.combocservices.com.cn cignacmb.comcmb-leasing.com cmbchina.com cmbi.com.hkcmbwinglungbank.comicbc icbc-ltd.com icbc-us.com icbc.com.cn  95516.com unionpay.comunionpayintl.comunionpaysecure.com abchina.com  whccb.com 9 - SQUIRRELVPNsquirrelvpn.comsquirrelgroup.net +DOUBAN +douban.com  douban.fm doubanio.com +s +EHENTAI e-hentai.org ehgt.org ehtracker.org +ehwiki.org exhentai.orghentaiverse.org + +AAEX aaex.uk + + APPLE-DEVappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cncalendarserver.orgapple-cloudkit.com cups.orgdeveloper.apple.comdevimages-cdn.apple.comdevstreaming-cdn.apple.comfoundationdb.orgmacosforge.org macruby.com macruby.net macruby.orgapple-mapkit.complaygrounds-cdn.apple.com carekit.orgresearchandcare.orgresearchkit.cn +cnresearchkit.com.cn +cnresearchkit.hkresearchkit.netresearchkit.orgresearchkit.tvservicetalk.io +webkit.org webkitgtk.org wpewebkit.orgwebobjects.com-)appleworldwidedeveloper.hb-api.omtrdc.net)%appleworldwidedeveloper.sc.omtrdc.net#p-events-delivery.akamaized.net +2 +INTERNATIONALSAIMOEinternationalsaimoe.com  -XDTY xdty.org - -AVN avn.com +PCRE pcre.org + +ZERONET +zeronet.io +H + ZYNGA-ADS zynga.com +ads#zyngaplayersupport.com +ads & - CHINADECODINGchinadecoding.com -# - PRIVACYTOOLSprivacytools.io - -STUNNEL stunnel.org - - TRUSTWAVE trustwave.com -( -WASHINGTONPOSTwashingtonpost.com -. -XDAxda-developers.com xda-cdn.com +CHINASO chinaso.com +pg0.cn ++ + TAPPX-ADSssp.api.tappx.com +ads + + +KINDLE4RSSkindle4rss.com  - FASTSTONE faststone.org -3 -INNER-ACTIVE-ADSinner-active.mobi -@ads + RPMFUSION rpmfusion.org + +AMYTELE amytele.com +1 +GODADDY godaddy.comx.co godaddy +" +LIHKG +lih.kg  lihkg.com +f +OOKLA-SPEEDTEST-ADSOB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ +ads +, +BYPASSCENSORSHIPbypasscensorship.org + +DROPBOX db.ttdropbox-dns.com dropbox.com dropbox.techdropboxapi.comdropboxbusiness.comdropboxcaptcha.comdropboxforum.comdropboxforums.comdropboxinsiders.comdropboxmail.comdropboxpartners.comdropboxstatic.comdropboxusercontent.comgetdropbox.com&"paper-attachments.s3.amazonaws.com + +MYSQL  mysql.com +* +PAGECDN pagecdn.com +pagecdn.io a SSRCLOUDchina-internet-exchange.com cxkcloud.com ssrcloud.com ssrcloud.org - -TELEGRAMt.me tdesktop.com -telegra.ph -telesco.pe telegram.me telegram.org telegram.dog  graph.org -9 -YOUZAN -youzan.com yzcdn.cn youzanyun.com -N -AMP amp.devampproject.comampproject.netampproject.org -z -CERNcern ams02.space cern.ch cixp.netdotcernpilot.info  ippog.orglinearcollider.org -d - JUSTMYSOCKSjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net +b + YAHOO-ADS ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +ads + +YUEWEN +yuewen.com hongxiu.com lrts.me qdmm.com +qidian.com readnovel.com tingbook.com webnovel.com +xs8.cn xxsy.net + +CUTTLY cutt.ly + +KUAISHOU gifshow.com ksapisrv.com kuaishou.com +yximgs.com log-sdk.gifshow.com +adswlog.kuaishou.com +ads + +NTC  ntc.party +6 + RULEOFLAWrolfoundation.orgrolsociety.org + +AKASHA akasha.world + +PINGPE ping.pe + +WEBEX webex.ca webex.co.in webex.co.it webex.co.jp webex.co.kr webex.co.nz webex.co.uk  webex.com webex.com.au webex.com.br webex.com.cn +cn webex.com.hk webex.com.mx webex.de webex.es webex.fr +a +DYNA dynacw.co.jp +dynacw.com dynacw.com.cn dynacw.com.hk dynacw.com.tw + +SSPAI  sspai.com + + WIRESHARK wireshark.org + +ATTaccbusiness.com +atandt.comatt-bundles.com att-japan.com att-mail.comatt-promotions.com att-rsvp.comatt.cn +cn att.com att.jobs att.net +att.tvattalascom.comattbelieves.comattbusiness.net attcenter.comattcollaborate.com +attcorp.cn +cnattexperts.com attglobal.netattinnovationspace.comattinternetservice.com +attjoy.comattnetclient.comattonlineoffers.com attproxy.comattpublicpolicy.comattpurchasing.comattsavings.comattspecial.com +attssl.comattstadium.comattsuppliers.com atttvnow.comattuverseoffers.comattuverseonline.com attvoip.com attwifi.comattwirelessinternet.comattwirelessonline.comattwirelesssolutions.com bellsouth.net +budatt.com +cobatt.com currently.com currently.netdirectvbusinessmarket.comenterprisepaging.com itcanwait.com mymmode.comnaturalvoices.comnettyinternet.comopenapiplatform.comopenapiservice.compatentgold.netpaygonline.comraponlinereview.com signalbar.comsundayready.com synaptic.netthanksloyalty.com tvpromise.com +uverse.comwebhosting.com att-idns.net +attdns.com +attdns.netna-att-idns.netaudiencenetwork.comaudiencenetwork.tvcabletvdirectv.com dierectv.com +dirctv.com direcpath.com direcpath.netdirecttv-deals.tvdirecttv-dish.com dkrecttv.com directtv.netdirecttvdeals.tvdirecttvreviews.comdirectv-4-you.comdirectv-newyork.com directv.comdirectvadsales.comdirectvatlantaga.comdirectvboston.comdirectvbundles.comdirectvbusiness.comdirectvcincinnatioh.comdirectvcinema.comdirectvconnect.comdirectvcookevilletn.comdirectvcrossvilletn.comdirectvdealer.comdirectvdeals.comdirectvdealsnow.com directvdsl.tvdirectvforhotels.comdirectvgrandslam.comdirectvhouston.comdirectvinternet.comdirectvkentucky.comdirectvlebanontn.comdirectvlosangeles.comdirectvmetropolisil.comdirectvmonitoring.comdirectvmurfreesborotn.comdirectvnewhampshire.comdirectvnow.comdirectvoffercodes.comdirectvonline.comdirectvplans.comdirectvpomise.comdirectvpromise.comdirectvpromotions.comdirectvrebate.comdirectvrichmond.comdirectvsavings.comdirectvsports.comdirectvsundayticket.com direectv.com +diretv.comdtv2009offers.comfreedirecttvspecial.com getdirect.tv hddirectv.com le-direct.tvmydirectgroove.commydirectvchannels.comredzonechannel.com txdirectv.com  xandr.com $ -CAS -csdl.ac.cn  las.ac.cn -N -CNBC cnbc.com -cnbcfm.com -nbcuni.comnbcudigitaladops.com - -IUS -ius.io - - MICROSOFT azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-test.net  azure.com  azure.netazurecomcdn.netazurecontainer.ioazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazurewebsites.net  microsoft azurebing hotmail -office skype windowsxbox microsoft.az microsoft.be microsoft.by microsoft.ca microsoft.cat microsoft.ch microsoft.cl microsoft.com microsoft.cz microsoft.de microsoft.dk microsoft.ee microsoft.es microsoft.eu microsoft.fi microsoft.ge microsoft.hu microsoft.io microsoft.is microsoft.it microsoft.jp microsoft.lt microsoft.lu microsoft.lv microsoft.md microsoft.pl microsoft.pt microsoft.ro microsoft.rs microsoft.ru microsoft.se microsoft.si microsoft.tv microsoft.ua microsoft.uz microsoft.vn 1drv.com 1drv.ms -aka.ms appcenter.msapplicationinsights.ioapplicationinsights.net asp.net aspnetcdn.com bing.com bing.net bingads.combingsandbox.combotframework.com breakdown.mecentralvalidation.com -ch9.ms cloudapp.netcloudappsecurity.comcortanaanalytics.comcrmdynint-gcc.com crmdynint.com docs.com dot.net dynamics.com efproject.net -gfx.ms -gigjam.com hololens.com hotmail.com imaginecup.pl live.com live.com.au live.netmicrosoft-int.commicrosoft-ppe.commicrosoft-sbs-domains.commicrosoft365.commicrosoftadvertising.commicrosoftaffiliates.commicrosoftcloud.commicrosoftedge.commicrosoftlinc.commicrosoftonline-p.commicrosoftonline.commicrosoftstore.commicrosoftstore.com.hkmicrosofttranslator.commicrosoftuwp.commono-project.comms-studiosmedia.com  msads.net -msauth.net msdn.com -msecnd.net -msedge.net  msft.info msft.net msftauth.net msftnet.org msn.com -msocdn.com -msocsp.commymicrosoft.com  nuget.org nugettest.orgo365weve-dev.como365weve-ppe.com o365weve.com -office.com -office.net office365.com onedrive.com onenote.com onenote.net onestore.ms outlook.com passport.netpowerappscdn.net powerbi.compowershellgallery.coms-microsoft.com  s-msn.com sfbassets.com sfbassets.net -sfx.mssharepointonline.com  skype.com  skype.netskypeassets.comskypeassets.net surface.com sway-cdn.com sway.comsysinternals.com tfsallin.netvideobreakdown.comvideoindexer.aivirtualearth.netvisualstudio-staging.comvisualstudio.com vsallin.net vsassets.iowindows-int.net windows.com windows.net -windows.nlwindowsmarketplace.comwindowsphone-int.comwindowsphone.comwindowssearch.comwindowsupdate.com -winhec.com -winhec.net xamarin.com xbox.com -xboxab.com xboxlive.com -yammer.com/+img-prod-cms-rt-microsoft-com.akamaized.netmwf-service.akamaized.net)%officecdn-microsoft-com.akamaized.net -' -928PLUS 928.plus -zind.cloud -1 -ABEMA abema.io abema.tv ameba.jp -0 -BITLY -bit.ly  bitly.com bitly.is -3 -ENTRUST entrust.netentrustdatacard.com -* -JAVWIDE -javwide.tv javwide.com + CLOUDCONVERTcloudconvert.com + +UU-CHAT  uug22.com  uug23.com  uug25.com  uug26.com  uug27.com  uuk28.com  uun78.com  uun79.com  uun82.com  uun83.com  uun85.com  uun86.com  uun87.com  uun89.com  uun92.com  uun93.com  uun95.com  uun96.com  uun97.com  uun98.com  uun99.com  uux68.com + + WIKILEAKS wikileaks.org ) -MEITU  meitu.com meitudata.com -L - UMENG-ADSalog.umeng.com -@ads!alog.umengcloud.com -@ads -+ -XIMALAYA ximalaya.com  xmcdn.com - -BILIPLUS biliplus.com - -CATEGORY-ANTICENSORSHIP ahmia.fi akasha.worldbrowserleaks.combypasscensorship.org citizenlab.cadat.foundationdemocracy.earth eff.orgepicbrowser.com ffprofile.comfreenetproject.org fteproxy.org  gfw.press -gfw.report greatfire.orgguardianproject.infohaveibeenpwned.compwnedpasswords.com -geti2p.net ipfs.io  jitsi.orggetlantern.org -lantern.io  ntc.partyonionshare.org ooni.org openvpn.netprivacytools.io psiphon3.comshadowsocks.org softether.orgsoftether-download.com stunnel.org telex.cctorproject.org tribler.org tunsafe.comtwister.net.co -uproxy.org  v2ray.com -v2ray.cool  v2fly.org vuvuzela.io -whonix.org wikileaks.org wireguard.com -zeronet.io - -CUP -cup.com.hk - - SWISSSIGN digital-id.ch digitalid.chmanaged-pki.chmanaged-pki.de pki-post.ch pki-posta.ch pki-poste.chroot-signing.chrootsigning.comssl-certificate.ch -swissid.ch swissign.com swissign.liswisssign-group.chswisssign-group.comswisssign-group.li swisssign.ch swisssign.com swisssign.li swisssign.net swisssign.orgswisssigner.chswisssigner.comswisssigngroup.chswisssigngroup.comswissstick.com swisstsa.ch swisstsa.li trustdoc.ch trustsign.ch zert.ch - - ALIBABA-ADS a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@ads -B -HASKELL haskell.orghaskellstack.org stackage.org + ADCOLONY-ADS adcolony.com +ads + + +BLOGSPOT blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn +: + ENTERMEDIADBentermediadb.netentermediadb.org +7 +SCP scp-wiki.net  scpdb.org scpwiki.com +6 +4CHAN 4cdn.org  4chan.org 4channel.org + +JUPYTER jupyter.org + +REDTUBE redtube.com + +ARK +ark.to +( +CHINAZ +chinaz.com +chinaz.net +L +LANZOU baidupan.com +lanzou.com lanzous.com woozooo.com , -PAOFUYUN paofu.cloud paofuyun.me - -NINTENDOnintendo-europe.com nintendo.at nintendo.be nintendo.chnintendo.co.jpnintendo.co.krnintendo.co.uknintendo.co.za nintendo.comnintendo.com.hknintendo.com.pt nintendo.de nintendo.dk nintendo.es nintendo.eu nintendo.fi nintendo.fr nintendo.it nintendo.net nintendo.nl nintendo.no nintendo.pt nintendo.ru nintendo.se nintendo.twnintendoeurope.com +THENATIONALPULSEthenationalpulse.com + +91PORN +91porn.com " -TED ted.com -tedcdn.com + ADBLOCKPLUSadblockplus.org  -VILAVPN vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz +GOOGLE-REGISTRYcharlestonroadregistry.comregistry.google get.app get.dev get.how get.page iam.soyxn--p8j9a0d9c9a.xn--q9jyb4c +1 +HOMEBREW brew.shhomebrew.bintray.com ++ +MONGODB mongodb.com mongodb.org + + CHINATELECOM +ctexcel.ca ctexcel.comctexcel.com.hk +ctexcel.fr +ctexcel.us +189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com +chntel.com + +IPIP ipip.net + +MINImini4myminicard.comaboutyourmini.comatlantaminidealers.comgreatergothammini.com!midatlanticbmwmotorcycles.commini-abudhabi.commini-antilles.frmini-bahrain.commini-bosnia.com mini-clubs-international.commini-connected.atmini-connected.bemini-connected.chmini-connected.co.ukmini-connected.commini-connected.czmini-connected.demini-connected.dkmini-connected.eemini-connected.esmini-connected.fimini-connected.frmini-connected.iemini-connected.itmini-connected.ltmini-connected.lumini-connected.lvmini-connected.nlmini-connected.nomini-connected.plmini-connected.ptmini-connected.semini-corporate-sales.com mini-coupe.camini-dubai.com +mini-e.commini-egypt.commini-georgia.commini-grouparchiv.demini-grouparchive.commini-jordan.com mini-ksa.commini-kuwait.commini-lebanon.com mini-me.com mini-oman.commini-qatar.commini-srilanka.commini-stjohns.camini-stjohns.commini-tahiti.commini-vietnam.commini-windsor.camini-windsor.com mini.am mini.at mini.be mini.bg mini.by mini.ca mini.cc mini.ch mini.cl +mini.co.cr +mini.co.id +mini.co.il +mini.co.kr +mini.co.me +mini.co.th +mini.co.uk +mini.co.za mini.com mini.com.ar mini.com.bn mini.com.br mini.com.co mini.com.cy mini.com.do mini.com.ec mini.com.gr mini.com.gt mini.com.hr mini.com.mk mini.com.mo mini.com.mt mini.com.mx mini.com.pa mini.com.pe mini.com.ph mini.com.pl mini.com.py mini.com.sg mini.com.tr mini.com.tw mini.com.uy mini.cz mini.de mini.dk mini.dz mini.es mini.fi mini.fr mini.gp mini.hu mini.ie mini.in mini.is mini.it mini.jp mini.kz mini.lu mini.ma mini.md mini.mq mini.mu mini.my mini.nc mini.nl mini.no mini.pt mini.re mini.ro mini.rs mini.ru mini.se mini.si mini.sk mini.tm mini.tn mini.ua +mini101.caminiargentina.comminibrossard.caminibrossard.com minicanada.caminicaribbean.com miniccrc.ca minicooper.caminidealer.comminidealernet.comminidowntown.caminidowntown.com minidrivingexperienceusa.com minidurham.caminidurham.com  minie.com +minifs.comminigeorgian.caminigrandriver.comminihalifax.caminihalifax.com +minihk.comminiinvasion.caminiitalianjob.comminikelowna.caminikelowna.comminilangley.caminilangley.com minilat.com minilaval.ca minilaval.com minilondon.ca minilondon.cominimarkham.caminimarkham.comminimoncton.caminimoncton.comminimontrealcentre.caminimontroyal.caminimontroyal.comminimotoringrewards.comminimotoringschool.comminimotorsport.commininanaimo.camininanaimo.comminioakville.comminiofmonrovia.comminipetfriendly.comminirichmond.caminirichmond.comminisaskatoon.caminisaskatoon.com minishop.ca minispace.comminispecialoffers.caminispygear.comministcatharines.caministeagathe.comministjohns.caminitakesthestates.comminitoronto.caminitroisrivieres.ca miniusa.comminiusaservice.comminiusatires.comminivalueservice.comminivancouver.caminivaughanwest.caminivaughanwest.comminivictoria.caminivictoria.comminivilledequebec.caminivilledequebec.comminiwholesaleconnect.com miniwidget.caminiwindsor.comminiworkshop.comminiyaletown.capugetsoundmini.comshopminiusa.comsouthfloridamini.com +trmini.comtroisrivieresmini.comyours-customised.mini.com -CHATURBATEchaturbate.com -$ -CSDN csdn.net -csdnimg.cn - - -GOOGLE-ADS  admob.com adsense.comadservice.google.comadvertisercommunity.comadvertiserscommunity.comadwords-community.com adwords.comadwordsexpress.comapp-measurement.comclickserver.googleads.comdoubleclick.comdoubleclick.netgoogle-analytics.comgoogleadapis.comgoogleadservices.comgoogleanalytics.comgoogleoptimize.comgooglesyndication.comgoogletagmanager.comgoogletagservices.comgoogletraveladservices.com -urchin.com +NODESOURCEnodesource.com + +OSDN osdn.net + +SINA-ADS 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +ads + +CATEGORY-MOOC-CNchinesemooc.org +cnmooc.orgicourse163.org icourses.cn mooc.cnopenlearning.com pmphmooc.commoocs.unipus.cnopencourse.pku.edu.cn study.163.com +3 + SEGMENTFAULTsegmentfault.com  sifou.com + + DAILYMAIL  anm.co.uk  dailym.aidailymail.co.uk dailymail.comdailymail.com.au dailymail.dkdailymailonline.comdmgmediaprivacy.co.ukmailhealth.commailonline.co.ukmailonline.commailonsunday.co.ukmailonsunday.ie metro.co.uk +mol.imthisismoney.co.uk +thismon.ee + +GRAVATAR gravatar.com +) +NPMJS  npmjs.com npm.community + +YOUTUBE youtubeggpht.cn +cn  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com +youtube.ae +youtube.al +youtube.am +youtube.at +youtube.az +youtube.ba +youtube.be +youtube.bg +youtube.bh +youtube.bo +youtube.by +youtube.ca youtube.cat +youtube.ch +youtube.cl +youtube.co youtube.co.ae youtube.co.at youtube.co.cr youtube.co.hu youtube.co.id youtube.co.il youtube.co.in youtube.co.jp youtube.co.ke youtube.co.kr youtube.co.ma youtube.co.nz youtube.co.th youtube.co.tz youtube.co.ug youtube.co.uk youtube.co.ve youtube.co.za youtube.co.zw youtube.comyoutube.com.aryoutube.com.auyoutube.com.azyoutube.com.bdyoutube.com.bhyoutube.com.boyoutube.com.bryoutube.com.byyoutube.com.coyoutube.com.doyoutube.com.ecyoutube.com.eeyoutube.com.egyoutube.com.esyoutube.com.ghyoutube.com.gryoutube.com.gtyoutube.com.hkyoutube.com.hnyoutube.com.hryoutube.com.jmyoutube.com.joyoutube.com.kwyoutube.com.lbyoutube.com.lvyoutube.com.lyyoutube.com.mkyoutube.com.mtyoutube.com.mxyoutube.com.myyoutube.com.ngyoutube.com.niyoutube.com.omyoutube.com.payoutube.com.peyoutube.com.phyoutube.com.pkyoutube.com.ptyoutube.com.pyyoutube.com.qayoutube.com.royoutube.com.sayoutube.com.sgyoutube.com.svyoutube.com.tnyoutube.com.tryoutube.com.twyoutube.com.uayoutube.com.uyyoutube.com.ve +youtube.cr +youtube.cz +youtube.de +youtube.dk +youtube.ee +youtube.es +youtube.fi +youtube.fr +youtube.ge +youtube.gr +youtube.gt +youtube.hk +youtube.hr +youtube.hu +youtube.ie +youtube.in +youtube.iq +youtube.is +youtube.it +youtube.jo +youtube.jp +youtube.kr +youtube.kz +youtube.la +youtube.lk +youtube.lt +youtube.lu +youtube.lv +youtube.ly +youtube.ma +youtube.md +youtube.me +youtube.mk +youtube.mn +youtube.mx +youtube.my +youtube.ng +youtube.ni +youtube.nl +youtube.no +youtube.pa +youtube.pe +youtube.ph +youtube.pk +youtube.pl +youtube.pr +youtube.pt +youtube.qa +youtube.ro +youtube.rs +youtube.ru +youtube.sa +youtube.se +youtube.sg +youtube.si +youtube.sk +youtube.sn youtube.soy +youtube.sv +youtube.tn +youtube.tv +youtube.ua +youtube.ug +youtube.uy +youtube.vnyoutubeeducation.comyoutubefanfest.comyoutubegaming.comyoutubego.co.idyoutubego.co.in youtubego.comyoutubego.com.br youtubego.id youtubego.inyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.com += + JAVFINDER javfinder.sh findercdn.me o0-2.com +. +OP op.ggopgg-static.akamaized.net + +HQPORNER hqporner.com +( +LAGOU  lagou.com lgstatic.com +S + OGURY-ADS ogury.com +ads +presage.io +adsogury.co +ads +< +SHOWTIMEANYTIMEshowtimeanytime.com showtime.com + +SAMSUNG samsung +xn--cg4bkigalaxyappstore.comgalaxymobile.jpgame-platform.net knoxemm.com samsung.comsamsungapps.comsamsungcloud.com samsungdm.comsamsungeshop.com.cn +cnsamsunggalaxyfriends.comsamsungknox.comsamsungqbe.com + +SHOPEE shopee.cn +cn shopee.co.id shopee.co.th +shopee.com shopee.com.br shopee.com.my  shopee.ph  shopee.sg  shopee.tw  shopee.vnshopeemobile.com shopeesz.com +cn +shp.ee + +SSRPASS +ssrpass.pw +( +TAPTAP +tapimg.com +taptap.com + +VIDEOLAN videolan.org +E +ETHEREUM +devcon.orgethereum.foundation ethereum.org +3 +PPTV  pplive.cn +pplive.com pptv.com % -HUPU hupu.com hupucdn.com -+ -MONGODB mongodb.com mongodb.org - -NVIDIA geforce.co.kr geforce.co.uk geforce.comgeforce.com.twgputechconf.co.krgputechconf.comgputechconf.com.augputechconf.com.twgputechconf.eugputechconf.ingputechconf.jp nvidia.asia  nvidia.be  nvidia.ch nvidia.co.jp nvidia.co.kr -nvidia.com nvidia.com.au nvidia.com.br nvidia.com.tr nvidia.com.tw  nvidia.cz  nvidia.de  nvidia.dk  nvidia.es  nvidia.eu  nvidia.fi  nvidia.fr  nvidia.it  nvidia.lu  nvidia.nl  nvidia.no  nvidia.pl  nvidia.ro  nvidia.ru  nvidia.seshotwithgeforce.com -F -APPLEicloud-content.com  icloud.ch -icloud.com  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.lv  icloud.om -icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloude.com icloudo.com -icloudo.de icloudos.de!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.com itun.es  itunes.co itunes.co.th -itunes.com  itunes.mx -itunes.org -itunes.rioitunesessentials.comitunesfestivals.comituneslatino.comituneslogin.netitunesmatch.comitunesradio.rioitunesstore.co itunesu.comitunes-apple.com.akadns.net  swift.org apple apple.ae apple.at apple.be apple.bg apple.bs apple.ca apple.ch apple.cl apple.cm apple.co.cr apple.co.hu apple.co.jp apple.co.kr apple.co.mz apple.co.nz apple.co.th apple.co.uk  apple.com apple.com.af apple.com.au apple.com.bo apple.com.br apple.com.co apple.com.de apple.com.do apple.com.gr apple.com.jm apple.com.lk apple.com.mg apple.com.mx apple.com.my apple.com.pa apple.com.pe apple.com.pl apple.com.pr apple.com.pt apple.com.py apple.com.sg apple.com.sv apple.com.tr apple.com.tw apple.com.uy apple.cz apple.de apple.dk apple.ee apple.es apple.eu apple.fi apple.fr apple.hamburg apple.hn apple.hr apple.hu apple.ie apple.in apple.is apple.it apple.jo apple.kr apple.lk apple.lt apple.lv apple.me apple.my  apple.net apple.net.gr apple.nl apple.no apple.pk apple.pl apple.pt apple.ro apple.rs apple.ru apple.sa apple.se apple.sg apple.si apple.sk apple.so apple.tt apple.uk  apple.xyz applestore.bg applestore.ch applestore.cmapplestore.co.huapplestore.co.jpapplestore.co.ugapplestore.co.ukapplestore.com.auapplestore.com.bnapplestore.com.eeapplestore.com.egapplestore.com.grapplestore.com.hkapplestore.com.hrapplestore.com.joapplestore.com.myapplestore.com.phapplestore.com.plapplestore.com.ptapplestore.com.roapplestore.com.ruapplestore.com.snapplestore.com.tw applestore.de applestore.hk applestore.kr applestore.meapplestore.net.gr applestore.ph applestore.qa applestore.sgapplestorepro.eu  appsto.reappstore.co.id appstore.hk appstore.my appstore.ph asto.reimac-apple.comimac-applecomputer.com imac.co -imac.co.nz imac.com imac.eu imac.gr imac.one imac.rs imacapple.comimacapplecomputer.com euroipad.com indiaipad.com -ipad.co.kr ipad.de  ipad.host  ipad3.com -ipadair.cl -ipadair.cmipadair.com.bripadair.com.es -ipadair.fr -ipadair.hk -ipadair.ie -ipadair.jp -ipadair.twipadaustralia.com ipadmini.cmipadmini.com.lk ipadmini.lk ipadpro.buzz -ukipad.comappleiphone.hu  iphone.cm -iphone.com iphone.com.au iphone.com.gr  iphone.es iphone.host iphone.net.gr  iphone.pt  iphone.rs  iphone.ru iphone4.comiphone4.com.br iphone4s.comiphoneacessorios.com.briphoneclaro.com.br iphonefc.comiphonegermany.com ipod.ca ipod.ch ipod.cm ipod.co -ipod.co.nz -ipod.co.uk -ipod.co.za ipod.com ipod.com.au ipod.com.fr ipod.com.hk ipod.com.sg ipod.de ipod.es ipod.eu ipod.fr ipod.gr ipod.hk ipod.is ipod.no ipod.pk ipod.rs ipod.ru ipod.tw ipodcentre.nlipodcleaner.com ipodnano.comipodprices.com -ipodrip.caipodrocks.com.au  ipods.comipodshop.com.au ipodtouch.co -macbook.co -macbook.hk -macbook.twmacbookair.co.krmacbookair.co.ukmacbookair.commacbookair.com.aumacbookair.com.es macbookair.es macbookair.hk macbookair.kr macbookair.jp macbookpro.comacbookpro.commacbookpro.com.au macbookpro.usapplemusic.berlinapplemusic.comapplemusic.com.auapplemusic.hamburgapplemusicfestival.comappleenews.comapplenews.berlinapplenews.hamburg apple-pay.rsapplepay.berlinapplepay.co.rsapplepay.hamburg applepay.info applepay.rs!applepaymerchantsupplies.infoapplepaysupplies.berlinapplepaysupplies.info ibook.co.nz ibook.euibookpartner.com  iphoto.eu  iphoto.no  iphoto.se  imovie.euimoviegallery.comimoviestage.comapplecare.berlin applecare.cc applecare.euapplecare.hamburg1to1computing.com.au1to1conference.com.auairport.brussels -airport.euairsupportapp.com airtunes.infoalchemysynth.comapple-cloudkit.comapple-darwin.comapple-darwin.netapple-darwin.org apple-dns.netapple-enews.comapple-expo.com apple-expo.eu apple-hk.com apple-inc.netapple-watch.com.ruappleaustralia.comappleaustralia.com.auappleaustralia.net.auapplecarbon.comapplecentar.co.rsapplecentar.rsapplecentre.com.auapplecentre.infoappleclub.com.hk applecom.comapplecomputer-imac.comapplecomputer.co.inapplecomputer.co.nzapplecomputer.com.hkapplecomputer.com.twapplecomputer.huapplecomputer.krapplecomputerimac.comapplecomputerinc.infoapplecomputers.co.nzappledarwin.comappledarwin.net appleexpo.euappleexpo.infoapplefilmaker.comapplefilmmaker.comapplefinalcutproworld.comapplefinalcutproworld.netapplefinalcutproworld.orgapplehongkong.comapplehongkong.com.hkappleid.berlinappleid.hamburgappleipodsettlement.comappleiservices.comapplemalaysia.com.myapplemasters.infoapplepodcasts.comapplepremiumreseller.com.au applepremiumresellers.com.auapplereach.comapplereach.net apples-msk.ruapplescript.infoappleshare.infoappleshop.co.ukappletaiwan.com -appletv.fr appleweb.net applexpo.netappmediagroup.combraeburncapital.com burstly.netburstlyrewards.com buyaapl.com buyaapl.net buyaple.comcalendarserver.org camelphat.comcamelspaceeffect.com carekit.org cdn-apple.com  chomp.com cups.orgdarwinsource.comdarwinsource.orgdarwinsourcecode.comdesktopmovie.comdesktopmovie.netdesktopmovie.orgdesktopmovies.netdesktopmovies.orgdigitalhub.com -dot-mac.de  dotmac.dedvdstudiopro.bizdvdstudiopro.comdvdstudiopro.infodvdstudiopro.netdvdstudiopro.orgdvdstudiopro.us -earpod.netedu-research.org -emac.co.in emac.in  emagic.de firewire.cl firewire.eu geoport.com ichat.co.in idvd.eu  ikids.comilecture.co.nz ilife.eu ilife.grinsidemacintosh.comipa-iphone.net ischool.com itools.info iwork.sejetfuelapp.comjetfuelapps.comlojaiphone.com.br -mac.com.au -mac.eu -mac.rs macappsto.re mach-os.com mach-os.net -machos.net macintosh.eumacintoshsoftware.com macos.com.aumacosforge.org macosx.info macreach.com macreach.net mobileme.dk mzstatic.com powerbook.euquicktime.com.au quicktime.euresearchkit.orgtruedepth3d.comwebobjects.co.uk webobjects.de webobjects.euapple.com.akadns.net%!courier-push-apple.com.akadns.netpush-apple.com.akadns.net!developer.apple.com -@dev%devimages-cdn.apple.com -@dev(devstreaming-cdn.apple.com -@dev'playgrounds-cdn.apple.com -@dev - -CASTRO  castro.fm -" - HUBBLEPHONEhubblephone.com - -TWISTERtwister.net.co -7 -DART dart.dev dartlang.org dartpad.dev -" - MASTERCLASSmasterclass.com +RTHK etvonline.hk rthk.hk +$ + APPLEINSIDERappleinsider.com +i +ARCHIVEOFOUROWN ao3.orgarchiveofourown.orgarchiveofourown.comarchiveofourown.net + +IETF ietf.org +1 + STACKPATH stackpath.com stackpath.dev + +VGTIME +vgtime.com + +VOXMEDIA cstatic.net +curbed.com  eater.comfunnyordie.com meridian.net polygon.com +racked.com +recode.net sbnation.com theverge.com vox-cdn.com vox.comvoxcreative.comvoxfieldguide.com voxmedia.com +voxops.net + +BILIBILI +acg.tv acgvideo.com +b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com +mincdn.com$ upos-hz-mirrorakam.akamaized.net * -PAGECDN pagecdn.com -pagecdn.io +DANGDANG dangdang.com ddimg.cn + +LETV-ADS#api.game.letvstore.com +ads ark.letv.com +ads dc.letv.com +adsdev.dc.letv.com +ads fz.letv.com +ads g3.letv.com +adsletv.allyes.com +adsminisite.letv.com +adsmsg.m.letv.com +adsn.mark.letv.com +adsplog.dc.letv.com +adspro.hoye.letv.com +ads pro.letv.com +ads stat.letv.com +ads"static.app.m.letv.com +ads + +VIDEOJS videojs.com + +WHONIX +whonix.org + + WIREGUARD wireguard.com + +DINGTALK ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to +. +NOTION  notion.sonotion-static.com  TIKTOK muscdn.com musical.ly tiktok.com tiktokcdn.com tiktokv.com#p16-tiktokcdn-com.akamaized.net -Y -UNIONPAY  95516.com unionpay.comunionpayintl.comunionpaysecure.com - -YYETS -got001.com -got002.com jstucdn.com playcvn.com rrys.tv rrys2019.com rrysapp.com  yyets.com zmz2019.com -zmzapi.com cvnad.com -@ads -iyoowi.com -@ads -* -TELEKOM telekom.com -telekom.de - -TWITTERads-twitter.com periscope.tv pscp.tvt.co tellapart.com tweetdeck.com  twimg.com twitpic.com twitter.comtwitteroauth.comtwitterstat.us -twitter.jp vine.co twtrdns.net - -GENTOO -gentoo.org -, - MXPLAYER-ADSevt.mxplay.com -@ads -F -SOGOU -go2map.com sogo.com  sogou.com sogoucdn.com - - -POSTGRESQLpostgresql.org - - R-PROJECT r-project.org - -VIU viu.com -viu.tv - - -FANHAODIANfanhaodian.com -x -GUCCI guccichimeforchange.org  gucci.comguccimuseo.comguccitimeless.comregiongold.com +7 +VANCL  vancl.com vanclimg.com  vcimg.com +@ + DIGITALOCEANdigitalocean.comdigitaloceanspaces.com +J +HUPUhoopchina.com.cn hupu.com hupucdn.com  shihuo.cn + +VMWARE +cfblob.comcloudchoose.comcloudvolumes.com +cmpaas.com +cpedge.comcrit-staging.comexperience-vmware.com gemfire.netgeodesummit.com getboxer.com gitstar.com gitstar.net gopivotal.net greenplum.net hwslabs.com immidio.comitfromtheinside.comlatamvmwareforum.compivotalinitiative.comsnapvolumes.com ssdevrd.com vcanedge.com vcloudair.net vfabric.netvidmpreview.com +virsto.com +virsto.net vmglobal.net +vmmark.comvmtestdrive.com vmw.comvmware-cloudmanagement.comvmware-techcenter.comvmware20mosaic.comvmwareausnews.com!vmwarecertificationvideos.comvmwarecloud.comvmwaredemandcenter.comvmwareemeablog.comvmwaregrid.comvmwarehorizon.comvmwareidentity.comvmwarelearning.comvmwarelearningplatform.comvmwarestuff.comvmwareusergroupstore.comvmwareviewpoint.com vmwarevmc.com vmwdemo.com vmwgcomms.comvmwhorizonair.comvmwidm-ads.com +vmwidm.comvmwlabconnect.comvmwlearningplatform.com vmworld.comvmworld2010.comvmworld2013.comvmwsalesrewards.comvmwservices.com +vnware.netwhychoosehorizon.comwhychooseview.comwhychoosevmwareeuc.comwindowsuem.comworkspaceair.com xlstudio.comavinetworks.com +badaas.com bitnami.combitnamiapp.combitnamistudio.comdockerizer.comcloudcredibility.comcloudhealthtech.com cloudlive.comkubeacademy.com kubeapps.com +nyansa.com velocloud.com gopivotal.com heptio.cn +cn +heptio.com aliveipc.com aliveitsm.comaliveprofiler.com alivercm.comaliverewind.com alivertsm.com alivevm.com alivevmax.com alivevue.com vsphere.com vsphere.net air-watch.comairwatchexpress.comairwatchqa.com +getws1.com getwsone.comwhatisairwatch.comwhatisworkspaceone.comworkspaceone.comvmware.tt.omtrdc.net + +SHORTURL shorturl.at +y +GANNETTgannett-cdn.com gannett.comgannettdigital.com usatoday.comusatodaynetworkservice.com +$ + HUANGHUAGANGhuanghuagang.org  -LITV litv.tv - -HINET  hinet.net -" -LIHKG -lih.kg  lihkg.com -< -QUIP quip-cdn.com quip.comquipelements.com -+ -TRELLO -trello.com trellocdn.com -' -WATCHOUT watchout.tw -waa.tw -( -ACERacer-group.com acer.com - - BITWARDEN bitwarden.com - -ERLANG -erlang.org - - RPMFUSION rpmfusion.org -" - SEGMENT-ADScdn.segment.com -Z -SPRINGER -apress.com springer.comspringerlink.comspringernature.com - -STEAM fanatical.comhumblebundle.complayartifact.comsteam-chat.comsteamcommunity.comsteamcontent.comsteamgames.comsteampowered.comsteamstatic.comsteamusercontent.comunderlords.comvalvesoftware.com dl.steam.ksyna.com -@cdn"st.dl.bscstorage.net -@cdnst.dl.eccdnx.com -@cdn#st.dl.pinyuncloud.com -@cdn(steampowered.com.8686c.com -@cdn'steamstatic.com.8686c.com -@cdn steambroadcast.akamaized.netsteamcdn-a.akamaihd.net!steamcommunity-a.akamaihd.netsteamstore-a.akamaihd.net#steamusercontent-a.akamaihd.net"steamuserimages-a.akamaihd.net -/ - -THEINITIUMtheinitium.com  init.shop -+ -BOSLIFE boslife.biz boslife.net -% +MOOV moov.hk +` +OAN aweencore.com  awetv.comherringnetwork.com oanencore.com oann.com + +ADOBE typekit.com typekit.net10xfotolia.com 2o7.net acrobat.com adbecrsl.comadobe-aemassets-value.comadobe-audience-finder.com"adobe-video-partner-finder.com  adobe.com adobe.lyadobeaemcloud.comadobeaemcloud.netadobeawards.comadobecontent.ioadobecreativityawards.com adobedc.net adobedemo.com adobedtm.comadobeexchange.comadobeexperienceawards.com adobegov.comadobehiddentreasures.comadobejanus.com adobeku.comadobelanding.comadobelogin.com adobeoobe.comadobeplatinumclub.comadobeprojectm.com adobesc.com adobesign.comadobesigncdn.comadobespark.com adobess.comadobestock.com adobetag.comadobetarget.comadobetcstrialdvd.comadobetechcomm.comadobetechcommcallback.comadobetechcommdemo.comadobexdplatform.comassetsadobe.com authorxml.combusinesscatalyst.com ccnsite.com  ccpsx.com +demdex.netdollarfotoclub.comdollarphotoclub.comdollarphotosclub.comdouwriteright.com echocdn.com echosign.com edgefonts.netenablementadobe.com  ftcdn.net gostorego.comimagineecommerce.commacromedia.commagentoliveconference.commarketing-nirvana.com omniture.com +omtrdc.net photoshop.complacesdocs.comsundanceignite2016.comworldsecureemail.comworldsecuresystems.com adobe.iodevelopria.com behance.nets2stagehance.com adobecc.com adobecce.comadobeccstatic.comcreativecloud.comcreativesdk.com cotolia.com ffotolia.com fiotolia.com foftolia.com fonolia.com fotiolia.com fotoiia.comfotolia-noticias.com +fotolia.cc fotolia.com +fotolia.tv fotolja.com fptolia.com gfotolia.com motolia.com photolia.nettenbyfotolia.com votolia.combluefootcms.com mageconf.commageconf.com.ua magento.com magento.netmagentocommerce.commagentomobile.commarketing-cloud.com marketo.co.uk marketo.com marketo.net +marketo.tvmarketodesigner.commarketolive.com +mktdns.commkto-c0100.com mktorest.com mktroute.commobilemarketo.com&"revenue-performance-management.com toutapp.comcompresspdf.new pdf.new sign.new +5 +COLORFULCLOUDS caiyunai.com caiyunapp.com +& +HUYA huya.com msstatic.com + +OVERCAST overcast.fm +L +TLD-!CNacadaeafagalamanaoaqaratauawaxazbabgbhbibjbmbnbobrbsbvbwbybzcacdcgclcmcrcucwcxcyczdedkdzecegehereseufifjfkfofrgagbgdgeghgiglgmgngrgsgtgugwgyhkhnhthuieiliniqirjejmjojpkekhkiknkpkrkwkykzlblclilklrlsltlulymamcmdmfmgmhmkmnmompmqmrmtmumwmxmymznancnenfngninlnonpnrnunzompapepfpgphplpnrerorurwsascsdsesgsisjskslsnsrssstsusvsxsysztctdtfthtjtktltmtntotptrtttwtzuaugukumusuyuzvavcvevgvivnvuwfytzazmzwaflmlbnbanflnra averybbbbcgcebcrsdnbdnpdunsdvagerni globalxice locus mckinsey olayangroup +olayan praxisapseek +vistaprint vistawtc xerox athletabananarepublic  bloomberg boots calvinklein cartier chloegap gucci +hermesiwcjlc  lancaster lipsyloft mango  montblanc mrporter +netaporter +nextdirectnextnike oldnavy omega panerai  patagonia +piaget  piperlimepolo redstone +swatchaarp +abbott +abbvie aetna alcon +anthembms +boehringer caremore +cialis dabur  freseniusjnj merck mutuelle +sanofiaeg +airbus +alstom +aramco +blanco bosch +bostik +chesapeakechk crown +doosan +dupontflirfls flsmidth  gecompany grainger hitachi  honeywellifm ipirangajio komatsukoneksb  kuokgroup leclerclidl linde lottemanmtr reliance rexrothril rockwoolrwesandvikcoromant sandvik sapphiresca +schaeffler schmidt schwarzgroup schwarz senersewsncf statoil total +vanish +walter +warman weberweir woodsidezara zippo agakhanakdn +ansons +bharti +extraspace genting glean ikano +imamat  ladbrokes +livestrongmaif +mattel shell transformersvanawme astriumcern +emerck  hisamitsu lilly lundbeck lupin merckmsdmsdmtpc +otsuka +pfizer stadateva toray weather auspost deutschepostdhl epost fedex +pitneyaaa +abarthadac  alfaromeoaudi bentleybmw bridgestone bugatti buick cadillaccase +caseih  chevrolet chevy chrysler +datsun dodge +dunlop ferrarifiat  firestonefordgmc goodyear honda hyundai infiniti iveco +jaguarjeepkia lamborghini +lancia  landrover lexus lincoln maseratimini +mitsubishi mopar +newholland +nissanramseatsrt +suzuki +tatamotors +toyotatvs uconnect +volkswagen volvoaigo android apple bestbuy brother canondell digikey fujitsu  fujixerox  goldpointibm nikon nokia olympus  panasonic philips pioneer samsung sharpsony toshiba  yodobashi  allfinanzallfinanzberaterallfinanzberatungallyamericanexpressamexampanz banamex barclaycard barclaysbbtbbvabnl +bnpparibasbofa bradesco +capitalone cashbackbonuscbacfa chasecimb citadelciti commbank deloitte discover everbank fidelity hdfcbankhdfchsbcitaujcbjll jpmorganchase jpmorgankfhkpmg lacaixa lasalle lixil lplfinanciallplnab nadex netbanknorthwesternmutualopen +pictetpncpohl  pramerica +prudentialprupwcsaxosbiscbscor shriram softbank  statebank temasek +transunion ubankubs vanguardvisa wolterskluwerafamilycompany  aquarellediyduck +finish glade  homedepot  homegoods mrmuscleoffraid rightathome  scjohnsonaig allstateamericanfamily amfam amicaaxa chartis esurance farmers  goodhands guardian guardianlife iselect metlifemma +mutual +nationwide +nissaynorthlandinsurance +onyourside progressive redumbrella  statefarm +swiftcover thehartfordtiaatravelersinsurance  travelers travelguardtrvvig beats blockbusterbway netflix playstation showtimetab williamhillxboxasda bloomingdales +george  homesense justforulego macys  marshallsobiqvc safeway samsclub shopyourway staples +targetthd tiffany +tjmaxxtjx +tkmaxxvons walmartabb  accentureaceraco +active +airtel +amazonandaolawsaxis azure chatr +chrome cisco comcast +connectorscscdclkdish +docomodtvdwg emerson epson ericsson etisalat  fairwindsfido +flickr frogans frontierftrgbizgeaggeegle gmailgmogmx godaddygoog +googlegoogreeguge hangouthkt hotmailhtc +hughesieee iinet infosysinfy intel +intuitjavajcpjmpjprs juniperkddi +kindle +konamikpn lanxess liaison +lockermeo  microsoftmihmiimint mitekmit +mobily +mozaicmtn multichoice naspersnec neustar nexusnico +nortonntt +officeollo +oracle +orangeovh patchpayupccwqtel quest  richardli ricoh +rogers +sakurasaposassessfrshaw skolkovo skydrive skype sling smart stcgroupstc symantectatatcitdk telecity +telefonica terra translations  ultrabook unicornuol verisignvivavivo windows xfinity +xperia yahoo yamaxun +yandex yellowpages youtube +zappos +chanel clinique garnier  kerastase +kiehls lamer lancome +loreal +matrix +maybelline +natura origins +redkensvr barefoot beknown cityeatscookingchannel +cuisinella delmonte edekafage ferrero foodnetworkfood gallo heinz +kindermcd  mcdonalds pamperedchef +rocher +wilmarxn--3oq18vl8pn36axn--55qx5d8y0buji4b870uxn--5su34j936bgsgxn--b4w605ferd xn--cckwcxetd +xn--cg4bkixn--dkwm73cwpn xn--flw351exn--fzys8d69uvgmxn--hxt035cmppuelxn--hxt035czzpfflxn--j6w470d71isscxn--jlq480n2rgxn--jlq61u9w7bxn--kcrx77d1x4axn--kcrx7bb75ajk3bxn--mgba3a3ejtxn--mgba7c0bbn0axn--mgbaakc7dvfxn--mgbb9fbpob xn--ngbe9e0a xn--pgb3ceoj xn--qcka1pmcxn--w4r85el8fhu5dnra xn--w4rs40l avianca caravan changiairport cipriani clubmed delta firmdale +hilton hyatt kerryhotelskerrylogisiticskerryproperties marriott orientexpress  shangrila tradershotelstui +viking +virgin +webjetablecbre chintai  frontdoor +lefrakabc africamagicartebbc  canalpluscbncbsdstv +eurovisionfox +gallup globogotv guardianmediahbohgtvimdbitv +kyknetmnet movistar mzansimagicnhk nowtvsbs sevensky spiegel starhub +supersport theguardian travelchannelweatherchannel bauhaus latrobe +monashrmit + +TWITTERads-twitter.com periscope.tv pscp.tvt.co tellapart.com tweetdeck.com  twimg.com twitpic.com twitter.com +twitter.jptwitterinc.comtwitteroauth.comtwitterstat.us twtrdns.net vine.co + +VANISHo2action.co.krpowerofresolve.capowerofresolve.comspraynwash.com  vanish.at  vanish.be  vanish.ch  vanish.cl vanish.cn +cn vanish.co.id vanish.co.il vanish.co.in vanish.co.nz vanish.co.uk vanish.co.za vanish.com.ar vanish.com.br vanish.com.co vanish.com.hr vanish.com.mx vanish.com.my vanish.com.pe vanish.com.sg vanish.com.tr  vanish.de  vanish.dk  vanish.es  vanish.fi  vanish.fr  vanish.hu  vanish.ie  vanish.it  vanish.nl  vanish.no  vanish.pl  vanish.pt  vanish.ro  vanish.ru  vanish.se  vanish.si  vanish.skvanisharabia.comvanishbancaseulook.com.brvanishcentroamerica.com vanishinfo.czvanishstains.comvanishstains.com.au +3 + XHAMSTER-ADS#collector.xhamster.com +ads + +CLOUDN  cloudn.me + +GIGABYTE  aorus.com aoruszone.cn +cn gigabyte.cn +cn gigabyte.comgigabyte2.azureedge.netsa78gs.wpc.edgecastcdn.net"sni1dcb6gl.wpc.edgecastcdn.net + +GOLANG go-lang.com go-lang.net go-lang.org +go.dev  godoc.org +golang.com +golang.net +golang.org + -CHINAPOWERchinapower.csis.org - -CUTTLY cutt.ly - -TSQUARE -tsquare.tv -U - UNITY-ADS"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads -> - YYETS-ADS cvnad.com -@ads -iyoowi.com -@ads -, -BYPASSCENSORSHIPbypasscensorship.org -B - LOCALBITCOINSlocalbitcoins.comlocalbitcoinschain.com - -RIXCLOUD rixcloud.com -c -YOUKU -kumiao.com  youku.com  ykimg.com -mmstat.com soku.com -cibntv.net + MICROSOFT-DEVadaptivecards.ioapi-extractor.com +apisof.net appcenter.ms +blazor.netbotframework.comcodethemicrobit.comdevopsassessment.net dot.netgamesstack.comgraphengine.ioinsiderdevtour.com +jwt.ms microbit.orgmicrosoftadc.commicrosoftgamestack.commicrosoftiotinsiderlabs.commicrosoftreactor.cn +cn#microsoftreactor.com.cn +cnmicrosoftreactor.infomicrosoftreactor.netmicrosoftreactor.orgmicrosoftsilverlight.commicrosoftsilverlight.orgmicrosoftsilverlight.netmicrosoftsqlserver.com  mmdnn.commono-project.com msdn.commsinnovationchallenge.commspairlift.commsropendata.com  nuget.org nugettest.orgopentranslatorstothings.orgposhtestgallery.compwabuilder.comreactorms.com.cn +cn +sankie.netsqlserveronlinux.comtimelinestoryteller.comuwpcommunitytoolkit.comvisualstudio-staging.comvisualstudio.comvisualstudio.covisualstudio.co.ukvisualstudio.euvisualstudio.net vfsforgit.com vfsforgit.org vsassets.io xamarin.comdeveloper.microsoft.comdtlgalleryint.cloudapp.net poshtestgallery.cloudapp.net"psg-int-centralus.cloudapp.netpsg-int-eastus.cloudapp.net + +MPV +mpv.io  -OSDN osdn.net - - SPEEDTEST  cdnst.net cellmaps.com ekahau.cloud -ekahau.com  ookla.com pingtest.net speedtest.co speedtest.netspeedtestcustom.com webtest.netPB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ -@ads - -TINYURL tinyurl.com -( -TAPTAP -tapimg.com -taptap.com - -WINDY  windy.com - - WORDPRESSvideopress.com w.org wordpress.com wordpress.org wordpress.tv wp-themes.com -wp.com  wpvip.com - -BIGHEAD bighead.group - -FOXfox fox.comfoxbusiness.comfoxcorporation.com -foxdcg.com foxdoua.com -foxfdm.com -foxinc.com -foxneo.comfoxneodigital.com foxnews.com fxnetwork.com foxnewsplayer-a.akamaihd.net -- -SURFLITE surflite.co surflite.net -S -PORNHUB -phncdn.com phprcdn.com pornhub.compornhubpremium.com - -PRESS  press.vin -C - SCIENCEDIRECTsciencedirect.comsciencedirectassets.com +OONI ooni.org  WENZHAO wenzhao.ca - - YUANFUDAO banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com - -GOFUNDME gofundme.com - -KOTLINkotlinlang.org - -OPPO coloros.com finzfin.com h2os.com -heytap.com heytapcs.comheytapdownload.comheytapimage.com -myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobi  oppoer.meoppomobile.com oppopay.com opposhop.cn -realme.com realmebbs.comrealmemobile.com +N + CLOUDCONE clco.cc +cloudc.one cloudcone.com cloudcone.net +% +FONTS  fonts.com  fonts.net + +HANYI hellofont.cnhellowebfont.com0,hellofontpreview.oss-cn-beijing.aliyuncs.com-)hellowebfonts.oss-cn-beijing.aliyuncs.com hanyi.com.cnfontstar.com.cn +, +HITUN hitun.ioxn--90wwvt03e.com + + STACKEXCHANGE askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.com + + XIAOMITV-ADSad.intl.xiaomi.com +ads ad.mi.com +ads ad.xiaomi.com +adsadmob.xiaomi.com +adsad1.xiaomi.com +adsmistat.xiaomi.com +adstracking.miui.com +adsadv.sec.miui.com +ads"adv.sec.intl.miui.com +ads"misc.in.duokanbox.com +ads ad.hpplay.cn +adsadeng.hpplay.cn +ads kuyun.com +ads umeng.com +ads +" + MOCLOUDPLUSmocloudplus.com +^ +SWIFTappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cn  -CYGWIN -cygwin.com -@ -TLD-!CNaubrcadeeufrhkjpmonzrusgtwukusvnaflmlbnbanflnra averybbbbcgcebcrsdnbdnpdunsdvagerni globalxice locus mckinsey olayangroup +ANTUTU +antutu.com +- +ASUS asus.com asus.com.cn +cn + +BEEG beeg.com + +ERJI erji.net +{ +QINIUstaticfile.org qbox.me  qiniu.com qiniucdn.com qiniudn.com qiniudns.com  qnssl.com + +BLIZZARD blizzard.cn +cn blizzard.comblizzardgearstore.comblz-contentstack.com blzstatic.cn +cn +battle.netbattlenet.com.cn +cn bnet.163.com +cnblizzard.nefficient.co.krblzddist1-a.akamaihd.netblzddistkr1-a.akamaihd.netbnetcmsus-a.akamaihd.netbnetproduct-a.akamaihd.netbnetshopus.akamaized.net diablo3.comdiabloimmortal.comdi.res.netease.com +cn!diablo3.nosdn.127.net +cnfiresidegatherings.complayhearthstone.com%hearthstone.nosdn.127.net +cnheroesofthestorm.com%hearthstone.nosdn.127.net +cn"heroes.nos.netease.com +cnplayoverwatch.com#overwatch.nosdn.127.net +cn starcraft.comstarcraft2.comsc2.nosdn.127.net +cnplaywarcraft3.comworldofwarcraft.com wowchina.com +cnwow.nosdn.127.net +cnblizzcon-a.akamaihd.netblz.nosdn.127.net +cnblzmedia-a.akamaihd.netblznav.akamaized.net + +DMZJ dmzj.com +' +HM +hm.com hm.com.cn +cn +f +ROKU fandango.com mgo.commgo-images.com ravm.tv roku.com rokutime.com +u + +ATTWATCHTV +att.tv atttvnow.comattwatchtv.com directv.com  dtvce.comnettyinternet.com + +HP +123-hp.com123hplaserjet.com8008206616.com as-hp.cabaterias-hp.com campushp.comcolorprotechnology.com +compaq.orgdavid-laserscanner.com demoprint.comdigitalpack.com eprintsw.comgaming-notebooks.comgetprintersupports.comhp-imagine.comhp-infolab.com hp-invent.comhp-invent.info +hp-mns.comhp-printing.comhp-webplatform.com  hp-ww.com +hp.com +hp.company hp.io hp3d.comhp3dmetals.comhp3dprinter.comhp3dsamplepromo.comhpallinoneprinter.comhpapplicationscenter.com hpbestbuy.comhpbluecarpet.comhpbluecarpet.nethpbuiltforlearning.com hpbundle.com hpcampus.comhpcatridge.com  hpccp.com  hpceo.com  hpcmw.nethpcodewarsbcn.comhpcomputers.comhpcomputerservices.comhpconnected.comhpconnected.nethpconnected.orghpconnected.ushpconnectedstage.comhpcontinuum.com  hpcpi.com hpcu.orghpcustomersupport.comhpcustomersupport.net +hpdaas.comhpdesignjetl25500.comhpdesktopcomputer.comhpdownloadstore.comhpdreamcolor.com hpdriver.com hpdrivers.com hpdrivers.org hpeclipse.com hpengage.com hpeprint.comhpeprintcenter.com hpeurope.comhpeventcenter.com +hpfaqs.comhpfeedback.com +hpgift.com +hpgpas.comhpgraphicspartners.com  hpiie.org +hpinc.info  hpinc.nethpindigopress.com hpinkjet.comhpinstantink.cahpinstantink.comhpkeyboard.com hplaptop.comhplaptopbattery.comhplargeformatremote.comhplatexknowledgecenter.com hplfmedia.com  hplip.nethplipopensource.comhpmarketplace.comhpmemorychips.comhpmicrcartridge.com +hpmini.com hpmobile.comhpofficejetprinter.comhponlinehelp.comhponlineprinting.comhppage5000.comhppavillionlaptop.comhpphotoscanners.comhpprinterdrivers.comhpprinterinstalls.comhpprintersupplies.comhpsalescentral.com hpserver.comhpservices.comhpshooping.com +hpshop.com hpshoping.com hpshopping.hk hpsignage.com hpsmart.com hpsmarts.comhpsmartstage.comhpsmartupdate.comhpsoftware.com hpspeaker.comhpsprocket.com  hpsso.comhpstore-china.comhpstore-emea.com +hpstore.cn +cn hpstore.comhpstorethailand.com hpsupport.comhpsuresupply.comhptechventures.com hpto.net hptouch.comhptouchpointmanager.comhptrainingcenter.com  hpuae.comhpuniversity.infohpusertraining.com +hpveer.comhpvirtualthin.com hpwallart.comhpwellnesscentral.com  hpwsn.com i-123-hp.com inkchoice.cominstantink.comleavinghpinc.comlife-global.orgmyhpsupport.com printeron.comprintersetupsupport.comprintspots.comprintspots.netserviceshp.comthecompaqstore.comtouchsmartpc.comtouchsmartpc.nettouchsmartpc.orgworkstations.tv www8-hp.comxn--6eup7j.comxn--6eup7j.nethpstore.corpmerchandise.com + +TWISTERtwister.net.co + +ALIYUNalibabadns.com +alicdn.com alidayu.com +alidns.comaliyun-inc.comaliyun-iot-share.com +aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com +f +COURSERAcoursera-for-business.orgcoursera.community coursera.help coursera.org + +GEOLOCATION-!CNacadaeafagalamanaoaqaratauawaxazbabgbhbibjbmbnbobrbsbvbwbybzcacdcgclcmcrcucwcxcyczdedkdzecegehereseufifjfkfofrgagbgdgeghgiglgmgngrgsgtgugwgyhkhnhthuieiliniqirjejmjojpkekhkiknkpkrkwkykzlblclilklrlsltlulymamcmdmfmgmhmkmnmompmqmrmtmumwmxmymznancnenfngninlnonpnrnunzompapepfpgphplpnrerorurwsascsdsesgsisjskslsnsrssstsusvsxsysztctdtfthtjtktltmtntotptrtttwtzuaugukumusuyuzvavcvevgvivnvuwfytzazmzwaflmlbnbanflnra averybbbbcgcebcrsdnbdnpdunsdvagerni globalxice locus mckinsey olayangroup olayan praxisapseek vistaprint vistawtc xerox athletabananarepublic  bloomberg boots calvinklein cartier chloegap gucci hermesiwcjlc  lancaster lipsyloft mango  montblanc mrporter @@ -4002,396 +3313,2270 @@ eurovisionfox gallup globogotv guardianmediahbohgtvimdbitv kyknetmnet movistar mzansimagicnhk nowtvsbs sevensky spiegel starhub supersport theguardian travelchannelweatherchannel bauhaus latrobe -monashrmit -: - ENTERMEDIADBentermediadb.netentermediadb.org -- -BITFLYER bitflyer.com bitflyer.jp - - BYTEDANCE -bytecdn.cn bytedance.com bytedance.net bytedns.net byteimg.com -douyin.com huaxiong.comjokecommunity.comneihanshequ.com -pstatp.com -snssdk.com toutiao.comtoutiaocdn.comtoutiaocloud.comtoutiaohao.comtoutiaohao.net toutiaoimg.cntoutiaoimg.comtoutiaoimg.nettoutiaopage.com -wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com -ixigua.com ixgvideo.com  365yg.com - -D100 d100.net - -SLACKslack-edge.comslack-imgs.com  slack.com -slackb.comslackcertified.com slackdemo.com slackhq.com - -YARNPKG yarnpkg.com - -ARK -ark.to -& - BAICAONETWORKbaicaonetwork.com - -KUAISHOU gifshow.com ksapisrv.com kuaishou.com -yximgs.com!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads - -WEVERSE -weverse.io - -XART  x-art.com - -GOOGLE-SCHOLARscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.sk -T -NOW now.com +monashrmit pubmatic.compubmatic.co.jpads.pubmatic.com +ads taboola.com ahmia.fi akasha.worldbrowserleaks.combypasscensorship.org citizenlab.cadat.foundationdemocracy.earth eff.orgepicbrowser.com ffprofile.comfreenetproject.org fteproxy.org  gfw.press +gfw.report greatfire.orgguardianproject.infohaveibeenpwned.compwnedpasswords.com +geti2p.net ipfs.io  jitsi.orggetlantern.org +lantern.io  ntc.partyonionshare.org ooni.org openvpn.netprivacytools.io psiphon3.comshadowsocks.org softether.orgsoftether-download.com stunnel.org telex.cctorproject.org tribler.org tunsafe.comtwister.net.co +uproxy.org  v2ray.com +v2ray.cool  v2fly.org vuvuzela.io +whonix.org wikileaks.org wireguard.com +zeronet.ioartstation.comartstationmedia.com drbl.in dribbble.com dynacw.co.jp +dynacw.com dynacw.com.cn dynacw.com.hk dynacw.com.tw  fonts.com  fonts.netfontsinuse.com glyphsapp.comjiyu-kobo.co.jpfontexplorerx.com fontbook.com fontshop.comfstopimages.com40fontshop-prod-responsive-images.s3.amazonaws.com linotype.com myfonts.com myfonts.net monotype.commonotypeimaging.com bitstream.com itcfonts.commorisawa.co.jptypesquare.com +pin.it +pinimg.com pinterest.at pinterest.be pinterest.ca pinterest.ch pinterest.cl pinterest.copinterest.co.atpinterest.co.inpinterest.co.krpinterest.co.nzpinterest.co.uk pinterest.compinterest.com.aupinterest.com.bopinterest.com.ecpinterest.com.mxpinterest.com.pepinterest.com.pypinterest.com.uypinterest.com.vn pinterest.de pinterest.dk pinterest.ecpinterest.engineering pinterest.es pinterest.fr pinterest.hu pinterest.id pinterest.ie pinterest.inpinterest.info pinterest.it pinterest.jp pinterest.kr pinterest.mx pinterest.nl pinterest.nz pinterest.pe pinterest.ph pinterest.pt pinterest.ru pinterest.se pinterest.th pinterest.tw pinterest.uk pinterest.vnpinterestmail.comrealtype.co.jp realtype.jptypenetwork.comtypography.com webtype.commini4myminicard.comaboutyourmini.comatlantaminidealers.comgreatergothammini.com!midatlanticbmwmotorcycles.commini-abudhabi.commini-antilles.frmini-bahrain.commini-bosnia.com mini-clubs-international.commini-connected.atmini-connected.bemini-connected.chmini-connected.co.ukmini-connected.commini-connected.czmini-connected.demini-connected.dkmini-connected.eemini-connected.esmini-connected.fimini-connected.frmini-connected.iemini-connected.itmini-connected.ltmini-connected.lumini-connected.lvmini-connected.nlmini-connected.nomini-connected.plmini-connected.ptmini-connected.semini-corporate-sales.com mini-coupe.camini-dubai.com +mini-e.commini-egypt.commini-georgia.commini-grouparchiv.demini-grouparchive.commini-jordan.com mini-ksa.commini-kuwait.commini-lebanon.com mini-me.com mini-oman.commini-qatar.commini-srilanka.commini-stjohns.camini-stjohns.commini-tahiti.commini-vietnam.commini-windsor.camini-windsor.com mini.am mini.at mini.be mini.bg mini.by mini.ca mini.cc mini.ch mini.cl +mini.co.cr +mini.co.id +mini.co.il +mini.co.kr +mini.co.me +mini.co.th +mini.co.uk +mini.co.za mini.com mini.com.ar mini.com.bn mini.com.br mini.com.co mini.com.cy mini.com.do mini.com.ec mini.com.gr mini.com.gt mini.com.hr mini.com.mk mini.com.mo mini.com.mt mini.com.mx mini.com.pa mini.com.pe mini.com.ph mini.com.pl mini.com.py mini.com.sg mini.com.tr mini.com.tw mini.com.uy mini.cz mini.de mini.dk mini.dz mini.es mini.fi mini.fr mini.gp mini.hu mini.ie mini.in mini.is mini.it mini.jp mini.kz mini.lu mini.ma mini.md mini.mq mini.mu mini.my mini.nc mini.nl mini.no mini.pt mini.re mini.ro mini.rs mini.ru mini.se mini.si mini.sk mini.tm mini.tn mini.ua +mini101.caminiargentina.comminibrossard.caminibrossard.com minicanada.caminicaribbean.com miniccrc.ca minicooper.caminidealer.comminidealernet.comminidowntown.caminidowntown.com minidrivingexperienceusa.com minidurham.caminidurham.com  minie.com +minifs.comminigeorgian.caminigrandriver.comminihalifax.caminihalifax.com +minihk.comminiinvasion.caminiitalianjob.comminikelowna.caminikelowna.comminilangley.caminilangley.com minilat.com minilaval.ca minilaval.com minilondon.ca minilondon.cominimarkham.caminimarkham.comminimoncton.caminimoncton.comminimontrealcentre.caminimontroyal.caminimontroyal.comminimotoringrewards.comminimotoringschool.comminimotorsport.commininanaimo.camininanaimo.comminioakville.comminiofmonrovia.comminipetfriendly.comminirichmond.caminirichmond.comminisaskatoon.caminisaskatoon.com minishop.ca minispace.comminispecialoffers.caminispygear.comministcatharines.caministeagathe.comministjohns.caminitakesthestates.comminitoronto.caminitroisrivieres.ca miniusa.comminiusaservice.comminiusatires.comminivalueservice.comminivancouver.caminivaughanwest.caminivaughanwest.comminivictoria.caminivictoria.comminivilledequebec.caminivilledequebec.comminiwholesaleconnect.com miniwidget.caminiwindsor.comminiworkshop.comminiyaletown.capugetsoundmini.comshopminiusa.comsouthfloridamini.com +trmini.comtroisrivieresmini.comyours-customised.mini.combmwapprovedusedbmw.combaltimorebmw.combayareabmw.combmw-abudhabi.combmw-adventskalender.combmw-albania.combmw-antilles.frbmw-art-journey.combmw-arts-design.com bmw-asia.com bmw-auslieferungszentrum.combmw-authority-vehicles.combmw-bahrain.combmw-businessdrive.combmw-calgary.ca bmw-carit.debmw-classic.combmw-clubs-international.combmw-connected-drive.combmw-connecteddrive.aebmw-connecteddrive.atbmw-connecteddrive.bebmw-connecteddrive.bgbmw-connecteddrive.cabmw-connecteddrive.chbmw-connecteddrive.co.nzbmw-connecteddrive.co.ukbmw-connecteddrive.co.zabmw-connecteddrive.combmw-connecteddrive.com.aubmw-connecteddrive.com.brbmw-connecteddrive.com.cybmw-connecteddrive.com.hrbmw-connecteddrive.com.kwbmw-connecteddrive.com.mtbmw-connecteddrive.czbmw-connecteddrive.debmw-connecteddrive.dkbmw-connecteddrive.eebmw-connecteddrive.esbmw-connecteddrive.fibmw-connecteddrive.frbmw-connecteddrive.grbmw-connecteddrive.hubmw-connecteddrive.iebmw-connecteddrive.itbmw-connecteddrive.jpbmw-connecteddrive.krbmw-connecteddrive.ltbmw-connecteddrive.lubmw-connecteddrive.lvbmw-connecteddrive.mxbmw-connecteddrive.mybmw-connecteddrive.nlbmw-connecteddrive.nobmw-connecteddrive.plbmw-connecteddrive.ptbmw-connecteddrive.robmw-connecteddrive.rubmw-connecteddrive.sebmw-connecteddrive.sgbmw-connecteddrive.sibmw-connecteddrive.skbmw-connecteddrive.twbmw-corporate-sales.combmw-diplomatic-sales.combmw-driving-center.co.krbmw-drivingexperience.com bmw-dubai.com +bmw-eg.com bmw-fleet.net bmw-ghana.combmw-golfsport.com bmw-group.com bmw-group.netbmw-grouparchiv.debmw-grouparchives.com +bmw-gta.cabmw-i-pure-impulse.com bmw-i.jp bmw-int1.com bmw-iraq.combmw-jordan.combmw-konzernarchiv.de bmw-ksa.combmw-kuwait.com +bmw-lao.labmw-lebanon.combmw-m-safetycar.com  bmw-m.combmw-mdrivetour.com +bmw-me.combmw-military-sales.combmw-motorcycle.combmw-motorcycles.vnbmw-motorrad-abudhabi.com bmw-motorrad-authorities.combmw-motorrad-dubai.combmw-motorrad-motorsport.com!bmw-motorrad-now-or-never.com&"bmw-motorrad-service-inclusive.combmw-motorrad-test-ride.combmw-motorrad.atbmw-motorrad.bebmw-motorrad.bgbmw-motorrad.bhbmw-motorrad.bobmw-motorrad.cabmw-motorrad.chbmw-motorrad.clbmw-motorrad.cobmw-motorrad.co.idbmw-motorrad.co.krbmw-motorrad.co.nzbmw-motorrad.co.thbmw-motorrad.co.ukbmw-motorrad.co.zabmw-motorrad.combmw-motorrad.com.arbmw-motorrad.com.aubmw-motorrad.com.brbmw-motorrad.com.dobmw-motorrad.com.hrbmw-motorrad.com.mxbmw-motorrad.com.mybmw-motorrad.com.pebmw-motorrad.com.pybmw-motorrad.com.trbmw-motorrad.crbmw-motorrad.czbmw-motorrad.debmw-motorrad.dkbmw-motorrad.dzbmw-motorrad.ecbmw-motorrad.eebmw-motorrad.esbmw-motorrad.fibmw-motorrad.frbmw-motorrad.grbmw-motorrad.gtbmw-motorrad.hubmw-motorrad.inbmw-motorrad.itbmw-motorrad.jpbmw-motorrad.lubmw-motorrad.mabmw-motorrad.nlbmw-motorrad.nobmw-motorrad.pabmw-motorrad.plbmw-motorrad.ptbmw-motorrad.robmw-motorrad.rsbmw-motorrad.rubmw-motorrad.sabmw-motorrad.sebmw-motorrad.sibmw-motorrad.skbmw-motorrad.svbmw-motorrad.twbmw-motorrad.uabmw-motorrad.uybmw-motorsport.combmw-mountains.combmw-museum.combmw-museum.netbmw-nigeria.com bmw-oman.com bmw-ottawa.cabmw-pakistan.combmw-plant-munich.combmw-pma.com.sgbmw-powertrain.combmw-product-highlights.com bmw-qatar.combmw-routes.com +bmw-rp.combmw-rrdays.combmw-saudiarabia.combmw-security-vehicles.combmw-special-sales.combmw-sports.com bmw-sudan.combmw-tahiti.combmw-tunisia.combmw-vancouver.ca bmw-voli.me bmw-welt.com bmw-welt.net bmw-welt.tvbmw-werk-berlin.de bmw-world.com bmw-world.net bmw-world.tvbmw-worldfinal.combmw-yachtsport.com +bmw-yeg.ca bmw-yemen.com +bmw.am +bmw.at +bmw.az +bmw.ba +bmw.bb +bmw.be +bmw.bg +bmw.bm +bmw.bs +bmw.by +bmw.ca +bmw.cc +bmw.ch +bmw.cl  bmw.co.ao  bmw.co.cr  bmw.co.id  bmw.co.il  bmw.co.jp  bmw.co.ke  bmw.co.kr  bmw.co.nz  bmw.co.th  bmw.co.uk  bmw.co.za bmw.com +bmw.com.ar +bmw.com.au +bmw.com.bd +bmw.com.bn +bmw.com.bo +bmw.com.br +bmw.com.cn +cn +bmw.com.co +bmw.com.cy +bmw.com.do +bmw.com.ec +bmw.com.ge +bmw.com.gt +bmw.com.kh +bmw.com.ky +bmw.com.mk +bmw.com.mo +bmw.com.mt +bmw.com.mx +bmw.com.my +bmw.com.ni +bmw.com.pa +bmw.com.pe +bmw.com.ph +bmw.com.py +bmw.com.sg +bmw.com.sv +bmw.com.tr +bmw.com.tw +bmw.com.uy +bmw.com.ve +bmw.cw +bmw.cz +bmw.de +bmw.dk +bmw.dz +bmw.ee +bmw.es +bmw.fi +bmw.fr +bmw.gp +bmw.gr +bmw.hn +bmw.hr +bmw.ht +bmw.hu +bmw.ie +bmw.in +bmw.is +bmw.it +bmw.kg +bmw.kz +bmw.lc +bmw.lk +bmw.lt +bmw.lu +bmw.lv +bmw.ly +bmw.ma +bmw.md +bmw.mn +bmw.mq +bmw.mu +bmw.nc +bmw.nl +bmw.no +bmw.pl +bmw.ps +bmw.pt +bmw.re +bmw.ro +bmw.rs +bmw.se +bmw.si +bmw.sk +bmw.sn +bmw.tm +bmw.tt +bmw.ua +bmw.uz +bmw.vn bmwarchiv.at bmwarchiv.debmwartjourney.com bmwasia.combmwauslieferungszentrum.com bmwbikes.com  bmwbkk.de +bmwccrc.cabmwcenternet.combmwchampionship.combmwchampionshipusa.combmwcharitygolf.combmwcitychallenge.combmwclassic.combmwcolorado.combmwconnecteddrive.combmwcustomapparel.com bmwdcsnet.netbmwdealercareers.combmwdealerdirect.combmwdelawarevalley.com bmwfilms.combmwgroup-classic-heart.combmwgroup-classic.combmwgroup-gaad.combmwgroup-plants.combmwgroup-posdigital.combmwgroup-werke.com bmwgroup.at bmwgroup.com bmwgroup.net bmwgroup.jobsbmwgroupclassic.combmwgroupdesignworks.combmwgroupdirect.combmwgroupfs.combmwgroupinfobahn.combmwgroupna.com  bmwhk.com bmwi.ca bmwi.jpbmwiventures.combmwjamaica.com +bmwlat.combmwlifestyle.ca bmwm.combmwmagazine.combmwmagazine.de bmwmass.com bmwmass.net  bmwmc.netbmwmontreal.cabmwmotorcycles.combmwmotorcycleusa.combmwmotorrad.co.krbmwmotorrad.com.aubmwmotorrad.com.phbmwmotorrad.com.sgbmwmotorradhk.combmwmotorshowblog.combmwmotorsport.combmwmperformance.com bmwmuseum.netbmwmyanmar.combmwofannapolis.combmwofcentralpa.combmwoftulsa.combmwondemandusa.com bmworegon.combmwperformancecenter.combmwpittsburgh.combmwproductnews.com bmwsafari.com +bmwsfl.com +bmwsfl.net +bmwshop.cabmwspecialoffers.ca bmwsports.combmwstartupgarage.com bmwstep.combmwstepconnections.combmwsummerschool.combmwtampabay.com +bmwusa.combmwusatires.combmwusaservice.combmwusfactory.combmwusrideracademy.combmwvalueservice.combmwwholesaleconnect.com bmwworld.com bmwworld.net bmwworld.tvbmwzentrum.combrand-protection-team.comcencoastbmw.com chargenow.comchargenowusa.comchicagolandbmw.comconnected-drive.com daytonbmw.comdealerspeed.net desertbmw.com dreambmw.ca grupobmw.com guambmw.comhackthedrive.com hawaiibmw.com iaablog.comlasvegasbmw.com m-power.comminneapolisbmw.comminneapolisbmw.netmotorshowblog.com mybmw.ca  mybmw.comnewhampshirebmw.com  nmbmw.comocbmwdealers.comoffresspecialesbmw.ca park-now.com parkinfo.com +pdxbmw.com +phxbmw.compre-bmwgroup.jobspugetsoundbmw.com rentaride.com rentaride.derhodeislandbmw.comsdcountybmw.comshopbmwmotorcycles.comshopbmwusa.com socalbmw.comstlouisbmw.netthe-m-festival.comtristatebmw.comvancouverbmwretailers.cawashingtondcbmw.com alfera.com.hk alfera.com.my  alfera.in  alfera.myalphera-finance.co.inalphera-finance.com.hkalphera-finance.in +alphera.ca alphera.co.in alphera.co.nz alphera.comalphera.com.esalphera.com.hkalphera.com.my +alphera.de +alphera.es +alphera.ie +alphera.in +alphera.my alphera.netalpherafinance.com.hkalpherafinancialservices.esalpherafinancialservices.in alpherafs.caalpherafs.co.nzalpherafs.com.hkalpherafs.com.my alpherafs.ie alpherafs.in alpherafs.my premiumfs.de alphabet.asia alphabet.at alphabet.be alphabet.biz alphabet.chalphabet.co.hualphabet.co.ukalphabet.co.za alphabet.comalphabet.com.cn +cnalphabet.com.esalphabet.com.lvalphabet.com.mxalphabet.com.plalphabet.com.pt alphabet.cz alphabet.de alphabet.es alphabet.eu alphabet.fr alphabet.info alphabet.jp alphabet.lt alphabet.lu alphabet.lv alphabet.mxalphabet.net.cn +cn alphabet.noalphabet.org.uk alphabet.pl alphabet.pt alphabet.uk alphabet.usalphabetfinance.netelectricluxury.comrolls-roycecullinan.comrolls-roycemotorcars.comrolls-roycemotorcarsna.com  rrtis.comspiritofecstasy.com bridgestone  bandag.cc +bandag.comblizzak-juken.jpbookmybridgestonetyre.combridgestone-asiapacific.combridgestone-bandag.combridgestone-brand.com#bridgestone-business-service.jpbridgestone-korea.co.krbridgestone-plt-eng.combridgestone-tac-oman.combridgestone.clbridgestone.cn +cnbridgestone.co.crbridgestone.co.idbridgestone.co.inbridgestone.co.jpbridgestone.co.thbridgestone.combridgestone.com.arbridgestone.com.brbridgestone.com.cn +cnbridgestone.com.cobridgestone.com.mxbridgestone.com.sgbridgestone.com.twbridgestone.com.vnbridgestoneamericas.combridgestonearena.combridgestonecntc.combridgestonecomercial.clbridgestonecomercial.co.crbridgestonecomercial.com.arbridgestonecomercial.com.brbridgestonecomercial.com.cobridgestonecomercial.com.mxbridgestonegolf.combridgestonegz.combridgestonela.combridgestonemarketing.combridgestonemerchandise.com bridgestonenationalfleet.combridgestoneperformance.com#bridgestoneperformancemedia.net bridgestonerapiddelivery.combridgestonerewards.combridgestonesyb.combridgestonetire.cabridgestonetire.combridgestonetyre.com.mybridgestonevan.combridgestonewx.combs-adreview.com bs-awh.ne.jp  bsw.co.jp +bsw.jpcarcare-and-tireshop.jpdaytontrucktires.com ecoforme.jp gcrtires.comjsbridgestone.commenshin-channel.com monitrix.net mr-tireman.jpmybridgestoneeducation.com playz.jp +potenza.jpprodrive-japan.comstore-bridgestonesports.com thetread.com tiresplus.com cfna.combastropfirestone.comcrossfitfirestone.com firestone.clfirestone.co.crfirestone.com.arfirestone.com.brfirestone.com.cofirestone.com.mxfirestonebpco.comfirestonecomercial.clfirestonecomercial.co.crfirestonecomercial.com.arfirestonecomercial.com.brfirestonecomercial.com.cofirestonecomercial.com.mx!firestonecompleteautocare.comfirestonedrivestore.comfirestoneip.comfirestonerewards.comfirestonetire.cafirestonetire.comhibdontire.comwheelworks.netnokiantyres.cn +cnnokiantyres.com solarcity.comtesla.cn +cn  tesla.com tesla.com.cn +cnteslamotors.cn +cnteslamotors.comteslamotors.com.cn +cntesla-cdn.thron.cn +cntesla-cdn.thron.com volvodynafleetonline.comescandinavia-arg.comindependentoperatorcn.com road-crew.com udfs.com vfsco.at vfsco.be vfsco.bg vfsco.ca vfsco.ch vfsco.cl vfsco.co.uk vfsco.co.za  vfsco.com vfsco.com.au vfsco.com.br vfsco.com.cn +cn vfsco.com.tr vfsco.cz vfsco.de vfsco.dk vfsco.ee vfsco.es vfsco.fi vfsco.fr vfsco.hu vfsco.ie vfsco.in vfsco.it vfsco.jp vfsco.kr vfsco.lt vfsco.lv vfsco.mx vfsco.nl vfsco.no vfsco.pe vfsco.pl vfsco.ro vfsco.ru vfsco.se vfsco.sk vfsco.us vgcareers.netvolvo-truck.nl volvo.cavolvo.cn +cn  volvo.com volvo.com.cn +cn volvo.sevolvobrandshop.com volvobuses.at volvobuses.be volvobuses.ca volvobuses.ch volvobuses.covolvobuses.co.nzvolvobuses.co.ukvolvobuses.co.zavolvobuses.comvolvobuses.com.arvolvobuses.com.auvolvobuses.com.brvolvobuses.com.kwvolvobuses.com.ptvolvobuses.com.tw volvobuses.de volvobuses.dk volvobuses.es volvobuses.fi volvobuses.fr volvobuses.hk volvobuses.hu volvobuses.in volvobuses.it volvobuses.jo volvobuses.kr volvobuses.ma volvobuses.mx volvobuses.my volvobuses.no volvobuses.om volvobuses.ph volvobuses.pk volvobuses.pl volvobuses.ru volvobuses.se volvobuses.sg volvobuses.tn volvobuses.us volvoce.comvolvodefense.com volvogroup.be volvogroup.cn +cnvolvogroup.comvolvogroup.com.brvolvogroup.com.cn +cn volvogroup.de volvogroup.fr volvogroup.jp volvogroup.kr volvogroup.mx volvogroup.nl volvogroup.pe volvogroup.pl volvogroup.ru volvogroup.sevolvogrouptruckcenter.nlvolvomerchandise.comvolvopenta.comvolvopenta.com.br volvopenta.de volvopenta.es volvopenta.fr volvopenta.it volvopenta.nl volvopenta.se volvopenta.usvolvosaatio.fivolvospares.comvolvotrucks.aevolvotrucks.alvolvotrucks.amvolvotrucks.atvolvotrucks.azvolvotrucks.bavolvotrucks.bevolvotrucks.bgvolvotrucks.byvolvotrucks.chvolvotrucks.clvolvotrucks.co.aovolvotrucks.co.bwvolvotrucks.co.ilvolvotrucks.co.mzvolvotrucks.co.navolvotrucks.co.ukvolvotrucks.co.nzvolvotrucks.co.zavolvotrucks.co.zmvolvotrucks.co.zwvolvotrucks.comvolvotrucks.com.arvolvotrucks.com.auvolvotrucks.com.bnvolvotrucks.com.brvolvotrucks.com.cn +cnvolvotrucks.com.covolvotrucks.com.kwvolvotrucks.com.ptvolvotrucks.com.trvolvotrucks.com.twvolvotrucks.com.uavolvotrucks.czvolvotrucks.devolvotrucks.dkvolvotrucks.eevolvotrucks.esvolvotrucks.fivolvotrucks.frvolvotrucks.gevolvotrucks.grvolvotrucks.hkvolvotrucks.hrvolvotrucks.huvolvotrucks.idvolvotrucks.involvotrucks.itvolvotrucks.jpvolvotrucks.kgvolvotrucks.krvolvotrucks.kzvolvotrucks.ltvolvotrucks.lvvolvotrucks.mavolvotrucks.mdvolvotrucks.mkvolvotrucks.mnvolvotrucks.myvolvotrucks.netvolvotrucks.nlvolvotrucks.novolvotrucks.pevolvotrucks.phvolvotrucks.pkvolvotrucks.plvolvotrucks.psvolvotrucks.qavolvotrucks.rovolvotrucks.rsvolvotrucks.ruvolvotrucks.sevolvotrucks.sgvolvotrucks.sivolvotrucks.skvolvotrucks.tmvolvotrucks.tnvolvotrucks.uyvolvotruckcenter.bevolvotruckcenter.dkvolvotruckcenter.esvolvotruckcenter.fivolvotruckcenter.itvolvotruckcenter.krvolvotruckcenter.kzvolvotruckcenter.nlvolvotruckcenter.novolvotruckcenter.sevolvotruckrental.beudtrucksmeena.com mastercard.ae mastercard.at mastercard.az mastercard.ba mastercard.be mastercard.bg mastercard.by mastercard.ca mastercard.ch mastercard.cl mastercard.cn +cnmastercard.co.idmastercard.co.ilmastercard.co.inmastercard.co.jpmastercard.co.kemastercard.co.krmastercard.co.nzmastercard.co.thmastercard.co.ukmastercard.co.vemastercard.co.zamastercard.commastercard.com.armastercard.com.aumastercard.com.bhmastercard.com.brmastercard.com.bzmastercard.com.cn +cnmastercard.com.comastercard.com.cymastercard.com.egmastercard.com.gemastercard.com.gtmastercard.com.hkmastercard.com.kwmastercard.com.lbmastercard.com.mxmastercard.com.mymastercard.com.ngmastercard.com.pemastercard.com.phmastercard.com.samastercard.com.sgmastercard.com.trmastercard.com.twmastercard.com.vemastercard.com.vn mastercard.cz mastercard.de mastercard.dk mastercard.es mastercard.eu mastercard.fi mastercard.fr mastercard.gr mastercard.hr mastercard.hu mastercard.iemastercard.inc mastercard.it mastercard.jo mastercard.ke mastercard.kz mastercard.lu mastercard.md mastercard.my mastercard.nl mastercard.no mastercard.om mastercard.pl mastercard.pt mastercard.qa mastercard.ro mastercard.rs mastercard.ru mastercard.se mastercard.si mastercard.sk mastercard.ua mastercard.usareyoucreditwise.comborderlessprepaid.combranchportal.com idservice.incinclusivegrowthscore.com findacard.com mastercad.commastercard-email.commastercardacademy.commastercardadvisors.commastercardcenter.commastercardcenter.org*&mastercardcenterforinclusivegrowth.orgmastercardconnect.commastercardezsavings.commastercardidtheftalerts.commastercardrestaurant.commastercardservices.commastercardworldwide.commasterpassteststore.commasterintelligence.commcpeaceofmind.commyaccountglobalcash.commycardbenefits.comonedinesfree.com paypass.netpieceofplastic.compredictivetechnologies.com priceless.com pricelessmarketingengine.comsbitravelcard.comshoppercentre.com!smartcommunitiescoalition.com!smartcommunitiescoalition.org startpath.comtaptotokyo.comtasteofpremium.jptravelcontroller.comwwwpaypass.combecomeindex.comcashpassport.cacashpassport.co.zacashpassport.comcashpassport.com.brcashpassport.netcorporatecashpassport.comicashpassport.com.mxintercamcashpassport.com.mx!multicurrencycashpassport.comshinhangmc.commastercardbiz.camastercardbiz.com!mastercardbusinessnetwork.com +nab.com.aunabtravellercard.com.au 53world.com53worldsweeps.comlovethiscity.commastercardmoments.compahabicilemezsurprizler.com priceless.compriceless.com.cn +cn priceless.orgpricelessafrica.compricelessarabia.compricelessaruba.compricelessbeijing.cn +cnpricelessbeijing.com#pricelessbeijing.com.cn +cnpricelesshongkong.compricelesshonolulu.compricelesspick.compricelesssantiago.compricelesssydney.compricelesssurprises.compricelesstoronto.capricelesstv.com simplify.comsimplifycommerce.comcashpassportglobe.comgwktravelex.nl travelex.be travelex.bh travelex.catravelex.co.intravelex.co.jptravelex.co.nztravelex.co.uk travelex.comtravelex.com.autravelex.com.cn +cntravelex.com.hktravelex.com.mytravelex.com.omtravelex.com.tr travelex.de travelex.fr travelex.it travelex.qatravelexae.comtravelexch.comtravelexmoneycard.combidvestbank.co.zaworldcurrencycard.co.zanab.demdex.net&"nationalaustraliaban.tt.omtrdc.netaccount-paypal.infoaccount-paypal.netaccount-paypal.orgaccountpaypal.comaccountpaypal.netaccountpaypal.org anfutong.cn +cn anfutong.comanfutong.com.cn +cn beibao.cn +cn +beibao.com beibao.com.cn +cn bill-safe.combillmelater.combillmelater.infobillmelater.net bml.infobuyfast-paysmart.net cashify.comdevtools-paypal.comexperiencebillmelater.comfundpaypal.com +gmoney.org +i-o-u.infologin-paypal.comlogin-paypal.infomywaytopay.infomywaytopay.net +pa9pal.com paaypal.com  paily.net  paily.org +paipal.com +pavpal.com paydiant.com paylike.com +paypa1.com +paypa1.org paypaal.compaypal-activate.compaypal-activate.infopaypal-activate.orgpaypal-apac.compaypal-apps.compaypal-biz.compaypal-brandcentral.compaypal-business.compaypal-business.netpaypal-business.orgpaypal-cardcash.compaypal-cash.compaypal-center.compaypal-center.infopaypal-center.netpaypal-center.orgpaypal-communication.compaypal-communications.compaypal-communications.netpaypal-community.compaypal-community.netpaypal-comunidad.compaypal-corp.compaypal-database.compaypal-database.uspaypal-donations.compaypal-dynamic.compaypal-engineering.compaypal-europe.compaypal-excelinvoicing.compaypal-exchanges.compaypal-forward.compaypal-galactic.compaypal-gift.compaypal-gifts.compaypal-gpplus.compaypal-here.compaypal-hrsystem.compaypal-innovationlab.compaypal-integration.compaypal-japan.compaypal-knowledge.compaypal-labs.compaypal-latam.compaypal-learning.compaypal-login.compaypal-login.infopaypal-login.orgpaypal-login.uspaypal-luxury.compaypal-mainstreet.netpaypal-marketing.compaypal-media.compaypal-merchantloyalty.compaypal-mobilemoney.compaypal-network.orgpaypal-notice.compaypal-notify.compaypal-online.infopaypal-online.netpaypal-online.orgpaypal-optimizer.compaypal-pages.compaypal-photocard.compaypal-plaza.compaypal-portal.compaypal-prepagata.compaypal-prepagata.netpaypal-prepaid.compaypal-profile.compaypal-proserv.compaypal-qrshopping.orgpaypal-recargacelular.compaypal-redeem.compaypal-referral.compaypal-retail.compaypal-scoop.compaypal-search.compaypal-secure.netpaypal-secure.orgpaypal-security.netpaypal-security.orgpaypal-service.orgpaypal-signin.compaypal-signin.uspaypal-special.compaypal-specialoffers.compaypal-sptam.compaypal-support.compaypal-survey.compaypal-survey.orgpaypal-status.compaypal-team.compaypal-viewpoints.net  paypal.ca +paypal.com paypal.com.cn +cn paypal.com.hk paypal.com.sg  paypal.hk paypal.info  paypal.jp  paypal.me paypal.net.cn +cn paypal.org.cn +cn  paypal.so  paypal.uspaypalbeacon.compaypalbenefits.compaypalbrasil.compaypalcommunity.cn +cnpaypalcommunity.compaypalcommunity.netpaypalcommunity.orgpaypalcorp.compaypalcredit.compaypalcreditcard.compaypalgivingfund.org paypalhere.cn +cnpaypalhere.compaypalhere.com.cn +cnpaypalhere.infopaypalhere.netpaypalhere.org paypalhere.tv paypali.net paypalinc.compaypalindia.compaypalinsuranceservices.org paypall.compaypallabs.com paypalme.com paypalnet.net paypalnet.orgpaypalnetwork.infopaypalnetwork.netpaypalnetwork.orgpaypalobjects.compaypalonline.netpaypalonline.orgpaypalprepagata.compaypalprepagata.netpaypalservice.compaypalshopping.compaypalshopping.netpaypalsurvey.com paypalx.com paypaly.com payppal.com payypal.compdncommunity.com +pp-soc.com ppaypal.com  pppds.com pypl.com  pypl.info pypl.net pypl.tvsecure-paypal.infosecurepaypal.info sslpaypal.orgthepaypalshop.comtheshoppingexpresslane.netwww-paypal.info www-paypal.usxn--bnq297cix3a.cn +cnbraintreegateway.combraintreegateway.tvbraintreepayments.combraintreepayments.infobraintreepayments.orgbraintreepayments.tv!braintreepaymentsolutions.combraintreeps.combriantreepayments.netbriantreepayments.tv card.iogetbraintree.com krakenjs.comloanbuilder.comswiftcapital.com simility.com cashify.netswiftbank.info swiftbank.usswiftfinancial.comswiftfinancial.infoswiftfinancial.netvenmo-touch.com  venmo.com +venmo.info  venmo.net  venmo.org  cash2.comfilipino-music.net +s-xoom.comwebmoneyinfo.com2.wiremoneytoirelandwithxoomeasierandcheaper.com wwwxoom.comxoom-experience.com xoom.com xoom.io xoom.net.cn +cn xoom.us xoomcom.comvenmo.s3.amazonaws.com softbank sb-mobile.jpsb-telecom.netsoftbank-ipo.comsoftbank-jp.comsoftbank-robotics.comsoftbank-telecom.comsoftbank-telecom.net softbank.jp softbank.tvsoftbankbb.comsoftbankbb.netsoftbankci.comsoftbankhawksstore.jpsoftbankmobile.netsoftbankrobotics.comsoftbanktelecom.comsoftbankusa.netsoftbankventuresasia.comsoftbankworld.com +stripe.comstripe.network stripecdn.com visa.be visa.ca visa.clvisa.cn +cn +visa.co.ao +visa.co.cr +visa.co.id +visa.co.il +visa.co.in +visa.co.jp +visa.co.ke +visa.co.ni +visa.co.nz +visa.co.th +visa.co.uk +visa.co.ve +visa.co.za visa.com visa.com.ag visa.com.ai visa.com.ar visa.com.au visa.com.az visa.com.bo visa.com.br visa.com.bs visa.com.bz visa.com.cn +cn visa.com.co visa.com.cy visa.com.dm visa.com.do visa.com.ec visa.com.ge visa.com.gt visa.com.gy visa.com.hk visa.com.hn visa.com.hr visa.com.jm visa.com.kh visa.com.kn visa.com.kz visa.com.lc visa.com.lk visa.com.ms visa.com.mx visa.com.my visa.com.ng visa.com.pa visa.com.pe visa.com.ph visa.com.pr visa.com.py visa.com.ru visa.com.sg visa.com.sv visa.com.tr visa.com.tt visa.com.tw visa.com.ua visa.com.uy visa.com.vc visa.com.vi visa.com.vn visa.cz visa.de visa.dk visa.es visa.fi visa.fr visa.gd visa.gp visa.gr visa.hk visa.hu visa.ie visa.is visa.ky visa.lt visa.lv visa.mn visa.mq visa.nl visa.no visa.pl visa.pt visa.ro visa.se visa.sk visa.so visa.sx visa.tc +visabg.com visaeurope.at visaeurope.ch visaeurope.lu visaeurope.sivisaitalia.com visakorea.comvisamiddleeast.comvisasoutheasteurope.comfinlitsummit.orgmyvisaluxuryhotels.comvisainfinite.cavisainfiniteluxuryhotels.ca!visaluxuryhotelcollection.com$ visaluxuryhotelcollection.com.br$ visaluxuryhotelcollection.com.mxvisaluxuryhotels.comvisaluxuryhotels.com.arvisasignaturehotels.com($connaissancesfinancierespratiques.ca dnsvisa.comeubluecardvisa.comfinancialsoccer.ca"financialsoccer.com.cn +cnlightbridge.commiamifintechfestival.commhshosting.compracticalbusinessskills.compracticalmoneyskills.ca#practicalmoneyskills.cn +cn'practicalmoneyskills.com.cn +cnpracticalmoneyskills.jpsoccerfinancier.catorcidadeouro.com vaultify.com vaultify.info vaultify.net visa-atm.com visa-news.jp visabank.orgvisabusinessinsights.comvisacarddesignlab.com visacards.comvisacheckout.netvisacheckout.orgvisaconciergelac.comvisadigital.comvisadigitalconcierge.com visadns.comvisadpsonline.usvisaeverywhereshop.comvisafintechfasttrack.comvisafulfillment.comvisagiftcard.usvisaglobalfinance.comvisaicsdirect.comvisainfinite.cavisainfinite.cn +cn visanet.net +visapay.cn +cnvisapcsdirect.comvisaplatinum.cn +cnvisaplatinum.com.cn +cn visaplus.comvisasavingsedge.cavisasignature.co.kr visb.org ak1.net +aka-ai.com +aka-ai.net akacrypto.net akadeem.net +akadns.com akadns6.net +akaeai.com +akafms.net akahost.net +akaint.net akam.net +akamaa.com +akamah.com +akamak.com +akamam.comakamai-access.comakamai-access.netakamai-cdn.com akamai-platform-internal.netakamai-platform-staging.comakamai-platform.netakamai-regression.netakamai-staging.netakamai-sucks.netakamai-thailand.comakamai-thailand.netakamai-trials.com akamai.co.kr +akamai.com +akamai.netakamaientrypoint.netakamaietpcnctest.com#akamaietpcompromisedcnctest.com'#akamaietpcompromisedmalwaretest.comakamaietpmalwaretest.comakamaietpphishingtest.comakamaihd-staging.net akamaihd.com akamaihd.netakamaimagicmath.netakamainewzealand.comakamaiphillipines.comakamaiphillipines.netakamaitech.comakamaitech.netakamaitechnologies.comakamaitechnologies.netakamaisingapore.netakamaized-staging.net akamaized.netakamaizercentral.com +akamci.com  akami.com  akami.net +akamii.com +akamqi.com akastream.com akastream.net +akatns.net iamakamai.com iamakamai.netsoasta-dswb.com +srtcdn.netcloudflare-dns.comcloudflare-ipfs.comcloudflare.comcloudflareapps.comcloudflareinsights.comcloudflareok.comcloudflaressl.comcloudflarestatus.comcloudflarestream.comcloudflaretest.com one.one.onetrycloudflare.comvideodelivery.net workers.dev +fastly.com +fastly.netfastlylabs.com fastlylb.netfastly-terrarium.com +zencdn.net  imgix.com  imgix.net pagecdn.com +pagecdn.io quantil.com stackpath.com stackpath.devbuypass-ssl.com buypass.com +buypass.no +buypass.se minid.no +comodo.com comodoca.com comodoca2.com comodoca3.com comodoca4.comcybertrust.co.jpcybertrust.ne.jp digicert.com freessl.com geotrust.com rapidssl.com +thawte.com  thawte.de  thawte.fr entrust.netentrustdatacard.comglobalsign-media.com globalsign.be globalsign.chglobalsign.co.ukglobalsign.comglobalsign.com.auglobalsign.com.hkglobalsign.com.sg globalsign.es globalsign.eu globalsign.frglobalsign.net globalsign.nl!secure.globalsign.com +cnocsp.globalsign.com +cn ocsp2.globalsign.com +cn identrust.comidentrust.co.uk identrust.netletsencrypt.org secom.co.jpsecomtrust.net sectigo.comenterprisessl.comhackerguardian.cominstantssl.comoptimumssl.compositivessl.com digital-id.ch digitalid.chmanaged-pki.chmanaged-pki.de pki-post.ch pki-posta.ch pki-poste.chroot-signing.chrootsigning.comssl-certificate.ch +swissid.ch swissign.com swissign.liswisssign-group.chswisssign-group.comswisssign-group.li swisssign.ch swisssign.com swisssign.li swisssign.net swisssign.orgswisssigner.chswisssigner.comswisssigngroup.chswisssigngroup.comswissstick.com swisstsa.ch swisstsa.li trustdoc.ch trustsign.ch zert.ch telekom.com +telekom.de trustwave.com verisign.asia verisign.biz verisign.chverisign.co.inverisign.co.uk verisign.comverisign.com.auverisign.com.brverisign.com.cnverisign.com.esverisign.com.hkverisign.com.sgverisign.com.twverisign.com.vn verisign.de verisign.dk verisign.es verisign.fr verisign.hk verisign.in verisign.info verisign.jobs verisign.mobi verisign.name verisign.net verisign.org verisign.pro verisign.se verisign.sg verisign.tw verisign.us verisign.vnverisigninc.com +discord.co discord.com +discord.gg discord.gift discord.gifts discord.media discord.newdiscordapp.comdiscordapp.net freenode.net +lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net +nhncorp.jp +signal.art +signal.orgsignalusers.orgslack-edge.comslack-imgs.com  slack.com +slackb.comslackcertified.com slackdemo.com slackhq.com contest.com  graph.orgquiz.directoryt.me tdesktop.com +telega.one +telegra.ph telegram.dog telegram.me telegram.orgtelegram.space +telesco.pe +tg.dev tx.meusercontent.dev asproex.comasproexapi.combinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com +bitbank.cc bitcoin.org bitfinex.com bitflyer.com bitflyer.jp +bitmex.com bitquick.co bisq.io bisq.network bitsquare.io bitstamp.net bittrex.com btcbox.co.jp +cex.io coinbase.com coinone.co.krcoinonecore.comcoinonecorp.com dogecoin.com +devcon.orgethereum.foundation ethereum.org +hbabit.com +hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com +kraken.comlocalbitcoins.comlocalbitcoinschain.com okex.com +paxful.com +zb.app +zb.com zb.io zb.live  adidas.at  adidas.be  adidas.ch adidas.co.in adidas.co.uk +adidas.com adidas.com.cn +cn adidas.com.sa adidas.com.tw  adidas.cz  adidas.de  adidas.dk  adidas.hu  adidas.ie  adidas.it  adidas.nl  adidas.pl  adidas.ru  adidas.se bby.combbycastatic.ca bbycloud.combbycontent.combbycontent.net bbyintl.com bbystatic.com  bbyurl.us bestbhy.combestbuy-audio.com"bestbuy-communityrelations.combestbuy-giftcard.infobestbuy-int.combestbuy-jobs.com +bestbuy.ca +bestbuy.cn +cn bestbuy.combestbuy.com.cn +cnbestbuy.com.mx bestbuy.infobestbuy24x7solutions.combestbuybusiness.com'#bestbuybusinessadvantageaccount.combestbuycanada.cabestbuycanada.combestbuycanadaltd.cabestbuycharityclassic.combestbuycoffeemakers.combestbuyethics.combestbuyforbusiness.cabestbuygsm.combestbuyideax.com!bestbuyphotoworkshoptours.combestbuyrewards.combestbuyrewardzone.ca bestbuys.combestbuysgeeksquad.combestbuysolutions.netbestbuystores.combestbuytradein.com bestbuyus.com besztbuy.com bextbuy.combienvenuechezbestbuy.ca cowboom.com futureshop.cainitproducts.commagnoliaav.com.cn +cn mybestbuy.commybestbuyclaims.commyrewardzone.com myrz.compacifickitchenandhome.comtiendabestbuy.comunbrandedproducts.comwelcometobestbuy.cawolfatbestbuy.comwolfatbestbuy.netwww-bestbuystores.comgeek-squad-support.comgeek-squad.netgeek-squad.orggeek-squads.net geeksquad.ca geeksquad.cc geeksquad.com geeksquad.net geeksquad.tvgeeksquadcares.comgeeksquadcentral.comgeeksquadforums.comgeeksquadonline.comgeeksquadprotectionplan.orggeeksquadservices.orggeeksquadwebroot.org gscanada.info +gsccdn.com  gslink.usonlinegeeksquad.comrocketfishproducts.com dealtree.orgtechliquidators.com +booking.cn +cn booking.com bstatic.comcostco-static.com +costco.comcostcobusinessdelivery.comcraigslist.org dmm.com  dmm.co.jpdmm-extension.com21centuryaccess.com4ebaytraders.com adcommerce.cn +cn adcommerce.tv appforebay.cn +cnappsonebay.net +asebay.com +baazee.com +bidbay.combidorbuyindia.com billpoint.combillpoint.info billpoint.tv billpoint.usbillpointnewzealand.com blogebay.combookclubcorner.combuiltfromebay.com buyitnow.com buyitnow.net buyitnow.org buyitnow.tvbuyitnowshop.net cafr.ca carebay.comcargigileads.com  cebay.comcollective99.comcommerceos.comconnectcommerce.cn +cn"connectcommerce.com.cn +cnconnectcommerce.hkconnectcommerce.infoconnectcommerce.tv connectedcommerce.cn +cnconnectedcommerce.comconnectedcommerce.tvcrececonebay.comcreditcardsbay.com cyber-bay.cn +cncyber-bay.com.cn +cncyber-bay.info cyber-bay.org +dba.dk dealbay.com dealtime.com  didce.com  douya.orgdreamtoplay.com  e-bay.com e-bay.it  e-bay.net eachpay.com eachpay.net  ebahy.comebay-authenticate.netebay-confirm.comebay-course.com ebay-cz.comebay-delivery.comebay-discoveries.comebay-fashion.com ebay-inc.com ebay-inc.net ebay-inc.orgebay-online.comebay-sales.comebay-stories.com ebay-us.comebay-vacation.com ebay.at ebay.be ebay.ca ebay.chebay.cn +cn +ebay.co.nz +ebay.co.uk +ebay.co.ve +ebay.co.za ebay.com ebay.com.ar ebay.com.au ebay.com.cn +cn ebay.com.ec ebay.com.hk ebay.com.mt ebay.com.my ebay.com.ph ebay.com.sg ebay.de ebay.es ebay.fr ebay.ie ebay.in ebay.it ebay.jp ebay.lt ebay.mn ebay.net.cn +cn ebay.nl ebay.org ebay.org.cn +cn ebay.ph ebay.pk ebay.pl ebay.sg ebay.us ebay.vn +ebay.yn.cn +cn +ebay.zj.cn +cn +ebay25.com +ebay68.com  ebaya.com ebayads.com ebayads.netebayadvertising.cn +cnebayadvertising.comebayanunsios.netebayauction.comebayaustralia.comebayauthenticate.com.cn ebaybags.com ebaybank.comebaybenefits.comebayboutique.com +ebayca.com +ebayca.org ebaycafe.com ebaycar.comebaycareers.com ebaycbt.co.kr ebaycdn.net ebaychina.netebayclassifiedsgroup.comebayclassifieds.cn +cnebayclassifieds.com"ebayclassifieds.com.cn +cnebayclassifieds.infoebayclassifieds.orgebayclassifieds.tvebayclassifiedsgroup.comebayclassifiedsgroup.infoebayclassifiedsgroup.orgebayclassifies.com ebayclub.com ebaycoins.com ebaycom.comebaycommercenetwork.comebaycourse.com  ebayd.com +ebayde.com ebaydesc.cn +cnebaydesc.com.cn +cnebaydlassifieds.com +ebaydns.cn +cn ebaydts.com ebayedu.comebayeletro.comebayenterprise.cn +cnebayenterprise.com!ebayenterprise.com.cn +cnebayenterprise.infoebayenterprise.netebayenterprise.tv ebayetc.comebayexpress.sgebayfashion.comebayfashion.netebayforcharity.orgebayforeclosure.orgebayfrance.comebayglobalshipping.com ebaygroup.com ebayhabit.com ebayheels.com ebayhots.com ebayimg.com ebayinc.com ebayinc.net ebayinc.org ebayincconnectedcommerce.netebayinkblog.comebayinternetsalestax.com +ebayit.comebayjewelry.com ebayjob.com +ebayla.orgebaylisting.com ebaylocal.netebaylocationsdevacances.com ebaymag.comebaymainstreet.com ebaymall.comebaymarketplace.net ebaymotors.ca ebaymotors.cn +cnebaymotors.comebaymotors.com.cn +cnebaymotors.orgebaymotorsblog.com ebaynow.com ebaynyc.com +ebayon.com +ebayon.netebayoncampus.com ebayopen.comebayopensource.comebayopensource.netebaypakistan.net ebaypark.com ebayparts.com ebaypedia.cn +cnebaypedia.com.cn +cnebayprivacycenter.com +ebayqq.com ebayradio.com ebayrtm.comebayseller.comebayshoesstore.com ebayshop.comebayshop111.comebayshopping.cn +cnebayshopping.com.cn +cnebayshopping.orgebaysocial.com ebaysocial.ru ebaysoho.com ebaysohos.com ebaystatic.cn +cnebaystatic.com ebaystore.comebaystore77.com ebaystores.cn +cn ebaystyle.comebaysweden.com  ebayt.comebaytechblog.comebaytopratedseller.netebaytrading.comebaytradingassistant.com +ebaytv.org ebayuae.netebayvakantiehuizen.com ebayvalet.comebayvietnam.netebayworlds.com  ebayy.com edisebay.com  eebay.com epinions.comeu-consumer-empowerment.comexpertmaker.comfairmarket.comfragrancebay.comfrancemail.com half.com half.com.cn +cn half.tvhalfcanada.com halfjapan.comhandbagsoutletebay.com  iebay.com irribay.comitsbetterwhenyouwinit.com liketwice.comliveauction.com milofetch.com musicbay.netmyconstructionworld.net +myebay.com  nebay.net paisapay.cc paisapay.info paisapay.tv premobay.comprivatemarketplaces.netprivatemarketplaces.us prostores.cn +cn prostores.comprostores.com.cn +cn rethink.net shopibay.net shoping.comsourcingforebay.com.cnsourcingforebay.netsourcingforebay.tv speybay.comstoresense.com +svpply.com telebay.com telesell.com texttobuy.orgtheebayshop.comtheopportunityproject.orgtowerauction.com  vendu.com weareebay.comwatch-ebay.org wwwdecide.com wwwebay.com wwwebay.net wwwwebay.com xindelu.comxn--3et96bj49ahpq.comxn--4vq475g.comxn--4vq477m.comxn--7hv594h.comxn--7hvy28f.cn +cnxn--hb4aw0g.comxn--q41am8x.comxn--qoq462m.comxn--tkry91n.comxn--ubt498knmf.comxn--xsq421m.comxn--xsq605n.comxn--xsq959n.comxn--yf1at58a.com  xxbay.com  yibei.orggittigidiyor.netgittigidiyorsikayet.com +gumtree.sg  jijiji.ca kiji.ca kijii.ca kijij.ca  kijiji.ca kijijiauto.cakijijiautos.ca kijijidns.cn +cnkijijidns.com.cn +cnkijijiforbusiness.ca +kijijii.ca kijijiraps.ca kijji.ca +kijjiji.ca automobile.fr  mobile.demobileinternational.com&mobileinternational.com.cn +cn +q10.jp qoo10.jpachievementanalytics.comcdn-terapeak.comlistinganalytics.netmarketexecutive.net tearapeak.com terapeack.com terapeak.ca terapeak.cn +cn terapeak.comterapeak.com.hk terapeak.hk terapeak.info teraperk.com terrapeak.com thebayuk.com +nexcat.com nexpart.com +nexpart.tv renchead.comwhisolutions.com wrenchead.com-)ebay-25-assets.s3-us-west-1.amazonaws.comfarfetch-apps.comfarfetch-contents.com farfetch.cn +cn farfetch.comfarfetch.com.cn +cn farfetch.netfarfetch.net.cn +cn  fflnk.net guccichimeforchange.orggucci.cn +cn  gucci.comguccimuseo.comguccitimeless.comregiongold.com +hm.com hm.com.cn +cnhomedepot-static.com homedepot.comikea.cn +cn ikea.com ikea.net  ingka.com  ingka.devingkacentres.comloveminiso.com.br miniso-au.com miniso-bh.com miniso-np.com miniso-nz.com  miniso.by  miniso.ca miniso.cn +cn  miniso.co miniso.co.id miniso.co.tz +miniso.com miniso.com.es miniso.com.gr miniso.com.mx miniso.com.pl miniso.com.py miniso.com.tr  miniso.ge  miniso.ie  miniso.jp  miniso.ma  miniso.my  miniso.pe  miniso.pk  miniso.ua  miniso.uz minisohome.cn +cnminisoindia.comminisojordan.comminisokorea.comminisolife.co.zaminisothailand.comminisovietam.vn minsio.cn +cn myminiso.com muji.com muji.com.cn +cn muji.com.hk muji.eu muji.net muji.tw muji.us mujikorea.netnikeair-nike-shoes.com airmax360.combeijingnike.combetternike.combuynikechina.comcheap-nike.comcheapnikedunks.comcheapnikeoutlet.comclassicnike.comcnnikebrand.comcustomnikeshoes.com easynike.com +eenike.comfashionnike.com finenike.comfoampositeshoes.comgoldnikeclub.com +gonike.comhandbags-nike.comhightopnikes.com +idnike.cominikesneakers.com just-do-it.cn +cn justdoit.uskicksnike1.comkidsnikeshoes.com +mynike.comnike-air-max.comnike-dunksb.com nike-fr.com nike-org.com nike-shox.cn +cn nike-uk.com nike-us.com nike-usa.com nike.cinike.cn +cn nike.com nike.com.br nike.com.hk nike.gy nike.hk  nike.shop nike.usnike.xn--hxt814e nike0594.com +nike23.comnikeadidas.comnikeairhuarache.comnikeairmax.comnikeairmaxs.comnikeairmaxshoes.comnikeairrift.com nikeasia.comnikeaustralia.com nikeaw77.com  nikeb.com nikebbn.comnikebetrue.comnikebetterworld.cn +cnnikebetterworld.com"nikebetterworld.com.cn +cnnikebetterworld.infonikebetterworld.netnikebetterworld.org nikebiz.info nikebuy.com +nikeby.com nikecdn.comnikecompany.comnikeconfluence.com nikechina.cn +cnnikechosen.com nikecloud.com nikeclub.com nikecraft.com nikedawn.com nikedunks.netnikedunksshoes.com nikeelite.comnikefactorystore.com nikefind.com nikefirm.comnikefoamposites.comnikefoampositeshoes.comnikefootballcleats.comnikefootballgloves.comnikefootballjersey.comnikefoundation.org +nikefr.comnikefrance.com nikefree.comnikefreeshoes.comnikefuelband.comnikegadgets.comnikegenealogy.com nikegolf.ca nikegolf.cn +cn nikegrid.com nikehelp.comnikehightops.comnikehyperdunk.com nikeid.cn +cn nikeid.com.cn +cnnikeidshoes.com nikeinc.comnikeinc.com.cn +cnnikeincchemistry.comnikeinstock.com +nikeit.comnikeitalia.com nikeitaly.com +nikekd.com nikekid.com +nikelab.cn +cnnikelab.com.cn +cn nikelink.comnikeliuxiang.cn +cnnikeliuxiang.comnikeliuxiang.com.cn +cn nikelives.comnikelunarglide.com nikemall.cn +cnnikemall.com.cn +cnnikemarketing.com nikenews.com +niken7.comnikeonlinestore.comnikeoutletstore.comnikeoutletstores.comnikepioneer.com nikeplus.com nikeplus.org nikepress.com nikeprice.comnikeproduct.comnikepromax.comnikeresponsibility.comnikereuseashoe.comnikerunclub.cn +cnnikerunclub.com.cn +cnnikerunner.comnikerunning.com.cn +cnnikerunningshoes.com +nikesb.comnikesbdunks.netnikeseason.comnikeselling.comnikesellorder.comnikeshoemarket.comnikeshoes-store.comnikeshoes21.comnikeshoes4u.comnikeshoescity.comnikeshoesgroup.comnikeshoesinc.comnikeshoesmarket.comnikeshoesretro.comnikeshoeswon.comnikeshoponline.comnikeshoxsale.com nikesku.comnikesnowboarding.comnikesoccercleats.comnikesportswear.comnikestares.com nikestore.cn +cn nikestore.comnikestore.com.aunikestyles.com nikeswim.comniketaiwan.netniketracking.comniketradeweb.comniketrainer.comniketrainers.comniketraining.com nikeusa.com nikewear.com  nikey.com nikezoom.com nke6.comoutletnike.com runnike.comrunningnike.comsale-nikeshoes.comstatic-nike.com swoo.sh +swoosh.com  swoosh.tvthedailysnkr.comverygoodnike.comwomensnikeshox.comxn--74q035i.xn--hxt814e nordstrom.comnordstrommedia.com shopee.cn +cn shopee.co.id shopee.co.th +shopee.com shopee.com.br shopee.com.my  shopee.ph  shopee.sg  shopee.tw  shopee.vnshopeemobile.com shopeesz.com +cn +shp.ee +target +target.comtargetimg1.com walmart wal-mart.com +wal.cowalmart-content.com walmart.comwalmart.pharmacywalmartimages.com +wmt.cobetterexplained.com brilliant.org apa.orgpsyccareers.com cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.orgnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.comwebofscience.com doi.org doi.info els-cdn.comelsevier-ae.com elsevier.com elsevier.ioengineeringvillage.com  evise.com +scopus.comscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.sk ic.ac.ukimperial.ac.ukimperialbusiness.schoolimperial.insendi.commit mit.edu mit.netmitpressjournals.orgamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com +ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.comserialssolutions.com proquest.comsciencedirect.comsciencedirectassets.com +apress.com springer.comspringerlink.comspringernature.com wkap.nl tandf.co.uktandfonline.comtaylorandfrancis.comtaylorfrancis.com +aclweb.org acm.org altmetric.comanalytictech.comannualreviews.org  arxiv.org asha.org berkeley.edubiomedcentral.com biorxiv.org  brill.com cell.comcomputingreviews.com degruyter.comdentalhypotheses.comelifesciences.org europepmc.orgfrontiersin.org gale.com galegroup.com  ggsrv.com hindawi.com informs.orgisca-speech.orgjamanetwork.comjapanknowledge.comjbe-platform.com jmlr.org jneurosci.org  jstor.org kuke.comlawdata.com.twliteratumonline.com mdpi.com +nature.com nejm.org neurology.org ovid.com  peerj.comphysiology.org plos.org pnas.org princeton.eduresearchgate.netroutledgehandbooks.comroyalsocietypublishing.org sagepub.comscholarpedia.orgsciencemag.orgscientificamerican.com scitation.orgsilverchair-cdn.comspiedigitallibrary.orgstatsmakemecry.com thelancet.com uchicago.edu ucla.edu  umass.edu  wiley.com yale.educern ams02.space cern.ch cixp.netdotcernpilot.info  ippog.orglinearcollider.orgchinapower.csis.org code.orgcodecademy.comcoursera-for-business.orgcoursera.community coursera.help coursera.org edx.org edx-cdn.org +egghead.iofreecodecamp.orgkhanacademy.org kastatic.org +knovel.com laracasts.commasterclass.com mzed.com oreil.ly oreilly.comoreilly.com.cn +cnoreilly.revieworeillystatic.com +orl.ly sitepoint.comskillshare.com ted.com +tedcdn.com udacity.com  udemy.com udemycdn.com w3schools.com abema.io abema.tv ameba.jp ao3.orgarchiveofourown.orgarchiveofourown.comarchiveofourown.net +att.tv atttvnow.comattwatchtv.com directv.com  dtvce.comnettyinternet.com gamer.com.twbahamut.com.twgamer-cds.cdn.hinet.netgamer2-cds.cdn.hinet.net bandcamp.com +bcbits.com blizzard.cn +cn blizzard.comblizzardgearstore.comblz-contentstack.com blzstatic.cn +cn +battle.netbattlenet.com.cn +cn bnet.163.com +cnblizzard.nefficient.co.krblzddist1-a.akamaihd.netblzddistkr1-a.akamaihd.netbnetcmsus-a.akamaihd.netbnetproduct-a.akamaihd.netbnetshopus.akamaized.net diablo3.comdiabloimmortal.comdi.res.netease.com +cn!diablo3.nosdn.127.net +cnfiresidegatherings.complayhearthstone.com%hearthstone.nosdn.127.net +cnheroesofthestorm.com%hearthstone.nosdn.127.net +cn"heroes.nos.netease.com +cnplayoverwatch.com#overwatch.nosdn.127.net +cn starcraft.comstarcraft2.comsc2.nosdn.127.net +cnplaywarcraft3.comworldofwarcraft.com wowchina.com +cnwow.nosdn.127.net +cnblizzcon-a.akamaihd.netblz.nosdn.127.net +cnblzmedia-a.akamaihd.netblznav.akamaized.net blubrry.com  castro.fmdeviantart.comdeviantart.net da-files.comabc-studios.com abc.com edgedatg.com espn.com espncdn.com watchespn.comespn.hb.omtrdc.netespndotcom.tt.omtrdc.net +marvel.commarvel10thanniversary.commarveldimensionofheroes.commarvelparty.netmarvelpinball.commarvelsdoubleagent.commarvelspotlightplays.com marvelsuperheroseptember.commarvelsuperwar.comthemarvelexperiencetour.comnatgeomaps.comnationalgeographic.com"nationalgeographicpartners.com ngeo.comadventuresbydisney.com +babble.com babyzone.com +dilcdn.comdisney-asia.comdisney-discount.comdisney-plus.netdisney-studio.comdisney-studio.net  disney.be  disney.bg  disney.ca disney.co.il disney.co.th disney.co.uk disney.co.za +disney.com disney.com.au disney.com.br  disney.cz  disney.de  disney.dk  disney.es  disney.fi  disney.fr  disney.gr  disney.hu  disney.id  disney.in  disney.io  disney.it  disney.my  disney.nl  disney.no  disney.ph  disney.pl  disney.pt  disney.ro  disney.se  disney.sgdisneyadsales.comdisneyarena.comdisneyaulani.comdisneybaby.comdisneycareers.comdisneychannelonstage.comdisneychannelroadtrip.comdisneycruisebrasil.comdisneyenconcert.comdisneyiejobs.comdisneyinflight.comdisneyjunior.comdisneyjuniortreataday.comdisneylatino.comdisneymagicmoments.co.ildisneymagicmoments.co.ukdisneymagicmoments.co.zadisneymagicmoments.dedisneymagicmoments.esdisneymagicmoments.frdisneymagicmoments.gen.trdisneymagicmoments.grdisneymagicmoments.itdisneymagicmoments.pl disneyme.comdisneymeetingsandevents.comdisneymovieinsiders.comdisneymusicpromotion.comdisneynewseries.com disneynow.comdisneypeoplesurveys.comdisneyplus.comdisneyredirects.comdisneysrivieraresort.comdisneystore.comdisneysubscription.comdisneyturkiye.com.trdisneytvajobs.comdisneyworld-go.com +dssott.comgo-disneyworldgo.com +go.com  mickey.tvmoviesanywhere.complaymation.comshopdisney.comshops-disney.comsorcerersarena.comspaindisney.com starwars.com#starwarsgalacticstarcruiser.comstreamingdisney.netthestationbymaker.comthisispolaris.comwatchdisneyfe.com dawngate.com eastore.comlordofultima.com +origin.com  origin.tv#cloudsync-prod.s3.amazonaws.comorigin-a.akamaihd.netrtm.tnt-ea.comssl-lvlt.cdn.ea.comawayoutgame.combattlefieldbadcompany2.combattlefront2.combattlefrontii.combejewled-stars.combejeweledstars.comcapitalgames.com chillingo.comcommandandconquer.comconquerwithcharacter.com  crysis.jp dawngate.comdawngatechronicles.com +dicela.com +dicela.netea-anz-press.com +ea.com eaaccess.comeacashcard.com eacodigos.com eakorea.co.kr eamobile.com eanordic.com +eaplay.com easports.com easports.jpeasportsactive.comeasportsactiveonline.comeasportsfootball.comeasportsfootballclub.comeasportsmma.comeasportsworld.comelectronicarts.comelectronicarts.fr futpromos.com futunited.comghostgames.comheroesofdragonage.com hutpromos.commaddenchampionship.commaddenrewards.commaddenseason.infomaddenseason.netmaddenseason.org  maxis.commysimsracing.com play4free.com playapex.com pogo.com pogobeta.com +popcap.comprojectapex.com pvzheroes.com spearhead.krspeedhunters.com  spore.com ssx3.comstarwarsbattlefront.comstarwarsbattlefront2.comtiberiumalliances.com tiburon.com +tnt-ea.comultimaforever.com unravel2.comunraveltwo.comvisceralgames.com +yogify.comanthemgame.comanthemthegame.comapexlegends.comprojectapex.combattlefield.combattlefield1943.combattlefield3.combattlefield4.combattlefield5.combattlefieldheroes.combattlefieldv.com battlelog.com bioware.combiowarestore.com eamythic.com eamythic.net cncrivals.comcommandandconquer.comtiberiumalliances.comcamelot-europe.comcamelotherald.comcamelotherald.net daoc.netdarkageofcamelot.comdarkness-risen.comdeadspacegame.com dice.se dragonage.comdragonagekeep.comdragonagemovie.comthedreadwolfrises.comdungeonkeeper.cndungeonkeeper.comdungeonkeeper.com.cneafootballworld.comfifastreet.comfifastreet3.com frostbite.comindustrialtoys.commasseffect.commasseffectarchives.comeamirrorsedge.commirrorsedge.commirrorsedge.jpmirrorsedge.netmirrorsedge2.commirrorsedge2d.comblackboxgames.comeablackbox.comneedforspeed.comneedforspeedboost.comneedforspeeddriftkings.comneedforspeedeliminator.comneedforspeedlightning.comneedforspeedoverdrive.comneedforspeedproven.comneedforspeedredline.comneedforspeedshowdown.comneedforspeedstreetkings.comneedforspeedtakedown.comneedforspeedtherun.comneedforspeedtimeattack.com#needforspeedundergroundeast.com nfsworld.comteamneedforspeed.complantsvszombies2.com +pvzgw2.com pvzheroes.comseaofsolitude.comsimcity-buildit.com simcity.com +skate2.com spearhead.krstarwarsfallenorder.comstarwarsjedifallenorder.comstarwarstheoldrepublic.comswjedifallenorder.com  swjfo.com  swtor.com  swtor.net +mysims.com thesims.com thesims3.com thesims4.comthesimssocial.com titanfall.commythicentertainment.commythicentertainment.netmythicgames.comultimaonline.com +uo.com uoherald.com xdsummit.comea.tt.omtrdc.neteaassets-a.akamaihd.netbattlebreakers.com epicgames.com fortnite.com paragon.complayparagon.comroborecall.comshadowcomplex.com spyjinx.comunrealengine.comunrealtournament.com6*^cdn\d-epicgames-\d+\.file\.myqcloud\.com$ +cn*&^epicgames-download\d\.akamaized\.net$;/^epicgames-download\d-\d+\.file\.myqcloud\.com$ +cn fireside.fm"avatargarenanow-a.akamaihd.netcdngarenanow-a.akamaihd.net!dlmobilegarena-a.akamaihd.net garena.co.id garena.co.th +garena.com garena.live  garena.my  garena.ph  garena.sg  garena.tv  garena.tw  garena.vn garenanow.com seagroup.com gog.comgog-statics.comgog.qtlglb.com +cn$gogalaxy.gog-statics.com +cn'menu-static.gog-statics.com +cn'productcard.gog-statics.com +cn(static-login.gog-statics.com +cn'www4-static.gog-statics.com +cn, ^images(-\d)?\.gog-statics\.com$ +cn cinemax.comforthethrone.com hbo.com hboasia.com  hbogo.com hbogoasia.com hbogoasia.hk +hbomax.com +hbonow.com  maxgo.com +112263.com callhulu.comfindyourlimits.com freehulu.com  hooloo.tv  hoolu.com hoolu.tv hu1u.com huloo.cc huloo.tv hulu.com hulu.tv hulu.ushuluaction.com +huluad.com huluapp.com huluasks.com hulucall.com hulufree.com hulugans.comhulugermany.com +hulugo.com +huluim.comhuluinstantmessenger.com huluitaly.com hulunet.comhulunetwork.com huluplus.comhulupremium.comhulupurchase.com +huluqa.comhulurussia.com huluspain.comhulusports.comhulustream.com huluteam.com +hulutv.com huluusa.comjoinmaidez.com mushymush.tv +myhulu.comoriginalhulu.com payhulu.comregisterhulu.comthehulubraintrust.comwwwhuluplus.com imdb.com imdb.tomedia-imdb.cominternationalsaimoe.comkingkong.com.twkingkongapp.com litv.tv megaphone.fm moov.hk fast.com +netflix.ca netflix.com netflix.netnetflixinvestor.comnetflixtechblog.com nflxext.com nflximg.com nflximg.netnflxsearch.net +nflxso.net nflxvideo.netnico +nicodic.jp nicomanga.jp niconico.com nicoseiga.jp nicovideo.jp nimg.jp simg.jp100classicbooks.com +amiibo.comayudanintendo.combowsersinsidestory.comexcitebots.comflipnotestudio.comgloryofheracles.comhackyourconsole.comkirbysuperstarultra.comkirbysepicyarn.comlegendofzelda.cn +cn legendofzelda.com.cn +cn miitomo.commiitomo.com.cn +cn miiverse.com nentindo.netnintendo-europe-sales.comnintendo-europe.com nintendo.at nintendo.be nintendo.chnintendo.co.jpnintendo.co.krnintendo.co.uknintendo.co.za nintendo.comnintendo.com.hknintendo.com.pt nintendo.de nintendo.dk nintendo.es nintendo.eu nintendo.fi nintendo.fr nintendo.it nintendo.net nintendo.nl nintendo.no nintendo.pt nintendo.ru nintendo.se nintendo.twnintendo3ds.comnintendodsi.comnintendoeurope.comnintendolabo.cn +cnnintendonetwork.netnintendonyc.comnintendostore.comnintendoswitch.comnintendoswitch.netnintendoswitchtogether.compersonaltrainermath.complaynintendo.comsupersmashbros.cn +cn!supersmashbros.com.cn +cnthelegendarystarfy.comthewonderful101.comwariolandshakeit.comwariowarediy.comyoshisnewisland.comac-pocketcamp.comdiddykongracing.com dkr.com donkeykongcountryreturns.comfire-emblem-heroes.comfireemblemawakening.com +dialga.com giratina.com +kyurem.com pokedex3d.compokemon-moon.compokemon-sun.compokemon-sunmoon.com pokemon.compokemonbank.compokemonblackwhite.com pokemonbw.compokemonchampionships.compokemongoldsilver.compokemonhome.compokemonletsgoeevee.compokemonletsgopikachu.compokemonmysterydungeon.compokemonpicross.compokemonplatinum.compokemonrubysapphire.compokemonsunmoon.compokemonswordshield.compokemonultrasunmoon.compokemonvgc.compokemonwifi.net xn--mts47c3w9b1qr.cn +cnxn--mts47c3w9b1qr.netsplatoon2tournament.com starfox.comdrmario-world.commarioandluigidreamteam.commariobroswii.com mariokart.cn +cnmariokart.com.cn +cnmariokart7.commariokart8.commariosupersluggers.comnewsupermariobrosu.comsupermario.comsupermario3dworld.com!supermariobros.com.cn +cnsupermariogalaxy.comsupermariorun.comsuperpapermario.comnintendowii.com  wii-u.com +wiifit.com wiifitu.com wiipartyu.com wiisports.comwiisportsresort.comwiiugamepad.com  wiivc.net xenoblade.com op.ggopgg-static.akamaized.net overcast.fm  pixiv.net  pixiv.org pixiv.co.jp  pximg.net playstationplaystation.complaystation.net sonyentertainmentnetwork.com +pca.stpocketcasts.com"api-priconne-redive.cygames.jpomotenashi.cygames.jp%!prd-priconne-redive.akamaized.nethistoryofdota.comhistoryofdota.nethistoryofdota.orginstituteofwar.orgmolesports.com rgpub.ioriot-games.com riot.com riot.net riotcdn.netriotgames.co.kr riotgames.comriotgames.info riotgames.jp riotgames.net riotgames.tv riotpin.comriotpoints.com rstatic.net supremacy.com supremacy.net championshipseriesleague.com lcsmerch.comleaguehighschool.comleagueoflegends.caleagueoflegends.cn +cnleagueoflegends.co.krleagueoflegends.comleagueoflegends.infoleagueoflegends.krleagueoflegends.netleagueoflegends.orgleagueoflegendsscripts.comleaguesharp.infoleaguoflegends.comlearnwithleague.comlol-europe.com lolclub.org lolespor.comlolesports.com lolfanart.net +lolpcs.com lolshop.co.kr lolstatic.comlolusercontent.com +lpl.com.cn +cn pvp.net +pvp.tv ulol.comlolstatic-a.akamaihd.netrockstargames.com +rsg.sc1-gamedownloads-rockstargames-com.akamaized.net)%media-rockstargames-com.akamaized.net*&videos-rockstargames-com.akamaized.net fandango.com mgo.commgo-images.com ravm.tv roku.com rokutime.com dishworld.comslinginternational.com  sling.commovenetworks.com +movetv.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com +wwtbam.comyourfantasybeginsnow.comsoundcloud.com +sndcdn.com byspotify.com pscdn.co scdn.co spoti.fispotify-everywhere.com spotify.comspotify.designspotifycdn.comspotifycharts.comspotifycodes.comspotifyforbrands.comspotifyjobs.com fanatical.comhumblebundle.complayartifact.com +s.teamsteam-chat.comsteamcommunity.comsteamcontent.comsteamgames.comsteampowered.comsteamstatic.comsteamusercontent.comunderlords.comvalvesoftware.com wmsjsteam.com +cn csgo.wmsj.cn +cndl.steam.ksyna.com +cn dota2.wmsj.cn +cn st.dl.bscstorage.net +cnst.dl.eccdnx.com +cn!st.dl.pinyuncloud.com +cn&steampowered.com.8686c.com +cn%steamstatic.com.8686c.com +cn steambroadcast.akamaized.netsteamcdn-a.akamaihd.net!steamcommunity-a.akamaihd.netsteamstore-a.akamaihd.net#steamusercontent-a.akamaihd.net"steamuserimages-a.akamaihd.netsteamunlocked.net syosetu.com +muscdn.com +musical.ly +tiktok.com tiktokcdn.com tiktokv.com#p16-tiktokcdn-com.akamaized.net ext-twitch.tv  jtvnw.net  ttvnw.net  twitch.tv twitchcdn.net twitchsvc.net ubi.com ubisoft.com  uplay.com,(ubisoft-uplay-savegames.s3.amazonaws.com,(ubisoft-orbit-savegames.s3.amazonaws.com)uplaypc-s-ubisoft.cdn.ubi.com +cn +vhx.tv +vhxqa1.com +vhxqa2.com +vhxqa3.com +vhxqa4.com +vhxqa6.comvimeo-staging.comvimeo-staging2.com  vimeo.com vimeo.frvimeobusiness.com vimeocdn.comvimeogoods.comvimeoondemand.comvimeostatus.comlivestream.com abow.jp angelbeats.jp +anigema.jpcharlotte-anime.jpclannad-movie.jpheaven-burns-red.comkamisama-day.jpkamisama-maeda-lab.com koubaibu.jplitbus-anime.com product.co.jprewrite-anime.tvvisualarts.gr.jpvisual-arts.jp +viu.tvapi.viu.now.com^ewcdn[0-9]{2}\.nowe\.com$ viu.com dfp6rglgjqszk.cloudfront.net!d1k2us671qcoau.cloudfront.net!d2anahhhmp1ffz.cloudfront.net +weverse.io wwe.com wwe9.com +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.comcallersbane.com minecraft.netminecraftshop.com +mojang.comforzamotorsport.netforzaracingchampionship.com forzarc.comorithegame.comrenovacionxboxlive.comtellmewhygame.com xbox.co xbox.com xbox.eu xbox.org +xbox360.co xbox360.com +xbox360.eu xbox360.org +xboxab.comxboxgamepass.comxboxgamestudios.com xboxlive.cn +cn xboxlive.com +xboxone.co xboxone.com +xboxone.euxboxplayanywhere.comxboxstudios.com +xbx.lv yande.re cvnad.com +ads +iyoowi.com +ads +got001.com +got002.com jstucdn.com playcvn.com rrys.tv rrys2019.com rrys2020.com rrysapp.com  yyets.com +zimuzu.com  zimuzu.tv zmz2019.com +zmzapi.com +z5.app +z5.com zee5.com zee5.in zee5.tvzeebioskop.com zeetv.co.uk  zeetv.com  zeeuk.com +0x0.st db.ttdropbox-dns.com dropbox.com dropbox.techdropboxapi.comdropboxbusiness.comdropboxcaptcha.comdropboxforum.comdropboxforums.comdropboxinsiders.comdropboxmail.comdropboxpartners.comdropboxstatic.comdropboxusercontent.comgetdropbox.com&"paper-attachments.s3.amazonaws.com +gfycat.com  imgur.com imgurinc.com embed-cdn.comstreamable.com 4cdn.org  4chan.org 4channel.org 2ch.net 5ch.net avsforum.com dcard.io dcard.tw  doom9.org +lih.kg  lihkg.com pincong.rocks  quora.com quoracdn.net qr.ae +reddit.comredditstatic.comredditmail.comredditmedia.com redd.it 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au +mi9.com.au +mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au9to5google.com 9to5mac.com9to5terminal.com 9to5toys.com dronedj.com electrek.cospaceexplored.com afp.com afpforum.com +ajplus.net aljazeera.com aljazeera.netpalestineremix.comsarajevopodopsadom.comsrebrenica360.com syhacked.comamericasvoice.news +ap.org +apnews.comappledaily.comappledaily.com.hkappledaily.com.tw appledaily.hkapplefruity.comapplehealth.com.hk +atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.comappleinsider.com  asahi.com asahicom.jpasahishimbun.sc.omtrdc.netbbc  bbc.co.uk bbc.com +bbci.co.uk bbgwatch.com  bloomberg bbgevent.com bbhub.io +bbthat.com bgov.com bloomberg.cnbloomberg.co.jpbloomberg.co.kr bloomberg.combloomberg.com.brbloombergapps.combloombergarcade.combloombergbeta.combloombergbna.combloombergbreakaway.combloombergbriefs.combloombergchina.combloombergenvironment.combloombergforeducation.combloomberggovernment.combloombergindices.combloombergindustry.combloomberglabs.combloomberglaw.combloomberglive.combloomberglp.combloombergmedia.combloombergnext.combloombergpolarlake.combloombergprep.combloombergquint.combloombergradio.combloombergsef.combloombergspace.combloombergstatus.combloombergsurvey.combloombergtax.combloombergtax1.combloombergtaxtech.com!bloombergtradingchallenge.combloombergtv.mnbloombergvault.combloombergview.comblpcareers.com blpevents.comblpprofessional.com bmia.org bnef.combusinessweekmag.comlondonmithraeum.comneweconomyforum.comnewenergyfinance.comtechatbloomberg.com  boxun.combowenpress.com breitbart.com +c-span.orgc-spanvideo.orgcabletv.com.hk i-cable.comcaijinglengyan.comcbs showtime cbs.comcbscorporation.com cbsi.com +cbsi.video +cbsiam.com  cbsig.net +cbsimg.netcbsinteractive.comcbsistatic.com cbsivideo.com cbsnews.comcbspressexpress.com cbssports.com cbsstatic.com cbssvideo.com +viacbs.com +viacom.com viacomcbs.comviacomcbspressexpress.com paramount.comchinadecoding.comchinadigitaltimes.net cnbc.com +cnbcfm.com +nbcuni.comnbcudigitaladops.com cnn.com +cnn.io cnnarabic.com cnnlabs.com cnnmoney.ch cnnmoney.comcnnmoneystream.comcnnpolitics.com +cup.com.hk d100.net  anm.co.uk  dailym.aidailymail.co.uk dailymail.comdailymail.com.au dailymail.dkdailymailonline.comdmgmediaprivacy.co.ukmailhealth.commailonline.co.ukmailonline.commailonsunday.co.ukmailonsunday.ie metro.co.uk +mol.imthisismoney.co.uk +thismon.ee +dw.com dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.cz +forbes.com forbesimg.comfoxfox-corporation.com fox-news.com fox.com +fox.tv fox10.tv fox10news.comfox10phoenix.com  fox11.comfox13memphis.com fox13news.com  fox23.comfox23maine.com +fox247.com  fox247.tv  fox26.comfox26houston.comfox28media.com  fox29.comfox2detroit.com fox2news.com  fox32.comfox32chicago.comfox35orlando.comfox38corpuschristi.com fox42kptm.com  fox46.comfox46charlotte.com  fox47.com fox49.tv fox4news.com fox51tns.netfox5atlanta.com +fox5dc.com +fox5ny.com fox5storm.com fox6now.com fox7.comfox7austin.com fox9.comfoxacrossamerica.comfoxaffiliateportal.comfoxandfriends.com +foxbet.comfoxbusiness.comfoxbusiness.tvfoxbusinessgo.comfoxcanvasroom.comfoxcareers.comfoxcharlotte.com foxcincy.com foxcincy.jobs foxcincy.netfoxcollegesports.comfoxcorporation.comfoxcreativeuniversity.com foxcredit.com foxcredit.org foxd.tv +foxdcg.comfoxdeportes.comfoxdeportes.netfoxdeportes.tvfoxdigitalmovies.com foxdoua.comfoxentertainment.com +foxest.com +foxfaq.com +foxfdm.com foxfiles.com +foxinc.com foxkansas.com  foxla.com foxla.tvfoxlexington.comfoxmediacloud.com foxnation.comfoxnebraska.com +foxneo.comfoxneodigital.comfoxnetworks.infofoxnetworksinfo.com +foxnews.cc foxnews.com foxnews.net foxnews.org +foxnews.tvfoxnewsaffiliates.comfoxnewsaroundtheworld.comfoxnewsb2b.comfoxnewschannel.com foxnewsgo.net foxnewsgo.org foxnewsgo.tvfoxnewshealth.comfoxnewslatino.comfoxnewsmagazine.comfoxnewsnetwork.comfoxnewsopinion.comfoxnewspodcasts.comfoxnewspolitics.comfoxnewsradio.comfoxnewsrundown.comfoxnewssunday.com  foxon.comfoxphiladelphia.com foxpoker.com  foxrad.io foxredeem.comfoxrelease.comfoxrichmond.com foxrobots.comfoxsmallbusinesscenter.comfoxsmallbusinesscenter.netfoxsmallbusinesscenter.org foxsoccer.net foxsoccer.tvfoxsoccermatchpass.comfoxsoccerplus.comfoxsoccerplus.netfoxsoccerplus.tvfoxsoccershop.comfoxsports-chicago.comfoxsports-newyork.comfoxsports-world.com foxsports.cl foxsports.cofoxsports.co.ve foxsports.comfoxsports.com.arfoxsports.com.bofoxsports.com.brfoxsports.com.cofoxsports.com.ecfoxsports.com.gtfoxsports.com.mxfoxsports.com.pefoxsports.com.pyfoxsports.com.uyfoxsports.com.ve foxsports.gtfoxsports.info foxsports.netfoxsports.net.br foxsports.pe foxsports.sv foxsports.uyfoxsports2.comfoxsportsflorida.comfoxsportsgo.comfoxsportsla.comfoxsportsnetmilwaukee.comfoxsportsneworleans.comfoxsportsracing.comfoxsportssupports.comfoxsportsuniversity.comfoxsportsworld.comfoxstudiolot.com foxsuper6.com +foxtel.com foxtel.com.aufoxtelevisionstations.com  foxtv.com foxtvdvd.com  foxuv.comfoxweatherwatch.com  fssta.com +fxn.ws fxnetwork.comfxnetworks.com bentobox.tv kicu.tv ktvu.commyfoxsanfran.comafewmomentswith.com +anidom.comcasoneexchange.comcoronavirusnow.com +fse.tvgeraldoatlarge.comgooddaychicago.com joeswall.comkilmeadeandfriends.commaskedsingerfox.com +my13la.com +my20dc.commy20houston.com +my29tv.com my45.com  my9nj.commyfoxatlanta.commyfoxaustin.commyfoxboston.commyfoxcharlotte.commyfoxchicago.com myfoxdc.commyfoxdetroit.com myfoxdfw.commyfoxhouston.commyfoxhurricane.com myfoxla.commyfoxlosangeles.commyfoxlubbock.commyfoxmaine.com myfoxny.commyfoxorlando.commyfoxphilly.commyfoxphoenix.commyfoxtampa.commyfoxtampabay.commyfoxtwincities.com myfoxzone.com myq2.comnewsnowfox.comorlandohurricane.comparadisehotelquizfox.com q13.com +q13fox.comrealamericanstories.comrealamericanstories.inforealamericanstories.netrealamericanstories.orgrealamericanstories.tvrealmilwaukeenow.com rprimelab.comshopspeedtv.comsoccermatchpass.comspeeddreamride.comspeedfantasybid.comspeedracegear.com speedxtra.comteenchoice.com testonfox.comtheclasshroom.comthefoxnation.comthegeorgiascene.comwhatthefox.comwhosthehost.com wofl.tvwoflthenewsstation.com wogx.com foxnewsplayer-a.akamaihd.netfreebeacon.comgannett-cdn.com gannett.comgannettdigital.com usatoday.comusatodaynetworkservice.comglobalvoices.orgglobalvoicesonline.org  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com hk01.com hkcnews.com hkopentv.com fantv.hkhongkongfp.comhuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com inmediahk.netbusinessinsider.co.zabusinessinsider.combusinessinsider.com.aubusinessinsider.com.plbusinessinsider.debusinessinsider.esbusinessinsider.frbusinessinsider.inbusinessinsider.jpbusinessinsider.mxbusinessinsider.mybusinessinsider.nlbusinessinsider.sginsider-intelligence.com insider.cominsiderintelligence.com jfengtime.com landofhope.tvlocalpresshk.comfreedomplatform.tv londonreal.tv +ltn.com.tw yes123.com.tw macrumors.commalayalamanorama.com manorama.commanoramanews.commanoramaonline.commanoramayearbook.inonmanorama.com radiomango.fm  theman.in +theweek.invanitaonline.com +vanitha.invanithaveedu.com matters.news matters.one +medium.commedium.systems +myradio.hkmyradio.com.hkdreamworks.com cnbc.com +cnbcfm.com  msnbc.com +nbc.co nbc.com nbcnews.comnbcolympics.com nbcsports.com +nbcuni.comnbcuniversal.com s-nbcnews.com peacocktv.comuniversalorlando.comuniversalpictures.com&"universalpicturesinternational.com!universalstudioshollywood.com newscorp.com dowjones.com dowjones.iodowjoneson.com wsj.com wsj.net barrons.comandysparis.com newsmax.com +newsmax.in newsmaxtv.com newyorker.com +nikkei.com  nikkei.jp nikkei.co.jp now.com now.com.hk nowe.com -now-tv.comnow-ashare.com - - SHARETHIS sharethis.com -H - YAHOO-ADS ads.yahoo.com -@adsgemini.yahoo.com -@ads - - -EVERBRIGHT cebbank.com ceblease.com -eb-ind.com ebasset.com ebchina.comebchinaintl.com -ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com -$ -GFW  gfw.press -gfw.report -o -IFANR coolbuy.com  ifanr.com ifanr.inifanrusercontent.com -ifanrx.com -minapp.com - -TENCENT -apcdns.net foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn imqq.com  myapp.com myqcloud.com -qcloud.com qcloudimg.com qlogo.cn qpic.cn -qq.com -qqmail.com  qzone.comservicewechat.com smtcdns.com -tencent.cn tencent.comtencent.com.cntencent.com.hktencent.net.cntencent-cloud.comtencentmusic.comtencentyun.com -tenpay.com -wechat.com -wegame.com -weiyun.com ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads - -BITFINEX bitfinex.com - -LINUX  linux.org -. - PUBMATIC-ADSads.pubmatic.com -@ads - - CORDCLOUD cordcloud.org -T - -PROTONMAIL protonmail.chprotonmail.comprotonstatus.com pm.me -" - SOUNDOFHOPEsoundofhope.org -s -SINOPECsinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com - -TELEX telex.cc -e -DISCORD discord.com -discord.gg discord.mediadiscordapp.comdiscordapp.net -9 -NIKKEI -nikkei.com  nikkei.jp nikkei.co.jp -* -SCIENTIFICLINUXscientificlinux.org -. -ASPROEX asproex.comasproexapi.com - -RFI -rfi.fr - -WARROOM warroom.org - -GOLANG go-lang.com go-lang.net go-lang.org +now-tv.comnow-ashare.com nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.com aweencore.com  awetv.comherringnetwork.com oanencore.com oann.compassiontimes.hk qmap.pubrealvision.com reuters.com +reuters.tvreutersmedia.net rfa.org +rfi.fr rsf.org +rt.com etvonline.hk rthk.hk +rtings.com scmp.com +i-scmp.comshuziyimin.orgsinoinsider.comsky sky.com skyassets.comskyoceanrescue.comskyoceanrescue.deskyoceanrescue.it skysports.com skysports.fr skysports.ieskysportsonline.comskysportsracing.com slashdot.orgsoundofhope.org theguardiandev-guardianapis.comdev-theguardian.com +gu-web.netguardianapis.comguardianapps.co.uk +guim.co.uktheguardian.comtheguardiandns.comtheinitium.com  init.shopthenationalpulse.comthestandnews.comdreamteamfc.com  page3.comsunbingo.co.uk talksport.comthescottishsun.co.uk thesun.co.uk  thesun.ie thetype.cloud +cn thetype.comtypeisbeautiful.com udn.com +udn.com.twudnfunlife.com  unwire.hkamerikaninsesi.comamerikaninsesi.orgamerikaovozi.comamerikayidzayn.comamerikiskhma.com bbg.govdandalinvoa.com darivoa.comdengeamerika.comdengiamerika.comglasamerike.netgolos-ameriki.ru insidevoa.com pashtovoa.com persagg.comradiyoyacuvoa.com urduvoa.com voa.govvoaafaanoromoo.comvoaafrique.comvoabambara.com voabangla.comvoacambodia.comvoacantonese.comvoachinese.comvoadeewanews.comvoadeewaradio.com voahausa.comvoaindonesia.com voakorea.comvoalingala.comvoandebele.com voanews.com +voanews.euvoanoticias.com voanouvel.comvoaportugues.com voashona.com voasomali.comvoaswahili.com voathai.comvoatibetan.comvoatibetanenglish.comvoatiengviet.com voatour.comvoazimbabwe.comzeriamerikes.com cstatic.net +curbed.com  eater.comfunnyordie.com meridian.net polygon.com +racked.com +recode.net sbnation.com theverge.com vox-cdn.com vox.comvoxcreative.comvoxfieldguide.com voxmedia.com +voxops.net warroom.orgwashingtonpost.com watchout.tw +waa.tw +wenzhao.castartupschool.orgycombinator.com +zaobao.com zaobao.com.sg  zaobao.sg +bgr.inbollywoodlife.comcareerfundas.comcricketcountry.com dnai.in dnaindia.com earngeek.com ekhindi.com +ind.sh  india.comindiancolleges.com itripto.com  oncars.in prepsure.comthehealthsite.com wionews.com yo1health.com zee.com +zeebiz.comzeeentertainment.com zeenews.com"zeenews-fonts.s3.amazonaws.com zerohedge.com zoomingin.tv aomedia.org archive.org  atypi.org +change.org ccstatic.orgcreativecommons.orgcreativecommons.engineeringlicensebuttons.net csis.orgcsis-prod.s3.amazonaws.comemojipedia.orgworldemojiawards.comworldemojiday.com xn--yt8h.laglobalsecurity.org ieee.org ieee.tvtryengineering.org ieee-ccnc.org ieee-ecce.org ieeemce.orgstandardsuniversity.orgieee-region6.org ieee.ca ieeer10.org +ieeer5.org +ieeer8.org ieeeusa.orgieeefoundation.orgieee-into-focus.org ieee-vics.org ieeeday.orgdatasheets360.comglobalspec.com ieee-isto.orgtechstreet.com computer.org +comsoc.org embs.org emcs.org grss-ieee.org ieee-aess.org ieee-cas.org ieee-ceda.orgieee-edusociety.org ieee-ies.org ieee-ims.org ieee-npss.org ieee-pels.org ieee-pes.org ieee-ras.orgieee-sensors.org ieee-tems.org ieee-uffc.org ieeeaps.org ieeecsc.org ieeecss.org ieeedeis.orgieeemagnetics.org ieeenano.org ieeeoes.org ieeesmc.orgieeesystemscouncil.org  itsoc.org mtt.orgphotonicssociety.orgsignalprocessingsociety.orgtechnologyandsociety.org vtsociety.org ietf.org itu.int nist.gov time.gov openmaps.orgopenstreetmap.comopenstreetmap.netopenstreetmap.orgopenstreetmaps.org osm.orgosmfoundation.orgstateofthemap.comstateofthemap.orgrolfoundation.orgrolsociety.org  smpte.org +un.org +w3.org who.int wto.org 0plkijj.vip  114av.xyz 16fhgdty.xyz 18novel.xyz +1jjdg2.vip +1jsa22.vip  51dh.site 520aa.tv 5278.cc +52hyse.com 54647.online 69story.com 69vj.com  721av.com +7mm.tv +85tube.com 91.51rmc.com 920share.com +a.91gay.me a.kslive.tv aavs.xyz  agzy1.com aibaobei.me aimei133.com airav.ccanimezilla.comasianpornmovies.com av01.tv  av1688.cc av6k.com avfox.cc +avinin.com +avpanda.cc +avsee01.tv avseesee.com bangbros.combesthentaitube.com brazzers.com +buzzav.com  caime.xyz calvappd.me cam4.com cslpldyb.me  dkk37.comdownload.91porn005.medownload.i91av.org +dvh30n.vipflirt4free.com follasian.com +gaypad.net  gouri.xyz hpjav.tv hsxhr.ccichineseporn.com  iijav.com  immxd.com isexlove.tw isexomega.twjapan-whores.comjapanesebeauties.net jav.guru jav01.cc +jav101.com  jav168.cc javcc.cc  javcc.com +javdoe.com javdove8.xyz  javfor.me javfull.net  javhd.pro javhd3x.com javhdfree.netjavlibrary.com javmost.com  javqd.com javynow.com  jgg18.xyz jinnaju.com jjdong7.com +johren.net kissjav.com kphimsex.net  love7.xyz lp99.pw lsnzxzy1.com lubetube.com +lululu.one manyvids.com mdlf.xyz myavfun.commydirtyhobby.commyfreecams.com nekoxxx.com nekoxxx.com nhentai.netohyeah1080.comosakamotion.netp3.csgfnmdb.com papalah.com pornbest.org porntea.com +pyhapp.com +qingse.one  r18lu.comrealitykings.com +rule34.xxx seselah.com sextop1.net +sexzy4.com +soirt4.funsouth-plus.net stripchat.com +sub147.comtbr.tangbr.net theav.cc +thisav.com thtmod1.com +tkb008.xyztokyomotion.net  tssp.besttubetubetube.com upjav.cc vgg8.com vjav.comwatchjavonline.com wuso.me  wzmyg.com  x99av.com  xo104.com  youav.com  1pondo.tv +91porn.com  avgle.com avn.com beeg.com bongacams.com +bcicdn.com bcrncdn.com +btt804.com +btt904.com +bttzyw.com +bttzyw.net t66y.comchaturbate.com e-hentai.org ehgt.org ehtracker.org +ehwiki.org exhentai.orghentaiverse.org eporner.comfanhaodian.com  hegre.com heydoga.com  heyzo.com hqporner.com +javbus.com javfinder.sh findercdn.me o0-2.com  javhd.comjavlibrary.com +javwide.tv javwide.com kindgirls.comlivejasmin.com dditsadn.com dditscdn.com +metart.commetartnetwork.com metcams.comnaiadsystems.com  nsimg.net netflav.com  pigav.com +pornhd.com +phncdn.com phprcdn.com pornhub.compornhubpremium.com  press.vin redtube.com scoreland.comcdn77.scoreuniverse.com spankbang.comtheporndude.com  tube8.com  uug22.com  uug23.com  uug25.com  uug26.com  uug27.com  uuk28.com  uun78.com  uun79.com  uun82.com  uun83.com  uun85.com  uun86.com  uun87.com  uun89.com  uun92.com  uun93.com  uun95.com  uun96.com  uun97.com  uun98.com  uun99.com  uux68.comvaginacontest.com  x-art.com xhamster.comxhamsterlive.com  xhcdn.comwidgets.stripst.com#collector.xhamster.com +ads xnxx.com xnxx-cdn.com xvideos.comxvideos-cdn.com youjizz.comyjcontentdelivery.com youporn.comaccuweather.comgetadblock.comadblockplus.org addthis.comaddthiscdn.comaddthisedge.com addtoany.comadguard-vpn.com adguard.com apkpure.com cdnpure.com pureapk.com +winudf.com +arphic.com arphic.com.cn arphic.com.twifontcloud.com +bit.ly  bitly.com bitly.is bitwarden.combigbuckbunny.org blender.orgelephantsdream.org videojs.com bcove.video bcovlive.io bcvp0rtal.com boltdns.netbrightcove.combrightcove.netbrightcove.servicesbrightcovecdn.combcovlive-a.akamaihd.netbcsecure01-a.akamaihd.netbrightcove.imgix.net buymeacoff.eebuymeacoffee.comcloudconvert.comcontentful.com ctfassets.net cutt.lydigitalocean.comdigitaloceanspaces.com +disqus.com disquscdn.comdisqusservice.comcispaletter.comcispaletter.orgcometotheduckside.com +ddg.co +ddg.gg +ddh.gg +dgg.gg dontbubble.us donttrack.us duck.co duck.comduckduckco.com duckduckco.de duckduckgo.ca duckduckgo.coduckduckgo.co.ukduckduckgo.comduckduckgo.com.mxduckduckgo.com.tw duckduckgo.de duckduckgo.dk duckduckgo.in duckduckgo.jp duckduckgo.ke duckduckgo.mx duckduckgo.nlduckduckgo.org duckduckgo.pl duckduckgo.sg duckduckgo.ukduckduckhack.com +duckgo.com ducksear.ch duckside.com  dukgo.comenteentegeh.defixtracking.com goduckgo.com hacksear.chjustduckit.comprivacysimplified.comprivatebrowsingmyths.comspreadprivacy.com easylist.to lanik.usentermediadb.netentermediadb.org +arcgis.comarcgisonline.com esri.com evernote.com faststone.org +feedly.com  figma.com gofundme.com gravatar.com botstop.com hcaptcha.comhcaptchastatus.com  heroku.co +heroku.com  heroku.me herokuapp.com herokucdn.comherokucharge.com herokussl.comheroku-app.comheroku-charge.com codei.sh +codeish.co +codeish.io iina.ioinfrapedia.com inoreader.com is.gdv.gd +jwpcdn.comjwplatform.com jwplayer.com +jwpltx.com +jwpsrv.comlongtailvideo.comkindle4rss.com kodi.tv  kodi.wiki liberapay.com liberapay.org linguee.com  deepl.com +madshi.net  madvr.com  madvr.net madvrlabs.llc mapbox.cn +cn +mapbox.com +mega.co.nz mega.nz +mpv.io netlify.combitballoon.com  notion.sonotion-static.comopencollective.com osdn.net pastebin.com patreon.com pics.ee  picsee.co +picsee.pro pise.pw pros.ee +pse.is ping.pe protonmail.chprotonmail.comprotonstatus.com pm.me quip-cdn.com quip.comquipelements.com +reabble.cn +cn reabble.com rb.gy rebrandly.com reurl.cc +dns.sb ip.sb loli.net sb.sb sm.msu.nu +www.sb sharethis.com myshopify.com shopify.com shopify.devshopifycdn.comshopifystatus.comshopifysvc.com shorturl.atsourceforge.comsourceforge.net +sf.net fsdn.com startpage.com ixquick.com steemit.com svp-team.com test-ipv6.com ctan.orglatex-project.org +miktex.org tug.org tidelift.com tinyurl.com +trello.com trellocdn.com +tumblr.com +now.shvercel-dns.comvercel-status.com +vercel.app +vercel.comzeit-world.co.ukzeit-world.comzeit-world.netzeit-world.org zeit.co zeit.sh zeitworld.com webflow.com wix.com  wixmp.com wixsite.com wixstatic.comvideopress.com w.org wordpress.com wordpress.org wordpress.tv wp-themes.com +wp.com  wpvip.com +zeplin.dev  zeplin.io zoho.com zoho.com.au zoho.eu zoho.in zohocdn.comzohomeetups.comzohomerchandise.comzohopublic.comzohoschools.comzohostatic.com zohostatic.inzohouniversity.comzohowebstatic.com zoom.com zoom.com.cn zoom.usalpinelinux.org anaconda.com anaconda.org conda.io android.comandroidify.com +apache.orgappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cncalendarserver.orgapple-cloudkit.com cups.orgdeveloper.apple.comdevimages-cdn.apple.comdevstreaming-cdn.apple.comfoundationdb.orgmacosforge.org macruby.com macruby.net macruby.orgapple-mapkit.complaygrounds-cdn.apple.com carekit.orgresearchandcare.orgresearchkit.cn +cnresearchkit.com.cn +cnresearchkit.hkresearchkit.netresearchkit.orgresearchkit.tvservicetalk.io +webkit.org webkitgtk.org wpewebkit.orgwebobjects.com-)appleworldwidedeveloper.hb-api.omtrdc.net)%appleworldwidedeveloper.sc.omtrdc.net#p-events-delivery.akamaized.net archlinux.orgarchlinuxarm.org atom.io +badgen.netbootstrapcdn.comgetbootstrap.combraventures.com braveux.com +compass.isfightforux.comforthebadge.comstockagainstphotography.com launchpad.netlaunchpadlibrarian.comlaunchpadlibrarian.netlaunchpadlibrarian.org snapcraft.io snapstore.io +ubuntu.com +ubuntu.netubuntuforums.org canonical.com  cdnjs.com +centos.orgchocolatey.org clojure.org +cnpmjs.org +cygwin.com +cython.org dart.dev dartlang.org dartpad.dev +debian.org +dotdeb.org  deno.landcompose-spec.io +docker.com  docker.ioelixir-lang.org +elrepo.org embed.ly embedly.com playerjs.io +erlang.orgaccountkit.comatscaleconference.com botorch.org +buck.build buckbuild.comcomponentkit.org draftjs.org +f8.comfacebookappcenter.infofacebookappcenter.netfacebookappcenter.orgfacebookconnect.comfacebookdevelopergarage.comfaciometrics.com fasttext.cc fbf8.com fbinfer.com fblitho.com fbredex.com +fbrell.com flow.dev flow.org flowtype.org frescolib.org hacklang.org hhvm.commakeitopen.com mcrouter.net mcrouter.orgmessengerdevelopers.com +ogp.meopengraphprotocol.comopengraphprotocol.org  parse.com pyrobot.org  react.com reactjs.com reactjs.org recoiljs.org rocksdb.com rocksdb.net rocksdb.orgyogalayout.comdevelopers.facebook.com fastlane.cifastlane.tools getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org +ffmpeg.org flathub.org flatpak.org flutter.devflutterapp.comfontawesome.comfortawesome.com freebsd.org  fury.blog fury.co fury.dev  fury.help fury.io gemfury.com +gentoo.orggetcomposer.org git-scm.com gitbook.com +gitbook.iogitbook.zendesk.com  npmjs.com npm.communitydependabot.com +git.io github.blog +github.comgithub.community  github.io githubapp.comgithubassets.comgithubhackathon.comgithubstatus.comgithubusercontent.com/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com +gitlab.com  gitlab.io +gitlab.netgitlab-static.net.*gitlab-assets.oss-cn-hongkong.aliyuncs.com gnu.org go-lang.com go-lang.net go-lang.org go.dev  godoc.org golang.com golang.net -golang.org - - MEGAPHONE megaphone.fm -? -SHOPIFY shopify.com shopify.devshopifysvc.com - -TUNSAFE tunsafe.com -/ - -AMAZON-ADS!amazon-adsystem.com -@ads - - BRILLIANT brilliant.org - -SPOTIFY byspotify.com pscdn.co scdn.co spoti.fispotify-everywhere.com spotify.comspotify.designspotifycdn.comspotifycharts.comspotifycodes.comspotifyforbrands.comspotifyjobs.com - -IPFS ipfs.io -= -LANDIAN -lancdn.comlandiannews.com  wsoso.com -% -MIHOYO -mihoyo.com bh3.com - - STCSERVERstc-server.com - -ADOBE  adobe.com adobe.ioadobeaemcloud.comadobeaemcloud.netadobeccstatic.com adobedc.net adobedtm.comadobelogin.com adobeoobe.comassetsadobe.com behance.net edgefonts.net -omtrdc.net typekit.com typekit.net -' - AMERICASVOICEamericasvoice.news - -FTEPROXY fteproxy.org - -NICONICOnico -nicodic.jp nicomanga.jp niconico.com nicoseiga.jp nicovideo.jp nimg.jp simg.jp -w -NYTIMES nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.com - -RARBG rarbg.me rarbg.to rarbg.israrbgaccess.org rarbggo.orgrarbgmirror.comrarbgmirror.orgrarbgproxy.org rarbgprx.orgrarbgunblock.com - - 58TONGCHENG -58.com  58.com.cn 5858.com  58che.com 58xueche.com -anjuke.comanjukestatic.com chinahr.com -daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com - - ALJAZEERA -ajplus.net aljazeera.com aljazeera.netpalestineremix.comsarajevopodopsadom.comsrebrenica360.com syhacked.com - - -MASTERCARD mastercard.ae mastercard.at mastercard.az mastercard.ba mastercard.be mastercard.bg mastercard.by mastercard.ca mastercard.ch mastercard.clmastercard.co.idmastercard.co.ilmastercard.co.inmastercard.co.jpmastercard.co.kemastercard.co.krmastercard.co.nzmastercard.co.thmastercard.co.ukmastercard.co.vemastercard.co.zamastercard.commastercard.com.armastercard.com.aumastercard.com.bhmastercard.com.brmastercard.com.bzmastercard.com.cnmastercard.com.comastercard.com.cymastercard.com.egmastercard.com.gemastercard.com.gtmastercard.com.hkmastercard.com.kwmastercard.com.lbmastercard.com.mxmastercard.com.mymastercard.com.ngmastercard.com.pemastercard.com.phmastercard.com.samastercard.com.sgmastercard.com.trmastercard.com.twmastercard.com.vemastercard.com.vn mastercard.cz mastercard.de mastercard.dk mastercard.es mastercard.eu mastercard.fi mastercard.fr mastercard.gr mastercard.hr mastercard.hu mastercard.ie mastercard.it mastercard.jo mastercard.ke mastercard.kz mastercard.lu mastercard.md mastercard.my mastercard.nl mastercard.no mastercard.om mastercard.pl mastercard.pt mastercard.qa mastercard.ro mastercard.rs mastercard.ru mastercard.se mastercard.si mastercard.sk mastercard.ua mastercard.us - - -SALESFORCE appcloud.comappexchange.com attic.iobeyondcore.combuddymedia.com chatter.comcloudcraze.com cotweet.com data.comdemandware.com desk.comdocumentforce.comdreamforce.com einstein.comexacttarget.com  force.com govforce.comgravitytank.com heywire.com krux.commarketingcloud.com metamind.io +golang.org  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io haskell.orghaskellstack.org stackage.org brew.shhomebrew.bintray.com +01.org hyperscan.iointellinuxgraphics.comintellinuxgraphics.net +oneapi.comopenvinotoolkit.orgsnap-telemetry.io +acpica.com clearlinux.cn +cnclearlinux.org +ospray.net +ospray.org +ius.iojava java.com java.net +jenkins.io jetbrains.com jetbrains.net datalore.iokotlinlang.org  jfrog.com  jfrog.org bintray.com!d29vzk4ow07wi7.cloudfront.net +js.org jsdelivr.net jsdelivr.comcdn.jsdelivr.net +cn jupyter.org kali.org kubernetes.io +k8s.iolinuxfromscratch.org linuxmint.com lua.org macports.org mariadb.orgadaptivecards.ioapi-extractor.com +apisof.net appcenter.ms +blazor.netbotframework.comcodethemicrobit.comdevopsassessment.net dot.netgamesstack.comgraphengine.ioinsiderdevtour.com +jwt.ms microbit.orgmicrosoftadc.commicrosoftgamestack.commicrosoftiotinsiderlabs.commicrosoftreactor.cn +cn#microsoftreactor.com.cn +cnmicrosoftreactor.infomicrosoftreactor.netmicrosoftreactor.orgmicrosoftsilverlight.commicrosoftsilverlight.orgmicrosoftsilverlight.netmicrosoftsqlserver.com  mmdnn.commono-project.com msdn.commsinnovationchallenge.commspairlift.commsropendata.com  nuget.org nugettest.orgopentranslatorstothings.orgposhtestgallery.compwabuilder.comreactorms.com.cn +cn +sankie.netsqlserveronlinux.comtimelinestoryteller.comuwpcommunitytoolkit.comvisualstudio-staging.comvisualstudio.comvisualstudio.covisualstudio.co.ukvisualstudio.euvisualstudio.net vfsforgit.com vfsforgit.org vsassets.io xamarin.comdeveloper.microsoft.comdtlgalleryint.cloudapp.net poshtestgallery.cloudapp.net"psg-int-centralus.cloudapp.netpsg-int-eastus.cloudapp.net  mingw.org mongodb.com mongodb.org  mysql.com  nginx.com  nginx.org  nixos.orgnodesource.comnotepad-plus-plus.org +openai.com openresty.org openssl.org opensuse.org openwrt.lan +private openwrt.orglede-project.org packagist.org pcre.org perl.org cpan.org metacpan.org phantomjs.org php.netpolymer-project.orgpolymerproject.orgpostgresql.org +python.orgpythonhosted.org pypa.io pypi.org qt.ioqt-project.org r-project.orgraspberrypi.org raspbian.orgreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org redis.io redislabs.com remirepo.net rpmfusion.org ruby-lang.org rubygems.orgscala-lang.org scala-sbt.orgscientificlinux.org scoop.sh +shields.io +sqlite.org askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.commystrikingly.comstrikingly.comstrikinglycdn.comsublimetext.com +kernel.org  linux.org amp.devampproject.comampproject.netampproject.orgcdn.ampproject.org +cnamp.akamaized.netelectronjs.org +jquery.comjquerymobile.com jqueryui.com mochajs.org +nodejs.org openjsf.orglfai.foundationlinuxfoundation.org  unity.com unity3d.com!unityads.unity3d.com +ads#unityads.unitychina.cn +ads  unpkg.com +v8.dev v8project.org videolan.org vim.org wireshark.org x.orgxda-developers.com xda-cdn.com xposed.info yarnpkg.com zsh.orgacer-group.com acer.com acer.com.cn +cn typekit.com typekit.net10xfotolia.com 2o7.net acrobat.com adbecrsl.comadobe-aemassets-value.comadobe-audience-finder.com"adobe-video-partner-finder.com  adobe.com adobe.lyadobeaemcloud.comadobeaemcloud.netadobeawards.comadobecontent.ioadobecreativityawards.com adobedc.net adobedemo.com adobedtm.comadobeexchange.comadobeexperienceawards.com adobegov.comadobehiddentreasures.comadobejanus.com adobeku.comadobelanding.comadobelogin.com adobeoobe.comadobeplatinumclub.comadobeprojectm.com adobesc.com adobesign.comadobesigncdn.comadobespark.com adobess.comadobestock.com adobetag.comadobetarget.comadobetcstrialdvd.comadobetechcomm.comadobetechcommcallback.comadobetechcommdemo.comadobexdplatform.comassetsadobe.com authorxml.combusinesscatalyst.com ccnsite.com  ccpsx.com +demdex.netdollarfotoclub.comdollarphotoclub.comdollarphotosclub.comdouwriteright.com echocdn.com echosign.com edgefonts.netenablementadobe.com  ftcdn.net gostorego.comimagineecommerce.commacromedia.commagentoliveconference.commarketing-nirvana.com omniture.com +omtrdc.net photoshop.complacesdocs.comsundanceignite2016.comworldsecureemail.comworldsecuresystems.com adobe.iodevelopria.com behance.nets2stagehance.com adobecc.com adobecce.comadobeccstatic.comcreativecloud.comcreativesdk.com cotolia.com ffotolia.com fiotolia.com foftolia.com fonolia.com fotiolia.com fotoiia.comfotolia-noticias.com +fotolia.cc fotolia.com +fotolia.tv fotolja.com fptolia.com gfotolia.com motolia.com photolia.nettenbyfotolia.com votolia.combluefootcms.com mageconf.commageconf.com.ua magento.com magento.netmagentocommerce.commagentomobile.commarketing-cloud.com marketo.co.uk marketo.com marketo.net +marketo.tvmarketodesigner.commarketolive.com +mktdns.commkto-c0100.com mktorest.com mktroute.commobilemarketo.com&"revenue-performance-management.com toutapp.comcompresspdf.new pdf.new sign.newalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.com amazon-adsystem.com +adswholecitiesfoundation.orgwholefoodsmarket.comwholekidsfoundation.orgwholeplanetfoundation.orgaws +amazonimdb +kindle xn--cckwcxetdxn--jlq480n2rg yamaxun +zapposaboutamazon.cn +cnaboutamazon.co.ukaboutamazon.comaboutamazon.com.auaboutamazon.deaboutamazon.esaboutamazon.euaboutamazon.fraboutamazon.inaboutamazon.itaboutamazon.jpaboutamazon.pl alexafund.cn +cnalexafund.com.cn +cn amaaozn.comamazon-fashions.comamazon-jp-recruiting.comamazon-lantern.comamazon-launchpad.com  amazon.ae  amazon.ca amazon.cn +cn amazon.co.jp amazon.co.uk +amazon.com amazon.com.au amazon.com.br amazon.com.mx amazon.com.tr  amazon.de  amazon.es  amazon.fr  amazon.in  amazon.it amazon.jobs  amazon.jp  amazon.nl +amazon.red  amazon.sgamazonalexavoxcon.comamazonauthorinsights.comamazonbusiness.cn +cn!amazonbusiness.com.cn +cnamazonbusiness.orgamazonbusinessblog.comamazonchoice.cn +cnamazonchoice.com.cn +cnamazonchoices.cn +cn amazonchoices.com.cn +cnamazondevicesupport.comamazonfctours.comamazonianblog.comamazonimages.comamazoninspire.cn +cn amazoninspire.com.cn +cnamazonlaunchpad.cn +cnamazonlaunchpad.com"amazonlaunchpad.com.cn +cn amazonlending.com.cn +cn!amazonliterarypartnership.comamazonlumberyard.wang amazonnow.cn +cnamazonnow.com.cn +cn amazonsdi.comamazonstudiosguilds.comamazontrust.comamazonvideodirect.com amzn.com amzn.to  amznl.comassoc-amazon.cn +cnassociates-amazon.comgameon-masters.comgdansk-amazon.commedia-amazon.com primeday.cn +cnprimeday.com.cn +cn primeday.infosiege-amazon.comssl-images-amazon.comueberamazon.de +yamaxun.cn +cn yamaxun.comz.cn +cn audible.comacmvalidations.comacmvalidationsaws.comaesworkshops.comamazonaws-china.com amazonaws.com amazonaws.tvamazonworkdocs.cn +cnamazonworkdocs.com!amazonworkdocs.com.cn +cnamplifyapp.comamplifyframework.comaws-iot-hackathon.comawsautopilot.comawsautoscaling.com awsbraket.comawscommandlineinterface.comawsedstart.comawseducate.comawseducate.netawseducate.orgawsloft-johannesburg.comawsloft-stockholm.comawssecworkshops.com awsstatic.comawsthinkbox.com awstrust.comcdkworkshop.comcloudfront.netcontainersonaws.comelasticbeanstalk.comthinkboxsoftware.com".+\.awsdns-[0-9][0-9]\.co\.uk$.+\.awsdns-[0-9][0-9]\.com$.+\.awsdns-[0-9][0-9]\.net$.+\.awsdns-[0-9][0-9]\.org$".+\.awsdns-cn-[0-9][0-9]\.biz$!.+\.awsdns-cn-[0-9][0-9]\.cn$".+\.awsdns-cn-[0-9][0-9]\.com$".+\.awsdns-cn-[0-9][0-9]\.net$ kindle.cn +cn kindle.co.jp kindle.co.uk +kindle.com  kindle.de  kindle.es  kindle.fr  kindle.in  kindle.it  kindle.jpkindleoasis.cn +cnkindleoasis.comkindleoasis.com.cn +cnkindleoasis.infokindleoasis.jpkindleoasis.orgkindleoasis.uskindleoasisnews.comkindleproject.comamazonprimevideo.cn +cn#amazonprimevideo.com.cn +cnamazonprimevideos.comamazonvideo.ccamazonvideo.comprime-video.com primevideo.ccprimevideo.comprimevideo.infoprimevideo.org primevideo.tv+images-cn.ssl-images-amazon.com +cn-!images-cn-8.ssl-images-amazon.com +cn amd.comamdfanstore.com +radeon.comiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +ads100beatscheap.com1monsterbeatsbydreus.com2013beatsbydrdreonline.com2013beatsbydrdreshop.com2013beatsbydreshop.com2013beatshdcybermonday.com2013cheapestbeats.com2013newbeatsworld.com2013pascherbeatsbydre.com2014cheapbeatsbydre.com 2beatsdre.com2buybeatsbydre.com2drdrebeats.com40shopping.com4beatsbydre.com5beatsbydre.comaaagradeheadphones.com +aanaan.comabcheadphones.comabeatsbydrdre.com aeasyshop.com +airmay.com +ajtalk.com albeats.com annstores.netaokwholesale.netaucheapbeats.comaudiobeatsau.comaudiobeatsbydre.comaudiomonsterbeatsonline.comauricularemonsterbeats.com#auricularesbeatsbaratosshop.comauricularesbeatsmarkt.comausbeatsbydrdre.combag-glasses1.com bandgirlz.com baxsound.com bbestmall.com +beatbd.combeatbydre2013.combeatbydremonster.com!beatbydreheadphonesonsale.combeatbydrekopen.combeatbydreuk2014.combeatdrdres.combeatfactoryoutlets.combeatmonstersaustralia.netbeats-by-dre-australia.combeats-bydrdre.netbeats-bydre-mall.combeats-bydrecheapsale.combeats-bydreoutletonline.combeats-bydreoutletsale.combeats-bydreoutletsale.netbeats-bydreoutletssale.netbeats-bydrestore.combeats-bydreuk.combeats-deal.combeats-dre-us.com"beats-headphones-buy-cheap.combeats-headphones.usbeats-sale.combeats-seller.combeats-soaho.com  beats1.cc beats1.cn +cn  beats1.tv beats1.com.cn +cn beats123.com beats2.com.cn +cn beats4.cn +cn +beats4.netbeats4outlets.combeats4salecheap.combeatsallsale.combeatsaudifonos.combeatsaudiobydre.combeatsaudiobydre.netbeatsaudios.netbeatsbeatsmonster.combeatsbestdeals.combeatsblackfridaydeals.netbeatsblackfridayretails.combeatsboxingdayuksale.combeatsbydrdre-headphones.combeatsbydrdre-officials5.combeatsbydrdre-online.combeatsbydrdre-onsale.combeatsbydrdre-store.combeatsbydrdre-store.usbeatsbydrdre4sale.combeatsbydrdrebiz.combeatsbydrdrecustom.combeatsbydrdredanmark.combeatsbydrdremall.combeatsbydrdreoutlet.combeatsbydrdres.combeatsbydrdresale.netbeatsbydrdrestore.combeatsbydrdreus.com!beatsbydre-beatsheadphone.combeatsbydre-chen.combeatsbydre-club.combeatsbydre-headphones.com!beatsbydre-headphonesshop.combeatsbydre-mall.combeatsbydre-outlet.combeatsbydre-outletsale.netbeatsbydre-outletstore.combeatsbydre-sell.combeatsbydre-store.combeatsbydre-studio.combeatsbydre-us.com beatsbydre.jpbeatsbydre2081.combeatsbydre411.combeatsbydre4usales.combeatsbydreauofficial.combeatsbydreausale.net beatsbydreaustralia-sale.com!beatsbydreaustraliaonline.com"beatsbydreaustraliaonlines.com beatsbydreaustraliasales.combeatsbydrebeatsby.com!beatsbydreblackfriday2013.com beatsbydreblackfridaypro.combeatsbydreboxingdayca.combeatsbydrecasquesfr.com#beatsbydrecheap-outletstore.combeatsbydrecheaper.com"beatsbydrecheaponlinesales.combeatsbydrecolors.com beatsbydrecustomwireless.com&"beatsbydrecybermondaydeals2013.com&"beatsbydrecybermondaydeals2013.netbeatsbydredanmarks.com"beatsbydredealsblackfriday.com"beatsbydredealscybermonday.combeatsbydrediscount.com beatsbydrediscountonline.netbeatsbydredr.combeatsbydreexecutivesale.com beatsbydreformall2013-nl.com beatsbydreforsalesonline.com beatsbydreforshop2013-nl.combeatsbydreforstore.combeatsbydreforyououtlet.combeatsbydrefr.com!beatsbydrefrcasquepascher.combeatsbydrefriday.combeatsbydregot.combeatsbydrehd.combeatsbydrehd.netbeatsbydreheadphones-nz.combeatsbydreheadphonesolo.combeatsbydrehut.combeatsbydreinexpensive.combeatsbydreireland-sales.com beatsbydreirelandonlines.combeatsbydreirelandsale.com beatsbydreirelandsonline.combeatsbydremall2013.com"beatsbydremonsteraustralia.combeatsbydrenls.combeatsbydrenorge1.net!beatsbydreofficialdanmark.combeatsbydreoksale.combeatsbydreol.combeatsbydreonlie2013-nl.com!beatsbydreonlines-ireland.combeatsbydreonlines-uk.combeatsbydreonlinesale-nz.combeatsbydreoordopjes.combeatsbydreoslo.combeatsbydreoutletsale.combeatsbydreoutletscheap.combeatsbydrerealstore.combeatsbydres-shop.combeatsbydresale-uk.combeatsbydresalemall2013.combeatsbydresales.us'#beatsbydresalesonline-australia.com beatsbydresaleonlines-nz.combeatsbydresdanmark.netbeatsbydreshop-uk.combeatsbydreshops.netbeatsbydresingapores.combeatsbydresingaporesale.combeatsbydrespeakers.combeatsbydresold.com%!beatsbydresolohdonline-canada.combeatsbydresonline-nz.combeatsbydrestorevip.combeatsbydressale.combeatsbydressolo.combeatsbydresstudio.com"beatsbydrestudio-australia.combeatsbydrestudio.combeatsbydretoutlet.combeatsbydreuk.combeatsbydreuk.netbeatsbydreus.combeatsbydrevipde.combeatsbydrew.combeatsbydrsmonsterinusa.combeatsbymusic.netbeatsbysdrbre.combeatsbysdrdres.combeatscasque-france.combeatscheap-nz.combeatscheap-uk.combeatscheapforsale.combeatscollection2014.combeatscustomblackfriday.combeatsdanmark2013.combeatsdrdre-headphones.combeatsdrdre-it.combeatsdrdre-solo.combeatsdrdre2014.combeatsdrdrecuffie.netbeatsdrdrekaufenschweiz.netbeatsdrdreneon.combeatsdre-monster.com beatsdre.netbeatsdre4cheap.combeatsdrecheap.combeatsdredreheadphones.combeatsdreforsale.combeatsdreinau.combeatsdremonster-uk.com!beatsdrenewcolorful4usale.combeatsdreoutletsale.combeatsdresale2013.combeatsdresalestore.combeatsdresolo2013.combeatsdreus.combeatsearbudsheadphoness.combeatsfacstore.combeatsfactoroutlets.combeatsfactorycollection.combeatsfactoryoutles.combeatsforcheap-usa.combeatsforme.combeatsfranceofficiel.combeatselectronic.netbeatselectronics.com +beatsep.cn +cn beatsep.com beatsep.net beatsheadphones-discount.combeatsheadphones1.combeatsheadphones2u.combeatsheadphonesale.combeatsheadphonesdealer.combeatsheadphonesforcheap.netbeatsheadphonesonline.combeatsheadphoness.combeatsheadphonestudio.combeatsheadphonesusamall.combestshoesale2014.netbeatshopuk.combeatsincanada.combeatsinsingapore.combeatsireland.net beatsjoy.combeatsmonstersales.combeatsmusic.combeatsmusic.wang beatsneon.combeatsnzsale.com beatsodre.combeatsofdre-usa.combeatsonblackfriday2013.com beatsone.netbeatsoutlet.netbeatsoutletanytime.combeatsoutletonlines.combeatspascher-bydre.combeatspascher-fr.netbeatspascher.netbeatspaschers.netbeatspillnewcolor.combeatspills.combeatspromonsterjp.combeatspromotions.combeatssales.combeatssaleus.combeatssaustraliabuy.combeatssbyaustralia.combeatssbydredanmark.combeatsshop-uk.combeatsshop-usa.combeatsshopstore.combeatssingapores.combeatssingaporeshop.com beatsstudiohodetelefoner.combeatsstudiosite.combeatstoreusa.com beatsua.combeatswholesale.usbeatswirelesscheap.combeatswirelesscuffie.combegin-trade.combestbeats4u.com +biitii.comblackfridaydrebeatsnew.comblackfridaydrebeatsshop.combloommicroventures.com bookonsky.net +bossae.combrandeasygo.combrandelectronic.combrandproducts1688.com brands098.combusinesswebwise.combuy-from-shanghai.combuybeatsbydre-uk.combuybeatsheadphonesbydre.combuycheapbeatsbus.combuycheapbeatsbydre.combuycheapbeatsbydreshop.combuycheapbeatsdreuk.combuydrdrebeatbox.combuyminibeatbox.combuyonlineheadphones.combuyshoponly.combuzzardflapper.combybeatsdre.combydrebeats.comcanada-beatsbydre.com casque-fr.com casquebeatsbydrdresolohd.comcasquebeatsdocteurdre.comcasquebeatsdre2013.comcasquebeatsenligne.comcasquebeatsfracheter.comcasquebeatsmer.netcasquebeatsofficiel-fr.comcasquebeatspascher2013.comcasquebeatssolo.netcasquedrdrebeatssfr.comcasquemonsterbeats.com#casquemonsterbeatsbydre2013.comcasquesbeatsaudio.comcheap-beats-by-dre.netcheap-beatsbydre.comcheapbagshoes.com cheapbeats.uscheapbeats365.comcheapbeats4sale.netcheapbeatsaustraliasale.comcheapbeatsbus.comcheapbeatsbydr.comcheapbeatsbydrdrepro.comcheapbeatsbydre-au.comcheapbeatsbydre99.comcheapbeatsbydrefau.comcheapbeatsbydremall.comcheapbeatsbydremonster.comcheapbeatsbydrenz.netcheapbeatsbydreonsale.com cheapbeatsbydreoutlet-nz.comcheapbeatsbydreoutlet.com"cheapbeatsbydreoutlets2013.comcheapbeatsbydresale.comcheapbeatsbydreshop.comcheapbeatsdrdresolo.com$ cheapbeatsbydrestudioedition.com"cheapbeatsbydrestudioutlet.comcheapbeatsdrestudios.comcheapbeatsheadphone2014.comcheapbeatsheadphones.uscheapbeatsie.comcheapbeatsla.comcheapbeatssale4u.comcheapbeatsshopbydre.comcheapcustombeatsbydre.comcheapdrdrebeats8.comcheapdrdrebeatsca.comcheapdrebeats8.netcheaperbeatsbydresale.comcheapestbeatsdrdre.comcheapheadphonesland.comcheapheadphonessale.comcheapheadsetmall.comcheapheadsetshop.com cheapmonsterbeatsbydrdre.com!cheapmonsterbeatsheadsets.com cheapmonstersbeatsonsale.comcheapmonsterbeatssale.comcheapmonsterbeatsusa.uscheapnewbeatsbydre.comcheapsalemonster.comcheapshoesvip.comcheapwireless04.comcheapwirelessbeats.comcheerwholesale.uschihair-straightener.comchinaclothesstore.comciattackers.com +cmhalq.com cnshopin.comcoolmonster.netcozydrdrebeats.com cqcorea.comcuffiesaldi.comcustombeatsbydrebuy.comcustombeatsdeals.comcustombeatsforcheap.comcustombeatsny.comcustombeatssbydreus.comcustomdrdrebeats.comcustomizedbeatbydre.comcustomizedbeatsbydre.comcustomizedbeatsdre.comcybermondaybeats4sale.comdanemarket.comdanmarkbeatsbydrdre.comdctbeatsbydre.comdealsbeatsblackfriday.comdetaliczny.comdiscountbeatsbydre-us.comdiscountbeatsstore.comdkbeatsbydre.comdrbeatsukmart.comdrdre-beats.comdrdrebeats-chen.comdrdrebeats-headphone.comdrdrebeats-usa.comdrdrebeatsale.comdrdrebeatsbillig.comdrdrebeatsdesale.comdrdrebeatsdiscount.comdrdrebeatsforu.comdrdrebeatsretail2013.comdrdrebeatssale7.comdrdrebeatsuk.comdrdreheadphonebeats.comdrdreheadphonekey.comdrdreheadphonesusstore.comdrdremonster-beats.comdrdremonsterdre.comdrdreprobeatssale.com drdrefnac.comdrebeats-australia.comdrebeats-france.comdrebeats-monster.com!drebeats-monsteraustralia.comdrebeats-monsterusa.comdrebeats-singapore.comdrebeats-singapore.netdrebeats-singaporecheap.comdrebeats-singaporecheap.netdrebeats-solo.comdrebeats-studio.comdrebeatsaustralia-cheap.comdrebeatsaustralia-cheap.netdrebeatsbuy.comdrebeatsbydreoutlet.comdrebeatscanada.comdrebeatsdeutschland.netdrebeatsforsaleus.comdrebeatsheadphones-nz.comdrebeatshome.comdrebeatsoutletstore.comdrebeatsoldes.comdrebeatspill.comdrebeatssite.com#drebeatssolocybermondaysale.comdrebeatsstudio2013.comdrebeatstudio.com drebyby.comdremonsterbeatsoutlets.comdreprobeats.com dreprofy.com +dtsell.comearphonescheapest.comebuyheadphones.comesbeatsbydrebuy.cometheadphones.comfamosascalvas.comfindmybeats.comfr-beatsbydrestore.comfrancecasquebeatssolde.comfrcasquesbeats.com free-aa.com free-sns.com frishoes.comgamebeforethegame.comgetdrebeatssale.comgmnetworks.net gobeatsye.comgobuyonlinestore.net goodsdunk.netheadphonepubs.comheadphones-cool.comheadphones-dre.com headphones-outlet-online.comheadphonesbeatsaudio.comheadphonesbeatsbydre.comheadphoneses.comheadphoneshome.comheadphoneshotsales.comheadphonesol.comheadphonesretailer.comheadphonessupply.comheadphonezip.comheadset987.comhellokittybeats.com highbolt.net highdefinitionbeatsbydre.com hipaa6020.com hipzoom.nethonawalaan.comhotbeatsonsale.comhotmonsterbeats.comhottestheadphonesonline.com  hrsaz.com ibeats-uk.comibeatsbydre.ccibeatsbydre.comigoshopping.net illianacomputerrecycling.comimonsterbeats.comincentivetravelgifts.comioffergift.com islamiccenterofnewlondon.comitaliabeatsbydrdre.com jkbeats.comkickshatchannel.comkobbeatssbydredk.comkopfhorergunstigshop.comleecountytimes.com lexuemei.comlovebeatsdr.com lovemarca.comluckyissue.com +lyzsxx.com mairbeats.com +makeeu.commallheadphone.commbeats-tech.commbheadphone.com +micstl.commmonsterheadphones.netmonbeats2013.commonster-beats-by-dr-dre.com monster-beats-headphones.commonsterbeats-cheap.commonsterbeats-headphone.commonsterbeats-onsale.commonsterbeats-solo.commonsterbeats-solo.netmonsterbeats365buy.commonsterbeats8beatsbydre.commonsterbeatsale.commonsterbeatsalestore.commonsterbeatssalg.commonsterbeatsau.commonsterbeatsbydrdre-nz.commonsterbeatsbydrdre-usa.com!monsterbeatsbydrdrecanada.com!monsterbeatsbydrdrestudio.commonsterbeatsbydre-nz.commonsterbeatsbydre-usa.commonsterbeatsbydre2015.com'#monsterbeatsbydreaustraliacheap.com!monsterbeatsbydrebilligde.com monsterbeatsbydrefactory.commonsterbeatsbydrenew.commonsterbeatsbydres.commonsterbeatsbydreshop.commonsterbeatscasques.commonsterbeatscommunity.commonsterbeatsdrdrecheap.commonsterbeatsfactory.netmonsterbeatsfinland.commonsterbeatsforsale.commonsterbeatsheadphone.commonsterbeatsheadphones.netmonsterbeatshere.commonsterbeatsitaly.commonsterbeatsmall.commonsterbeatsnegozi.netmonsterbeatsok.com!monsterbeatsonlinestoreuk.commonsterbeatsoutlet.usmonsterbeatspascher.netmonsterbeatsru.commonsterbeatssales.commonsterbeatsshops.netmonsterbeatsstore.com#monsterbeatssydneyaustralia.commonsterbeatstang.commonsterbeatstienda.commonsterbeatstudio.commonsterbydrebeat.com!monstercasquebeatspascher.netmonstercheapbeatss.commonsterdrebeats-canada.netmonsterdrebeats-usa.commonsterdrebeats-usa.netmonsterheadphone.netmonsterproduct.netmonstersbeatbydres.commonstersdebea.commonstershopcheapbeats.netmoreheadphones.com +ms4dre.commybeatsbydrestudio.commybeatsbydreuk.commybeatscheapbydre.commyferrariheadphones.comnamemybeats.com neborder.comnegozimonsterbeats.comnegoziomonsterbeats.comnewbeatsblackfriday.com newbemany.comnewdrediscount.comnewestbeatsbydre.comnewlysprung.netnewmonst1erbeatsto1re.com!newmonsterbeatsheadphones.comnewschristmasshopping.comnflhotsalejerseys.com nicesshop.netofferairjordanlebron.comofficialbeatsbydreshop.comofficialbeatsbydrestore.comofficialdrdre.comofficialheadphone.com ogameblog.comonbeatsbydresale.com onlinemonsterbeatsonsale.com onsalekey.comonsaletrend.comoutletbeatsshop.compascherbeatsmonster.compaulsimon-music.comperfectkickz.netpersoneelsland.compicknicekicks.netpickshoesclothes.com pillbeatsblackfridaysale.compocketbiketrader.compowerbeats2wireless.compowerbeatsbydrdre.compowerbeatsbydre.compromonsterbeatsbydre.comprostudiobeatscybersale.com  rbsgr.comrepsneakermall.com repswing.com!salebeatslasteststyle4you.comsaleblackfridaydrebeats.comsalecheaphandbags.com samebags.com sanvaras.com +scnshop.cc +shoers.com shoestop2.comshop-headphones.netshopbeatsdre.com shopbydre.comshopcustomizedbeats.comshopdrebeats.comshopmonsterbeats.comshopping-days.netshoppinguheadphones.comsneaker666.comsneakerpage.netsneakerskick.comsolostudioksale.com soso7778.comspecialtyheadphones.comspiritclubs.comstraightouttasomewhere.comstudiobeatsbydrdre.comsulwerphoto.comsunglassessale2014.comsuperearsenjoy.comsupplybestjerseys.comsustainthesound.comsverigebeatsbydrdre.com szcheapmonsterheadphones.comszwinnertechnology.com takegoto.comthe-monster-beats.comthebeatsbydre.comthebeatsbydre.netthebeatsheadphonesale.com +theuab.nettopbeatsbydrdreoutlet.comtopbeatsdealer.comtopbeatsforsale.com tradevip1.com tteshop.com ubnw.net +unstyle.us&"usa-beatsbydreheadphonesonsale.net  v-has.com vip-beats.comvipbeatsbydre.comvipheadphones.com vipshoes2.com  wasdj.comwholesale-exporter1.comwholesalediscountpurses.comwholesalefine.comwholesaleonlinemart.comworldcoinpay.comyourmonsterbeats.com%!beatselectronicsllc.tt.omtrdc.netapple-icloud.cn +cnappleicloud.cn +cnapplemx-icloud.comicloud-apple.cn +cnicloud-content.comicloud-isupport.com  icloud.ch +icloud.com icloud.com.cn +cn  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.jp  icloud.lv icloud.net.cn +cn  icloud.om +icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloudads.neticloudapple.cn +cn icloudbox.neticloudbrowser.net icloude.comicloudhome.comicloudmail.neticloudmusic.net icloudnet.net icloudpay.net icloudo.com +icloudo.de icloudo.net icloudos.de icloudos.neticloudsecure.neticloudsetup.comios-icloud.com +me.com myicloud.net mylcloud.net wwwicloud.com!www-cdn.icloud.com.akadns.net!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.comapple-itunes.cn +cn itun.es itunbes.com ituneas.comitunes-apple.cn +cnitunes-radio.net  itunes.ca  itunes.co itunes.co.th +itunes.com  itunes.hk  itunes.mx +itunes.org +itunes.rio  itunes.usitunes12days.comitunesapple.cn +cnitunesessentials.comitunesfestivals.comitunesiradio.comituneslatino.comituneslogin.netitunesmatch.comitunesparty.comitunesradio.cn +cnitunesradio.comitunesradio.com.cn +cnitunesradio.rioitunesradio.tvitunesradio.twitunesstore.co itunesu.com itunesu.net iutunes.com wwwitunes.comitunes-apple.com.akadns.net apple apple.ae apple.at apple.be apple.bg apple.bs apple.ca apple.ch apple.cl apple.cmapple.cn +cn apple.co apple.co.cr apple.co.hu apple.co.jp apple.co.kr apple.co.mz apple.co.nz apple.co.th apple.co.uk  apple.com apple.com.af apple.com.au apple.com.bo apple.com.br apple.com.cn +cn apple.com.co apple.com.de apple.com.do apple.com.gr apple.com.gy apple.com.jm apple.com.lk apple.com.mg apple.com.mx apple.com.my apple.com.pa apple.com.pe apple.com.pl apple.com.pr apple.com.pt apple.com.py apple.com.sg apple.com.sv apple.com.tr apple.com.tw apple.com.uy apple.cz apple.de apple.dk apple.ee apple.es apple.eu apple.fi apple.fr apple.hamburg apple.hn apple.hr apple.hu apple.ie apple.in apple.is apple.it apple.jo apple.jp apple.kr apple.lk apple.lt apple.lv apple.me apple.my  apple.net apple.net.gr apple.nl apple.no apple.pk apple.pl apple.pt apple.ro apple.rs apple.ru apple.sa apple.se apple.sg apple.si apple.sk apple.so apple.tt apple.tw apple.uk apple.usapple.xn--czr694bapple.xn--fiqs8s  apple.xyz aplestore.comapple-store.cn +cnapple-store.netapple-store.wang applestor.com applestore.bg applestore.cc applestore.ch applestore.cm applestore.cn +cnapplestore.co.huapplestore.co.jpapplestore.co.ugapplestore.co.ukapplestore.comapplestore.com.auapplestore.com.bnapplestore.com.cn +cnapplestore.com.eeapplestore.com.egapplestore.com.grapplestore.com.hkapplestore.com.hrapplestore.com.joapplestore.com.myapplestore.com.phapplestore.com.plapplestore.com.ptapplestore.com.roapplestore.com.ruapplestore.com.snapplestore.com.tw applestore.de applestore.hk applestore.kr applestore.meapplestore.netapplestore.net.gr applestore.ph applestore.qa applestore.sgapplestore.wangapplestoreonline.comapplestorepro.euonlineapplestore.comapp-store.wangappe-store.comapple-appstore.cn +cnappleappstore.cn +cnappleappstore.netappleappstore.tv  appsto.reappstore.co.id appstore.hk appstore.my appstore.phappstoreapple.cn +cn asto.retvappstore.netapple-imac.com appleimac.comimac-apple.comimac-applecomputer.com imac.co +imac.co.nz imac.com imac.eu imac.gr imac.one imac.rs imacapple.comimacapplecomputer.comebookforipad.com euroipad.comfindmyipad.com indiaipad.com +ipad.co.kr ipad.de  ipad.host  ipad.wang  ipad3.com +ipadair.cl +ipadair.cmipadair.com.bripadair.com.es +ipadair.fr +ipadair.hk +ipadair.ie +ipadair.jp +ipadair.twipadaustralia.com ipadmini.cmipadmini.com.lk ipadmini.lk ipadpro.buzz +ukipad.comappleiphone.huappleiphone.netappleiphonecell.combestiphonestuff.comcooliphonecasesstore.comcustom-iphonecase.comdesigneriphonescases.com dl-iphone.comfundaiphone5s.com hebiphone.com hf-iphone.com +iphine.comiphone-8.com.cn +cn iphone-cd.com iphone-cn.com iphone-sh.comiphone-vip1.comiphone-vip2.comiphone-vip3.comiphone-vip4.comiphone-vip5.com iphone-x.tv iphone-yh.com iphone-zh.com  iphone.cm +iphone.com iphone.com.au iphone.com.gr  iphone.es iphone.host iphone.net.gr  iphone.pt  iphone.rs  iphone.ru iphone.wang iphone4.comiphone4.com.br iphone4s.com iphone5.comiphone5casescovers.comiphone5s5case.comiphoneacessorios.com.briphonecase2013.comiphonecase5.comiphonecases100.comiphonecases5.comiphoneclaro.com.briphonecollcase.com iphonefc.comiphonegermany.comiphonehangzhou.comiphoneimessage.comiphoneplus.wang iphonerip.net iphonese.tviphoneunlockimei.com iphonexs.tvonlyiphone5case.comaplleipods.comappleclassicipod.comdownloadsforipod.com ipod.ca ipod.ch ipod.cm ipod.co +ipod.co.nz +ipod.co.uk +ipod.co.za ipod.com ipod.com.au ipod.com.cn +cn ipod.com.fr ipod.com.hk ipod.com.sg ipod.com.tw ipod.de ipod.es ipod.eu ipod.fr ipod.gr ipod.hk ipod.is ipod.net ipod.no ipod.pk ipod.rs ipod.ru ipod.tw ipodcentre.nlipodcleaner.comipoditouch.com ipodnano.com ipodnano.netipodprices.com +ipodrip.caipodrocks.com.au  ipods.comipodshop.com.au ipodtouch.co ipodtouch.com +myipod.netoffrezdesipods.comsimplyipod.comwwwipodlounge.comimacsources.comlaunchpad.wang mac.wang +macbook.co +macbook.hk +macbook.tw macbook.wang macbookair.cn +cnmacbookair.co.krmacbookair.co.ukmacbookair.commacbookair.com.aumacbookair.com.cn +cnmacbookair.com.es macbookair.es macbookair.hk macbookair.kr macbookair.jpmacbookair.net macbookpro.comacbookpro.commacbookpro.com.aumacbookpro.net macbookpro.usmacbookpros.commacbooksale.comwwwmacbookair.comapple-watch.com.ru applewatch.hk applewatch.tv applewatch.twapplewatch.wangapplewatchedition.comapplewatchseries3.netapplewatchsport.comapplemusic.berlinapplemusic.comapplemusic.com.auapplemusic.hamburgapplemusic.wangapplemusicconnect.comapplemusicfestival.com musickit.netwwwapplemusic.comapple.comscoreresearch.com +apple.newsappleenews.comapplenews.berlinapplenews.hamburg applenews.tvapplenewsformat.com apple-pay.com apple-pay.rsapple-pay.wangapplepay.berlinapplepay.co.rsapplepay.com.twapplepay.hamburg applepay.hk applepay.info applepay.jp applepay.rs applepay.tvapplepaycash.cn +cnapplepaycash.com.cn +cnapplepaycash.netapplepaycash.tv!applepaymerchantsupplies.infoapplepaysupplies.berlinapplepaysupplies.cn +cnapplepaysupplies.com#applepaysupplies.com.cn +cnapplepaysupplies.infoapplepaysupplies.netapplepaysupplies.tvapplewallet.comapplewallet.tv +i-book.com +i-book.net ibook.co.nz  ibook.com ibook.eu  ibook.netibookpartner.comibooksauthor.com  iphoto.eu  iphoto.no  iphoto.se iphoto.wang  imovie.euimoviegallery.comimoviestage.comapplecare.berlin applecare.cc applecare.euapplecare.hamburgapplecare.wangappledarwin.comappledarwin.netdarwinsource.comdarwinsource.orgdarwinsourcecode.comappleaccount.netappleid-applemx.comappleid-applemx.usappleid-iclou.com appleid-uk.usappleid.berlin appleid.comappleid.hamburg +appleid.hk ids-apple.com myappleid.com appletv.com +appletv.fr appletv.wang appletv4.cn +cnappletv4.com.cn +cnappletvapp.appleappleone.audio appleone.blog appleone.chatappleone.cloud appleone.clubappleone.community appleone.filmappleone.guide appleone.hostappleone.space appleone.techappleone.website +shazam.com1to1computing.com.au1to1conference.com.au 5lml.com +a0pple.net aapl.twairport.brussels airport.com +airport.euairsupportapp.com airtunes.com airtunes.info airtunes.netalchemysynth.com  ap0le.com aple.com  apole.com +app0le.com +appl-e.com appl.com +appl4e.com  appla.comapple-darwin.comapple-darwin.netapple-darwin.org apple-dns.cn +cn apple-dns.comapple-dns.com.cn +cn apple-dns.netapple-enews.comapple-expo.com apple-expo.eu apple-hk.comapple-ibooks.cn +cn apple-inc.netapple-livephotoskit.com apple-maps.cn +cnapple-online.com apple-usa.netappleafrica.comappleantilles.comappleaustralia.comappleaustralia.com.auappleaustralia.net.au applebk.netapplecarbon.com applecard.tvapplecentar.co.rsapplecentar.rsapplecenter.cn +cnapplecenter.com.cn +cnapplecentre.com.auapplecentre.infoappleclub.com.hk applecom.comapplecomputer-imac.comapplecomputer.cn +cnapplecomputer.co.inapplecomputer.co.nzapplecomputer.com applecomputer.com.cn +cnapplecomputer.com.hkapplecomputer.com.twapplecomputer.huapplecomputer.krapplecomputerimac.comapplecomputerinc.infoapplecomputers.co.nzapplecoronavirus.com appledns.cn +cnappledns.com.cn +cn appleexpo.euappleexpo.infoapplefilmaker.comapplefilmmaker.comapplefinalcutproworld.comapplefinalcutproworld.netapplefinalcutproworld.orgapplehongkong.comapplehongkong.com.hkappleinclegal.comappleipodsettlement.comappleiservices.com applelink.comapplemagickeyboard.comapplemalaysia.com.myapplemasters.infoappleonline.comappleonline.net appleoriginalproductions.com +appleos.tvapplepencil.netapplepodcasts.comapplepremiumreseller.com.au applepremiumresellers.com.auapplereach.comapplereach.net apples-msk.ruapplescreensavers.comapplescript.infoappleshare.infoappleshop.co.uk applesiri.cn +cnapplesurveys.comappletaiwan.com appletips.net appleweb.net applexpo.net applezh.com  applf.com +applfe.com +applle.com  applw.comappmediagroup.com +appule.com  appye.com  apyle.com  beddit.tvbraeburncapital.com burstly.netburstlyrewards.com buyaapl.com buyaapl.net buyaple.com camelphat.comcamelspaceeffect.com +carbon.com catalina.hk cdn-apple.com  chomp.com +coreml.netdashwood360.comdesktopmovie.comdesktopmovie.netdesktopmovie.orgdesktopmovies.netdesktopmovies.orgdeveloper-advisor.comdevice-manager.usdigitalhub.comdiscussionsapple.com +dot-mac.de  dotmac.dedvdstudiopro.bizdvdstudiopro.comdvdstudiopro.infodvdstudiopro.netdvdstudiopro.orgdvdstudiopro.us +earpod.net ecgapp.com.cn +cn +ecgapp.netedu-research.org +emac.co.in emac.in  emagic.de +eworld.com faceid99.com faceid99.netfaceidglobal.com faceshift.cn +cn facetime.netfinalcutpro.comfind-apple.com firewire.cl firewire.eu geoport.com +homepod.cn +cn +hopstop.tv ichat.co.in idvd.eu  ikids.comilecture.co.nz ilife.eu ilife.gr +ilife.wang imessage.tv insidear.cn +cninsidemacintosh.comiosinthecar.comipa-iphone.net  ipple.com ischool.com itools.info  iwork.com iwork.se +iwork.wangjetfuelapp.comjetfuelapps.comlatticedata.com livephotos.cn +cnlivephotos.com.cn +cn livephotos.tvlojaiphone.com.br mac-mini.com mac.com +mac.com.au +mac.eu +mac.rs macappsto.re macboxset.com mach-os.com mach-os.net +machos.net macintosh.eumacintoshsoftware.com macmini.com macos.com.aumacossierra.com macosx.infomacosxlion.com macpazar.com macreach.com macreach.net mobileme.dkmr-apple.com.tw mzstatic.com +newton.com next.com overapple.com powerbook.eupullstring.netquatrowireless.com quicktime.cc quicktime.comquicktime.com.au quicktime.eu quicktime.net quicktime.tvreform-apple.comservices-apple.net siri.com spektral.cc texture.comthinkdifferent.us +touchid.tv touchid.wangtracking-location.comtruedepth3d.com tryrating.comwebobjects.co.uk webobjects.de webobjects.euwebobjects.net wuxiapple.com wwapple.netwww-sms-apple.com wwwapple.com wwwapple.net wwwlapple.comxn--czrs0t4phtr3a.cnxn--fiqs8sxootzz.cn xn--fiqs8sxootzz.xn--hxt814e!xn--gtvq61aiijy0b.xn--hxt814exn--gtvz22d.wangxn--gtvz22d.xn--hxt814exn--hxtr4rozx.xn--czr694b xn--kput3imi374g.xn--hxt814e#xn--ohq11k7pl25iyo8a.cn +cn xn--ruq8a011kt6y.xn--hxt814e, adcdownload.apple.com.akadns.net +cn!adcdownload.apple.com +cn."amp-api-search-edge.apps.apple.com +cn"amp-api.apps.apple.com +cn aod.itunes.apple.com +cn#api-edge.apps.apple.com +cnappldnld.apple.com +cn"appldnld.g.aaplimg.com +cnapps.apple.com +cnapps.mzstatic.com +cn(apptrailers.itunes.apple.com +cn bag.itunes.apple.com +cn'bookkeeper.itunes.apple.com +cnbooks.apple.com +cn!cds-cdn.v.aaplimg.com +cn$cds.apple.com.akadns.net +cn cds.apple.com +cncl2-cn.apple.com +cn<0cl2.apple.com.edgekey.net.globalredir.akadns.net +cncl4-cn.apple.com +cn'client-api.itunes.apple.com +cn+clientflow.apple.com.akadns.net +cn clientflow.apple.com +cn cma.itunes.apple.com +cn."configuration.apple.com.akadns.net +cn#configuration.apple.com +cn!communities.apple.com +cncstat.apple.com +cn."dd-cdn.origin-apple.com.akadns.net +cn(discussionschinese.apple.com +cn(download.developer.apple.com +cnfides-pol.apple.com +cngs-loc-cn.apple.com +cngs-loc.apple.com +cn%gsp10-ssl-cn.ls.apple.com +cn!gsp11-cn.ls.apple.com +cn!gsp12-cn.ls.apple.com +cn!gsp13-cn.ls.apple.com +cnC7gsp4-cn.ls.apple.com.edgekey.net.globalredir.akadns.net +cn, gsp4-cn.ls.apple.com.edgekey.net +cn gsp4-cn.ls.apple.com +cn gsp5-cn.ls.apple.com +cn(gspe11-2-cn-ssl.ls.apple.com +cn&gspe12-cn-ssl.ls.apple.com +cn&gspe19-cn-ssl.ls.apple.com +cn-!gspe19-cn.ls-apple.com.akadns.net +cn"gspe19-cn.ls.apple.com +cn#gspe21-ssl.ls.apple.com +cngspe21.ls.apple.com +cn#gspe35-ssl.ls.apple.com +cn&gspe85-cn-ssl.ls.apple.com +cniadsdk.apple.com +cn, icloud-cdn.icloud.com.akadns.net +cn icloud.cdn-apple.com +cn'images.apple.com.akadns.net +cn?3images.apple.com.edgekey.net.globalredir.akadns.net +cnimages.apple.com +cn3'init-p01md-lb.push-apple.com.akadns.net +cn init-p01md.apple.com +cn3'init-p01st-lb.push-apple.com.akadns.net +cn%init-p01st.push.apple.com +cn3'init-s01st-lb.push-apple.com.akadns.net +cn%init-s01st.push.apple.com +cn!init.itunes.apple.com +cn$iosapps.itunes.apple.com +cn(iosapps.itunes.g.aaplimg.com +cniphone-ld.apple.com +cn'itunes-apple.com.akadns.net +cnitunes.apple.com +cn#itunesconnect.apple.com +cn"js-cdn.music.apple.com +cn km.support.apple.com +cnmaps.apple.com +cn)mesu-cdn.apple.com.akadns.net +cn+mesu-china.apple.com.akadns.net +cnmesu.apple.com +cnmusic.apple.com +cn(ocsp-lb.apple.com.akadns.net +cnocsp.apple.com +cnoscdn.apple.com +cn-!oscdn.origin-apple.com.akadns.net +cn$osxapps.itunes.apple.com +cnpancake.apple.com +cn, pancake.cdn-apple.com.akadns.net +cnpd.itunes.apple.com +cnphobos.apple.com +cn!play.itunes.apple.com +cn1%prod-support.apple-support.akadns.net +cn$se-edge.itunes.apple.com +cn se2.itunes.apple.com +cn#search.itunes.apple.com +cn1%sf-api-token-service.itunes.apple.com +cnsp.itunes.apple.com +cn4(stocks-sparkline-lb.apple.com.akadns.net +cn&stocks-sparkline.apple.com +cn>2store.apple.com.edgekey.net.globalredir.akadns.net +cn'store.apple.com.edgekey.net +cnstore.apple.com +cn2&store.storeimages.apple.com.akadns.net +cn+store.storeimages.cdn-apple.com +cn+streamingaudio.itunes.apple.com +cnsu.itunes.apple.com +cn2&support-china.apple-support.akadns.net +cnsupport.apple.com +cn."swcatalog-cdn.apple.com.akadns.net +cnswcatalog.apple.com +cnswcdn.apple.com +cnswcdn.g.aaplimg.com +cn'swdist.apple.com.akadns.net +cnswdist.apple.com +cn+swscan-cdn.apple.com.akadns.net +cnswscan.apple.com +cn!sync.itunes.apple.com +cn1%updates-http.cdn-apple.com.akadns.net +cn&updates-http.cdn-apple.com +cn upp.itunes.apple.com +cnvalid.apple.com +cn-!valid.origin-apple.com.akadns.net +cn"weather-data.apple.com +cn<0www.apple.com.edgekey.net.globalredir.akadns.net +cn%www.apple.com.edgekey.net +cn www.apple.com +cn#^a[1-5]\.mzstatic\.com$ +cn0$^cdn(-cn)?[1-4]?\.apple-mapkit\.com$ +cn9-^cl[1-5]-cdn\.origin-apple\.com\.akadns\.net$ +cn!^cl[1-5]\.apple\.com$ +cn+^is[1-5](-ssl)?\.mzstatic\.com$ +cn$^s[1-5]?\.mzstatic\.com$ +cnapple.com.akadns.net%!courier-push-apple.com.akadns.netpush-apple.com.akadns.net asus.com asus.com.cn +cn atlassian.com bitbucket.org statuspage.ioaccbusiness.com +atandt.comatt-bundles.com att-japan.com att-mail.comatt-promotions.com att-rsvp.comatt.cn +cn att.com att.jobs att.net +att.tvattalascom.comattbelieves.comattbusiness.net attcenter.comattcollaborate.com +attcorp.cn +cnattexperts.com attglobal.netattinnovationspace.comattinternetservice.com +attjoy.comattnetclient.comattonlineoffers.com attproxy.comattpublicpolicy.comattpurchasing.comattsavings.comattspecial.com +attssl.comattstadium.comattsuppliers.com atttvnow.comattuverseoffers.comattuverseonline.com attvoip.com attwifi.comattwirelessinternet.comattwirelessonline.comattwirelesssolutions.com bellsouth.net +budatt.com +cobatt.com currently.com currently.netdirectvbusinessmarket.comenterprisepaging.com itcanwait.com mymmode.comnaturalvoices.comnettyinternet.comopenapiplatform.comopenapiservice.compatentgold.netpaygonline.comraponlinereview.com signalbar.comsundayready.com synaptic.netthanksloyalty.com tvpromise.com +uverse.comwebhosting.com att-idns.net +attdns.com +attdns.netna-att-idns.netaudiencenetwork.comaudiencenetwork.tvcabletvdirectv.com dierectv.com +dirctv.com direcpath.com direcpath.netdirecttv-deals.tvdirecttv-dish.com dkrecttv.com directtv.netdirecttvdeals.tvdirecttvreviews.comdirectv-4-you.comdirectv-newyork.com directv.comdirectvadsales.comdirectvatlantaga.comdirectvboston.comdirectvbundles.comdirectvbusiness.comdirectvcincinnatioh.comdirectvcinema.comdirectvconnect.comdirectvcookevilletn.comdirectvcrossvilletn.comdirectvdealer.comdirectvdeals.comdirectvdealsnow.com directvdsl.tvdirectvforhotels.comdirectvgrandslam.comdirectvhouston.comdirectvinternet.comdirectvkentucky.comdirectvlebanontn.comdirectvlosangeles.comdirectvmetropolisil.comdirectvmonitoring.comdirectvmurfreesborotn.comdirectvnewhampshire.comdirectvnow.comdirectvoffercodes.comdirectvonline.comdirectvplans.comdirectvpomise.comdirectvpromise.comdirectvpromotions.comdirectvrebate.comdirectvrichmond.comdirectvsavings.comdirectvsports.comdirectvsundayticket.com direectv.com +diretv.comdtv2009offers.comfreedirecttvspecial.com getdirect.tv hddirectv.com le-direct.tvmydirectgroove.commydirectvchannels.comredzonechannel.com txdirectv.com  xandr.combandwagonhost.com bwh1.net bwh8.net  bwh88.net canon c-ij.com canon-cee.comcanon-cmos-sensors.com canon-cna.comcanon-ebm.com.hkcanon-emea.comcanon-emirates.aecanon-europa.comcanon-europe.com canon-me.com canon-ois.qacanon-se.com.tw canon.am canon.at canon.az canon.ba canon.be canon.bg canon.ca canon.chcanon.cn +cn canon.co.il canon.co.uk canon.co.za  canon.com canon.com.al canon.com.au canon.com.by canon.com.cn +cn canon.com.cy canon.com.hk canon.com.mk canon.com.mt canon.com.my canon.com.tr canon.com.tw canon.cz canon.de canon.dk canon.ee canon.es canon.fi canon.fr canon.ge canon.gr canon.hr canon.hu canon.ie canon.it canon.kz canon.lt canon.lu canon.lv canon.me  canon.net canon.nl canon.no canon.pl canon.pt canon.ro canon.rs canon.ru canon.se canon.si canon.sk canon.tj canon.ua canon.uzcanonfoundation.orgcanonproprinters.com webex.ca webex.co.in webex.co.it webex.co.jp webex.co.kr webex.co.nz webex.co.uk  webex.com webex.com.au webex.com.br webex.com.cn +cn webex.com.hk webex.com.mx webex.de webex.es webex.fr ciscoacademynetriders.comcciernslabs.comcciesecuritylabs.comccievoicelabs.com  ccna5.netcisco-returns.comcisco-warrantyfinder.comcisco.cn +cn  cisco.com cisco.com.cn +cn +cisco.mobiciscoccservice.comciscoconnectcloud.comciscoconnectcloud.netciscoconnectcloud.orgciscocontest.comciscoerate.com ciscofax.comciscoinvestments.comciscojabbervideo.netciscokinetic.comciscoknowledgenetwork.comciscolearningsociety.orgciscolearningsystem.com ciscolive.comcisconetspace.comcisconetspace.infocisconetspace.netcisconetapp.comciscopartnermarketing.comciscopowercube.comciscoprice.comciscoresearch.comciscosoftware.com ciscospark.caciscospark.com ciscospark.jpciscotaccc.com ciscotr.com ciscoturk.netciscovideo.comciscowebseminars.com cloudlock.com cloupia.com cloupia.netconnect-in-canada.comcoreoptics.net cs.co +devm2m.com dnaspaces.io flipshare.comgpstheseries.com inlethd.cominternetofeverything.com ioe.com kscisco.com m2m.com +mcisco.commediafiles-cisco.com metacloud.com mindmeld.commultiplydiversity.commyciscobenefits.com  mysdn.com +mysdn.info  mysdn.net netacad.com netacad.netnetwork-auth.cn +cnobservable.net obsrvbl.com parstream.com parstream.net parstream.orgservices-exchange.comstatic-cisco.comtandberg-china.com tandberg.com +versly.comvideochampion.com virtuata.comwballiance.com!whyiwantciscotelepresence.com wifi-mx.comyoutubecisco.comapp-dynamics.comappdynamics.co.ukappdynamics.comappdynamics.deappdynamics.frappdynamics.infoappdynamics.jpappdynamics.org +mearki.com meraki-go.com  meraki.hk merakigo.com +tail-f.com  tailf.comcisco.evergage.comciscolivehls-i.akamaihd.net clco.cc +cloudc.one cloudcone.com cloudcone.net +cfblob.comcloudchoose.comcloudvolumes.com +cmpaas.com +cpedge.comcrit-staging.comexperience-vmware.com gemfire.netgeodesummit.com getboxer.com gitstar.com gitstar.net gopivotal.net greenplum.net hwslabs.com immidio.comitfromtheinside.comlatamvmwareforum.compivotalinitiative.comsnapvolumes.com ssdevrd.com vcanedge.com vcloudair.net vfabric.netvidmpreview.com +virsto.com +virsto.net vmglobal.net +vmmark.comvmtestdrive.com vmw.comvmware-cloudmanagement.comvmware-techcenter.comvmware20mosaic.comvmwareausnews.com!vmwarecertificationvideos.comvmwarecloud.comvmwaredemandcenter.comvmwareemeablog.comvmwaregrid.comvmwarehorizon.comvmwareidentity.comvmwarelearning.comvmwarelearningplatform.comvmwarestuff.comvmwareusergroupstore.comvmwareviewpoint.com vmwarevmc.com vmwdemo.com vmwgcomms.comvmwhorizonair.comvmwidm-ads.com +vmwidm.comvmwlabconnect.comvmwlearningplatform.com vmworld.comvmworld2010.comvmworld2013.comvmwsalesrewards.comvmwservices.com +vnware.netwhychoosehorizon.comwhychooseview.comwhychoosevmwareeuc.comwindowsuem.comworkspaceair.com xlstudio.comavinetworks.com +badaas.com bitnami.combitnamiapp.combitnamistudio.comdockerizer.comcloudcredibility.comcloudhealthtech.com cloudlive.comkubeacademy.com kubeapps.com +nyansa.com velocloud.com gopivotal.com heptio.cn +cn +heptio.com aliveipc.com aliveitsm.comaliveprofiler.com alivercm.comaliverewind.com alivertsm.com alivevm.com alivevmax.com alivevue.com vsphere.com vsphere.net air-watch.comairwatchexpress.comairwatchqa.com +getws1.com getwsone.comwhatisairwatch.comwhatisworkspaceone.comworkspaceone.comvmware.tt.omtrdc.netdelldell-brand.com dell.com dellcdn.com!achat-followers-instagram.com#acheter-followers-instagram.com$ acheterdesfollowersinstagram.com!acheterfollowersinstagram.combookstagram.comcarstagram.comcdninstagram.comchickstagram.com ig.me  igcdn.com igsonar.com igtv.com imstagram.com imtagram.cominstaadder.cominstachecker.cominstafallow.cominstafollower.cominstagainer.com instagda.com instagify.cominstagmania.com instagor.cominstagram-brand.cominstagram-engineering.cominstagram-help.cominstagram-press.cominstagram-press.net instagram.cominstagramci.cominstagramcn.cominstagramdi.cominstagramhashtags.netinstagramhilecim.cominstagramhilesi.orginstagramium.cominstagramizlenme.cominstagramkusu.cominstagramlogin.cominstagramm.cominstagramn.cominstagrampartners.cominstagramphoto.cominstagramq.cominstagramsepeti.cominstagramtakipcisatinal.netinstagramtakiphilesi.cominstagramtips.cominstagramtr.com instagran.cominstagranm.com instagrem.com instagrm.cominstagtram.com instagy.cominstamgram.cominstangram.cominstanttelegram.cominstaplayer.net instastyle.tv instgram.com intagram.com intagrm.com intgram.comkingstagram.comlnstagram-help.comtheinstagramhack.comoninstagram.comonline-instagram.comonlineinstagram.comweb-instagram.netwwwinstagram.comfbmessenger.comm.me messenger.com +nbabot.net binoculus.com buyoculus.com ocul.usoculus-china.com +oculus.comoculus2014.com oculus3d.comoculusblog.comoculusbrand.comoculuscasino.net oculuscdn.comoculusconnect.comoculusdiving.comoculusforbusiness.comoculusrift.com oculusvr.compowersunitedvr.com wa.mewhatsapp-plus.infowhatsapp-plus.mewhatsapp-plus.net whatsapp.cc whatsapp.com whatsapp.info whatsapp.net whatsapp.org whatsapp.tvwhatsappbrand.comaboutfacebook.com accessfacebookfromschool.com acebooik.com acebook.comadvancediddetection.comaskfacebook.netaskfacebook.org +atdmt2.com atlasdmt.comatlasonepoint.combuyingfacebooklikes.comcareersatfb.comcelebgramme.comchina-facebook.com click-url.comcomo-hackearfacebook.comcrowdtangle.com dacebook.comdlfacebook.comdotfacebook.comdotfacebook.netexpresswifi.com faacebok.com faacebook.com faasbook.com facbebook.com facbeok.com +facboo.com facbook.com facbool.com facboox.com faccebook.comfaccebookk.com facdbook.com facdebook.com face-book.com faceabook.com facebboc.com facebbook.comfacebboook.com facebcook.com facebdok.com facebgook.com facebhook.com facebkkk.com facebo-ok.com faceboak.com facebock.com facebocke.com facebof.com faceboik.com facebok.comfacebokbook.com facebokc.com facebokk.com facebokok.com faceboks.com facebol.com facebolk.com facebomok.com faceboo.com facebooa.com faceboob.comfaceboobok.com facebooc.com faceboock.com facebood.com facebooe.com faceboof.com facebooi.com facebooik.com facebooik.org facebooj.comfacebook-corp.comfacebook-covid-19.comfacebook-ebook.comfacebook-forum.comfacebook-inc.comfacebook-login.comfacebook-newsroom.comfacebook-newsroom.orgfacebook-pmdcenter.comfacebook-pmdcenter.netfacebook-pmdcenter.orgfacebook-privacy.comfacebook-program.comfacebook-studio.comfacebook-support.orgfacebook-texas-holdem.comfacebook-texas-holdem.net facebook.br facebook.ca facebook.cc facebook.comfacebook.design facebook.net facebook.hu facebook.in fecebook.net facebook.nl facebook.org facebook.se facebook.shop facebook.tv facebook.us facebook.wangfacebook123.orgfacebook30.comfacebook30.netfacebook30.orgfacebook4business.comfacebookads.com"facebookadvertisingsecrets.comfacebookatschool.comfacebookawards.comfacebookblueprint.netfacebookbrand.comfacebookbrand.net3/facebookcanadianelectionintegrityinitiative.comfacebookcareer.comfacebookcheats.comfacebookck.comfacebookclub.comfacebookcom.comfacebookconsultant.orgfacebookcoronavirus.comfacebookcovers.orgfacebookcredits.infofacebookdating.netfacebookdusexe.orgfacebookemail.comfacebookenespanol.comfacebookexchange.comfacebookexchange.netfacebookfacebook.comfacebookflow.comfacebookgames.comfacebookgraphsearch.comfacebookgraphsearch.infofacebookgroups.comfacebookhome.ccfacebookhome.comfacebookhome.infofacebookhub.com facebooki.comfacebookinc.comfacebookland.comfacebooklikeexchange.comfacebooklive.comfacebooklivestaging.netfacebooklivestaging.orgfacebooklogin.comfacebooklogin.infofacebookloginhelp.netfacebooklogs.comfacebookmail.comfacebookmail.tvfacebookmanager.infofacebookmarketing.info facebookmarketingpartner.com!facebookmarketingpartners.comfacebookmobile.comfacebookmsn.comfacebooknews.comfacebooknfl.comfacebooknude.comfacebookofsex.comfacebookook.comfacebookpaper.comfacebookpay.comfacebookphonenumber.netfacebookphoto.comfacebookphotos.comfacebookpmdcenter.comfacebookpoke.netfacebookpoke.orgfacebookpoker.infofacebookpokerchips.infofacebookporn.netfacebookporn.orgfacebookporno.netfacebookportal.com facebooks.comfacebooksafety.comfacebooksecurity.netfacebookshop.comfacebooksignup.netfacebooksite.netfacebookstories.comfacebookstudios.netfacebookstudios.orgfacebooksupplier.comfacebooksuppliers.comfacebookswagemea.comfacebookswagstore.comfacebooksz.comfacebookthreads.netfacebooktv.netfacebooktv.orgfacebookvacation.com facebookw.comfacebookworld.com facebool.com facebool.info facebooll.com faceboom.com faceboon.com faceboonk.comfaceboooik.com faceboook.com faceboop.com faceboot.com faceboox.com facebopk.com facebpook.com facebuk.com facebuok.com facebvook.com facebyook.com facebzook.comfacecbgook.com facecbook.com facecbook.org facecook.com facecook.org facedbook.com faceebok.com faceebook.com faceebot.com facegbok.com facegbook.com faceobk.com faceobok.com faceobook.com faceook.comfacerbooik.com facerbook.com facesbooc.comfacesounds.com facetook.com facevbook.com facewbook.co facewook.comfacfacebook.com facfebook.com fackebook.com facnbook.com facrbook.com facvebook.com facwebook.com facxebook.com fadebook.com +faebok.com faebook.com faebookc.com faeboook.com faecebok.com faesebook.comfafacebook.com faicbooc.com fasebokk.com fasebook.com faseboox.com favebook.com faycbok.com +fb.careers +fb.com fb.me fbacebook.com fbbmarket.comfbboostyourbusiness.com  fbcdn.com  fbcdn.netfbfeedback.com +fbhome.com fbidb.io  fbinc.comfbinnovation.comfbmarketing.com  fbreg.com +fbrpms.com  fbsbx.com  fbsbx.netfbsupport-covid.netfbthirdpartypixel.comfbthirdpartypixel.netfbthirdpartypixel.org  fburl.comfbworkmail.com fcacebook.com fcaebook.com fcebook.com fcebookk.comfcfacebook.comfdacebook.info feacboo.com feacbook.com feacbooke.com feacebook.com fecbbok.com fecbooc.com fecbook.com feceboock.com feceboox.com fececbook.com  feook.com ferabook.com fescebook.com fesebook.com ffacebook.com fgacebook.com ficeboock.com fmcebook.com fnacebook.com fosebook.com fpacebook.com fqcebook.com fracebook.com  freeb.comfreebasics.comfreebasics.net +freebs.comfreefacebook.comfreefacebook.netfreefacebookads.netfreefblikes.comfreindfeed.comfriendbook.info friendfed.comfriendfeed-api.comfriendfeed-media.comfriendfeed.comfriendfeedmedia.com fsacebok.com fscebook.comfundraisingwithfacebook.comfunnyfacebook.orgfutureofbusinesssurvey.org gacebook.com gameroom.comgfacecbook.com +groups.comhackerfacebook.comhackfacebook.comhackfacebookid.comhifacebook.info!howtohackfacebook-account.comhsfacebook.comhttpfacebook.comhttpsfacebook.comhttpwwwfacebook.com i.org internet.org klik.me liverail.com liverail.tvlogin-account.netmarkzuckerberg.commidentsolutions.commobilefacebook.commoneywithfacebook.com myfbfans.com newsfeed.com nextstop.comonline-deals.netopencreate.orgreachtheworldonfacebook.com rocksdb.orgshopfacebook.comsportsfacebook.comsportstream.comsupportfacebook.comterragraph.comthefacebook.comthefacebook.net thefind.comtoplayerserver.comviewpointsfromfacebook.comwhyfacebook.com worldhack.comwww-facebook.comwwwfacebok.comwwwfacebook.comwwwmfacebook.comzuckerberg.comzuckerberg.netfacebookwork.com +redkix.com workplace.comworkplaceusecases.comfbcdn-a.akamaihd.net  aorus.com aoruszone.cn +cn gigabyte.cn +cn gigabyte.comgigabyte2.azureedge.netsa78gs.wpc.edgecastcdn.net"sni1dcb6gl.wpc.edgecastcdn.net godaddy.comx.co godaddy blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +adscharlestonroadregistry.comregistry.google get.app get.dev get.how get.page iam.soyxn--p8j9a0d9c9a.xn--q9jyb4c youtubeggpht.cn +cn  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com +youtube.ae +youtube.al +youtube.am +youtube.at +youtube.az +youtube.ba +youtube.be +youtube.bg +youtube.bh +youtube.bo +youtube.by +youtube.ca youtube.cat +youtube.ch +youtube.cl +youtube.co youtube.co.ae youtube.co.at youtube.co.cr youtube.co.hu youtube.co.id youtube.co.il youtube.co.in youtube.co.jp youtube.co.ke youtube.co.kr youtube.co.ma youtube.co.nz youtube.co.th youtube.co.tz youtube.co.ug youtube.co.uk youtube.co.ve youtube.co.za youtube.co.zw youtube.comyoutube.com.aryoutube.com.auyoutube.com.azyoutube.com.bdyoutube.com.bhyoutube.com.boyoutube.com.bryoutube.com.byyoutube.com.coyoutube.com.doyoutube.com.ecyoutube.com.eeyoutube.com.egyoutube.com.esyoutube.com.ghyoutube.com.gryoutube.com.gtyoutube.com.hkyoutube.com.hnyoutube.com.hryoutube.com.jmyoutube.com.joyoutube.com.kwyoutube.com.lbyoutube.com.lvyoutube.com.lyyoutube.com.mkyoutube.com.mtyoutube.com.mxyoutube.com.myyoutube.com.ngyoutube.com.niyoutube.com.omyoutube.com.payoutube.com.peyoutube.com.phyoutube.com.pkyoutube.com.ptyoutube.com.pyyoutube.com.qayoutube.com.royoutube.com.sayoutube.com.sgyoutube.com.svyoutube.com.tnyoutube.com.tryoutube.com.twyoutube.com.uayoutube.com.uyyoutube.com.ve +youtube.cr +youtube.cz +youtube.de +youtube.dk +youtube.ee +youtube.es +youtube.fi +youtube.fr +youtube.ge +youtube.gr +youtube.gt +youtube.hk +youtube.hr +youtube.hu +youtube.ie +youtube.in +youtube.iq +youtube.is +youtube.it +youtube.jo +youtube.jp +youtube.kr +youtube.kz +youtube.la +youtube.lk +youtube.lt +youtube.lu +youtube.lv +youtube.ly +youtube.ma +youtube.md +youtube.me +youtube.mk +youtube.mn +youtube.mx +youtube.my +youtube.ng +youtube.ni +youtube.nl +youtube.no +youtube.pa +youtube.pe +youtube.ph +youtube.pk +youtube.pl +youtube.pr +youtube.pt +youtube.qa +youtube.ro +youtube.rs +youtube.ru +youtube.sa +youtube.se +youtube.sg +youtube.si +youtube.sk +youtube.sn youtube.soy +youtube.sv +youtube.tn +youtube.tv +youtube.ua +youtube.ug +youtube.uy +youtube.vnyoutubeeducation.comyoutubefanfest.comyoutubegaming.comyoutubego.co.idyoutubego.co.in youtubego.comyoutubego.com.br youtubego.id youtubego.inyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.comand +chromedclkgbizgle gmailgoogoog +googleguge hangout nexus xn--qcka1pmc  google.ad  google.ae  google.al  google.am  google.as  google.at  google.az  google.ba  google.be  google.bf  google.bg  google.bi  google.bj  google.bs  google.bt  google.by  google.ca +google.cat  google.cd  google.cf  google.cg  google.ch  google.ci  google.cl  google.cm google.cn +cn google.co.ao google.co.bw google.co.ck google.co.cr google.co.id google.co.il google.co.in google.co.jp google.co.ke google.co.kr google.co.ls google.co.ma google.co.mz google.co.nz google.co.th google.co.tz google.co.ug google.co.uk google.co.uz google.co.ve google.co.vi google.co.za google.co.zm google.co.zw +google.com google.com.af google.com.ag google.com.ai google.com.ar google.com.au google.com.bd google.com.bh google.com.bn google.com.bo google.com.br google.com.bz google.com.co google.com.cu google.com.cy google.com.do google.com.ec google.com.eg google.com.et google.com.fj google.com.gh google.com.gi google.com.gt google.com.hk google.com.jm google.com.kh google.com.kw google.com.lb google.com.ly google.com.mm google.com.mt google.com.mx google.com.my google.com.na google.com.ng google.com.ni google.com.np google.com.om google.com.pa google.com.pe google.com.pg google.com.ph google.com.pk google.com.pr google.com.py google.com.qa google.com.sa google.com.sb google.com.sg google.com.sl google.com.sv google.com.tj google.com.tr google.com.tw google.com.ua google.com.uy google.com.vc google.com.vn  google.cv  google.cz  google.de  google.dj  google.dk  google.dm  google.dz  google.ee  google.es  google.fi  google.fm  google.fr  google.ga  google.ge  google.gg  google.gl  google.gm  google.gr  google.gy  google.hn  google.hr  google.ht  google.hu  google.ie  google.im  google.iq  google.is  google.it  google.je  google.jo  google.kg  google.ki  google.kz  google.la  google.li  google.lk  google.lt  google.lu  google.lv  google.md  google.me  google.mg  google.mk  google.ml  google.mn  google.ms  google.mu  google.mv  google.mw  google.ne  google.nl  google.no  google.nr  google.nu  google.pl  google.pn  google.ps  google.pt  google.ro  google.rs  google.ru  google.rw  google.sc  google.se  google.sh  google.si  google.sk  google.sm  google.sn  google.so  google.sr  google.st  google.td  google.tg  google.tl  google.tm  google.tn  google.to  google.tt  google.vg  google.vu  google.ws 0emm.com  1e100.net  1ucrs.com +466453.com abc.xyz adgoogle.net +admeld.comangulardart.org +api.ai +apigee.com appbridge.ca appbridge.io appbridge.it appspot.com +apture.com area120.com +asp-cc.com autodraw.com bandpage.combaselinestudy.combaselinestudy.org bazel.build bdn.devbeatthatquote.com  blink.org blogblog.com blogger.combrocaproject.com +brotli.org bumpshare.com +bumptop.ca bumptop.com bumptop.net bumptop.org bumptunes.comcampuslondon.com certificate-transparency.org +chrome.comchromebook.comchromecast.com chromeos.dev chromium.orgchronicle.securitychroniclesec.comcloudburstresearch.comcloudfunctions.netcloudrobotics.comcobrasearch.com codespot.com conscrypt.com conscrypt.orgcookiechoices.org  coova.com  coova.net  coova.orgcrossmediapanel.com crr.com  cs4hs.comdartsearch.netdataliberation.org  debug.comdebugproject.com deepmind.comdevsitetest.howdialogflow.comdigitalassetlinks.org episodic.comfeedburner.com +fflick.comfinanceleadsonline.comfirebaseapp.comfirebaseio.com +foofle.com froogle.com fuchsia.dev  g-tun.comg.cn +cng.co g.dev +g.page gateway.devgerritcodereview.comgetbumptop.com ggoogle.com gipscorp.com gkecnapps.cn +cn globaledu.org  gmail.com gmodules.com  gogle.com +gogole.comgonglchuangl.net +goo.gl +googel.com +googil.com  googl.comgoogle-syndication.com google.berlin +google.dev +google.net +google.orggoogle.ventures"googleacquisitionmigration.com googleapis.cn +cngoogleapis.comgoogleapps.comgooglearth.comgoogleblog.com googlebot.comgooglecapital.comgooglecert.netgooglecnapps.cn +cngooglecode.comgooglecommerce.comgooglecompare.co.ukgoogledanmark.comgoogledomains.comgoogledrive.com googlee.comgoogleearth.comgooglefiber.netgooglefinland.comgooglemail.comgooglemaps.comgooglepagecreator.comgooglephotos.comgoogleplay.comgoogleplus.comgooglesource.comgooglestore.comgooglesverige.comgoogleusercontent.comgoogleventures.com +googlr.com +goolge.com gooogle.com gridaware.app gsrc.io +gstatic.cn +cn gstatic.comgstaticcnapps.cn +cn +gsuite.com +gv.com gvt0.com gvt1.com gvt2.com gvt3.com gvt5.com gvt6.com gvt7.com gvt9.comhdrplusdata.org hindiweb.comhowtogetmo.co.ukhtml5rocks.com hwgo.comiamremarkable.org igoogle.com impermium.com +j2objc.orgjibemobile.com keyhole.comkeytransparency.comkeytransparency.fookeytransparency.org lanternal.com like.commadewithcode.com material.io mdialog.com meet.newmfg-inspector.commobileview.pagemoodstocks.com near.by nest.com nomulus.foo +oauthz.com on.here on2.comonefifteen.netonefifteen.orgoneworldmanystories.com openthread.io openweave.io orbitera.com  page.linkpagespeedmobilizer.com pageview.mobi panoramio.compartylikeits1986.orgpaxlicense.org +picasa.com picasaweb.com picasaweb.net picasaweb.org +picnik.com pittpatt.com +pixate.com postini.comprojectara.comprojectbaseline.compublishproxy.comquestvisual.comquickoffice.com quiksee.com +revolv.comridepenguin.com run.appsavethedate.foo +saynow.com schemer.comscreenwisetrends.comscreenwisetrendspanel.com snapseed.com solveforx.com +stadia.devstcroixmosquito.comstcroixmosquitoproject.comstudywatchbyverily.comstudywatchbyverily.orgstxmosquito.comstxmosquitoproject.comstxmosquitoproject.netstxmosquitoproject.org synergyse.comtensorflow.org  tfhub.devthecleversense.comthegooglestore.comthinkquarterly.co.ukthinkquarterly.comthinkwithgoogle.com tiltbrush.com txcloud.net  txvia.comunfiltered.news useplannr.comusvimosquito.comusvimosquitoproject.comvelostrata.com +verily.comverilylifesciences.comverilystudyhub.comverilystudywatch.comverilystudywatch.org +wallet.com  waymo.com waze.com web.app web.devwebappfieldguide.comwebmproject.orgwebpkgcache.com +webrtc.orgweltweitwachsen.dewhatbrowser.org widevine.comwithgoogle.com womenwill.comwomenwill.com.br womenwill.id womenwill.in womenwill.mx  x.company +x.team xn--9kr7l.comxn--9trs65b.comxn--flw351e.comxn--ggle-55da.comxn--gogl-0nd52e.comxn--gogl-1nd42e.com xplr.cozukunftswerkstatt.de265.com +cn2mdn.net +cn adservice.google.com +cnapp-measurement.com +cn beacons.gcp.gvt2.com +cnbeacons.gvt2.com +cnbeacons3.gvt2.com +cn c.admob.com +cn(c.android.clients.google.com +cn!cache.pack.google.com +cncheckin.gstatic.com +cn%clickserve.dartsearch.net +cn)clientservices.googleapis.com +cn)connectivitycheck.gstatic.com +cncorp.google.com +cn crl.pki.goog +cn"csi-china.l.google.com +cncsi.gstatic.com +cn dl.google.com +cndl.l.google.com +cndoubleclick.net +cn-!firebase-settings.crashlytics.com +cn fonts.googleapis.com +cnfonts.gstatic.com +cn google-analytics.com +cn googleadservices.com +cngoogleanalytics.com +cn!googlesyndication.com +cn googletagmanager.com +cn!googletagservices.com +cngtm.oasisfeng.com +cn!imasdk.googleapis.com +cn kh.google.com +cn ocsp.pki.goog +cn, pagead-googlehosted.l.google.com +cn!pki-goog.l.google.com +cn recaptcha.net +cnredirector.gvt1.com +cn)safebrowsing-cache.google.com +cn'safebrowsing.googleapis.com +cn$settings.crashlytics.com +cn-!ssl-google-analytics.l.google.com +cnssl.gstatic.com +cn%toolbarqueries.google.com +cntools.google.com +cntools.l.google.com +cn$translate.googleapis.com +cn!update.googleapis.com +cn-!www-googletagmanager.l.google.com +cnwww.gstatic.com +cnwww.recaptcha.net +cn0$^khm([0-3]|db)?\.google(apis)?\.com$ +cn  hinet.net +123-hp.com123hplaserjet.com8008206616.com as-hp.cabaterias-hp.com campushp.comcolorprotechnology.com +compaq.orgdavid-laserscanner.com demoprint.comdigitalpack.com eprintsw.comgaming-notebooks.comgetprintersupports.comhp-imagine.comhp-infolab.com hp-invent.comhp-invent.info +hp-mns.comhp-printing.comhp-webplatform.com  hp-ww.com +hp.com +hp.company hp.io hp3d.comhp3dmetals.comhp3dprinter.comhp3dsamplepromo.comhpallinoneprinter.comhpapplicationscenter.com hpbestbuy.comhpbluecarpet.comhpbluecarpet.nethpbuiltforlearning.com hpbundle.com hpcampus.comhpcatridge.com  hpccp.com  hpceo.com  hpcmw.nethpcodewarsbcn.comhpcomputers.comhpcomputerservices.comhpconnected.comhpconnected.nethpconnected.orghpconnected.ushpconnectedstage.comhpcontinuum.com  hpcpi.com hpcu.orghpcustomersupport.comhpcustomersupport.net +hpdaas.comhpdesignjetl25500.comhpdesktopcomputer.comhpdownloadstore.comhpdreamcolor.com hpdriver.com hpdrivers.com hpdrivers.org hpeclipse.com hpengage.com hpeprint.comhpeprintcenter.com hpeurope.comhpeventcenter.com +hpfaqs.comhpfeedback.com +hpgift.com +hpgpas.comhpgraphicspartners.com  hpiie.org +hpinc.info  hpinc.nethpindigopress.com hpinkjet.comhpinstantink.cahpinstantink.comhpkeyboard.com hplaptop.comhplaptopbattery.comhplargeformatremote.comhplatexknowledgecenter.com hplfmedia.com  hplip.nethplipopensource.comhpmarketplace.comhpmemorychips.comhpmicrcartridge.com +hpmini.com hpmobile.comhpofficejetprinter.comhponlinehelp.comhponlineprinting.comhppage5000.comhppavillionlaptop.comhpphotoscanners.comhpprinterdrivers.comhpprinterinstalls.comhpprintersupplies.comhpsalescentral.com hpserver.comhpservices.comhpshooping.com +hpshop.com hpshoping.com hpshopping.hk hpsignage.com hpsmart.com hpsmarts.comhpsmartstage.comhpsmartupdate.comhpsoftware.com hpspeaker.comhpsprocket.com  hpsso.comhpstore-china.comhpstore-emea.com +hpstore.cn +cn hpstore.comhpstorethailand.com hpsupport.comhpsuresupply.comhptechventures.com hpto.net hptouch.comhptouchpointmanager.comhptrainingcenter.com  hpuae.comhpuniversity.infohpusertraining.com +hpveer.comhpvirtualthin.com hpwallart.comhpwellnesscentral.com  hpwsn.com i-123-hp.com inkchoice.cominstantink.comleavinghpinc.comlife-global.orgmyhpsupport.com printeron.comprintersetupsupport.comprintspots.comprintspots.netserviceshp.comthecompaqstore.comtouchsmartpc.comtouchsmartpc.nettouchsmartpc.orgworkstations.tv www8-hp.comxn--6eup7j.comxn--6eup7j.nethpstore.corpmerchandise.comibmweatherchannel weather bluemix.com bluemix.net ibm.com +ibm.eu ibm.net +ibm.us s-bluemix.net s81c.com intel intel.ac intel.ae intel.af intel.ag intel.ai intel.ar intel.at intel.az intel.ba intel.bg intel.bh intel.bi intel.bo intel.bs intel.by intel.ca intel.cc intel.cg intel.ch intel.cl intel.cmintel.cn +cn intel.co.ae intel.co.cr intel.co.id intel.co.il intel.co.jp intel.co.kr intel.co.uk intel.co.za  intel.com intel.com.ar intel.com.au intel.com.bo intel.com.br intel.com.cn +cn intel.com.co intel.com.ec intel.com.hk intel.com.jm intel.com.mx intel.com.my intel.com.pe intel.com.ph intel.com.pr intel.com.py intel.com.tr intel.com.tw intel.com.uy intel.com.ve intel.cr intel.cu intel.cz intel.de intel.dk intel.dz intel.ec intel.ee intel.eg intel.es intel.eu intel.fi intel.fr intel.ga intel.gd intel.ge intel.gl intel.gm intel.gr intel.gs intel.gt intel.gy intel.hk intel.hn intel.ht intel.hu intel.ie intel.in intel.io intel.it intel.je intel.jo intel.jp intel.ke intel.la intel.lc intel.lk intel.lt intel.lu intel.ly intel.ma intel.md intel.me intel.mg intel.mk intel.mn intel.mp intel.mt intel.mu intel.mw intel.mx intel.my intel.ng intel.nl intel.nu intel.nz intel.pa intel.pe intel.ph intel.pl intel.pn intel.re intel.ro intel.ru intel.rw intel.sa intel.sc intel.se intel.sg intel.si intel.sk intel.sn intel.sr intel.st intel.sv intel.sx intel.sy intel.tf intel.tj intel.tl intel.tm intel.tn intel.tt intel.tv intel.tw intel.ua intel.uk intel.us intel.uy intel.uz intel.vg intel.vn intel.vu intel.wf intel.yt +altera.comalteraforum.comalteraforums.comalteraforums.netalterauserforum.comalterauserforum.netalterauserforums.comalterauserforums.net buyaltera.com celeron.com celeron.net centrino.com centrino.net  chips.com cilk.com cilk.netcloudinsights.comclusterconnection.com coreduo.comcoreextreme.comcrosswalk-project.comcrosswalk-project.netdoceapower.com  easic.com enpirion.comexascale-tech.comexploreintel.comgordonmoore.cominsidefilms.com intc.comintel-research.net&"intel-university-collaboration.netintelamericasstore.comintelapacstore.com intelatom.netintelcapital.comintelcapital.netintelcloudbuilders.comintelcloudfinder.comintelemeastore.cominteleventexpress.comintelforchange.comintelfreepress.com intelgo.netintelinsight.cominteliotmarketplace.com +intell.comintellearningseries.comintellinuxwireless.netintelnervana.comintelnet.component intelplay.comintelquark.comintelrealsense.cn +cnintelrealsense.com intelrxt.comintelsalestraining.comintelsecurity.comintelserveredge.comintelsoftwarenetwork.comintelstore.cominteltechnologyprovider.com intelvmwarecybersecurity.com  itnel.comlatencytop.comlookinside.commakebettercode.commakesenseofdata.com movidius.com movidius.netnervanasys.com  nevex.comnextgenerationcenter.com +niosii.com +niosii.netomekinteractive.com +omnitek.tv openamt.comopendroneid.orgoptanedifference.com +pc.com pentium.com pentium.net pintool.compoweredbyintel.comreconinstruments.com reconjet.comresearchintel.comsaffrontech.comsensorynetworks.com +siport.comsmart-edge.comtheintelstore.comthunderbolttechnology.nettrustedanalytics.comtrustedanalytics.net +vokevr.com vpro.com vpro.net xeon.comxn--ztsq84g.cn +xscale.combarefootnetworks.com +lg.com lgappstv.com  lge.co.kr lge.comlgecareers.com +lghvac.comlghvacstory.comlgrecyclingprogram.comlgsalesportal.comlgelectronics.122.2o7.net linkedin.com  licdn.com logi.comlogicool.co.jp logicoolg.com logitech.biz logitech.com logitech.fr logitechg.com logitechg.frworldsfastestgamer.net azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-sphere.comazure-test.netazure.cn +cn  azure.com  azure.netazurecomcdn.netazurecontainer.ioazurecosmos.netazurecosmosdb.comazurecosmosdb.infoazurecosmosdb.netazuredatabricks.netazuredevopslaunch.comazuredigitaltwin.comazuredigitaltwins.comazuredigitaltwins.netazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazureiotcentral.comazureiotsolutions.comazureiotsuite.comazureplanetscale.infoazureplanetscale.netazureserviceprofiler.comazuresmartspaces.netazurestackvalidation.comazurewebsites.netchinacloudapi.cn +cnchinacloudapp.cn +cnchinacloudsites.cn +cn cosmosdb.info cosmosdb.net devopsms.com gotcosmos.commicrosofteca.commicrosoftiotcentral.comserverlesslibrary.nettryfunctions.comwindowsazure.cn +cnwindowsazure.comazure.microsoft.com"azuremarketplace.microsoft.combing bing.com bing.com.cn +cn bing.net bingads.combingagencyawards.combingapistatistics.combingsandbox.combingvisualsearch.com bingworld.combluehatnights.com +dictate.msflipwithsurface.commasalladeloslimites.commicrosoft-give.commicrosoftcloudsummit.commicrosoftdiplomados.commicrosoftlatamholiday.commicrosoftmxfilantropia.com!microsoftpartnersolutions.commsunlimitedcloudsummit.comoffice365love.comoffice365tw.comrenovacionoffice.comsprinklesapp.com cn.bing.com +cn cn.bing.net +cn ditu.live.com +cnbj1.api.bing.com +cnemoi-cncdn.bing.com +cnmicrosoftnews.ccmicrosoftnews.cn +cnmicrosoftnews.commicrosoftnews.netmicrosoftnews.orgmicrosoftnewsforkids.commicrosoftnewsforkids.netmicrosoftnewsforkids.orgmicrosoftnewskids.commicrosoftnewskids.netmicrosoftnewskids.org msn.commsnewskids.commsnewskids.netmsnewskids.org msnkids.com 1drv.com 1drv.mslivefilestore.com onedrive.coonedrive.co.uk onedrive.com onedrive.eu onedrive.net onedrive.orgonedrive.live.comstorage.live.com  microsoft azure hotmail +office skype windowsxbox microsoft.az microsoft.be microsoft.by microsoft.ca microsoft.cat microsoft.ch microsoft.cl microsoft.com microsoft.cz microsoft.de microsoft.dk microsoft.ee microsoft.es microsoft.eu microsoft.fi microsoft.ge microsoft.hu microsoft.io microsoft.is microsoft.it microsoft.jp microsoft.lt microsoft.lu microsoft.lv microsoft.md microsoft.pl microsoft.pt microsoft.red microsoft.ro microsoft.rs microsoft.ru microsoft.se microsoft.si microsoft.tv microsoft.ua microsoft.uz microsoft.vnfemalefounderscomp.com +m12.vc +aka.msankarazirvesi2018.comapplicationinsights.ioapplicationinsights.net aria.ms asp.net aspnetcdn.com +binads.com bluehatil.combrazilpartneruniversity.com breakdown.mecentralvalidation.com +ch9.mscharticulator.com cloudapp.netcloudappsecurity.comcortanaanalytics.comcortanaskills.comcrmdynint-gcc.com crmdynint.comcrossborderexpansion.com docs.com dynamics.com efproject.netazuredigitaltwin.comfasttrackreadysupport.comfluidpreview.comgameuxmasterguide.com +gears5.com gearspop.comgearstactics.com +gfx.ms +gigjam.com hololens.com +hotmail.co hotmail.com +hotmail.eu hotmail.net hotmail.orghummingbird.ms +ie8.co ie9.com ie10.com ie11.cominternetexplorer.cointernetexplorer.com imaginecup.pl +ingads.comintunewiki.comiotinactionevents.com +kidgrid.tvlatampartneruniversity.com live.com live.com.au live.eu live.netlivingyourambition.com makecode.orgmanagedmeetingrooms.commeetfasttrack.commeetyourdevices.com mepn.commicrosoft-int.commicrosoft-ppe.commicrosoft-sap-events.commicrosoft-sbs-domains.commicrosoft-smb.cn +cnmicrosoft365.commicrosoftaccountguard.commicrosoftads.commicrosoftadvertising.com*µsoftadvertisingregionalawards.commicrosoftaffiliates.commicrosoftcloud.commicrosoftcloudworkshop.com"microsoftcommunitytraining.commicrosoftedge.commicrosofthouse.commicrosofthouse.netmicrosoftinternetsafety.netmicrosoftlatamaitour.commicrosoftlinc.commicrosoftonline-p.commicrosoftonline.com!microsoftpartnercommunity.commicrosoftready.commicrosoftsiteselection.commicrosoftstore.commicrosoftstore.com.hkmicrosoftstream.commicrosoftteams.commicrosofttradein.commicrosofttranslator.commicrosoftuwp.commomentumms.commorphcharts.commpnevolution.comms-studiosmedia.comms365surfaceoffer.com  msads.net msauth.cn +cn +msauth.netmschallenge2018.com +msecnd.net +msedge.net  msft.info msft.net msftauth.cn +cn msftauth.netmsfteducation.ca msftnet.orgmsgamesresearch.com +msocdn.com +msocsp.com msturing.orgmsudalosti.commymicrosoft.comnextechafrica.net nxta.orgo365weve-dev.como365weve-ppe.com o365weve.com +office.com +office.net office365.com onenote.com onenote.net onestore.msopticsforthecloud.netoutingsapp.com outlook.com passport.net +pixapp.netpowerappscdn.netpowerautomate.com powerbi.compowershellgallery.comprojectmurphy.netprojectsangam.com +pxt.ios-microsoft.com  s-msn.com sfbassets.com sfbassets.net +sfx.ms sharepoint.cn +cnsharepoint.comsharepointonline.com  skype.com  skype.netskypeassets.comskypeassets.net staffhub.mssuccesswithteams.com surface.com sway-cdn.com sway.comsysinternals.comtailwindtraders.com +techhub.ms tfsallin.nettrafficmanager.nettranslatetheweb.comunlocklimitlesslearning.com +userpxt.iovideobreakdown.comvideoindexer.aivirtualearth.net vsallin.net +wbd.ms what-fan.netwindows-int.net windows.com windows.net +windows.nl windows8.hkwindowscommunity.netwindowsmarketplace.comwindowsphone-int.comwindowsphone.comwindowssearch.comwindowsupdate.com +winhec.com +winhec.net +yammer.comcdn.office.net +cn(dl.delivery.mp.microsoft.com +cn&download.windowsupdate.com +cn'bg.v4.a.dl.ws.microsoft.com +cn(bg4.v4.a.dl.ws.microsoft.com +cn2&cdn.marketplaceimages.windowsphone.com +cn cn.windowssearch.com +cn#ctldl.windowsupdate.com +cn#developer.microsoft.com +cndocs.microsoft.com +cn"download.microsoft.com +cn/#download.visualstudio.microsoft.com +cnfs.microsoft.com +cn(msgr.dlservice.microsoft.com +cn, msgruser.dlservice.microsoft.com +cn#officecdn.microsoft.com +cn&qh.dlservice.microsoft.com +cnsdx.microsoft.com +cn/#silverlight.dlservice.microsoft.com +cn, slupdate.dlservice.microsoft.com +cn, storeedgefd.dsx.mp.microsoft.com +cn&wl.dlservice.microsoft.com +cn&wscont1.apps.microsoft.com +cn&wscont2.apps.microsoft.com +cnwww.microsoft.com +cn&xb.dlservice.microsoft.com +cn/+img-prod-cms-rt-microsoft-com.akamaized.netimg-s-msn-com.akamaized.netmwf-service.akamaized.net)%officecdn-microsoft-com.akamaized.net3/statics-marketingsites-eus-ms-com.akamaized.net40statics-marketingsites-wcus-ms-com.akamaized.net firefox.comdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud rust-lang.org  rustup.rs  crates.io docs.rsmozilla.community mozilla.net mozilla.org bugzilla.org getpocket.comseamonkey-project.orgthunderbird.net grafolio.com  naver.com naver.jp  naver.net navercorp.com  plug.game pstatic.net neuralink.com +geforce.cn +cn geforce.co.kr geforce.co.uk geforce.comgeforce.com.twgputechconf.cn +cngputechconf.co.krgputechconf.comgputechconf.com.augputechconf.com.twgputechconf.eugputechconf.ingputechconf.jp nvidia.asia  nvidia.be  nvidia.ch nvidia.cn +cn nvidia.co.jp nvidia.co.kr +nvidia.com nvidia.com.au nvidia.com.br nvidia.com.tr nvidia.com.tw  nvidia.cz  nvidia.de  nvidia.dk  nvidia.es  nvidia.eu  nvidia.fi  nvidia.fr  nvidia.it  nvidia.lu  nvidia.nl  nvidia.no  nvidia.pl  nvidia.ro  nvidia.ru  nvidia.seshotwithgeforce.comnvidia.tt.omtrdc.net +oracle +oracle.comoraclecloud.comoraclefoundation.org oracleimg.comateam-oracle.com +bronto.comcovid19-rx.org covid19rx.org sun.com  panasonic panasonic.cn +cn panasonic.com panasonic.jp technics.comairgonetworks.comberkanawireless.comdragoniscoming.comgobianywhere.comhellosmartbook.com imod.comipleadership.org +iskoot.commeetsmartbook.compatenttruth.org pixtronix.comqctconnect.com +qprize.comqualcomm-email.com qualcomm.cnqualcomm.co.idqualcomm.co.inqualcomm.co.jpqualcomm.co.krqualcomm.co.uk qualcomm.comqualcomm.com.brqualcomm.com.tw qualcomm.de qualcomm.frqualcommhalo.comqualcommlabs.comqualcommmea.comqualcommretail.comqualcommventures.cnqualcommventures.com qualphone.com quicinc.com snapdragon.cnsnapdragonbooth.com +uplinq.com wipower.comwirelessreach.com +brewmp.comqualcomm.sc.omtrdc.net  razer.comrazersupport.com razerzone.com razerzone.jprespawnbyrazer.com appcloud.comappexchange.com attic.iobeyondcore.combuddymedia.com chatter.comcloudcraze.com cotweet.com data.comdemandware.com desk.comdocumentforce.comdreamforce.com einstein.comexacttarget.com  force.com govforce.comgravitytank.com heywire.com krux.commarketingcloud.com metamind.io pardot.com quotable.com radian6.com relateiq.comsalesforce.comsalesforce.orgsalesforceiq.comsalesforceliveagent.com salesforcemarketingcloud.com sequence.comsfdcstatic.com sforce.com site.com -social.comsteelbrick.com twinprime.comweinvoiceit.com -$ - THESTANDNEWSthestandnews.com -/ -XVIDEOS xvideos.comxvideos-cdn.com -2 -YNET ynet.cn ynet.com ynet.com.cn +social.comsteelbrick.com twinprime.comweinvoiceit.com samsung +xn--cg4bkigalaxyappstore.comgalaxymobile.jpgame-platform.net knoxemm.com samsung.comsamsungapps.comsamsungcloud.com samsungdm.comsamsungeshop.com.cn +cnsamsunggalaxyfriends.comsamsungknox.comsamsungqbe.comsonyginzasonypark.jpsony-africa.com sony-asia.comsony-europe.comsony-hes.co.jpsony-latin.com sony-mea.comsony-olympus-medical.comsony-promotion.eusony-semicon.co.jp sony.at sony.ba sony.be sony.bg sony.ca sony.ch sony.cl +sony.co.cr +sony.co.id +sony.co.in +sony.co.jp +sony.co.kr +sony.co.nz +sony.co.th +sony.co.uk sony.com sony.com.ar sony.com.au sony.com.bo sony.com.br sony.com.co sony.com.do sony.com.ec sony.com.gt sony.com.hk sony.com.hn sony.com.mk sony.com.mx sony.com.my sony.com.ni sony.com.pa sony.com.pe sony.com.ph sony.com.sg sony.com.sv sony.com.tr sony.com.tw sony.com.vn sony.cz sony.de sony.dk sony.ee sony.es sony.eu sony.fi sony.fr sony.gr sony.hr sony.hu sony.ie sony.it sony.kz sony.lt sony.lu sony.lv sony.net sony.nl sony.no sony.pl sony.pt sony.ro sony.rs sony.ru sony.se sony.si sony.sk sony.ua sonybo.co.jp sonybsc.comsonybuilding.jpsonydesign.com sonydna.comsonyglobalsolutions.jp sonykigyo.jpsonylatvija.com +sonypcl.jpsonyprotechnosupport.co.jpsonystoragemedia.co.jp sonytc.co.jp  sovec.net +spacex.comboringcompany.com x.comads-twitter.com periscope.tv pscp.tvt.co tellapart.com tweetdeck.com  twimg.com twitpic.com twitter.com +twitter.jptwitterinc.comtwitteroauth.comtwitterstat.us twtrdns.net vine.couber-assets.com uber.com ubereats.com +oath.cloud oath.com ouroath.comstatic-verizon.com verizon.com verizon.netverizonbusinessfios.comverizonenterprise.comverizonfios.comverizonmedia.comverizonwireless.com vzw.com +xo.com mvk.com userapi.com  vk-cdn.me vk-portal.net vk.cc +vk.com  vk.design vk.link vk.me vkcache.com vkgo.app +vklive.appvkmessenger.comvkmessenger.app vkontakte.ruvkuseraudio.comvkuserlive.netvkuservideo.comvkuservideo.netg-technology.com +sandisk.ae +sandisk.it +sandisk.cn +cn sandisk.co.jp sandisk.co.kr sandisk.co.uk sandisk.comsandisk.com.ausandisk.com.brsandisk.com.trsandisk.com.tw +sandisk.de +sandisk.es +sandisk.fr +sandisk.hk +sandisk.id +sandisk.in +sandisk.nl +sandisk.sg +wd.com wdc.comwesterndigital.com +flickr +flickr.com +flickr.netstaticflickr.com ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +ads yahoo yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cmyahoo.cn +cn yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.cn +cn yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws maktoob.com +myguide.hkyahoo-news.com.hk yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yho.com yimg.com  ymail.comxn--d1acpjx3f.xn--p1ai  yandex.az  yandex.by yandex.co.il +yandex.com yandex.com.am yandex.com.ge yandex.com.tr  yandex.ee  yandex.kg  yandex.kz  yandex.lt  yandex.lv  yandex.md +yandex.net  yandex.ru  yandex.st  yandex.sx  yandex.tj  yandex.tm  yandex.ua  yandex.uzyandexcloud.net yastatic.net +yandex 928.plus +zind.cloud aaex.uk amytele.com +ark.tobaicaonetwork.com bighead.groupblinkload.zone boslife.biz boslife.net  cloudn.me  conair.me cordcloud.org ctyun.online +cylink.procylink0122.icu dlercloud.com dlercloud.org dlercloud.me dleris.best duyaoss.com duyaossr.com geph.io hitun.ioxn--90wwvt03e.comjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net  maying.coxn--i2ru8q2qg.commocloudplus.com  mray.club muncloud.dog n3ro.fun  n3ro.live n3ro.net nexitally.comnexitallysafe.com nexitcore.com paofu.cloud paofuyun.me renzhe.cloud rixcloud.comshadowsocks.comshadowsocks.nlsquirrelvpn.comsquirrelgroup.net +ssplive.pwchina-internet-exchange.com cxkcloud.com ssrcloud.com ssrcloud.org +ssrpass.pwstc-server.com surflite.co surflite.net vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz cursecdn.com +fandom.com  wikia.com  wikia.org dndbeyond.com futhead.com gamepedia.com muthead.comwikia.nocookie.netfandom.zendesk.com miraheze.org scp-wiki.net  scpdb.org scpwiki.comtranslatewiki.nettranslatewiki.org wdfiles.com wikidot.com wikihow.com mediawiki.org wikibooks.org wikidata.orgwikimediafoundation.org wikimedia.org wikinews.org wikipedia.org wikiquote.orgwikisource.orgwikiversity.orgwikivoyage.orgwiktionary.orgwmfusercontent.org +w.wiki toolforge.orgwikimediacloud.org wmcloud.org wmflabs.orgfamifun.com.tw family.co.jp family.com.twfamilymart.com.cn +cnfamilymart.com.myfamilymart.com.ph  famima.vn hkedcity.nethkreadingcity.nethuanghuagang.orgmcd  mcdonalds4008-517-517.cn +cnaboutmcdonalds.comhappymeal.co.nzhappymeal.com.au mcd.commcdelivery.co.idmcdelivery.co.krmcdelivery.com.aumcdelivery.com.mymcdelivery.com.sgmcdelivery.com.twmcdindonesia.com mcdonalds.camcdonalds.co.uk mcdonalds.commcdonalds.com.hk mcdonalds.hk mcdonalds.it mcdonalds.no mcdonalds.semcdonaldsarabia.commcdonaldsparties.co.nzmcdonaldsparties.com.au!xn--qhrx81fxh2a.xn--55qx5d.hk rarbg.me rarbg.to rarbg.israrbgaccess.org rarbggo.orgrarbgmirror.comrarbgmirror.orgrarbgproxy.org rarbgprx.orgrarbgunblock.comaerogard.com.auaerogard.com.cn +cnaerogardcn.com +airwick.at +airwick.be +airwick.ca +airwick.ch +airwick.cl airwick.co.in airwick.co.nz airwick.co.uk airwick.co.za airwick.comairwick.com.auairwick.com.brairwick.com.cn +cnairwick.com.mxairwick.com.tr +airwick.cz +airwick.de +airwick.dk +airwick.es +airwick.fi +airwick.fr +airwick.hr +airwick.hu +airwick.ie +airwick.it +airwick.jp airwick.net +airwick.nl +airwick.no +airwick.pl +airwick.pt +airwick.ro +airwick.ru +airwick.se +airwick.si +airwick.sk +airwick.tv +airwick.usairwickarabia.com vipoo.es  calgon.at  calgon.be  calgon.ch calgon.cn +cn calgon.co.uk +calgon.com calgon.com.tr  calgon.de  calgon.es  calgon.fr  calgon.ie  calgon.it  calgon.nl  calgon.pt  calgon.ru  calgon.tvcalgoncarbon-china.comcalgoncarbon.com calgonit.com clearasil.cn +cnclearasil.com.cn +cn clearasil.usdettol-prize.com  dettol.at  dettol.be  dettol.ch  dettol.cl dettol.co.id dettol.co.in dettol.co.ke dettol.co.nz dettol.co.uk +dettol.com dettol.com.au dettol.com.bd dettol.com.br dettol.com.cn +cn dettol.com.eg dettol.com.hk dettol.com.my dettol.com.ng dettol.com.sg  dettol.cz  dettol.fr  dettol.hu  dettol.ie +dettol.net  dettol.nl  dettol.pk  dettol.pl  dettol.pt  dettol.rudettolarabia.comdettolcleannaija.comdettolsitishield.co.indettolthailand.comespadoldettol.com.ardewitwithdurex.com dotherex.com durex-shop.chdurex-shopline.comdurex-slovenia.si durex.at durex.be durex.cl durex.co.id durex.co.il durex.co.nz durex.co.th durex.co.uk durex.co.za  durex.com durex.com.au durex.com.bd durex.com.cn +cn durex.com.co durex.com.hr durex.com.my durex.com.ng durex.com.pe durex.com.ph durex.com.pk durex.com.sg durex.com.tr durex.cz durex.de durex.dk durex.ee durex.es durex.fi durex.fr durex.hu durex.ie durex.it durex.jp durex.lv durex.mx durex.nl durex.no durex.pl durex.pt durex.ro durex.ru durex.se durex.us durexcam.comdurexcanada.comdurexchina.comdurexchina.com.cn +cndurexindia.comdurexloveclub.comdurexukraine.com durexusa.comlovesexdurex.cn +cnlovesexdurex.complaybydurex.com shopdurex.com trydurex.net trydurex.tvbebepremium3.com.bo +enfa.co.id enfa.com.vn enfaaplus.com enfababy.com enfabebe.comenfabebe.com.brenfabebe.com.coenfabebe.com.doenfabebe.com.ecenfabebe.com.mxenfabebe.com.peenfabebe.com.veenfabebe3.com.arenfagrow.co.inenfagrow.com.bnenfagrow.com.myenfagrow.com.phenfagrow.com.sg enfagrow4.comenfamama.com.arenfamama.com.ph +enfamil.ca enfamil.com +enfamil.es +enfamil.pl +enfamil.pt enfasmart.comenspireformula.comnutramigen.net nutramigen.pl$dishwashingexpert.com.cn +cn  finish.at  finish.bg finish.co.kr finish.co.nz finish.co.uk finish.co.za finish.com.cn +cn finish.com.hr finish.com.tr  finish.de  finish.es  finish.fr  finish.gr  finish.hu  finish.lv  finish.pl  finish.pt  finish.ro  finish.si  finish.skfinisharabia.comfinishbrasil.com.brfinishdishwashing.cafinishdishwashing.com finishinfo.be finishinfo.clfinishinfo.comfinishinfo.com.arfinishinfo.com.au finishinfo.cz finishinfo.fi finishinfo.it finishinfo.jp finishinfo.nl finishinfo.no finishinfo.ru finishinfo.sefinishkilpailu.fi finishwin.beyarininsuyu.com lizol.co.in lysol.ca lysol.cllysol.cn +cn lysol.co.cr  lysol.com lysol.com.cn +cn lysol.com.mx  lysol.netenfinitas.com.cn +cnmeadjohnson.commeadjohnson.com.cn +cnmeadjohnson.com.hkmeadjohnson.com.twmeadjohnson.net +mortein.cn +cn mortein.co.in mortein.co.nz mortein.co.za mortein.commortein.com.aumortein.com.brmortein.com.ngmortein.com.pkmorteincam.compifpafarabia.comkeepmovingwithmovefree.com move-free.net movefree.cn +cn movefrees.commovefreeoffers.commovefreerewards.comschiffvitamins.com +mucinex.ca +mucinex.cn mucinex.co.nz mucinex.commucinex.com.cn mucinex.net +mucinex.tvmucinexprofessional.com +nurofen.at +nurofen.bg +nurofen.cn +cn nurofen.co.il nurofen.co.nz nurofen.co.uk nurofen.co.za nurofen.comnurofen.com.aunurofen.com.cn +cnnurofen.com.sg +nurofen.cz +nurofen.de +nurofen.es +nurofen.fr +nurofen.hr +nurofen.hu +nurofen.ie +nurofen.it nurofen.net +nurofen.no +nurofen.pl +nurofen.pt +nurofen.ro +nurofen.sk +nurofen.runurofengel.com51nurofensk-prod-env.eu-west-1.elasticbeanstalk.com +cepacol.ca cepacol.com dobendan.degraneodin.com.mx +repsils.no strepsils.at strepsils.ch strepsils.cn +cnstrepsils.co.krstrepsils.co.nzstrepsils.co.zastrepsils.com.arstrepsils.com.brstrepsils.com.cn +cnstrepsils.com.costrepsils.com.austrepsils.com.hkstrepsils.com.phstrepsils.com.tw strepsils.es strepsils.fi strepsils.fr strepsils.hr strepsils.hu strepsils.ie strepsils.net strepsils.pl strepsils.pt strepsils.ro strepsils.ru strepsils.si strepsils.usstrepsilsarabia.como2action.co.krpowerofresolve.capowerofresolve.comspraynwash.com  vanish.at  vanish.be  vanish.ch  vanish.cl vanish.cn +cn vanish.co.id vanish.co.il vanish.co.in vanish.co.nz vanish.co.uk vanish.co.za vanish.com.ar vanish.com.br vanish.com.co vanish.com.hr vanish.com.mx vanish.com.my vanish.com.pe vanish.com.sg vanish.com.tr  vanish.de  vanish.dk  vanish.es  vanish.fi  vanish.fr  vanish.hu  vanish.ie  vanish.it  vanish.nl  vanish.no  vanish.pl  vanish.pt  vanish.ro  vanish.ru  vanish.se  vanish.si  vanish.skvanisharabia.comvanishbancaseulook.com.brvanishcentroamerica.com vanishinfo.czvanishstains.comvanishstains.com.au veet.at veet.be veet.ca veet.ch veet.clveet.cn +cn +veet.co.id +veet.co.in +veet.co.kr +veet.co.nz +veet.co.uk +veet.co.za veet.com veet.com.ar veet.com.au veet.com.bd veet.com.br veet.com.cn +cn veet.com.co veet.com.hk veet.com.mx veet.com.my veet.com.ph veet.com.pk veet.com.sg veet.com.tr veet.de veet.dk veet.es veet.fi veet.fr veet.hu veet.jp veet.nl veet.no veet.pt veet.ro veet.ru veet.se veet.tv veet.usveetarabia.comveetbangladesh.comveetcentroamerica.com veetclub.it +woolite.ca +woolite.cn +cn woolite.comwoolite.com.cn +cn +woolite.pl +woolite.uswoolitecarpet.comdigital-rb.com rb-crisis.com +rb.com +rb.netrbbusinessshop.comrbdigitalab.comrbdigitallab.comrbeuroinfo.com rbgrads.comrbgraduates.comrbmavericks.comrbnainternational.com  rbplc.comrbrandlibrary.com rbspeakup.com reckitt.netreckittbenckiser.cn +cnreckittbenckiser.com#reckittbenckiser.com.cn +cnreckittbenckiser.netreckittbenckiser.tvreckittprofessional.com starbucks.castarbucks.co.uk starbucks.comstarbucks.com.cn +cn starbucks.de starbucks.fr starbucks.ie +tsquare.tv  windy.com xdty.org  xingrz.me +D +RUST rust-lang.org  rustup.rs  crates.io docs.rs + +TELEX telex.cc + +TGBUS  tgbus.com + +EA dawngate.com eastore.comlordofultima.com +origin.com  origin.tv#cloudsync-prod.s3.amazonaws.comorigin-a.akamaihd.netrtm.tnt-ea.comssl-lvlt.cdn.ea.comawayoutgame.combattlefieldbadcompany2.combattlefront2.combattlefrontii.combejewled-stars.combejeweledstars.comcapitalgames.com chillingo.comcommandandconquer.comconquerwithcharacter.com  crysis.jp dawngate.comdawngatechronicles.com +dicela.com +dicela.netea-anz-press.com +ea.com eaaccess.comeacashcard.com eacodigos.com eakorea.co.kr eamobile.com eanordic.com +eaplay.com easports.com easports.jpeasportsactive.comeasportsactiveonline.comeasportsfootball.comeasportsfootballclub.comeasportsmma.comeasportsworld.comelectronicarts.comelectronicarts.fr futpromos.com futunited.comghostgames.comheroesofdragonage.com hutpromos.commaddenchampionship.commaddenrewards.commaddenseason.infomaddenseason.netmaddenseason.org  maxis.commysimsracing.com play4free.com playapex.com pogo.com pogobeta.com +popcap.comprojectapex.com pvzheroes.com spearhead.krspeedhunters.com  spore.com ssx3.comstarwarsbattlefront.comstarwarsbattlefront2.comtiberiumalliances.com tiburon.com +tnt-ea.comultimaforever.com unravel2.comunraveltwo.comvisceralgames.com +yogify.comanthemgame.comanthemthegame.comapexlegends.comprojectapex.combattlefield.combattlefield1943.combattlefield3.combattlefield4.combattlefield5.combattlefieldheroes.combattlefieldv.com battlelog.com bioware.combiowarestore.com eamythic.com eamythic.net cncrivals.comcommandandconquer.comtiberiumalliances.comcamelot-europe.comcamelotherald.comcamelotherald.net daoc.netdarkageofcamelot.comdarkness-risen.comdeadspacegame.com dice.se dragonage.comdragonagekeep.comdragonagemovie.comthedreadwolfrises.comdungeonkeeper.cndungeonkeeper.comdungeonkeeper.com.cneafootballworld.comfifastreet.comfifastreet3.com frostbite.comindustrialtoys.commasseffect.commasseffectarchives.comeamirrorsedge.commirrorsedge.commirrorsedge.jpmirrorsedge.netmirrorsedge2.commirrorsedge2d.comblackboxgames.comeablackbox.comneedforspeed.comneedforspeedboost.comneedforspeeddriftkings.comneedforspeedeliminator.comneedforspeedlightning.comneedforspeedoverdrive.comneedforspeedproven.comneedforspeedredline.comneedforspeedshowdown.comneedforspeedstreetkings.comneedforspeedtakedown.comneedforspeedtherun.comneedforspeedtimeattack.com#needforspeedundergroundeast.com nfsworld.comteamneedforspeed.complantsvszombies2.com +pvzgw2.com pvzheroes.comseaofsolitude.comsimcity-buildit.com simcity.com +skate2.com spearhead.krstarwarsfallenorder.comstarwarsjedifallenorder.comstarwarstheoldrepublic.comswjedifallenorder.com  swjfo.com  swtor.com  swtor.net +mysims.com thesims.com thesims3.com thesims4.comthesimssocial.com titanfall.commythicentertainment.commythicentertainment.netmythicgames.comultimaonline.com +uo.com uoherald.com xdsummit.comea.tt.omtrdc.neteaassets-a.akamaihd.net + +HUFFPOSThuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com + +REMIREPO remirepo.net + +SSPLIVE +ssplive.pw  - ZHIHUISHU zhihuishu.com - + BRILLIANT brilliant.org +) +KEEP gotokeep.com keepcdn.com + +KNOVEL +knovel.com + +AHMIA ahmia.fi + + BLOOMBERG  bloomberg bbgevent.com bbhub.io +bbthat.com bgov.com bloomberg.cnbloomberg.co.jpbloomberg.co.kr bloomberg.combloomberg.com.brbloombergapps.combloombergarcade.combloombergbeta.combloombergbna.combloombergbreakaway.combloombergbriefs.combloombergchina.combloombergenvironment.combloombergforeducation.combloomberggovernment.combloombergindices.combloombergindustry.combloomberglabs.combloomberglaw.combloomberglive.combloomberglp.combloombergmedia.combloombergnext.combloombergpolarlake.combloombergprep.combloombergquint.combloombergradio.combloombergsef.combloombergspace.combloombergstatus.combloombergsurvey.combloombergtax.combloombergtax1.combloombergtaxtech.com!bloombergtradingchallenge.combloombergtv.mnbloombergvault.combloombergview.comblpcareers.com blpevents.comblpprofessional.com bmia.org bnef.combusinessweekmag.comlondonmithraeum.comneweconomyforum.comnewenergyfinance.comtechatbloomberg.com +( +GLOBALSECURITYglobalsecurity.org + + PACKAGIST packagist.org +# + PRIVACYTOOLSprivacytools.io + +RIOThistoryofdota.comhistoryofdota.nethistoryofdota.orginstituteofwar.orgmolesports.com rgpub.ioriot-games.com riot.com riot.net riotcdn.netriotgames.co.kr riotgames.comriotgames.info riotgames.jp riotgames.net riotgames.tv riotpin.comriotpoints.com rstatic.net supremacy.com supremacy.net championshipseriesleague.com lcsmerch.comleaguehighschool.comleagueoflegends.caleagueoflegends.cn +cnleagueoflegends.co.krleagueoflegends.comleagueoflegends.infoleagueoflegends.krleagueoflegends.netleagueoflegends.orgleagueoflegendsscripts.comleaguesharp.infoleaguoflegends.comlearnwithleague.comlol-europe.com lolclub.org lolespor.comlolesports.com lolfanart.net +lolpcs.com lolshop.co.kr lolstatic.comlolusercontent.com +lpl.com.cn +cn pvp.net +pvp.tv ulol.comlolstatic-a.akamaihd.net + +I2P +geti2p.net + + INTEL-DEV +01.org hyperscan.iointellinuxgraphics.comintellinuxgraphics.net +oneapi.comopenvinotoolkit.orgsnap-telemetry.io +acpica.com clearlinux.cn +cnclearlinux.org +ospray.net +ospray.org + +RFA rfa.org +e + ATOM-DATA-ADS atom-data.io +adsanalytics-data.io +ads ironbeast.io +ads +N +OPENWRT openwrt.lan +private openwrt.orglede-project.org +. +ASPROEX asproex.comasproexapi.com + +CATEGORY-VPNSERVICES 928.plus +zind.cloud aaex.uk amytele.com +ark.tobaicaonetwork.com bighead.groupblinkload.zone boslife.biz boslife.net  cloudn.me  conair.me cordcloud.org ctyun.online +cylink.procylink0122.icu dlercloud.com dlercloud.org dlercloud.me dleris.best duyaoss.com duyaossr.com geph.io hitun.ioxn--90wwvt03e.comjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net  maying.coxn--i2ru8q2qg.commocloudplus.com  mray.club muncloud.dog n3ro.fun  n3ro.live n3ro.net nexitally.comnexitallysafe.com nexitcore.com paofu.cloud paofuyun.me renzhe.cloud rixcloud.comshadowsocks.comshadowsocks.nlsquirrelvpn.comsquirrelgroup.net +ssplive.pwchina-internet-exchange.com cxkcloud.com ssrcloud.com ssrcloud.org +ssrpass.pwstc-server.com surflite.co surflite.net vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz +. +CHINADIGITALTIMESchinadigitaltimes.net + -BLOGSPOT blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn - -ERJI erji.net -E -ETHEREUM -devcon.orgethereum.foundation ethereum.org -! -FREENETfreenetproject.org +ITUNES!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.comapple-itunes.cn +cn itun.es itunbes.com ituneas.comitunes-apple.cn +cnitunes-radio.net  itunes.ca  itunes.co itunes.co.th +itunes.com  itunes.hk  itunes.mx +itunes.org +itunes.rio  itunes.usitunes12days.comitunesapple.cn +cnitunesessentials.comitunesfestivals.comitunesiradio.comituneslatino.comituneslogin.netitunesmatch.comitunesparty.comitunesradio.cn +cnitunesradio.comitunesradio.com.cn +cnitunesradio.rioitunesradio.tvitunesradio.twitunesstore.co itunesu.com itunesu.net iutunes.com wwwitunes.comitunes-apple.com.akadns.net + - -KUBERNETES kubernetes.io -k8s.io - - -SHUZIYIMINshuziyimin.org - -AAEX aaex.uk -< - BITSQUARE bisq.io bisq.network bitsquare.io - - EPICGAMESbattlebreakers.com epicgames.com fortnite.com paragon.complayparagon.comroborecall.comshadowcomplex.com spyjinx.comunrealengine.comunrealtournament.com*&^epicgames-download\d\.akamaized\.net$.*^cdn\d-epicgames-\d+\.file\.myqcloud\.com$3/^epicgames-download\d-\d+\.file\.myqcloud\.com$ +TYPEKIT typekit.com typekit.net +S + UNITY-ADS!unityads.unity3d.com +ads#unityads.unitychina.cn +ads +" +NIST nist.gov time.gov  -FEEDLY -feedly.com -@ - GLOBALVOICESglobalvoices.orgglobalvoicesonline.org - +BADGEN +badgen.net +{ + CLARIVATEnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.comwebofscience.com +" + EPICBROWSERepicbrowser.com + +MZED mzed.com + +RTINGS +rtings.com +& +SMZDM  smzdm.com +zdmimg.com + +ICLOUDapple-icloud.cn +cnappleicloud.cn +cnapplemx-icloud.comicloud-apple.cn +cnicloud-content.comicloud-isupport.com  icloud.ch +icloud.com icloud.com.cn +cn  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.jp  icloud.lv icloud.net.cn +cn  icloud.om +icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloudads.neticloudapple.cn +cn icloudbox.neticloudbrowser.net icloude.comicloudhome.comicloudmail.neticloudmusic.net icloudnet.net icloudpay.net icloudo.com +icloudo.de icloudo.net icloudos.de icloudos.neticloudsecure.neticloudsetup.comios-icloud.com +me.com myicloud.net mylcloud.net wwwicloud.com!www-cdn.icloud.com.akadns.net +? +LIEPIN +liepin.com +lietou.comlietou-static.com +, +LINUXFROMSCRATCHlinuxfromscratch.org +i +RAZER  razer.comrazersupport.com razerzone.com razerzone.jprespawnbyrazer.com +g +SPRINGER +apress.com springer.comspringerlink.comspringernature.com wkap.nl +/ + STARTPAGE startpage.com ixquick.com +c + UMENG-ADSalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads +: +BBCbbc  bbc.co.uk bbc.com +bbci.co.uk + -INFRAPEDIAinfrapedia.com +CLOUDFLAREcloudflare-dns.comcloudflare-ipfs.comcloudflare.comcloudflareapps.comcloudflareinsights.comcloudflareok.comcloudflaressl.comcloudflarestatus.comcloudflarestream.comcloudflaretest.com one.one.onetrycloudflare.comvideodelivery.net workers.dev + +FARFETCHfarfetch-apps.comfarfetch-contents.com farfetch.cn +cn farfetch.comfarfetch.com.cn +cn farfetch.netfarfetch.net.cn +cn  fflnk.net + +NINTENDO100classicbooks.com +amiibo.comayudanintendo.combowsersinsidestory.comexcitebots.comflipnotestudio.comgloryofheracles.comhackyourconsole.comkirbysuperstarultra.comkirbysepicyarn.comlegendofzelda.cn +cn legendofzelda.com.cn +cn miitomo.commiitomo.com.cn +cn miiverse.com nentindo.netnintendo-europe-sales.comnintendo-europe.com nintendo.at nintendo.be nintendo.chnintendo.co.jpnintendo.co.krnintendo.co.uknintendo.co.za nintendo.comnintendo.com.hknintendo.com.pt nintendo.de nintendo.dk nintendo.es nintendo.eu nintendo.fi nintendo.fr nintendo.it nintendo.net nintendo.nl nintendo.no nintendo.pt nintendo.ru nintendo.se nintendo.twnintendo3ds.comnintendodsi.comnintendoeurope.comnintendolabo.cn +cnnintendonetwork.netnintendonyc.comnintendostore.comnintendoswitch.comnintendoswitch.netnintendoswitchtogether.compersonaltrainermath.complaynintendo.comsupersmashbros.cn +cn!supersmashbros.com.cn +cnthelegendarystarfy.comthewonderful101.comwariolandshakeit.comwariowarediy.comyoshisnewisland.comac-pocketcamp.comdiddykongracing.com dkr.com donkeykongcountryreturns.comfire-emblem-heroes.comfireemblemawakening.com +dialga.com giratina.com +kyurem.com pokedex3d.compokemon-moon.compokemon-sun.compokemon-sunmoon.com pokemon.compokemonbank.compokemonblackwhite.com pokemonbw.compokemonchampionships.compokemongoldsilver.compokemonhome.compokemonletsgoeevee.compokemonletsgopikachu.compokemonmysterydungeon.compokemonpicross.compokemonplatinum.compokemonrubysapphire.compokemonsunmoon.compokemonswordshield.compokemonultrasunmoon.compokemonvgc.compokemonwifi.net xn--mts47c3w9b1qr.cn +cnxn--mts47c3w9b1qr.netsplatoon2tournament.com starfox.comdrmario-world.commarioandluigidreamteam.commariobroswii.com mariokart.cn +cnmariokart.com.cn +cnmariokart7.commariokart8.commariosupersluggers.comnewsupermariobrosu.comsupermario.comsupermario3dworld.com!supermariobros.com.cn +cnsupermariogalaxy.comsupermariorun.comsuperpapermario.comnintendowii.com  wii-u.com +wiifit.com wiifitu.com wiipartyu.com wiisports.comwiisportsresort.comwiiugamepad.com  wiivc.net xenoblade.com +/ +REALTYPErealtype.co.jp realtype.jp . -NOTION  notion.sonotion-static.com +U17 u17.com u17i.com u17t.com + +UMENG mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com +uyunad.comwhalecloud.comalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads + +XIAOMI +mi.com +mi-img.com  mifile.cn miui.com +miwifi.com  xiaomi.cn +xiaomi.com +xiaomi.netxiaomiyoupin.com  -BBGWATCH bbgwatch.com - -FACEBOOK facebook.br facebook.comfacebook.design facebook.net facebook.hu facebook.in facebook.nl facebook.se -fb.com fb.me  fbcdn.net  fbsbx.comm.me messenger.com -oculus.com oculuscdn.com rocksdb.orgthefacebook.com whatsapp.com whatsapp.netfbcdn-a.akamaihd.netcdninstagram.com  igcdn.com igsonar.com instagram.cominstagram-press.com -_ -FEDORA getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org -$ - MOPUB-ADS mopub.com -@ads -' -ZEPLIN -zeplin.dev  zeplin.io -D - APPLOVIN-ADS applovin.com -@ads -applvn.com -@ads - -BITBANK -bitbank.cc -1 -JINSHUJU jinshuju.netjinshujucdn.com -Q - SOURCEFORGEsourceforge.comsourceforge.net -sf.net fsdn.com - -VUVUZELA vuvuzela.io -, -CYLINK -cylink.procylink0122.icu -? -MAFENGWO mafengwo.cn mafengwo.com mafengwo.net +GOFUNDME gofundme.com  -WHONIX -whonix.org - -GEOLOCATION-!CNaubrcadeeufrhkjpmonzrusgtwukusvnaflmlbnbanflnra averybbbbcgcebcrsdnbdnpdunsdvagerni globalxice locus mckinsey olayangroup -olayan praxisapseek -vistaprint vistawtc xerox athletabananarepublic  bloomberg boots calvinklein cartier chloegap gucci -hermesiwcjlc  lancaster lipsyloft mango  montblanc mrporter -netaporter -nextdirectnextnike oldnavy omega panerai  patagonia -piaget  piperlimepolo redstone -swatchaarp -abbott -abbvie aetna alcon -anthembms -boehringer caremore -cialis dabur  freseniusjnj merck mutuelle -sanofiaeg -airbus -alstom -aramco -blanco bosch -bostik -chesapeakechk crown -doosan -dupontflirfls flsmidth  gecompany grainger hitachi  honeywellifm ipirangajio komatsukoneksb  kuokgroup leclerclidl linde lottemanmtr reliance rexrothril rockwoolrwesandvikcoromant sandvik sapphiresca -schaeffler schmidt schwarzgroup schwarz senersewsncf statoil total -vanish -walter -warman weberweir woodsidezara zippo agakhanakdn -ansons -bharti -extraspace genting glean ikano -imamat  ladbrokes -livestrongmaif -mattel shell transformersvanawme astriumcern -emerck  hisamitsu lilly lundbeck lupin merckmsdmsdmtpc -otsuka -pfizer stadateva toray weather auspost deutschepostdhl epost fedex -pitneyaaa -abarthadac  alfaromeoaudi bentleybmw bridgestone bugatti buick cadillaccase -caseih  chevrolet chevy chrysler -datsun dodge -dunlop ferrarifiat  firestonefordgmc goodyear honda hyundai infiniti iveco -jaguarjeepkia lamborghini -lancia  landrover lexus lincoln maseratimini -mitsubishi mopar -newholland -nissanramseatsrt -suzuki -tatamotors -toyotatvs uconnect -volkswagen volvoaigo android apple bestbuy brother canondell digikey fujitsu  fujixerox  goldpointibm nikon nokia olympus  panasonic philips pioneer samsung sharpsony toshiba  yodobashi  allfinanzallfinanzberaterallfinanzberatungallyamericanexpressamexampanz banamex barclaycard barclaysbbtbbvabnl -bnpparibasbofa bradesco -capitalone cashbackbonuscbacfa chasecimb citadelciti commbank deloitte discover everbank fidelity hdfcbankhdfchsbcitaujcbjll jpmorganchase jpmorgankfhkpmg lacaixa lasalle lixil lplfinanciallplnab nadex netbanknorthwesternmutualopen -pictetpncpohl  pramerica -prudentialprupwcsaxosbiscbscor shriram softbank  statebank temasek -transunion ubankubs vanguardvisa wolterskluwerafamilycompany  aquarellediyduck -finish glade  homedepot  homegoods mrmuscleoffraid rightathome  scjohnsonaig allstateamericanfamily amfam amicaaxa chartis esurance farmers  goodhands guardian guardianlife iselect metlifemma -mutual -nationwide -nissaynorthlandinsurance -onyourside progressive redumbrella  statefarm -swiftcover thehartfordtiaatravelersinsurance  travelers travelguardtrvvig beats blockbusterbway netflix playstation showtimetab williamhillxboxasda bloomingdales -george  homesense justforulego macys  marshallsobiqvc safeway samsclub shopyourway staples -targetthd tiffany -tjmaxxtjx -tkmaxxvons walmartabb  accentureaceraco -active -airtel -amazonandaolawsaxis azure chatr -chrome cisco comcast -connectorscscdclkdish -docomodtvdwg emerson epson ericsson etisalat  fairwindsfido -flickr frogans frontierftrgbizgeaggeegle gmailgmogmx godaddygoog -googlegoogreeguge hangouthkt hotmailhtc -hughesieee iinet infosysinfy intel -intuitjavajcpjmpjprs juniperkddi -kindle -konamikpn lanxess liaison -lockermeo  microsoftmihmiimint mitekmit -mobily -mozaicmtn multichoice naspersnec neustar nexusnico -nortonntt -officeollo -oracle -orangeovh patchpayupccwqtel quest  richardli ricoh -rogers -sakurasaposassessfrshaw skolkovo skydrive skype sling smart stcgroupstc symantectatatcitdk telecity -telefonica terra translations  ultrabook unicornuol verisignvivavivo windows xfinity -xperia yahoo yamaxun -yandex yellowpages youtube -zappos -chanel clinique garnier  kerastase -kiehls lamer lancome -loreal -matrix -maybelline -natura origins -redkensvr barefoot beknown cityeatscookingchannel -cuisinella delmonte edekafage ferrero foodnetworkfood gallo heinz -kindermcd  mcdonalds pamperedchef -rocher -wilmarxn--3oq18vl8pn36axn--55qx5d8y0buji4b870uxn--5su34j936bgsgxn--b4w605ferd xn--cckwcxetd -xn--cg4bkixn--dkwm73cwpn xn--flw351exn--fzys8d69uvgmxn--hxt035cmppuelxn--hxt035czzpfflxn--j6w470d71isscxn--jlq480n2rgxn--jlq61u9w7bxn--kcrx77d1x4axn--kcrx7bb75ajk3bxn--mgba3a3ejtxn--mgba7c0bbn0axn--mgbaakc7dvfxn--mgbb9fbpob xn--ngbe9e0a xn--pgb3ceoj xn--qcka1pmcxn--w4r85el8fhu5dnra xn--w4rs40l avianca caravan changiairport cipriani clubmed delta firmdale -hilton hyatt kerryhotelskerrylogisiticskerryproperties marriott orientexpress  shangrila tradershotelstui -viking -virgin -webjetablecbre chintai  frontdoor -lefrakabc africamagicartebbc  canalpluscbncbsdstv -eurovisionfox -gallup globogotv guardianmediahbohgtvimdbitv -kyknetmnet movistar mzansimagicnhk nowtvsbs sevensky spiegel starhub -supersport theguardian travelchannelweatherchannel bauhaus latrobe -monashrmit 928.plus -zind.cloud aaex.uk amytele.com -ark.tobaicaonetwork.com bighead.groupblinkload.zone boslife.biz boslife.net  cloudn.me  conair.me cordcloud.org ctyun.online -cylink.procylink0122.icu dlercloud.com dlercloud.org dlercloud.me dleris.best duyaoss.com duyaossr.com hitun.ioxn--90wwvt03e.comjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net  maying.coxn--i2ru8q2qg.commocloudplus.com  mray.club muncloud.dog n3ro.fun  n3ro.live n3ro.net nexitally.comnexitallysafe.com nexitcore.com paofu.cloud paofuyun.me renzhe.cloud rixcloud.comshadowsocks.comshadowsocks.nlsquirrelvpn.comsquirrelgroup.net -ssplive.pwchina-internet-exchange.com cxkcloud.com ssrcloud.com ssrcloud.org -ssrpass.pwstc-server.com surflite.co surflite.net vilavpn.com vilavpn.xyz vilavpn1.xyz vilavpn2.xyz vilavpn3.xyz vilavpn4.xyz vilavpn5.xyz vilavpn6.xyz vilavpn7.xyz ahmia.fi akasha.worldbrowserleaks.combypasscensorship.org citizenlab.cadat.foundationdemocracy.earth eff.orgepicbrowser.com ffprofile.comfreenetproject.org fteproxy.org  gfw.press -gfw.report greatfire.orgguardianproject.infohaveibeenpwned.compwnedpasswords.com -geti2p.net ipfs.io  jitsi.orggetlantern.org -lantern.io  ntc.partyonionshare.org ooni.org openvpn.netprivacytools.io psiphon3.comshadowsocks.org softether.orgsoftether-download.com stunnel.org telex.cctorproject.org tribler.org tunsafe.comtwister.net.co -uproxy.org  v2ray.com -v2ray.cool  v2fly.org vuvuzela.io -whonix.org wikileaks.org wireguard.com -zeronet.io  1pondo.tv +OPENAI +openai.com + + +STATICFILEstaticfile.org + + YUNFANJIASU yfcache.com +yfcalc.com yfcloud.com  yfdts.net  yfp2p.net +yfscdn.net yunfancdn.com + + +GOOGLE-ADS2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +ads + +CISCO webex.ca webex.co.in webex.co.it webex.co.jp webex.co.kr webex.co.nz webex.co.uk  webex.com webex.com.au webex.com.br webex.com.cn +cn webex.com.hk webex.com.mx webex.de webex.es webex.fr ciscoacademynetriders.comcciernslabs.comcciesecuritylabs.comccievoicelabs.com  ccna5.netcisco-returns.comcisco-warrantyfinder.comcisco.cn +cn  cisco.com cisco.com.cn +cn +cisco.mobiciscoccservice.comciscoconnectcloud.comciscoconnectcloud.netciscoconnectcloud.orgciscocontest.comciscoerate.com ciscofax.comciscoinvestments.comciscojabbervideo.netciscokinetic.comciscoknowledgenetwork.comciscolearningsociety.orgciscolearningsystem.com ciscolive.comcisconetspace.comcisconetspace.infocisconetspace.netcisconetapp.comciscopartnermarketing.comciscopowercube.comciscoprice.comciscoresearch.comciscosoftware.com ciscospark.caciscospark.com ciscospark.jpciscotaccc.com ciscotr.com ciscoturk.netciscovideo.comciscowebseminars.com cloudlock.com cloupia.com cloupia.netconnect-in-canada.comcoreoptics.net cs.co +devm2m.com dnaspaces.io flipshare.comgpstheseries.com inlethd.cominternetofeverything.com ioe.com kscisco.com m2m.com +mcisco.commediafiles-cisco.com metacloud.com mindmeld.commultiplydiversity.commyciscobenefits.com  mysdn.com +mysdn.info  mysdn.net netacad.com netacad.netnetwork-auth.cn +cnobservable.net obsrvbl.com parstream.com parstream.net parstream.orgservices-exchange.comstatic-cisco.comtandberg-china.com tandberg.com +versly.comvideochampion.com virtuata.comwballiance.com!whyiwantciscotelepresence.com wifi-mx.comyoutubecisco.comapp-dynamics.comappdynamics.co.ukappdynamics.comappdynamics.deappdynamics.frappdynamics.infoappdynamics.jpappdynamics.org +mearki.com meraki-go.com  meraki.hk merakigo.com +tail-f.com  tailf.comcisco.evergage.comciscolivehls-i.akamaihd.net +5 +IMDB imdb.com imdb.tomedia-imdb.com +, +MATTERS matters.news matters.one + +SONY playstationplaystation.complaystation.net sonyentertainmentnetwork.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com +wwtbam.comyourfantasybeginsnow.comsonyginzasonypark.jpsony-africa.com sony-asia.comsony-europe.comsony-hes.co.jpsony-latin.com sony-mea.comsony-olympus-medical.comsony-promotion.eusony-semicon.co.jp sony.at sony.ba sony.be sony.bg sony.ca sony.ch sony.cl +sony.co.cr +sony.co.id +sony.co.in +sony.co.jp +sony.co.kr +sony.co.nz +sony.co.th +sony.co.uk sony.com sony.com.ar sony.com.au sony.com.bo sony.com.br sony.com.co sony.com.do sony.com.ec sony.com.gt sony.com.hk sony.com.hn sony.com.mk sony.com.mx sony.com.my sony.com.ni sony.com.pa sony.com.pe sony.com.ph sony.com.sg sony.com.sv sony.com.tr sony.com.tw sony.com.vn sony.cz sony.de sony.dk sony.ee sony.es sony.eu sony.fi sony.fr sony.gr sony.hr sony.hu sony.ie sony.it sony.kz sony.lt sony.lu sony.lv sony.net sony.nl sony.no sony.pl sony.pt sony.ro sony.rs sony.ru sony.se sony.si sony.sk sony.ua sonybo.co.jp sonybsc.comsonybuilding.jpsonydesign.com sonydna.comsonyglobalsolutions.jp sonykigyo.jpsonylatvija.com +sonypcl.jpsonyprotechnosupport.co.jpsonystoragemedia.co.jp sonytc.co.jp  sovec.net + +NIKEnikeair-nike-shoes.com airmax360.combeijingnike.combetternike.combuynikechina.comcheap-nike.comcheapnikedunks.comcheapnikeoutlet.comclassicnike.comcnnikebrand.comcustomnikeshoes.com easynike.com +eenike.comfashionnike.com finenike.comfoampositeshoes.comgoldnikeclub.com +gonike.comhandbags-nike.comhightopnikes.com +idnike.cominikesneakers.com just-do-it.cn +cn justdoit.uskicksnike1.comkidsnikeshoes.com +mynike.comnike-air-max.comnike-dunksb.com nike-fr.com nike-org.com nike-shox.cn +cn nike-uk.com nike-us.com nike-usa.com nike.cinike.cn +cn nike.com nike.com.br nike.com.hk nike.gy nike.hk  nike.shop nike.usnike.xn--hxt814e nike0594.com +nike23.comnikeadidas.comnikeairhuarache.comnikeairmax.comnikeairmaxs.comnikeairmaxshoes.comnikeairrift.com nikeasia.comnikeaustralia.com nikeaw77.com  nikeb.com nikebbn.comnikebetrue.comnikebetterworld.cn +cnnikebetterworld.com"nikebetterworld.com.cn +cnnikebetterworld.infonikebetterworld.netnikebetterworld.org nikebiz.info nikebuy.com +nikeby.com nikecdn.comnikecompany.comnikeconfluence.com nikechina.cn +cnnikechosen.com nikecloud.com nikeclub.com nikecraft.com nikedawn.com nikedunks.netnikedunksshoes.com nikeelite.comnikefactorystore.com nikefind.com nikefirm.comnikefoamposites.comnikefoampositeshoes.comnikefootballcleats.comnikefootballgloves.comnikefootballjersey.comnikefoundation.org +nikefr.comnikefrance.com nikefree.comnikefreeshoes.comnikefuelband.comnikegadgets.comnikegenealogy.com nikegolf.ca nikegolf.cn +cn nikegrid.com nikehelp.comnikehightops.comnikehyperdunk.com nikeid.cn +cn nikeid.com.cn +cnnikeidshoes.com nikeinc.comnikeinc.com.cn +cnnikeincchemistry.comnikeinstock.com +nikeit.comnikeitalia.com nikeitaly.com +nikekd.com nikekid.com +nikelab.cn +cnnikelab.com.cn +cn nikelink.comnikeliuxiang.cn +cnnikeliuxiang.comnikeliuxiang.com.cn +cn nikelives.comnikelunarglide.com nikemall.cn +cnnikemall.com.cn +cnnikemarketing.com nikenews.com +niken7.comnikeonlinestore.comnikeoutletstore.comnikeoutletstores.comnikepioneer.com nikeplus.com nikeplus.org nikepress.com nikeprice.comnikeproduct.comnikepromax.comnikeresponsibility.comnikereuseashoe.comnikerunclub.cn +cnnikerunclub.com.cn +cnnikerunner.comnikerunning.com.cn +cnnikerunningshoes.com +nikesb.comnikesbdunks.netnikeseason.comnikeselling.comnikesellorder.comnikeshoemarket.comnikeshoes-store.comnikeshoes21.comnikeshoes4u.comnikeshoescity.comnikeshoesgroup.comnikeshoesinc.comnikeshoesmarket.comnikeshoesretro.comnikeshoeswon.comnikeshoponline.comnikeshoxsale.com nikesku.comnikesnowboarding.comnikesoccercleats.comnikesportswear.comnikestares.com nikestore.cn +cn nikestore.comnikestore.com.aunikestyles.com nikeswim.comniketaiwan.netniketracking.comniketradeweb.comniketrainer.comniketrainers.comniketraining.com nikeusa.com nikewear.com  nikey.com nikezoom.com nke6.comoutletnike.com runnike.comrunningnike.comsale-nikeshoes.comstatic-nike.com swoo.sh +swoosh.com  swoosh.tvthedailysnkr.comverygoodnike.comwomensnikeshox.comxn--74q035i.xn--hxt814e + +EGGHEAD +egghead.io +' +POLYV  polyv.net videocc.net + +SMPTE  smpte.org + +VEET veet.at veet.be veet.ca veet.ch veet.clveet.cn +cn +veet.co.id +veet.co.in +veet.co.kr +veet.co.nz +veet.co.uk +veet.co.za veet.com veet.com.ar veet.com.au veet.com.bd veet.com.br veet.com.cn +cn veet.com.co veet.com.hk veet.com.mx veet.com.my veet.com.ph veet.com.pk veet.com.sg veet.com.tr veet.de veet.dk veet.es veet.fi veet.fr veet.hu veet.jp veet.nl veet.no veet.pt veet.ro veet.ru veet.se veet.tv veet.usveetarabia.comveetbangladesh.comveetcentroamerica.com veetclub.it + +DNSPOD dns.pub  dnsapi.cn  dnspod.cn +dnspod.com dnspod.com.cn +dnspod.net +dnspod.org  dnsv1.com  dnsv2.com  dnsv3.com  dnsv4.com  dnsv5.com doh.pub +7 + FONTAWESOMEfontawesome.comfortawesome.com + +FTEPROXY fteproxy.org + +LUA lua.org + +NUROFEN +nurofen.at +nurofen.bg +nurofen.cn +cn nurofen.co.il nurofen.co.nz nurofen.co.uk nurofen.co.za nurofen.comnurofen.com.aunurofen.com.cn +cnnurofen.com.sg +nurofen.cz +nurofen.de +nurofen.es +nurofen.fr +nurofen.hr +nurofen.hu +nurofen.ie +nurofen.it nurofen.net +nurofen.no +nurofen.pl +nurofen.pt +nurofen.ro +nurofen.sk +nurofen.runurofengel.com51nurofensk-prod-env.eu-west-1.elasticbeanstalk.com + +EVERNOTE evernote.com +) + LEANPLUM-ADS leanplum.com +ads + +CAOLIU t66y.com + +MUCINEX +mucinex.ca +mucinex.cn mucinex.co.nz mucinex.commucinex.com.cn mucinex.net +mucinex.tvmucinexprofessional.com + +STEAM fanatical.comhumblebundle.complayartifact.com +s.teamsteam-chat.comsteamcommunity.comsteamcontent.comsteamgames.comsteampowered.comsteamstatic.comsteamusercontent.comunderlords.comvalvesoftware.com wmsjsteam.com +cn csgo.wmsj.cn +cndl.steam.ksyna.com +cn dota2.wmsj.cn +cn st.dl.bscstorage.net +cnst.dl.eccdnx.com +cn!st.dl.pinyuncloud.com +cn&steampowered.com.8686c.com +cn%steamstatic.com.8686c.com +cn steambroadcast.akamaized.netsteamcdn-a.akamaihd.net!steamcommunity-a.akamaihd.netsteamstore-a.akamaihd.net#steamusercontent-a.akamaihd.net"steamuserimages-a.akamaihd.net + +HEROKU  heroku.co +heroku.com  heroku.me herokuapp.com herokucdn.comherokucharge.com herokussl.comheroku-app.comheroku-charge.com codei.sh +codeish.co +codeish.io +" +KODI kodi.tv  kodi.wiki + + R-PROJECT r-project.org + +RARBG rarbg.me rarbg.to rarbg.israrbgaccess.org rarbggo.orgrarbgmirror.comrarbgmirror.orgrarbgproxy.org rarbgprx.orgrarbgunblock.com +U +SB +dns.sb ip.sb loli.net sb.sb sm.msu.nu +www.sb +: +ZAOBAO +zaobao.com zaobao.com.sg  zaobao.sg +X +FACEBOOKaccountkit.comatscaleconference.com botorch.org +buck.build buckbuild.comcomponentkit.org draftjs.org +f8.comfacebookappcenter.infofacebookappcenter.netfacebookappcenter.orgfacebookconnect.comfacebookdevelopergarage.comfaciometrics.com fasttext.cc fbf8.com fbinfer.com fblitho.com fbredex.com +fbrell.com flow.dev flow.org flowtype.org frescolib.org hacklang.org hhvm.commakeitopen.com mcrouter.net mcrouter.orgmessengerdevelopers.com +ogp.meopengraphprotocol.comopengraphprotocol.org  parse.com pyrobot.org  react.com reactjs.com reactjs.org recoiljs.org rocksdb.com rocksdb.net rocksdb.orgyogalayout.comdevelopers.facebook.com!achat-followers-instagram.com#acheter-followers-instagram.com$ acheterdesfollowersinstagram.com!acheterfollowersinstagram.combookstagram.comcarstagram.comcdninstagram.comchickstagram.com ig.me  igcdn.com igsonar.com igtv.com imstagram.com imtagram.cominstaadder.cominstachecker.cominstafallow.cominstafollower.cominstagainer.com instagda.com instagify.cominstagmania.com instagor.cominstagram-brand.cominstagram-engineering.cominstagram-help.cominstagram-press.cominstagram-press.net instagram.cominstagramci.cominstagramcn.cominstagramdi.cominstagramhashtags.netinstagramhilecim.cominstagramhilesi.orginstagramium.cominstagramizlenme.cominstagramkusu.cominstagramlogin.cominstagramm.cominstagramn.cominstagrampartners.cominstagramphoto.cominstagramq.cominstagramsepeti.cominstagramtakipcisatinal.netinstagramtakiphilesi.cominstagramtips.cominstagramtr.com instagran.cominstagranm.com instagrem.com instagrm.cominstagtram.com instagy.cominstamgram.cominstangram.cominstanttelegram.cominstaplayer.net instastyle.tv instgram.com intagram.com intagrm.com intgram.comkingstagram.comlnstagram-help.comtheinstagramhack.comoninstagram.comonline-instagram.comonlineinstagram.comweb-instagram.netwwwinstagram.comfbmessenger.comm.me messenger.com +nbabot.net binoculus.com buyoculus.com ocul.usoculus-china.com +oculus.comoculus2014.com oculus3d.comoculusblog.comoculusbrand.comoculuscasino.net oculuscdn.comoculusconnect.comoculusdiving.comoculusforbusiness.comoculusrift.com oculusvr.compowersunitedvr.com wa.mewhatsapp-plus.infowhatsapp-plus.mewhatsapp-plus.net whatsapp.cc whatsapp.com whatsapp.info whatsapp.net whatsapp.org whatsapp.tvwhatsappbrand.comaboutfacebook.com accessfacebookfromschool.com acebooik.com acebook.comadvancediddetection.comaskfacebook.netaskfacebook.org +atdmt2.com atlasdmt.comatlasonepoint.combuyingfacebooklikes.comcareersatfb.comcelebgramme.comchina-facebook.com click-url.comcomo-hackearfacebook.comcrowdtangle.com dacebook.comdlfacebook.comdotfacebook.comdotfacebook.netexpresswifi.com faacebok.com faacebook.com faasbook.com facbebook.com facbeok.com +facboo.com facbook.com facbool.com facboox.com faccebook.comfaccebookk.com facdbook.com facdebook.com face-book.com faceabook.com facebboc.com facebbook.comfacebboook.com facebcook.com facebdok.com facebgook.com facebhook.com facebkkk.com facebo-ok.com faceboak.com facebock.com facebocke.com facebof.com faceboik.com facebok.comfacebokbook.com facebokc.com facebokk.com facebokok.com faceboks.com facebol.com facebolk.com facebomok.com faceboo.com facebooa.com faceboob.comfaceboobok.com facebooc.com faceboock.com facebood.com facebooe.com faceboof.com facebooi.com facebooik.com facebooik.org facebooj.comfacebook-corp.comfacebook-covid-19.comfacebook-ebook.comfacebook-forum.comfacebook-inc.comfacebook-login.comfacebook-newsroom.comfacebook-newsroom.orgfacebook-pmdcenter.comfacebook-pmdcenter.netfacebook-pmdcenter.orgfacebook-privacy.comfacebook-program.comfacebook-studio.comfacebook-support.orgfacebook-texas-holdem.comfacebook-texas-holdem.net facebook.br facebook.ca facebook.cc facebook.comfacebook.design facebook.net facebook.hu facebook.in fecebook.net facebook.nl facebook.org facebook.se facebook.shop facebook.tv facebook.us facebook.wangfacebook123.orgfacebook30.comfacebook30.netfacebook30.orgfacebook4business.comfacebookads.com"facebookadvertisingsecrets.comfacebookatschool.comfacebookawards.comfacebookblueprint.netfacebookbrand.comfacebookbrand.net3/facebookcanadianelectionintegrityinitiative.comfacebookcareer.comfacebookcheats.comfacebookck.comfacebookclub.comfacebookcom.comfacebookconsultant.orgfacebookcoronavirus.comfacebookcovers.orgfacebookcredits.infofacebookdating.netfacebookdusexe.orgfacebookemail.comfacebookenespanol.comfacebookexchange.comfacebookexchange.netfacebookfacebook.comfacebookflow.comfacebookgames.comfacebookgraphsearch.comfacebookgraphsearch.infofacebookgroups.comfacebookhome.ccfacebookhome.comfacebookhome.infofacebookhub.com facebooki.comfacebookinc.comfacebookland.comfacebooklikeexchange.comfacebooklive.comfacebooklivestaging.netfacebooklivestaging.orgfacebooklogin.comfacebooklogin.infofacebookloginhelp.netfacebooklogs.comfacebookmail.comfacebookmail.tvfacebookmanager.infofacebookmarketing.info facebookmarketingpartner.com!facebookmarketingpartners.comfacebookmobile.comfacebookmsn.comfacebooknews.comfacebooknfl.comfacebooknude.comfacebookofsex.comfacebookook.comfacebookpaper.comfacebookpay.comfacebookphonenumber.netfacebookphoto.comfacebookphotos.comfacebookpmdcenter.comfacebookpoke.netfacebookpoke.orgfacebookpoker.infofacebookpokerchips.infofacebookporn.netfacebookporn.orgfacebookporno.netfacebookportal.com facebooks.comfacebooksafety.comfacebooksecurity.netfacebookshop.comfacebooksignup.netfacebooksite.netfacebookstories.comfacebookstudios.netfacebookstudios.orgfacebooksupplier.comfacebooksuppliers.comfacebookswagemea.comfacebookswagstore.comfacebooksz.comfacebookthreads.netfacebooktv.netfacebooktv.orgfacebookvacation.com facebookw.comfacebookworld.com facebool.com facebool.info facebooll.com faceboom.com faceboon.com faceboonk.comfaceboooik.com faceboook.com faceboop.com faceboot.com faceboox.com facebopk.com facebpook.com facebuk.com facebuok.com facebvook.com facebyook.com facebzook.comfacecbgook.com facecbook.com facecbook.org facecook.com facecook.org facedbook.com faceebok.com faceebook.com faceebot.com facegbok.com facegbook.com faceobk.com faceobok.com faceobook.com faceook.comfacerbooik.com facerbook.com facesbooc.comfacesounds.com facetook.com facevbook.com facewbook.co facewook.comfacfacebook.com facfebook.com fackebook.com facnbook.com facrbook.com facvebook.com facwebook.com facxebook.com fadebook.com +faebok.com faebook.com faebookc.com faeboook.com faecebok.com faesebook.comfafacebook.com faicbooc.com fasebokk.com fasebook.com faseboox.com favebook.com faycbok.com +fb.careers +fb.com fb.me fbacebook.com fbbmarket.comfbboostyourbusiness.com  fbcdn.com  fbcdn.netfbfeedback.com +fbhome.com fbidb.io  fbinc.comfbinnovation.comfbmarketing.com  fbreg.com +fbrpms.com  fbsbx.com  fbsbx.netfbsupport-covid.netfbthirdpartypixel.comfbthirdpartypixel.netfbthirdpartypixel.org  fburl.comfbworkmail.com fcacebook.com fcaebook.com fcebook.com fcebookk.comfcfacebook.comfdacebook.info feacboo.com feacbook.com feacbooke.com feacebook.com fecbbok.com fecbooc.com fecbook.com feceboock.com feceboox.com fececbook.com  feook.com ferabook.com fescebook.com fesebook.com ffacebook.com fgacebook.com ficeboock.com fmcebook.com fnacebook.com fosebook.com fpacebook.com fqcebook.com fracebook.com  freeb.comfreebasics.comfreebasics.net +freebs.comfreefacebook.comfreefacebook.netfreefacebookads.netfreefblikes.comfreindfeed.comfriendbook.info friendfed.comfriendfeed-api.comfriendfeed-media.comfriendfeed.comfriendfeedmedia.com fsacebok.com fscebook.comfundraisingwithfacebook.comfunnyfacebook.orgfutureofbusinesssurvey.org gacebook.com gameroom.comgfacecbook.com +groups.comhackerfacebook.comhackfacebook.comhackfacebookid.comhifacebook.info!howtohackfacebook-account.comhsfacebook.comhttpfacebook.comhttpsfacebook.comhttpwwwfacebook.com i.org internet.org klik.me liverail.com liverail.tvlogin-account.netmarkzuckerberg.commidentsolutions.commobilefacebook.commoneywithfacebook.com myfbfans.com newsfeed.com nextstop.comonline-deals.netopencreate.orgreachtheworldonfacebook.com rocksdb.orgshopfacebook.comsportsfacebook.comsportstream.comsupportfacebook.comterragraph.comthefacebook.comthefacebook.net thefind.comtoplayerserver.comviewpointsfromfacebook.comwhyfacebook.com worldhack.comwww-facebook.comwwwfacebok.comwwwfacebook.comwwwmfacebook.comzuckerberg.comzuckerberg.netfacebookwork.com +redkix.com workplace.comworkplaceusecases.comfbcdn-a.akamaihd.net +y +FONTSHOP fontbook.com fontshop.comfstopimages.com40fontshop-prod-responsive-images.s3.amazonaws.com + +GENTOO +gentoo.org + + INSTAGRAM!achat-followers-instagram.com#acheter-followers-instagram.com$ acheterdesfollowersinstagram.com!acheterfollowersinstagram.combookstagram.comcarstagram.comcdninstagram.comchickstagram.com ig.me  igcdn.com igsonar.com igtv.com imstagram.com imtagram.cominstaadder.cominstachecker.cominstafallow.cominstafollower.cominstagainer.com instagda.com instagify.cominstagmania.com instagor.cominstagram-brand.cominstagram-engineering.cominstagram-help.cominstagram-press.cominstagram-press.net instagram.cominstagramci.cominstagramcn.cominstagramdi.cominstagramhashtags.netinstagramhilecim.cominstagramhilesi.orginstagramium.cominstagramizlenme.cominstagramkusu.cominstagramlogin.cominstagramm.cominstagramn.cominstagrampartners.cominstagramphoto.cominstagramq.cominstagramsepeti.cominstagramtakipcisatinal.netinstagramtakiphilesi.cominstagramtips.cominstagramtr.com instagran.cominstagranm.com instagrem.com instagrm.cominstagtram.com instagy.cominstamgram.cominstangram.cominstanttelegram.cominstaplayer.net instastyle.tv instgram.com intagram.com intagrm.com intgram.comkingstagram.comlnstagram-help.comtheinstagramhack.comoninstagram.comonline-instagram.comonlineinstagram.comweb-instagram.netwwwinstagram.com + +STAGE1ST saraba1st.com +0 +BITLY +bit.ly  bitly.com bitly.is + + +JAVLIBRARYjavlibrary.com + +STEEMIT steemit.com + +DIGICERT digicert.com freessl.com geotrust.com rapidssl.com +thawte.com  thawte.de  thawte.fr +$ +NOTEPADnotepad-plus-plus.org + +XBOX +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.comcallersbane.com minecraft.netminecraftshop.com +mojang.comforzamotorsport.netforzaracingchampionship.com forzarc.comorithegame.comrenovacionxboxlive.comtellmewhygame.com xbox.co xbox.com xbox.eu xbox.org +xbox360.co xbox360.com +xbox360.eu xbox360.org +xboxab.comxboxgamepass.comxboxgamestudios.com xboxlive.cn +cn xboxlive.com +xboxone.co xboxone.com +xboxone.euxboxplayanywhere.comxboxstudios.com +xbx.lv +h +51JOB  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn +F +DEEPIN  deepin.cn +deepin.com  deepin.io +deepin.org + +HINET  hinet.net +8 + HOMEDEPOThomedepot-static.com homedepot.com + + TRUSTWAVE trustwave.com + +YANDE yande.re + + ALIBABA-ADS a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +ads +3 +HKEDCITY hkedcity.nethkreadingcity.net + +TIPDM +tipdim.org + +AMP amp.devampproject.comampproject.netampproject.orgcdn.ampproject.org +cnamp.akamaized.net +Q + CHINANEWS chinanews.comchinanews.com.cn +cns.com.cn ecns.cn ++ +COWLEVEL cowlevel.net  cdncl.net + + SPEEDTEST  cdnst.net cellmaps.com ekahau.cloud +ekahau.com  ookla.comooklaserver.net pingtest.net speedtest.co speedtest.netspeedtestcustom.com webtest.netOB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ +ads +G +TEX ctan.orglatex-project.org +miktex.org tug.org + +VOANEWSamerikaninsesi.comamerikaninsesi.orgamerikaovozi.comamerikayidzayn.comamerikiskhma.com bbg.govdandalinvoa.com darivoa.comdengeamerika.comdengiamerika.comglasamerike.netgolos-ameriki.ru insidevoa.com pashtovoa.com persagg.comradiyoyacuvoa.com urduvoa.com voa.govvoaafaanoromoo.comvoaafrique.comvoabambara.com voabangla.comvoacambodia.comvoacantonese.comvoachinese.comvoadeewanews.comvoadeewaradio.com voahausa.comvoaindonesia.com voakorea.comvoalingala.comvoandebele.com voanews.com +voanews.euvoanoticias.com voanouvel.comvoaportugues.com voashona.com voasomali.comvoaswahili.com voathai.comvoatibetan.comvoatibetanenglish.comvoatiengviet.com voatour.comvoazimbabwe.comzeriamerikes.com + +YOUPORN youporn.com + +GLYPHS glyphsapp.com +D +ICBCicbc icbc-ltd.com icbc-us.com icbc.com.cn + + CALGONCARBON  calgon.at  calgon.be  calgon.ch calgon.cn +cn calgon.co.uk +calgon.com calgon.com.tr  calgon.de  calgon.es  calgon.fr  calgon.ie  calgon.it  calgon.nl  calgon.pt  calgon.ru  calgon.tvcalgoncarbon-china.comcalgoncarbon.com calgonit.com +C +GITBOOK gitbook.com +gitbook.iogitbook.zendesk.com +/ +MAPBOX mapbox.cn +cn +mapbox.com + +RT +rt.com +( +UDEMY  udemy.com udemycdn.com +. +FLUTTER flutter.devflutterapp.com +M + MESSENGERfbmessenger.comm.me messenger.com +nbabot.net +0 + MIXPANEL-ADS decide.mixpanel.com +ads + +OPENSSL openssl.org +O +PUBMATIC pubmatic.compubmatic.co.jpads.pubmatic.com +ads +. +XUEQIUdanjuanfunds.com +xueqiu.com + + +FAMILYMARTfamifun.com.tw family.co.jp family.com.twfamilymart.com.cn +cnfamilymart.com.myfamilymart.com.ph  famima.vn +$ + THESTANDNEWSthestandnews.com +$ +CAS +csdl.ac.cn  las.ac.cn + + +SALESFORCE appcloud.comappexchange.com attic.iobeyondcore.combuddymedia.com chatter.comcloudcraze.com cotweet.com data.comdemandware.com desk.comdocumentforce.comdreamforce.com einstein.comexacttarget.com  force.com govforce.comgravitytank.com heywire.com krux.commarketingcloud.com metamind.io +pardot.com quotable.com radian6.com relateiq.comsalesforce.comsalesforce.orgsalesforceiq.comsalesforceliveagent.com salesforcemarketingcloud.com sequence.comsfdcstatic.com +sforce.com site.com +social.comsteelbrick.com twinprime.comweinvoiceit.com + +CENTOS +centos.org + + +CHATURBATEchaturbate.com + +TESLA solarcity.comtesla.cn +cn  tesla.com tesla.com.cn +cnteslamotors.cn +cnteslamotors.comteslamotors.com.cn +cntesla-cdn.thron.cn +cntesla-cdn.thron.com + + +APPLEDAILYappledaily.comappledaily.com.hkappledaily.com.tw appledaily.hkapplefruity.comapplehealth.com.hk +atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.com ++ +FLATPAK flathub.org flatpak.org + +TUBE8  tube8.com + +PHP php.net + + CATEGORY-PORN 0plkijj.vip  114av.xyz 16fhgdty.xyz 18novel.xyz +1jjdg2.vip +1jsa22.vip  51dh.site 520aa.tv 5278.cc +52hyse.com 54647.online 69story.com 69vj.com  721av.com +7mm.tv +85tube.com 91.51rmc.com 920share.com +a.91gay.me a.kslive.tv aavs.xyz  agzy1.com aibaobei.me aimei133.com airav.ccanimezilla.comasianpornmovies.com av01.tv  av1688.cc av6k.com avfox.cc +avinin.com +avpanda.cc +avsee01.tv avseesee.com bangbros.combesthentaitube.com brazzers.com +buzzav.com  caime.xyz calvappd.me cam4.com cslpldyb.me  dkk37.comdownload.91porn005.medownload.i91av.org +dvh30n.vipflirt4free.com follasian.com +gaypad.net  gouri.xyz hpjav.tv hsxhr.ccichineseporn.com  iijav.com  immxd.com isexlove.tw isexomega.twjapan-whores.comjapanesebeauties.net jav.guru jav01.cc +jav101.com  jav168.cc javcc.cc  javcc.com +javdoe.com javdove8.xyz  javfor.me javfull.net  javhd.pro javhd3x.com javhdfree.netjavlibrary.com javmost.com  javqd.com javynow.com  jgg18.xyz jinnaju.com jjdong7.com +johren.net kissjav.com kphimsex.net  love7.xyz lp99.pw lsnzxzy1.com lubetube.com +lululu.one manyvids.com mdlf.xyz myavfun.commydirtyhobby.commyfreecams.com nekoxxx.com nekoxxx.com nhentai.netohyeah1080.comosakamotion.netp3.csgfnmdb.com papalah.com pornbest.org porntea.com +pyhapp.com +qingse.one  r18lu.comrealitykings.com +rule34.xxx seselah.com sextop1.net +sexzy4.com +soirt4.funsouth-plus.net stripchat.com +sub147.comtbr.tangbr.net theav.cc +thisav.com thtmod1.com +tkb008.xyztokyomotion.net  tssp.besttubetubetube.com upjav.cc vgg8.com vjav.comwatchjavonline.com wuso.me  wzmyg.com  x99av.com  xo104.com  youav.com  1pondo.tv 91porn.com  avgle.com avn.com beeg.com bongacams.com bcicdn.com bcrncdn.com btt804.com @@ -4403,44 +5588,389 @@ javbus.com javfinder.sh findercdn.me o0-2.com  javhd.com javwide.tv javwide.com kindgirls.comlivejasmin.com dditsadn.com dditscdn.com metart.commetartnetwork.com metcams.comnaiadsystems.com  nsimg.net netflav.com  pigav.com pornhd.com -phncdn.com phprcdn.com pornhub.compornhubpremium.com  press.vin redtube.com spankbang.comtheporndude.com  tube8.comvaginacontest.com  x-art.com xhamster.com xnxx.com xnxx-cdn.com xvideos.comxvideos-cdn.com youporn.com asproex.comasproexapi.combinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com -bitbank.cc bitcoin.org bitfinex.com bitflyer.com bitflyer.jp -bitmex.com bitquick.co bisq.io bisq.network bitsquare.io bitstamp.net bittrex.com btcbox.co.jp -cex.io coinbase.com coinone.co.krcoinonecore.comcoinonecorp.com -devcon.orgethereum.foundation ethereum.org -hbabit.com -hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com -kraken.comlocalbitcoins.comlocalbitcoinschain.com okex.com -paxful.com -zb.app -zb.com zb.io zb.live 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au +phncdn.com phprcdn.com pornhub.compornhubpremium.com  press.vin redtube.com scoreland.comcdn77.scoreuniverse.com spankbang.comtheporndude.com  tube8.com  uug22.com  uug23.com  uug25.com  uug26.com  uug27.com  uuk28.com  uun78.com  uun79.com  uun82.com  uun83.com  uun85.com  uun86.com  uun87.com  uun89.com  uun92.com  uun93.com  uun95.com  uun96.com  uun97.com  uun98.com  uun99.com  uux68.comvaginacontest.com  x-art.com xhamster.comxhamsterlive.com  xhcdn.comwidgets.stripst.com#collector.xhamster.com +ads xnxx.com xnxx-cdn.com xvideos.comxvideos-cdn.com youjizz.comyjcontentdelivery.com youporn.com +, +GANJI  ganji.comganjistatic1.com + +NICONICOnico +nicodic.jp nicomanga.jp niconico.com nicoseiga.jp nicovideo.jp nimg.jp simg.jp +. +SCALAscala-lang.org scala-sbt.org + +BITMEX +bitmex.com + + ALJAZEERA +ajplus.net aljazeera.com aljazeera.netpalestineremix.comsarajevopodopsadom.comsrebrenica360.com syhacked.com +' +APA apa.orgpsyccareers.com + +PINCONG pincong.rocks + +SOLIDOT solidot.org +Y +UNIONPAY  95516.com unionpay.comunionpayintl.comunionpaysecure.com + +MORTEIN +mortein.cn +cn mortein.co.in mortein.co.nz mortein.co.za mortein.commortein.com.aumortein.com.brmortein.com.ngmortein.com.pkmorteincam.compifpafarabia.com +I +PYTHON +python.orgpythonhosted.org pypa.io pypi.org +9 +YOUZAN +youzan.com yzcdn.cn youzanyun.com +# + PASSIONTIMESpassiontimes.hk + +QIHOO360 75.team +75team.com baomitu.com +360.cn 360.com +360-jr.com 360chou.com360daikuan.com360huzhubao.com +360jie.com360jinrong.net +360kan.com 360kuai.com  360os.com 360panyun.cn 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com +haosou.com haosou.com.cn +haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com +qihuapi.cn qihucdn.com  qihoo.com qikucdn.com +so.com sou.com urlqh.cnxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com +youhua.com  yunpan.cn +^ +BITAUTO bitauto.combitautoimg.com cheyisou.com  yiche.com  yccdn.com + +GUCCI guccichimeforchange.orggucci.cn +cn  gucci.comguccimuseo.comguccitimeless.comregiongold.com + +EFF eff.org +/ +FASTLANE fastlane.cifastlane.tools ++ +LINKEDIN linkedin.com  licdn.com + +YARNPKG yarnpkg.com + +CATEGORY-SCHOLAR-CN +csdl.ac.cn  las.ac.cn cnki.netwanfangdata.com.cn  apabi.comcnthinkers.com  cqvip.com + +DENO  deno.land +< +NGA +nga.cn 178.com +ngabbs.com ngacn.cc + + +REALVISIONrealvision.com + +CTRIP c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn +skysea.com  suanya.cn +suanya.com +tieyou.com +toptown.cn toursbms.com trip.com tripcdn.com +vipdlt.com + + +DUCKDUCKGOcispaletter.comcispaletter.orgcometotheduckside.com +ddg.co +ddg.gg +ddh.gg +dgg.gg dontbubble.us donttrack.us duck.co duck.comduckduckco.com duckduckco.de duckduckgo.ca duckduckgo.coduckduckgo.co.ukduckduckgo.comduckduckgo.com.mxduckduckgo.com.tw duckduckgo.de duckduckgo.dk duckduckgo.in duckduckgo.jp duckduckgo.ke duckduckgo.mx duckduckgo.nlduckduckgo.org duckduckgo.pl duckduckgo.sg duckduckgo.ukduckduckhack.com +duckgo.com ducksear.ch duckside.com  dukgo.comenteentegeh.defixtracking.com goduckgo.com hacksear.chjustduckit.comprivacysimplified.comprivatebrowsingmyths.comspreadprivacy.com +: + SOFTETHER softether.orgsoftether-download.com + +CUP +cup.com.hk +E + HIIDO-ADSmlog.hiido.com +adsylog.hiido.com +ads ++ +MYFONTS myfonts.com myfonts.net +~ +NEWSCORP newscorp.com dowjones.com dowjones.iodowjoneson.com wsj.com wsj.net barrons.com +" +TED ted.com +tedcdn.com + +VK mvk.com userapi.com  vk-cdn.me vk-portal.net vk.cc +vk.com  vk.design vk.link vk.me vkcache.com vkgo.app +vklive.appvkmessenger.comvkmessenger.app vkontakte.ruvkuseraudio.comvkuserlive.netvkuservideo.comvkuservideo.net + +OCULUS binoculus.com buyoculus.com ocul.usoculus-china.com +oculus.comoculus2014.com oculus3d.comoculusblog.comoculusbrand.comoculuscasino.net oculuscdn.comoculusconnect.comoculusdiving.comoculusforbusiness.comoculusrift.com oculusvr.compowersunitedvr.com + +OPPO coloros.com finzfin.com +heytap.com heytapcs.comheytapdownload.comheytapimage.com +myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobioppodigital.com  oppoer.meoppomobile.com oppopay.com opposhop.cn +realme.com realmebbs.comrealmemobile.com +F +SOGOU +go2map.com sogo.com  sogou.com sogoucdn.com +; +XUEERSI speiyou.com +xesimg.com xueersi.com + +PRESS  press.vin +$ + BROWSERLEAKSbrowserleaks.com +1 +N3RO n3ro.fun  n3ro.live n3ro.net + +UNPKG  unpkg.com +' +928PLUS 928.plus +zind.cloud + +CBScbs showtime cbs.comcbscorporation.com cbsi.com +cbsi.video +cbsiam.com  cbsig.net +cbsimg.netcbsinteractive.comcbsistatic.com cbsivideo.com cbsnews.comcbspressexpress.com cbssports.com cbsstatic.com cbssvideo.com +viacbs.com +viacom.com viacomcbs.comviacomcbspressexpress.com paramount.com + +ENFAbebepremium3.com.bo +enfa.co.id enfa.com.vn enfaaplus.com enfababy.com enfabebe.comenfabebe.com.brenfabebe.com.coenfabebe.com.doenfabebe.com.ecenfabebe.com.mxenfabebe.com.peenfabebe.com.veenfabebe3.com.arenfagrow.co.inenfagrow.com.bnenfagrow.com.myenfagrow.com.phenfagrow.com.sg enfagrow4.comenfamama.com.arenfamama.com.ph +enfamil.ca enfamil.com +enfamil.es +enfamil.pl +enfamil.pt enfasmart.comenspireformula.comnutramigen.net nutramigen.pl +d +REDDIT +reddit.comredditstatic.comredditmail.comredditmedia.com redd.it ++ + SEGMENT-ADScdn.segment.com +ads +" + ALPINELINUXalpinelinux.org +H + NEXITALLY nexitally.comnexitallysafe.com nexitcore.com +5 +SENSORSDATA-ADS"static.sensorsdata.cn +ads +Q + SOURCEFORGEsourceforge.comsourceforge.net +sf.net fsdn.com +4 +THEBORINGCOMPANYboringcompany.com x.com + +W3C +w3.org + + BREITBART breitbart.com +- +C-SPAN +c-span.orgc-spanvideo.org +h +CMB cignacmb.comcmb-leasing.com cmbchina.com cmbi.com.hkcmbwinglungbank.com +0 + +SOUNDCLOUDsoundcloud.com +sndcdn.com + +B3LOG  b3log.org ++ +TRELLO +trello.com trellocdn.com + +VISA visa.be visa.ca visa.clvisa.cn +cn +visa.co.ao +visa.co.cr +visa.co.id +visa.co.il +visa.co.in +visa.co.jp +visa.co.ke +visa.co.ni +visa.co.nz +visa.co.th +visa.co.uk +visa.co.ve +visa.co.za visa.com visa.com.ag visa.com.ai visa.com.ar visa.com.au visa.com.az visa.com.bo visa.com.br visa.com.bs visa.com.bz visa.com.cn +cn visa.com.co visa.com.cy visa.com.dm visa.com.do visa.com.ec visa.com.ge visa.com.gt visa.com.gy visa.com.hk visa.com.hn visa.com.hr visa.com.jm visa.com.kh visa.com.kn visa.com.kz visa.com.lc visa.com.lk visa.com.ms visa.com.mx visa.com.my visa.com.ng visa.com.pa visa.com.pe visa.com.ph visa.com.pr visa.com.py visa.com.ru visa.com.sg visa.com.sv visa.com.tr visa.com.tt visa.com.tw visa.com.ua visa.com.uy visa.com.vc visa.com.vi visa.com.vn visa.cz visa.de visa.dk visa.es visa.fi visa.fr visa.gd visa.gp visa.gr visa.hk visa.hu visa.ie visa.is visa.ky visa.lt visa.lv visa.mn visa.mq visa.nl visa.no visa.pl visa.pt visa.ro visa.se visa.sk visa.so visa.sx visa.tc +visabg.com visaeurope.at visaeurope.ch visaeurope.lu visaeurope.sivisaitalia.com visakorea.comvisamiddleeast.comvisasoutheasteurope.comfinlitsummit.orgmyvisaluxuryhotels.comvisainfinite.cavisainfiniteluxuryhotels.ca!visaluxuryhotelcollection.com$ visaluxuryhotelcollection.com.br$ visaluxuryhotelcollection.com.mxvisaluxuryhotels.comvisaluxuryhotels.com.arvisasignaturehotels.com($connaissancesfinancierespratiques.ca dnsvisa.comeubluecardvisa.comfinancialsoccer.ca"financialsoccer.com.cn +cnlightbridge.commiamifintechfestival.commhshosting.compracticalbusinessskills.compracticalmoneyskills.ca#practicalmoneyskills.cn +cn'practicalmoneyskills.com.cn +cnpracticalmoneyskills.jpsoccerfinancier.catorcidadeouro.com vaultify.com vaultify.info vaultify.net visa-atm.com visa-news.jp visabank.orgvisabusinessinsights.comvisacarddesignlab.com visacards.comvisacheckout.netvisacheckout.orgvisaconciergelac.comvisadigital.comvisadigitalconcierge.com visadns.comvisadpsonline.usvisaeverywhereshop.comvisafintechfasttrack.comvisafulfillment.comvisagiftcard.usvisaglobalfinance.comvisaicsdirect.comvisainfinite.cavisainfinite.cn +cn visanet.net +visapay.cn +cnvisapcsdirect.comvisaplatinum.cn +cnvisaplatinum.com.cn +cn visaplus.comvisasavingsedge.cavisasignature.co.kr visb.org + + CHINAMOBILE 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn +cmvideo.cn miguvideo.com andfx.cn  andfx.net +cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com +: +EBAY21centuryaccess.com4ebaytraders.com adcommerce.cn +cn adcommerce.tv appforebay.cn +cnappsonebay.net +asebay.com +baazee.com +bidbay.combidorbuyindia.com billpoint.combillpoint.info billpoint.tv billpoint.usbillpointnewzealand.com blogebay.combookclubcorner.combuiltfromebay.com buyitnow.com buyitnow.net buyitnow.org buyitnow.tvbuyitnowshop.net cafr.ca carebay.comcargigileads.com  cebay.comcollective99.comcommerceos.comconnectcommerce.cn +cn"connectcommerce.com.cn +cnconnectcommerce.hkconnectcommerce.infoconnectcommerce.tv connectedcommerce.cn +cnconnectedcommerce.comconnectedcommerce.tvcrececonebay.comcreditcardsbay.com cyber-bay.cn +cncyber-bay.com.cn +cncyber-bay.info cyber-bay.org +dba.dk dealbay.com dealtime.com  didce.com  douya.orgdreamtoplay.com  e-bay.com e-bay.it  e-bay.net eachpay.com eachpay.net  ebahy.comebay-authenticate.netebay-confirm.comebay-course.com ebay-cz.comebay-delivery.comebay-discoveries.comebay-fashion.com ebay-inc.com ebay-inc.net ebay-inc.orgebay-online.comebay-sales.comebay-stories.com ebay-us.comebay-vacation.com ebay.at ebay.be ebay.ca ebay.chebay.cn +cn +ebay.co.nz +ebay.co.uk +ebay.co.ve +ebay.co.za ebay.com ebay.com.ar ebay.com.au ebay.com.cn +cn ebay.com.ec ebay.com.hk ebay.com.mt ebay.com.my ebay.com.ph ebay.com.sg ebay.de ebay.es ebay.fr ebay.ie ebay.in ebay.it ebay.jp ebay.lt ebay.mn ebay.net.cn +cn ebay.nl ebay.org ebay.org.cn +cn ebay.ph ebay.pk ebay.pl ebay.sg ebay.us ebay.vn +ebay.yn.cn +cn +ebay.zj.cn +cn +ebay25.com +ebay68.com  ebaya.com ebayads.com ebayads.netebayadvertising.cn +cnebayadvertising.comebayanunsios.netebayauction.comebayaustralia.comebayauthenticate.com.cn ebaybags.com ebaybank.comebaybenefits.comebayboutique.com +ebayca.com +ebayca.org ebaycafe.com ebaycar.comebaycareers.com ebaycbt.co.kr ebaycdn.net ebaychina.netebayclassifiedsgroup.comebayclassifieds.cn +cnebayclassifieds.com"ebayclassifieds.com.cn +cnebayclassifieds.infoebayclassifieds.orgebayclassifieds.tvebayclassifiedsgroup.comebayclassifiedsgroup.infoebayclassifiedsgroup.orgebayclassifies.com ebayclub.com ebaycoins.com ebaycom.comebaycommercenetwork.comebaycourse.com  ebayd.com +ebayde.com ebaydesc.cn +cnebaydesc.com.cn +cnebaydlassifieds.com +ebaydns.cn +cn ebaydts.com ebayedu.comebayeletro.comebayenterprise.cn +cnebayenterprise.com!ebayenterprise.com.cn +cnebayenterprise.infoebayenterprise.netebayenterprise.tv ebayetc.comebayexpress.sgebayfashion.comebayfashion.netebayforcharity.orgebayforeclosure.orgebayfrance.comebayglobalshipping.com ebaygroup.com ebayhabit.com ebayheels.com ebayhots.com ebayimg.com ebayinc.com ebayinc.net ebayinc.org ebayincconnectedcommerce.netebayinkblog.comebayinternetsalestax.com +ebayit.comebayjewelry.com ebayjob.com +ebayla.orgebaylisting.com ebaylocal.netebaylocationsdevacances.com ebaymag.comebaymainstreet.com ebaymall.comebaymarketplace.net ebaymotors.ca ebaymotors.cn +cnebaymotors.comebaymotors.com.cn +cnebaymotors.orgebaymotorsblog.com ebaynow.com ebaynyc.com +ebayon.com +ebayon.netebayoncampus.com ebayopen.comebayopensource.comebayopensource.netebaypakistan.net ebaypark.com ebayparts.com ebaypedia.cn +cnebaypedia.com.cn +cnebayprivacycenter.com +ebayqq.com ebayradio.com ebayrtm.comebayseller.comebayshoesstore.com ebayshop.comebayshop111.comebayshopping.cn +cnebayshopping.com.cn +cnebayshopping.orgebaysocial.com ebaysocial.ru ebaysoho.com ebaysohos.com ebaystatic.cn +cnebaystatic.com ebaystore.comebaystore77.com ebaystores.cn +cn ebaystyle.comebaysweden.com  ebayt.comebaytechblog.comebaytopratedseller.netebaytrading.comebaytradingassistant.com +ebaytv.org ebayuae.netebayvakantiehuizen.com ebayvalet.comebayvietnam.netebayworlds.com  ebayy.com edisebay.com  eebay.com epinions.comeu-consumer-empowerment.comexpertmaker.comfairmarket.comfragrancebay.comfrancemail.com half.com half.com.cn +cn half.tvhalfcanada.com halfjapan.comhandbagsoutletebay.com  iebay.com irribay.comitsbetterwhenyouwinit.com liketwice.comliveauction.com milofetch.com musicbay.netmyconstructionworld.net +myebay.com  nebay.net paisapay.cc paisapay.info paisapay.tv premobay.comprivatemarketplaces.netprivatemarketplaces.us prostores.cn +cn prostores.comprostores.com.cn +cn rethink.net shopibay.net shoping.comsourcingforebay.com.cnsourcingforebay.netsourcingforebay.tv speybay.comstoresense.com +svpply.com telebay.com telesell.com texttobuy.orgtheebayshop.comtheopportunityproject.orgtowerauction.com  vendu.com weareebay.comwatch-ebay.org wwwdecide.com wwwebay.com wwwebay.net wwwwebay.com xindelu.comxn--3et96bj49ahpq.comxn--4vq475g.comxn--4vq477m.comxn--7hv594h.comxn--7hvy28f.cn +cnxn--hb4aw0g.comxn--q41am8x.comxn--qoq462m.comxn--tkry91n.comxn--ubt498knmf.comxn--xsq421m.comxn--xsq605n.comxn--xsq959n.comxn--yf1at58a.com  xxbay.com  yibei.orggittigidiyor.netgittigidiyorsikayet.com +gumtree.sg  jijiji.ca kiji.ca kijii.ca kijij.ca  kijiji.ca kijijiauto.cakijijiautos.ca kijijidns.cn +cnkijijidns.com.cn +cnkijijiforbusiness.ca +kijijii.ca kijijiraps.ca kijji.ca +kijjiji.ca automobile.fr  mobile.demobileinternational.com&mobileinternational.com.cn +cn +q10.jp qoo10.jpachievementanalytics.comcdn-terapeak.comlistinganalytics.netmarketexecutive.net tearapeak.com terapeack.com terapeak.ca terapeak.cn +cn terapeak.comterapeak.com.hk terapeak.hk terapeak.info teraperk.com terrapeak.com thebayuk.com +nexcat.com nexpart.com +nexpart.tv renchead.comwhisolutions.com wrenchead.com-)ebay-25-assets.s3-us-west-1.amazonaws.com ++ + +KUBERNETES kubernetes.io +k8s.io + +ROCKSTARrockstargames.com +rsg.sc1-gamedownloads-rockstargames-com.akamaized.net)%media-rockstargames-com.akamaized.net*&videos-rockstargames-com.akamaized.net +, +SECOM secom.co.jpsecomtrust.net +? +STRIPE +stripe.comstripe.network stripecdn.com + +VIM vim.org + + MANMANBUY manmanbuy.com + + BITWARDEN bitwarden.com + + BYTEDANCE +bytecdn.cn bytedance.com bytedance.net bytedns.net byteimg.com +douyin.com huaxiong.comjokecommunity.comneihanshequ.com +pstatp.com +snssdk.com toutiao.comtoutiaocdn.comtoutiaocloud.comtoutiaohao.comtoutiaohao.net toutiaoimg.cntoutiaoimg.comtoutiaoimg.nettoutiaopage.com +wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com  baike.com +ixigua.com ixgvideo.com  365yg.com +* +JAVWIDE +javwide.tv javwide.com + +MUJI muji.com muji.com.cn +cn muji.com.hk muji.eu muji.net muji.tw muji.us mujikorea.net + +MUNCLOUD muncloud.dog +' + AMERICASVOICEamericasvoice.news +w +CATEGORY-MEDIA 9cdn.net9nation.com.au 9news.com.au 9now.com.aufreeviewplus.net.au mi9.com.au -mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au afp.com afpforum.com +mi9cdn.com nine.com.aunineentertainment.com.aunineentertainmentco.com.auninemediaroom.com.auninemsn.com.austatic9.net.au yourtv.com.au9to5google.com 9to5mac.com9to5terminal.com 9to5toys.com dronedj.com electrek.cospaceexplored.com afp.com afpforum.com ajplus.net aljazeera.com aljazeera.netpalestineremix.comsarajevopodopsadom.comsrebrenica360.com syhacked.comamericasvoice.news ap.org apnews.comappledaily.comappledaily.com.hkappledaily.com.tw appledaily.hkapplefruity.comapplehealth.com.hk -atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.com bbc.com  bbc.co.uk -bbci.co.uk bbgwatch.com  boxun.combowenpress.com breitbart.comcabletv.com.hk i-cable.comcaijinglengyan.comchinadecoding.comchinadigitaltimes.net cnbc.com +atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.comappleinsider.com  asahi.com asahicom.jpasahishimbun.sc.omtrdc.netbbc  bbc.co.uk bbc.com +bbci.co.uk bbgwatch.com  bloomberg bbgevent.com bbhub.io +bbthat.com bgov.com bloomberg.cnbloomberg.co.jpbloomberg.co.kr bloomberg.combloomberg.com.brbloombergapps.combloombergarcade.combloombergbeta.combloombergbna.combloombergbreakaway.combloombergbriefs.combloombergchina.combloombergenvironment.combloombergforeducation.combloomberggovernment.combloombergindices.combloombergindustry.combloomberglabs.combloomberglaw.combloomberglive.combloomberglp.combloombergmedia.combloombergnext.combloombergpolarlake.combloombergprep.combloombergquint.combloombergradio.combloombergsef.combloombergspace.combloombergstatus.combloombergsurvey.combloombergtax.combloombergtax1.combloombergtaxtech.com!bloombergtradingchallenge.combloombergtv.mnbloombergvault.combloombergview.comblpcareers.com blpevents.comblpprofessional.com bmia.org bnef.combusinessweekmag.comlondonmithraeum.comneweconomyforum.comnewenergyfinance.comtechatbloomberg.com  boxun.combowenpress.com breitbart.com +c-span.orgc-spanvideo.orgcabletv.com.hk i-cable.comcaijinglengyan.comcbs showtime cbs.comcbscorporation.com cbsi.com +cbsi.video +cbsiam.com  cbsig.net +cbsimg.netcbsinteractive.comcbsistatic.com cbsivideo.com cbsnews.comcbspressexpress.com cbssports.com cbsstatic.com cbssvideo.com +viacbs.com +viacom.com viacomcbs.comviacomcbspressexpress.com paramount.comchinadecoding.comchinadigitaltimes.net cnbc.com cnbcfm.com nbcuni.comnbcudigitaladops.com cnn.com cnn.io cnnarabic.com cnnlabs.com cnnmoney.ch cnnmoney.comcnnmoneystream.comcnnpolitics.com cup.com.hk d100.net  anm.co.uk  dailym.aidailymail.co.uk dailymail.comdailymail.com.au dailymail.dkdailymailonline.comdmgmediaprivacy.co.ukmailhealth.commailonline.co.ukmailonline.commailonsunday.co.ukmailonsunday.ie metro.co.uk mol.imthisismoney.co.uk thismon.ee -dw.com dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.czfox fox.comfoxbusiness.comfoxcorporation.com -foxdcg.com foxdoua.com -foxfdm.com -foxinc.com -foxneo.comfoxneodigital.com foxnews.com fxnetwork.com foxnewsplayer-a.akamaihd.netfreebeacon.comglobalvoices.orgglobalvoicesonline.org  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com hk01.com hkcnews.com hkopentv.com fantv.hkhongkongfp.comhuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com inmediahk.net jfengtime.com landofhope.tvlocalpresshk.com -ltn.com.tw yes123.com.tw matters.news matters.one -medium.com -myradio.hkmyradio.com.hk newyorker.com +dw.com dajiyuan.com dajiyuan.euepochmediagroup.comepochstories.com epochtime.comepochtimes-romania.comepochtimes.co.ilepochtimes.co.krepochtimes.co.ukepochtimes.comepochtimes.com.auepochtimes.com.brepochtimes.com.sgepochtimes.com.twepochtimes.com.ua epochtimes.cz epochtimes.de epochtimes.eu epochtimes.fr epochtimes.it epochtimes.jp epochtimes.nl epochtimes.pl epochtimes.ru epochtimes.seepochtimestr.com epochweek.comepochweekly.com erabaru.netlagranepoca.com ntd.com ntdtv.ca ntdtv.co.kr  ntdtv.com ntdtv.com.tw ntdtv.jp ntdtv.kr  ntdtv.org ntdtv.ru ntdtvla.com  ntdvn.comtheepochtimes.comtheepochtimessubscribe.comvelkaepocha.cz +forbes.com forbesimg.comfoxfox-corporation.com fox-news.com fox.com +fox.tv fox10.tv fox10news.comfox10phoenix.com  fox11.comfox13memphis.com fox13news.com  fox23.comfox23maine.com +fox247.com  fox247.tv  fox26.comfox26houston.comfox28media.com  fox29.comfox2detroit.com fox2news.com  fox32.comfox32chicago.comfox35orlando.comfox38corpuschristi.com fox42kptm.com  fox46.comfox46charlotte.com  fox47.com fox49.tv fox4news.com fox51tns.netfox5atlanta.com +fox5dc.com +fox5ny.com fox5storm.com fox6now.com fox7.comfox7austin.com fox9.comfoxacrossamerica.comfoxaffiliateportal.comfoxandfriends.com +foxbet.comfoxbusiness.comfoxbusiness.tvfoxbusinessgo.comfoxcanvasroom.comfoxcareers.comfoxcharlotte.com foxcincy.com foxcincy.jobs foxcincy.netfoxcollegesports.comfoxcorporation.comfoxcreativeuniversity.com foxcredit.com foxcredit.org foxd.tv +foxdcg.comfoxdeportes.comfoxdeportes.netfoxdeportes.tvfoxdigitalmovies.com foxdoua.comfoxentertainment.com +foxest.com +foxfaq.com +foxfdm.com foxfiles.com +foxinc.com foxkansas.com  foxla.com foxla.tvfoxlexington.comfoxmediacloud.com foxnation.comfoxnebraska.com +foxneo.comfoxneodigital.comfoxnetworks.infofoxnetworksinfo.com +foxnews.cc foxnews.com foxnews.net foxnews.org +foxnews.tvfoxnewsaffiliates.comfoxnewsaroundtheworld.comfoxnewsb2b.comfoxnewschannel.com foxnewsgo.net foxnewsgo.org foxnewsgo.tvfoxnewshealth.comfoxnewslatino.comfoxnewsmagazine.comfoxnewsnetwork.comfoxnewsopinion.comfoxnewspodcasts.comfoxnewspolitics.comfoxnewsradio.comfoxnewsrundown.comfoxnewssunday.com  foxon.comfoxphiladelphia.com foxpoker.com  foxrad.io foxredeem.comfoxrelease.comfoxrichmond.com foxrobots.comfoxsmallbusinesscenter.comfoxsmallbusinesscenter.netfoxsmallbusinesscenter.org foxsoccer.net foxsoccer.tvfoxsoccermatchpass.comfoxsoccerplus.comfoxsoccerplus.netfoxsoccerplus.tvfoxsoccershop.comfoxsports-chicago.comfoxsports-newyork.comfoxsports-world.com foxsports.cl foxsports.cofoxsports.co.ve foxsports.comfoxsports.com.arfoxsports.com.bofoxsports.com.brfoxsports.com.cofoxsports.com.ecfoxsports.com.gtfoxsports.com.mxfoxsports.com.pefoxsports.com.pyfoxsports.com.uyfoxsports.com.ve foxsports.gtfoxsports.info foxsports.netfoxsports.net.br foxsports.pe foxsports.sv foxsports.uyfoxsports2.comfoxsportsflorida.comfoxsportsgo.comfoxsportsla.comfoxsportsnetmilwaukee.comfoxsportsneworleans.comfoxsportsracing.comfoxsportssupports.comfoxsportsuniversity.comfoxsportsworld.comfoxstudiolot.com foxsuper6.com +foxtel.com foxtel.com.aufoxtelevisionstations.com  foxtv.com foxtvdvd.com  foxuv.comfoxweatherwatch.com  fssta.com +fxn.ws fxnetwork.comfxnetworks.com bentobox.tv kicu.tv ktvu.commyfoxsanfran.comafewmomentswith.com +anidom.comcasoneexchange.comcoronavirusnow.com +fse.tvgeraldoatlarge.comgooddaychicago.com joeswall.comkilmeadeandfriends.commaskedsingerfox.com +my13la.com +my20dc.commy20houston.com +my29tv.com my45.com  my9nj.commyfoxatlanta.commyfoxaustin.commyfoxboston.commyfoxcharlotte.commyfoxchicago.com myfoxdc.commyfoxdetroit.com myfoxdfw.commyfoxhouston.commyfoxhurricane.com myfoxla.commyfoxlosangeles.commyfoxlubbock.commyfoxmaine.com myfoxny.commyfoxorlando.commyfoxphilly.commyfoxphoenix.commyfoxtampa.commyfoxtampabay.commyfoxtwincities.com myfoxzone.com myq2.comnewsnowfox.comorlandohurricane.comparadisehotelquizfox.com q13.com +q13fox.comrealamericanstories.comrealamericanstories.inforealamericanstories.netrealamericanstories.orgrealamericanstories.tvrealmilwaukeenow.com rprimelab.comshopspeedtv.comsoccermatchpass.comspeeddreamride.comspeedfantasybid.comspeedracegear.com speedxtra.comteenchoice.com testonfox.comtheclasshroom.comthefoxnation.comthegeorgiascene.comwhatthefox.comwhosthehost.com wofl.tvwoflthenewsstation.com wogx.com foxnewsplayer-a.akamaihd.netfreebeacon.comgannett-cdn.com gannett.comgannettdigital.com usatoday.comusatodaynetworkservice.comglobalvoices.orgglobalvoicesonline.org  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com hk01.com hkcnews.com hkopentv.com fantv.hkhongkongfp.comhuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com inmediahk.netbusinessinsider.co.zabusinessinsider.combusinessinsider.com.aubusinessinsider.com.plbusinessinsider.debusinessinsider.esbusinessinsider.frbusinessinsider.inbusinessinsider.jpbusinessinsider.mxbusinessinsider.mybusinessinsider.nlbusinessinsider.sginsider-intelligence.com insider.cominsiderintelligence.com jfengtime.com landofhope.tvlocalpresshk.comfreedomplatform.tv londonreal.tv +ltn.com.tw yes123.com.tw macrumors.commalayalamanorama.com manorama.commanoramanews.commanoramaonline.commanoramayearbook.inonmanorama.com radiomango.fm  theman.in +theweek.invanitaonline.com +vanitha.invanithaveedu.com matters.news matters.one +medium.commedium.systems +myradio.hkmyradio.com.hkdreamworks.com cnbc.com +cnbcfm.com  msnbc.com +nbc.co nbc.com nbcnews.comnbcolympics.com nbcsports.com +nbcuni.comnbcuniversal.com s-nbcnews.com peacocktv.comuniversalorlando.comuniversalpictures.com&"universalpicturesinternational.com!universalstudioshollywood.com newscorp.com dowjones.com dowjones.iodowjoneson.com wsj.com wsj.net barrons.comandysparis.com newsmax.com +newsmax.in newsmaxtv.com newyorker.com nikkei.com  nikkei.jp nikkei.co.jp now.com now.com.hk nowe.com -now-tv.comnow-ashare.com ntd.com  ntdtv.com nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.compassiontimes.hk qmap.pubrealvision.com reuters.com +now-tv.comnow-ashare.com nyt.com nyt.net nytcn.me  nytco.com nytimes.com nytstyle.comtimestalks.com aweencore.com  awetv.comherringnetwork.com oanencore.com oann.compassiontimes.hk qmap.pubrealvision.com reuters.com reuters.tvreutersmedia.net rfa.org -rfi.fr rsf.org etvonline.hk rthk.hk scmp.com -i-scmp.comshuziyimin.orgsinoinsider.comsoundofhope.orgtheinitium.com  init.shopthestandnews.com udn.com +rfi.fr rsf.org +rt.com etvonline.hk rthk.hk +rtings.com scmp.com +i-scmp.comshuziyimin.orgsinoinsider.comsky sky.com skyassets.comskyoceanrescue.comskyoceanrescue.deskyoceanrescue.it skysports.com skysports.fr skysports.ieskysportsonline.comskysportsracing.com slashdot.orgsoundofhope.org theguardiandev-guardianapis.comdev-theguardian.com +gu-web.netguardianapis.comguardianapps.co.uk +guim.co.uktheguardian.comtheguardiandns.comtheinitium.com  init.shopthenationalpulse.comthestandnews.comdreamteamfc.com  page3.comsunbingo.co.uk talksport.comthescottishsun.co.uk thesun.co.uk  thesun.ie thetype.cloud +cn thetype.comtypeisbeautiful.com udn.com udn.com.twudnfunlife.com  unwire.hkamerikaninsesi.comamerikaninsesi.orgamerikaovozi.comamerikayidzayn.comamerikiskhma.com bbg.govdandalinvoa.com darivoa.comdengeamerika.comdengiamerika.comglasamerike.netgolos-ameriki.ru insidevoa.com pashtovoa.com persagg.comradiyoyacuvoa.com urduvoa.com voa.govvoaafaanoromoo.comvoaafrique.comvoabambara.com voabangla.comvoacambodia.comvoacantonese.comvoachinese.comvoadeewanews.comvoadeewaradio.com voahausa.comvoaindonesia.com voakorea.comvoalingala.comvoandebele.com voanews.com voanews.euvoanoticias.com voanouvel.comvoaportugues.com voashona.com voasomali.comvoaswahili.com voathai.comvoatibetan.comvoatibetanenglish.comvoatiengviet.com voatour.comvoazimbabwe.comzeriamerikes.com cstatic.net curbed.com  eater.comfunnyordie.com meridian.net polygon.com @@ -4448,63 +5978,1134 @@ racked.com recode.net sbnation.com theverge.com vox-cdn.com vox.comvoxcreative.comvoxfieldguide.com voxmedia.com voxops.net warroom.orgwashingtonpost.com watchout.tw waa.tw -wenzhao.ca -zaobao.com zaobao.com.sg  zaobao.sg zerohedge.com zoomingin.tv apa.orgpsyccareers.com cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.orgnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.com doi.org doi.infoengineeringvillage.com -scopus.comscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.skmit mit.edu mit.netmitpressjournals.orgamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com -ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.comsciencedirect.comsciencedirectassets.com -apress.com springer.comspringerlink.comspringernature.com tandf.co.uktaylorandfrancis.comtaylorfrancis.comtaylorandfrancis.com -aclweb.org acm.organalytictech.comannualreviews.org  arxiv.org asha.org berkeley.edu biorxiv.org  brill.com cell.comcomputingreviews.com degruyter.comdentalhypotheses.comelifesciences.orgfrontiersin.org hindawi.com ieee.orgisca-speech.org jmlr.org jneurosci.org  jstor.org mdpi.com -nature.com nejm.org neurology.org ovid.com  peerj.comphysiology.org plos.org pnas.org princeton.eduresearchgate.netroutledgehandbooks.comroyalsocietypublishing.org sagepub.comscholarpedia.orgsciencemag.orgscientificamerican.com scitation.orgspiedigitallibrary.orgstatsmakemecry.com thelancet.com uchicago.edu ucla.edu  umass.edu  wiley.com yale.edubetterexplained.com brilliant.orgcern ams02.space cern.ch cixp.netdotcernpilot.info  ippog.orglinearcollider.orgchinapower.csis.org code.orgcodecademy.comcoursera-for-business.orgcoursera.community coursera.help coursera.org edx.org edx-cdn.org -egghead.iokhanacademy.org kastatic.org -knovel.com laracasts.commasterclass.com mzed.com sitepoint.comskillshare.com ted.com -tedcdn.com udacity.com  udemy.com udemycdn.com w3schools.comalpinelinux.org amp.devampproject.comampproject.netampproject.org anaconda.com anaconda.org conda.io android.comandroidify.com -apache.org archlinux.orgarchlinuxarm.org atom.iobootstrapcdn.comgetbootstrap.com -centos.orgchocolatey.org clojure.org -cygwin.com -cython.org dart.dev dartlang.org dartpad.dev -debian.org -dotdeb.org  deno.landcompose-spec.io -docker.com  docker.ioelixir-lang.org -elrepo.org -erlang.org fastlane.cifastlane.tools getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org flutter.devflutterapp.comfontawesome.comfortawesome.com freebsd.org -gentoo.orggetcomposer.org gitbook.com -gitbook.iogitbook.zendesk.com -git.io github.blog -github.comgithub.community  github.io githubapp.comgithubassets.comgithubstatus.comgithubusercontent.com atom.io/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com -gitlab.com  gitlab.io -gitlab.netgitlab-static.net.*gitlab-assets.oss-cn-hongkong.aliyuncs.com gnu.org go-lang.com go-lang.net go-lang.org -go.dev  godoc.org -golang.com -golang.net -golang.org  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io haskell.orghaskellstack.org stackage.org brew.sh -ius.iojava java.com java.net -jenkins.io jetbrains.com jetbrains.net datalore.iokotlinlang.org  jfrog.com  jfrog.org bintray.com -jquery.comjquerymobile.com jqueryui.com -js.org jupyter.org kali.org -kernel.orgkotlinlang.org kubernetes.io -k8s.io  linux.orglinuxfromscratch.org linuxmint.com lua.org macports.org mariadb.org  mingw.org mongodb.com mongodb.org  mysql.com  nginx.com  nginx.org  nixos.org -nodejs.orgnodesource.comnotepad-plus-plus.org  npmjs.com npm.community openresty.org openssl.org opensuse.org openwrt.orglede-project.org packagist.org pcre.org perl.org cpan.org metacpan.org phantomjs.org php.netpolymer-project.orgpolymerproject.orgpostgresql.org -python.orgpythonhosted.org pypa.io pypi.org qt.ioqt-project.org r-project.orgraspberrypi.org raspbian.orgreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org redis.io redislabs.com remirepo.net rpmfusion.org ruby-lang.org rubygems.orgscala-lang.org scala-sbt.orgscientificlinux.org -sqlite.org askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.comsublimetext.com  swift.org -ubuntu.com -ubuntu.netubuntuforums.org  unity.com unity3d.com"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads  unpkg.com -v8.dev v8project.org vim.org wireshark.org x.orgxda-developers.com xda-cdn.com xposed.info yarnpkg.comacer-group.com acer.com  adobe.com adobe.ioadobeaemcloud.comadobeaemcloud.netadobeccstatic.com adobedc.net adobedtm.comadobelogin.com adobeoobe.comassetsadobe.com behance.net edgefonts.net -omtrdc.net typekit.com typekit.netalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.com!amazon-adsystem.com -@adsaws +wenzhao.castartupschool.orgycombinator.com +zaobao.com zaobao.com.sg  zaobao.sg +bgr.inbollywoodlife.comcareerfundas.comcricketcountry.com dnai.in dnaindia.com earngeek.com ekhindi.com +ind.sh  india.comindiancolleges.com itripto.com  oncars.in prepsure.comthehealthsite.com wionews.com yo1health.com zee.com +zeebiz.comzeeentertainment.com zeenews.com"zeenews-fonts.s3.amazonaws.com zerohedge.com zoomingin.tv +- + ACFUN-ADS apilog-web.acfun.cn +ads + +BOC +boc.cnbankofchina.combocaviation.com  boccfc.cn  bocgi.com bocgins.com  bochk.com bocichina.com bocigroup.com  bocim.combocservices.com.cn + + +BRIGHTCOVE videojs.com bcove.video bcovlive.io bcvp0rtal.com boltdns.netbrightcove.combrightcove.netbrightcove.servicesbrightcovecdn.combcovlive-a.akamaihd.netbcsecure01-a.akamaihd.netbrightcove.imgix.net +t + CAMBRIDGE cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.org +2 +MORISAWAmorisawa.co.jptypesquare.com + +NIXOS  nixos.org + +VERIZON +flickr +flickr.com +flickr.netstaticflickr.com ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +ads yahoo yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cmyahoo.cn +cn yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.cn +cn yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws maktoob.com +myguide.hkyahoo-news.com.hk yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yho.com yimg.com  ymail.com +oath.cloud oath.com ouroath.comstatic-verizon.com verizon.com verizon.netverizonbusinessfios.comverizonenterprise.comverizonfios.comverizonmedia.comverizonwireless.com vzw.com +xo.com + +CNPMJS +cnpmjs.org +3 +ENTRUST entrust.netentrustdatacard.com ++ +RUBY ruby-lang.org rubygems.org + + NEWYORKER newyorker.com +) +OSCHINA  gitee.com oschina.net + + +SHUZIYIMINshuziyimin.org +0 +SOHU sohu.com +sohucs.com +itc.cn + + YUANFUDAO banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com + +AIRWICK +airwick.at +airwick.be +airwick.ca +airwick.ch +airwick.cl airwick.co.in airwick.co.nz airwick.co.uk airwick.co.za airwick.comairwick.com.auairwick.com.brairwick.com.cn +cnairwick.com.mxairwick.com.tr +airwick.cz +airwick.de +airwick.dk +airwick.es +airwick.fi +airwick.fr +airwick.hr +airwick.hu +airwick.ie +airwick.it +airwick.jp airwick.net +airwick.nl +airwick.no +airwick.pl +airwick.pt +airwick.ro +airwick.ru +airwick.se +airwick.si +airwick.sk +airwick.tv +airwick.usairwickarabia.com vipoo.es +O +GUO  guo.media  gnews.org gtv.org gtv1.org g-tvapp.com + +VIMEO +vhx.tv +vhxqa1.com +vhxqa2.com +vhxqa3.com +vhxqa4.com +vhxqa6.comvimeo-staging.comvimeo-staging2.com  vimeo.com vimeo.frvimeobusiness.com vimeocdn.comvimeogoods.comvimeoondemand.comvimeostatus.comlivestream.com + +BITBANK +bitbank.cc +b + +EMOJIPEDIAemojipedia.orgworldemojiawards.comworldemojiday.com xn--yt8h.la +v +NATIONALGEOGRAPHICnatgeomaps.comnationalgeographic.com"nationalgeographicpartners.com ngeo.com + + TEST-IPV6 test-ipv6.com + +5CH 2ch.net 5ch.net +G +ASAHI  asahi.com asahicom.jpasahishimbun.sc.omtrdc.net ++ +BOSLIFE boslife.biz boslife.net +3 +ELEME +ele.me elemecdn.com eleme.cn + +MACPORTS macports.org + +MSNmicrosoftnews.ccmicrosoftnews.cn +cnmicrosoftnews.commicrosoftnews.netmicrosoftnews.orgmicrosoftnewsforkids.commicrosoftnewsforkids.netmicrosoftnewsforkids.orgmicrosoftnewskids.commicrosoftnewskids.netmicrosoftnewskids.org msn.commsnewskids.commsnewskids.netmsnewskids.org msnkids.com + +TSQUARE +tsquare.tv +T +NOW now.com +now.com.hk nowe.com +now-tv.comnow-ashare.com +p +ONEPLUS oneplus.com +oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com +ŏ +CNcn citic baidu +unicomsohu +xn--fiqs8s +xn--fiqz9s xn--1qqw23a xn--xhq521b xn--8y0a063a xn--6frz82g +xn--fiq64b xn--estv75g xn--vuq861b xn--zfr164b +42r.cn +5566ua.com aurorapush.cn +e0n.cn japps.cn jchat.io +jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com +jsurvey.cn  jvoice.cn +kc9.cn +n0q.cn pushcfg.com +s0n.cn mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com +uyunad.comwhalecloud.comalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads bootcss.com +bootcdn.cnphpcomposer.com +maoyun.commaoyuncloud.cnmaoyuncloud.comstaticfile.org qbox.me  qiniu.com qiniucdn.com qiniudn.com qiniudns.com  qnssl.com  ucloud.cn ufileos.com  aicdn.com upai.com upaiyun.com  upcdn.net  upyun.com  8686c.comchinanetcenter.com +wangsu.com ourdvsss.com yfcache.com +yfcalc.com yfcloud.com  yfdts.net  yfp2p.net +yfscdn.net yunfancdn.com +boc.cnbankofchina.combocaviation.com  boccfc.cn  bocgi.com bocgins.com  bochk.com bocichina.com bocigroup.com  bocim.combocservices.com.cn cignacmb.comcmb-leasing.com cmbchina.com cmbi.com.hkcmbwinglungbank.comicbc icbc-ltd.com icbc-us.com icbc.com.cn  95516.com unionpay.comunionpayintl.comunionpaysecure.com abchina.com  whccb.com cebbank.com ceblease.com +eb-ind.com ebasset.com ebchina.comebchinaintl.com +ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.comdanjuanfunds.com +xueqiu.com +58.com  58.com.cn 5858.com  58che.com 58xueche.com +anjuke.comanjukestatic.com chinahr.com +daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn +skysea.com  suanya.cn +suanya.com +tieyou.com +toptown.cn toursbms.com trip.com tripcdn.com +vipdlt.com dangdang.com ddimg.cn +ele.me elemecdn.com eleme.cn  ganji.comganjistatic1.com3.cn  300hu.com +360buy.com 360buyimg.com +360top.com +7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn +dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com +jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com +jd-app.com  jd-ex.com jd.cn jd.co.th +jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com +jingxi.com +jkcsjd.com +joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn +paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com +vg.com wangyin.com  wdfok.com yhd.com yihaodian.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads lianjia.com  ljcdn.com manmanbuy.com dianping.com +maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com mogu.com mogucdn.com mogujie.com +pddpic.com pinduoduo.com yangkeduo.com  smzdm.com +zdmimg.com cnsuning.com +suning.comsuningcloud.comsuningestate.comsuningholdings.com 40017.cn +17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com +ly.com  vancl.com vanclimg.com  vcimg.com +youzan.com yzcdn.cn youzanyun.com +ziroom.comziroomapartment.com 3dmgame.com 3304399.net 4399.com 4399api.com 4399dmw.com +4399er.com4399youpai.com 5054399.com img4399.com acfun.cn aixifan.com apilog-web.acfun.cn +ads +acplay.netdandanplay.com +ali213.net +acg.tv acgvideo.com +b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com +mincdn.com$ upos-hz-mirrorakam.akamaized.net biji.com +ddmogo.com +igetget.cn igetget.com luojilab.com  mogoo.com +sao.cn saolife.com dmzj.com  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com gamersky.com +gcores.com gitv.cn gitv.tv huya.com msstatic.com 71.am  iqiyi.com iqiyipic.com +pps.tv +ppsimg.com qiyi.com qiyipic.com +qy.net +71edge.coma.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +ads  jjwxc.net ku6.com +ku6cdn.com +ku6img.com kkmh.comkuaikanmanhua.com gifshow.com ksapisrv.com kuaishou.com +yximgs.com log-sdk.gifshow.com +adswlog.kuaishou.com +ads  kgimg.com  kugou.com +le.com lecloud.com +lemall.com letv.com letvcdn.com letvimg.com miaopai.com +mihoyo.com bh3.com  pplive.cn +pplive.com pptv.com qingting.fm  sfacg.com +61.com +taomee.com +tapimg.com +taptap.com  tgbus.com tiancity.comtiancitycdn.com u17.com u17i.com u17t.com +vgtime.com ximalaya.com  xmcdn.com +kumiao.com  youku.com  ykimg.com +mmstat.com soku.com +cibntv.net +duowan.com dwstatic.com +yy.com yystatic.com +heytea.com chiphell.com +douban.com  douban.fm doubanio.com erji.net +hacpai.com  ld246.com +nga.cn 178.com +ngabbs.com ngacn.cc saraba1st.com  zhihu.com  zhimg.com  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.comsf-financial.com sf-saas.comsf-tech.com.cn sfcar.hk sffix.cn sfgy.org 36kr.com 36krcdn.com  dgtle.comhoopchina.com.cn hupu.com hupucdn.com  shihuo.cn coolbuy.com  ifanr.com ifanr.inifanrusercontent.com +ifanrx.com +minapp.com +caixin.com cctv.cn cctv.com cctvpic.com chinaepg.cn chinalive.com citv.net.cn cnms.net.cn cntv.cn cntv.com.cn +cctvlib.cncctvlibrary.cncctvlib.com.cncctvlibrary.com.cn +cctvpro.cncctvpro.com.cn  cntvwb.cn gjgbdszt.cngjgbdszt.com.cngjgbdszt.net.cn  ipanda.cn +ipanda.com ipanda.com.cn +ipanda.net livechina.cn livechina.comolympicchannelchina.cn tvcc.cn tvcc.com.cn%!xn--fiq53l6wcx3kp9bc7joo6apn8a.cn%!xn--fiq53l90et9fpncc7joo6apn8a.cn-)xn--fiq53l6wcx3kp9bc7joo6apn8a.xn--fiqs8s%!xn--kprv4ewxfr9cpxcc7joo6apn8a.cn-)xn--kprv4ewxfr9cpxcc7joo6apn8a.xn--fiqs8s zggbdszt.cnzggbdszt.com.cnzggbdszt.net.cnzygbdszt.net.cn chinanews.comchinanews.com.cn +cns.com.cn ecns.cn geekpark.net jiemian.comjiemian.com.cn +lancdn.comlandiannews.com  wsoso.com  ifeng.com ifengimg.comphoenixcenter.cn fengedu.comifengweekly.com 6655.com cooldock.com +ithome.com lapin365.com ruanmei.com +saayaa.com win7china.com win8china.com sohu.com +sohucs.com +itc.cn solidot.org  sspai.com tmtpost.com chaindd.com +72whys.com checkzeit.com +tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com feng.com fengimg.com wfdata.club ynet.cn ynet.com ynet.com.cnhainanairlines.com hnacargo.com  hnair.com 10044.cnsinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com +csdl.ac.cn  las.ac.cn  fuwai.com pkuh6.cn puh3.net.cnhospital.pku.edu.cnss.bjmu.edu.cn 115.com 3type.cn 4paradigm.com  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn +afdian.net afdiancdn.com agora.io +agoraio.cn agoralab.co +antutu.com bitauto.combitautoimg.com cheyisou.com  yiche.com  yccdn.com shimo.im  yuque.com chinaso.com +pg0.cn +chinaz.com +chinaz.net caiyunai.com caiyunapp.com coolapk.comcoolapkmarket.comcoolapkmarket.net c-t.workcowtransfer.com geetest.com#geetest.datasink.sensorsdata.cn hellofont.cnhellowebfont.com0,hellofontpreview.oss-cn-beijing.aliyuncs.com-)hellowebfonts.oss-cn-beijing.aliyuncs.com hanyi.com.cnfontstar.com.cnfoundertype.com ipip.net jianshu.com +jianshu.io jinshuju.netjinshujucdn.com gotokeep.com keepcdn.com  lagou.com lgstatic.com baidupan.com +lanzou.com lanzous.com woozooo.com +liepin.com +lietou.comlietou-static.com mafengwo.cn mafengwo.com mafengwo.net  meitu.com meitudata.com moji.com mojichina.com  polyv.net videocc.net +renren.comrenren-inc.com vaptcha.com vaptcha.net wamawama.com +wiwide.com +sojump.com +wjx.cn wjx.com wjx.top zcmbc.com.cn zdns.cn zdns.net.cn zdns.org.cn zdnscloud.biz zdnscloud.cn zdnscloud.comzdnscloud.com.cnzdnscloud.info zdnscloud.netzdnscloud.net.cnzdnscloud.org.cnchinesemooc.org +cnmooc.orgicourse163.org icourses.cn mooc.cnopenlearning.com pmphmooc.commoocs.unipus.cnopencourse.pku.edu.cn study.163.com cnki.net  apabi.comcnthinkers.com  cqvip.comhuijistatic.com huijiwiki.com moegirl.orgmoegirl.org.cn  guokr.comwanfangdata.com.cn speiyou.com +xesimg.com xueersi.com banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com zhihuishu.com  coding.me +coding.net csdn.net +csdnimg.cn  deepin.cn +deepin.com  deepin.io +deepin.org  gitee.comjinrishici.com  juejin.imb-gold-cdn.xitu.iomirror-gold-cdn.xitu.iop1-juejin.byteimg.comp2-juejin.byteimg.comp3-juejin.byteimg.comp4-juejin.byteimg.comp5-juejin.byteimg.comp6-juejin.byteimg.comp7-juejin.byteimg.comp8-juejin.byteimg.comp9-juejin.byteimg.com oschina.netruby-china.orgrubyconfchina.org mysxl.cn +sxl.cn  sxlcdn.cnsegmentfault.com  sifou.com +tipdim.orgxueyuanjun.com alibaba +alipay +taobao tmall a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com +alicdn.com alidayu.com +alidns.comaliyun-inc.comaliyun-iot-share.com +aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.toteambition.comteambition.netteambitionapis.com 25pp.com  56che.com  95095.com 9game.cn +aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.com alifanyi.comalihealth.com.cn alihealth.hk +aliimg.com +alikmd.com alimama.com alimebot.com +alimei.com alios.cn +alipay.comalipayobjects.com aliplus.comaliresearch.com alisoft.com alisports.com alitianji.comaliunicorn.com +aliway.com aliwork.com alixiaomi.comalizhaopin.com alyms.cn +asczwa.comasczxcefsv.com +asmlink.cn atatech.org +b2byao.com  bazai.com  bcvbw.com  cheng.xin cloudeagle.cn damai.cn dayu.com +dfkhgj.com doctoryou.ai doctoryou.cn dongting.com +dratio.com emas-poc.com +gongyi.xin ialicdn.com iconfont.cn +ics.design +jhgtgb.com +kanbox.com +lazada.comliangxinyao.com m-now.cn +maitix.com  mdeer.com mei.commiaostreet.com  mshare.cc nic.xinphilanthropy.xin phpwind.com phpwind.netqingtingtrip.com  rexpos.cn saee.org.cn shenjing.com  shuqi.comshuqireader.com sparenode.com  supet.com  ttpod.com wandoujia.comxinlingshou.cn yowhale.com yunos-inc.com  yunos.comyushanfang.com +zuodao.comaliexpress.com aliexpress.ru sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com +hemaos.com hemashare.cn shyhhema.com 1688.com etao.com juhuasuan.comlingshoujia.com +mashort.cn pailitao.com +taobao.com +taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmall.ru tmalltv.com tmjl.ai alitrip.com  feizhu.cn +feizhu.com +fliggy.com  fliggy.hk +iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net  b3log.org a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +ads zuoyebang.cc zuoyebang.com +zybang.com baidu +91.com +aipage.com apollo.auto baidu.cn  baidu.com baidu.com.cn baidubce.combaiducontent.com baidupcs.combaidustatic.com +baifae.com baifubao.com +bcebos.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn +bdydns.com +bdydns.net chuanke.com  dlnel.com  dlnel.org +duapps.com +dwz.cn +hao123.com hao123img.com +hao222.com +haokan.com jomocdn.net jomodns.com +mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com +bytecdn.cn bytedance.com bytedance.net bytedns.net byteimg.com +douyin.com huaxiong.comjokecommunity.comneihanshequ.com +pstatp.com +snssdk.com toutiao.comtoutiaocdn.comtoutiaocloud.comtoutiaohao.comtoutiaohao.net toutiaoimg.cntoutiaoimg.comtoutiaoimg.nettoutiaopage.com +wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com  baike.com +ixigua.com ixgvideo.com  365yg.com didi-food.comdidiaustralia.blogdidichuxing.comdidiglobal.comdidimobility.co.jpdidistatic.comxiaojukeji.com  dbank.com dbankcdn.com harmonyos.com hicloud.com hihonor.com honor.cn +huawei.comhuaweicloud.com  vmall.com vmallres.com cmcm.com cmcmcdn.com  liebao.cn duba.com duba.net ijinshan.comseasungames.com xishanju.com xoyo.com testplus.cn +wps.cn  51dzt.com  iciba.com  docer.com kdocs.cn papocket.com  wpspdf.cn kimg.cn kingsoft.com ksmobile.com +ks-cdn.com  ksyun.com ksyungslb.com flyme.cn meizu.cn  meizu.com  mzres.com 126.com 126.link 126.net 127.com 127.net 163.com163industry.com 163mail.com 163qiyukf.com +163yun.com 166.net +haowu.linkicourse163.org  kaola.com +lofter.com  nease.netnetease-inc.com netease.com +netease.im +qiyukf.com ydstatic.com yeah.net +youdao.comanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads coloros.com finzfin.com +heytap.com heytapcs.comheytapdownload.comheytapimage.com +myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobioppodigital.com  oppoer.meoppomobile.com oppopay.com opposhop.cn +realme.com realmebbs.comrealmemobile.com oneplus.com +oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com 75.team +75team.com baomitu.com +360.cn 360.com +360-jr.com 360chou.com360daikuan.com360huzhubao.com +360jie.com360jinrong.net +360kan.com 360kuai.com  360os.com 360panyun.cn 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com +haosou.com haosou.com.cn +haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com +qihuapi.cn qihucdn.com  qihoo.com qikucdn.com +so.com sou.com urlqh.cnxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com +youhua.com  yunpan.cn  97973.com +picself.cn sina.cn sina.com sina.com.cn sina.net sinaapp.com sinaedge.com +sinaimg.cn sinaimg.com  sinajs.cn +sinajs.comt.cn videoself.cn  wbimg.com wbimg.cn wcdn.cn weibo.cn  weibo.com weibo.com.cn weibocdn.com xhaiwai.com 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +ads +go2map.com sogo.com  sogou.com sogoucdn.com dns.pub  dnsapi.cn  dnspod.cn +dnspod.com dnspod.com.cn +dnspod.net +dnspod.org  dnsv1.com  dnsv2.com  dnsv3.com  dnsv4.com  dnsv5.com doh.pub ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads +yuewen.com hongxiu.com lrts.me qdmm.com +qidian.com readnovel.com tingbook.com webnovel.com +xs8.cn xxsy.net +apcdns.net  cdn-go.cn cdntips.com foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn idqqimg.com imqq.com  myapp.com myqcloud.com +qcloud.com qcloudimg.com qlogo.cn qpic.cn +qq.com +qqmail.com  qzone.com +rtx.com.cnservicewechat.com smtcdns.com smtcdns.net +tencent.cn tencent.comtencent.com.cntencent.com.hktencent.net.cntencent-cloud.comtencentmusic.comtencentyun.com +tenpay.com +wechat.com +wegame.com wegame.com.cn +weiyun.com alloyteam.com imweb.io ivweb.io +mi.com +mi-img.com  mifile.cn miui.com +miwifi.com  xiaomi.cn +xiaomi.com +xiaomi.netxiaomiyoupin.com  00cdn.com  88cdn.com +sandai.netthunderurl.com +xunlei.com 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn +cmvideo.cn miguvideo.com andfx.cn  andfx.net +cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com +ctexcel.ca ctexcel.comctexcel.com.hk +ctexcel.fr +ctexcel.us +189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com +chntel.com  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cnguoxuedashi.com guoxuemi.com jikipedia.com haidilao.com0123456789.com 0379home.com +055110.com  05sun.com 0759job.com  100bt.com 100offer.com  11467.com +114chn.com 114piaowu.com 114shouji.com +119you.com 123juzi.com 123juzi.net 123u.com 1637.com  16888.com 16rd.com  17173.com 178linux.com  17989.com  17cdn.com 17house.com  18183.com 188.com 1905.com  19yxw.com 1nongjing.com  1ting.com 1zhe.com 21cn.com 2265.com 2288.org 2345.com 258.com 263.net 289.com 2cto.com 3000.com +310win.com +315che.com 3234.com 32r.com 3322.org 3387.com 33lc.com 3454.com 3456.cc +35.com 3533.com 360aiyi.com +360doc.com  360jq.com 360zhyx.com +365azw.com +365dmp.com +37.com 3733.com 3839.com +39.net 3conline.com 3d66.com +3elife.net 3h3.com 3yx.com  40407.com 500.com 500d.me +50bang.org +51.com 51.la +510you.com 51credit.com  51cto.com 51eshop.com 51gaifang.com 51hejia.com51jingying.com 51meishu.com +51sole.com 51wendang.com  51yes.com 5253.com  52hxw.com +52miji.com 52pk.com 52z.com 53kf.com +55.com +56.com 5577.com  55bbs.com  58pic.com  5bite.com 5fun.com 5gzm.net 5khouse.com 5you.com 66wz.com 68h5.com +6rooms.com 714.com 7230.com +72byte.com  7down.com 7k7k.com  7moor.com 7po.com +7x24cc.com +7xdown.com  818ps.com  84399.com 885.com +900.la 917.com 91danji.com 91yunxiao.com 9553.com 962.net 9718.com  99166.com 998.com 999d.com 99danji.com 9ht.com +9xgame.com 9xu.com a9vg.com +aardio.com +adxvip.com +afzhan.com agrantsem.com  aiemy.com aiketour.com  aiops.com  aipai.comairchangan.com airguilin.com aisee.tv aiskycn.com aiyunxiao.com +aizhan.comalittle-tea.com +allyes.com anfensi.com +anquan.org +anruan.com +aotrip.net  aoyou.com apk3.com apk8.com appchina.com +appinn.com  arpun.com babytree.combabytreeimg.com baidufree.combaifendian.com  baihe.com baixing.com baixing.netbamenzhushou.combangongziyuan.com bankcomm.com baofeng.combaoxianshichang.com bcy.net bearychat.com beihaidc.combeijing-lipin.com bengbeng.com  benmi.com  berui.combestopview.com biancheng.net bianews.com bibaodao.com bidchance.com biddingx.com bihu.com +bio360.net  bio4p.com bio-equip.combiodiscover.com bishijie.com bitecoin.com biyehome.net bjcathay.com bobo.com bojianger.com +bokecc.com  boosj.com btcfans.com btgtravel.com bthhotels.com  btime.comcabbagebox.com caijingwu.com +caiyun.com cang.comcankaoxiaoxi.comcardbaobao.com +carnoc.com ccb.com  cdn20.com  cecdc.com cecport.com centanet.com cerambath.org +ch.com chachaba.com changba.com chashebao.comchazhengla.com +che168.comchina-chair.comchina-nengyuan.com  china.comchinacache.comchinacache.netchinachugui.comchinadongchu.com chinafph.comchinakaoyan.comchinalawedu.com chinapay.com chinapp.netchinapubmed.net chinasspp.comchinatranslation.net chinaunix.netchinaweiyu.comchinawutong.com chinazns.comchongdiantou.com +chouti.com chuangxin.com chuansong.mechuansongme.com +chushou.tv chuyu.me  city8.com cjol.com clouddn.com cloudxns.com cnanzhi.com +cnbeta.com cnbetacdn.com cnblogs.com +cnepub.com  cnfol.com  cnlaw.net cnstock.com cnzz.com cocodiy.com code666.com +cofeed.com +cofool.com coindog.comcontentchina.com  cpppf.org  cr173.com  crsky.com  csbew.com +csmjzs.com csslcloud.net +ctfile.com ctiforum.com ctoutiao.com  ctsbw.com +cubead.com  cwxzx.com +cyagen.com  cybtc.com cyol.com cyts.com cztv.com cztvcloud.com dadajiasu.com dadighost.com daguzhe.com dajiabao.com  dajie.com dajieimg.com dalongyun.com dangbei.com danji100.com +danji6.com daocloud.io daovoice.iodayukaoshi.com dazijia.com +dcdkjx.com  dd373.com  ddooo.com dedecms.com develenv.com +dginfo.comdgphospital.comdianchacha.com diandian.comdiandianqi.comdianwannan.comdingxiang-inc.com +diopic.net diyiyou.com dj99.com  docin.com dockerone.com +dockone.io dogedoge.com +donews.com +dongao.comdongguantoday.com dopa.com +douxie.com +downcc.com downxia.com +downyi.com +dpfile.comdreams-travel.comdrivergenius.com +dui.ai duiopen.com duoduocdn.com duokanbox.com +duomai.com duoshuo.com  duote.com dxpmedia.com +dxycdn.com  dyhjw.com dzsc.com dzw3.com  dzwww.com easesale.com  easiu.com eastday.com eastmoney.com eastsoo.com +eayyou.com  ebico.com  ebrun.com +ecitic.com ecjobhome.com +edu.cn  eduei.com eeyy.com eflycloud.com elecfans.com emarbox.com +emumax.com enterdesk.comeoeandroid.com excelhome.net expreview.comf.cx  faloo.com famulei.com  fanli.comfangxiaoer.com fanxian.com fastapi.net +feihuo.com feiniaomy.comfengkongcloud.com fengniao.comfengxian110.com  fenxi.com +fhldns.com  fimmu.com finchina.com fixdown.com  fqjob.net freebuf.com fugetech.com fuwj.com fxxz.com fyxz.com game234.com gameabc.com gamemei.com +gaodun.comgaoshouyou.comgaoxiaojob.com +gdjdxy.comgdliontech.com gdrc.com geilicdn.comgenelinkout.com  getui.com +gezida.com gfan.com +giocdn.com globrand.com gm86.com gmallbio.com  gmz88.comgobasearcher.com gold678.com  golue.comgongxiangcj.com goosail.com  goufw.com gree.comgreenxiazai.com growingio.com  gtags.net  guabu.com guaiguai.comguanaitong.comguanhaobio.com gucheng.com  guigu.org guoxinmac.com  gupzs.com gushiwen.orgguzhangting.com +gwdang.comgxairlines.com +gxb.io gzwanju.com h5uc.com hack520.com hackhome.com haishun.com hanboshi.com handanjob.comhangjiayun.com haolietou.com  haote.comhaoyouyinxiang.com hefei.cc +heisha.net  henha.com henkuai.com herostart.com  hexun.com  hiido.com hitv.com hiyd.com hktheone.com hn-cbec.com +hnrcsc.com hntv.tv hnyuyuhui.com hollycrm.com homeinns.com homekoo.comhongsanban.com +houdao.comhouyuantuan.com hteacher.net huanqiu.comhuashengdaili.com  huatu.com  huize.com  hujia.org hujiang.com hunantv.comhuochepiao.com huocheso.com  huxiu.com hxfy888.com hxsd.com iask.com +ibaotu.com ibuychem.com icaidao.com ichangtou.com idongdong.com iflytek.com  igao7.com +iheima.com ijiandao.com +ikafan.com im2maker.com  im-cc.com +imedao.com imgo.tv  imooc.com indienova.com  infoq.cominfoqstatic.com +ip-cdn.com  ip138.com ipinyou.com iranshao.com  irs01.com ishumei.com  it165.net  it168.com  it610.com  iteye.com +itjuzi.com  itmop.com  iyiou.com iyunxiao.com +izuche.com +jandan.net jb51.com  jdair.net jia.com jiameng.com jianbihua.com jianzhi8.com jiaodong.net jiaoyimao.com jiasuhui.com jiasule.com jiathis.com jiayuan.com jiazhao.com jiemeng8.comjikexueyuan.com jinianbi.comjinrongren.net  jinse.com  jinti.comjiqizhixin.com jisuanke.com jisuxia.com jiuzhilan.com jj20.com jkbl.com jmstatic.com job5588.com +job910.com  jobjm.com jsbc.com +jsrdgg.com jstv.com  jsyks.com juefeng.com +julive.com  jumei.com  juwan.com  juxia.com  jyimg.com k366.com kaifubiao.com kaixin001.com kameng98.com +kanimg.com kankanews.com kantianqi.net kanzhun.com kaopu001.comkeboyunxiao.com  kejet.net kf5.com +kimiss.com kingdee.com kkzj.com +kongfz.com koolearn.com +kouclo.com +koudai.com koudai8.com kq7.com  ksord.com  kuaaa.com kuaidi100.com kuaihou.com kuaizhan.com  kuqin.com +kuyiso.com lady8844.com laomaotao.net laomaotao.org  lascn.net  lawxp.com leanote.com ledu.comleetcode-cn.com leikeji.com leiphone.com leiting.com leju.com leturich.org lianmishu.com +liantu.com  liantu.me lianzhuli.comliaoxuefeng.com liba.com libaclub.comlieyunwang.com lightonus.com +likuso.com lingkou.com linkvans.com  linsn.com linuxidc.com liulanqi.net liuxiaoer.com live800.com liweijia.com lixinger.com lkkbrand.com longhoo.net +longre.comlongtugame.com longzhu.com  lotpc.com +loupan.com +lu.com luckyair.net  lufax.com lufaxcdn.com lunwengo.net luyouqi.com +lvmama.comlvsexitong.com  lxdns.com  lxway.com +magedu.com maisanqi.com +mamecn.com manhuatai.com manmankan.com +mapbar.com mayi.com +mayihr.com +mcbang.com  mdpda.com mechina.org +mediav.com meifang.com meika360.com meilishuo.commeimingteng.com +meiqia.commeishichina.com meishij.netmengtuoshi.wang mgtv.commiaobolive.com miaozhen.com +miercn.com mikecrm.comminhangshi.com miusi.co mjia.cc +mmbang.com mmbang.info +mofang.com mofazhu.com mogu.com mogucdn.com mogujie.com +mokahr.com moleecel.commoocollege.com mop.com msanjia.com +mscbsc.com mukewang.com +mumayi.com +muomou.com muzhiwan.com +mydown.com mydrivers.com myshow360.net myyx618.com myzaker.com naixuecha.com netbian.com +newasp.netnewbandeng.com  newyx.net nowcoder.com nowscore.com  nruan.com ntalker.com nvsheng.com  nzbdw.com oadz.com  oeeee.com  offcn.com officese.com +oicq88.com  okooo.com +ol-cdn.com +ol-img.com oldboyedu.com +oneapm.com onegreen.net +oneyac.comonlinedown.netonlinesjtu.com onlylady.com +opdown.com oray.com  ottcn.com +oupeng.com +p2peye.com p5w.netpaipaibang.com paopaoche.net pc6.com +pcbeta.com +pchome.net  pcpop.com  peccn.com pgzs.compharmacodia.com piaoliang.com +pingan.compingplusplus.com pingwest.com +pingxx.com pintu360.com  pipaw.com  pipaw.net pptbest.com psbc.com +pubyun.com  qc188.com qcc.com qcds.com qd8.com qd-metro.com qh24.com qiangbus.com qianjia.com qianlima.com qianzhan.comqiaobutang.com qichacha.com +qie.tv qifeiye.comqijiayoudao.net qingcloud.comqingdaochina.orgqingdaonews.comqingsongchou.com qiumibao.com qizuang.com  qqddc.comqqgexingqianming.com qqrizhi.comqqshuoshuo.com +qschou.com +qtmojo.com +qudong.com +qugame.com  qunar.com qunarzz.com qyer.com rfchost.comrockyenglish.com rong360.com rtbasia.com  ruan8.com +runoob.com rzrc114.com  saibo.com sanguosha.com +sanwen.net  scdng.com scoregg.com +sczsxx.com sdo.com sec-wiki.com +sencdn.com seniverse.comsenlinjimore.com +sgamer.com shang360.com +shangc.netshanghairc.com shangzhibo.tvshanshuihotel.com sharejs.com shebiaotm.comshelter-china.comshelterdome.netshengdaosoft.comshenmayouxi.com  sheui.com shijiexia.com shixiseng.com shmetro.comshoujihuifu.comshouyoubus.com shrbank.comshuidichou.comshuidihuzhu.com shumensy.comshuoshuokong.com +shutcm.com +simei8.com simuwang.com sinesafe.com  sjwyx.com  skycn.com sllssrq.com +snimay.com  sobot.com sofreight.com softwhy.com +sojson.com +somode.com soso.com souqian.comsouthmoney.comsparkletour.comspringtour.com ssports.com starbaby.cc starbaby.com stockstar.com sun0769.com +sunrtb.com supermap.comsupermapcloud.com +sys321.com szfw.org szhk.com szzfgjj.com t1y5.com  taihe.comtaihuoniao.com tangeche.com tanx.com +tao123.com +taoche.com te5.com tenxcloud.comtianjimedia.comtianjin-air.comtianlailive.com +tianqi.com tietuku.com +tiexue.net timedoo.com tingyun.com titanar.com tjjt360.com  tmcdn.net +tobosu.com tom.com tongdun.net topthink.com touqikan.com travelsky.com trunktech.comtrustexporter.com trustutn.org  tudou.com tudouui.com tuer123.com tuicool.com +tuiwen.net  tujia.com  tuniu.com tutuapp.com  tuwan.com tuwanjun.com u.tools  ucbug.com +uggame.com uoko.com urselect.comurumqi-air.com  useso.com uuu9.com uzzf.com  v5875.com value500.com vamaker.com vdolady.com veryhuo.com veryzhun.com  vic18.com videojj.com  vijos.org vip.com  vobao.com +vpgame.comwallstreetcn.comwangyangyang.vipwannianli8.com wanplus.com wanwushuo.com wanyiwang.com  wanyx.com +wdjimg.com wdzj.com  weand.com webterren.com weicaifu.com weidian.comweilaicaijing.comweilaiyunxiao.com weiphone.net weixing.com weiyangx.comwelltrend-edu.com wenjuan.comwhlovehome.com wicresoft.com +win007.com win8.netwindows10zj.comwindows7en.com windowszj.com winwin7.com wishdown.com  wmzhe.com wnhuifu.com wodingche.com  womai.com wonnder.com +wooyun.org worktile.comwoyaogexing.com  woyoo.com  wqiis.com wrating.com +wscdns.com  wtown.com  wumii.com +wuming.comwuximediaglobal.com  wywyx.com xafc.com  xbiao.com  xdwan.com +xfdown.com +xhscdn.comxiachufang.comxiaobaixitong.comxiaoe-tech.com xiaogouh5.comxiaohongshu.com  xiaoka.tv xiaokaxiu.comxiaomingtaiji.comxiaoxiongxitong.comxiaoyuxitong.com  xiayx.com xiazaiba.com xingjiesj.com xinhuanet.comxinrenxinshi.com xinshipu.comxingtan001.com xitong8.com xitu.com xiu8.com +xiucai.com xiziwang.net xmhouse.com  xnpic.com  xpgod.com +xsa239.comxuanchuanyi.com  xue51.com xuekanba.com xuexicha.com xundupdf.com  xycdn.com xywy.com +xzking.com yahui.cc +yaolan.com  yaoyl.com  yaozh.com +ycgame.com +yeepay.com +yeshen.com  yesky.com yh31.com  yicai.com  yigao.com yigoonet.com yihedoors.comyikaochacha.com yikexue.comyingjia360.comyinhang123.net yinxiang.com yinyuetai.comyinzhaowang.com +yiqifa.com +yiqifa.org yisu.com yitaifang.com  yiwan.com yixi.tv yizhibo.com  yjbys.com ynhr.com +yocajr.com +youboy.com youjiao.com youke.co youlian.fun youshang.com youxiake.com youxihezi.net youxila.com youxiniao.com youxigt.com  youzu.com yoyojie.com  yoyou.com  ypppt.com +yslyhr.com  ysten.com +yuewen.com  yunaq.com yunba.io yundaex.com yundasys.com +yundun.com yunqishi.net yunshipei.com yunxiao.com yunzhijia.com  yupoo.com  yuzua.com  yxbao.com +yxdown.com +yytcdn.com +zampda.net zampdsp.com zastatic.com +zbjimg.com zczj.com +zdfans.com zgjm.org +zgjsks.com  zglxw.com  zgzcw.com zhanbuba.comzhangyoubao.com  zhanqi.tv zhanzhang.net zhaodanji.com zhaopin.com zhcw.com +zhenai.com  zhibo8.cc  zhidx.com zhifang.com +zhipin.com zhiziyun.com zhongkao.comzhuangjiba.comzhuanyewanjia.comzhuayoukong.com zhubajie.com zhugeapi.net zhugeio.com  zimuzu.io zixiaomao.com zixuntop.com  zjstv.com zmengzhu.com zongheng.com +zpb365.com +zrblog.net zsxq.com  zuche.com zuchecdn.com zuhaowan.com zuidaima.com zuowen8.comzuowenwang.net jindidata.comtianyancha.comzhuanxiandai.com +fm3838.comlarsonlimited.com runsheng.com vzuu.com +zoom3g.com +zoomyou.cn chaoxing.com chaoxing.cc +n +ESPN espn.com espncdn.com watchespn.comespn.hb.omtrdc.netespndotcom.tt.omtrdc.net + + FACEBOOK-DEVaccountkit.comatscaleconference.com botorch.org +buck.build buckbuild.comcomponentkit.org draftjs.org +f8.comfacebookappcenter.infofacebookappcenter.netfacebookappcenter.orgfacebookconnect.comfacebookdevelopergarage.comfaciometrics.com fasttext.cc fbf8.com fbinfer.com fblitho.com fbredex.com +fbrell.com flow.dev flow.org flowtype.org frescolib.org hacklang.org hhvm.commakeitopen.com mcrouter.net mcrouter.orgmessengerdevelopers.com +ogp.meopengraphprotocol.comopengraphprotocol.org  parse.com pyrobot.org  react.com reactjs.com reactjs.org recoiljs.org rocksdb.com rocksdb.net rocksdb.orgyogalayout.comdevelopers.facebook.com + +FINISH$dishwashingexpert.com.cn +cn  finish.at  finish.bg finish.co.kr finish.co.nz finish.co.uk finish.co.za finish.com.cn +cn finish.com.hr finish.com.tr  finish.de  finish.es  finish.fr  finish.gr  finish.hu  finish.lv  finish.pl  finish.pt  finish.ro  finish.si  finish.skfinisharabia.comfinishbrasil.com.brfinishdishwashing.cafinishdishwashing.com finishinfo.be finishinfo.clfinishinfo.comfinishinfo.com.arfinishinfo.com.au finishinfo.cz finishinfo.fi finishinfo.it finishinfo.jp finishinfo.nl finishinfo.no finishinfo.ru finishinfo.sefinishkilpailu.fi finishwin.beyarininsuyu.com + + +FREEBEACONfreebeacon.com + +GCORES +gcores.com +I +MADSHI +madshi.net  madvr.com  madvr.net madvrlabs.llc + +PATREON patreon.com +N +SEASUNseasungames.com xishanju.com xoyo.com testplus.cn +n +TWITCH ext-twitch.tv  jtvnw.net  ttvnw.net  twitch.tv twitchcdn.net twitchsvc.net + +X-ORG x.org + +XINGRZ  xingrz.me + + YOUKU-ADSactives.youku.com +ads ad.api.3g.youku.com +ads$ad.api.mobile.youku.com +ads ad.mobile.youku.com +ads(a-dxk.play.api.3g.youku.com +ads atm.youku.com +ads#b.smartvideo.youku.com +adsc.yes.youku.com +adsdas.api.youku.com +ads!das.mobile.youku.com +ads!dev-push.m.youku.com +adsdl.g.youku.com +adsdmapp.youku.com +adse.stat.ykimg.com +ads#gamex.mobile.youku.com +ads!guanggaoad.youku.com +ads hudong.pl.youku.com +ads!huodong.pl.youku.com +ads"huodong.vip.youku.com +ads hz.youku.com +adsiyes.youku.com +ads l.ykimg.com +adslstat.youku.com +ads mobilemsg.youku.com +ads msg.youku.com +adsmyes.youku.com +ads p.l.youku.com +ads pl.youku.com +ads#passport-log.youku.com +adsp-log.ykimg.com +adspush.m.youku.com +ads r.l.youku.com +ads s.p.youku.com +adssdk.m.youku.com +adsstat.youku.com +ads$statis.api.3g.youku.com +ads&store.tv.api.3g.youku.com +ads&store.xl.api.3g.youku.com +adstdrec.youku.com +adstest.ott.youku.com +ads!test.sdk.m.youku.com +ads v.l.youku.com +adsval.api.youku.com +ads wan.youku.com +adsykatr.youku.com +adsykrec.youku.com +ads +D +YY +duowan.com dwstatic.com +yy.com yystatic.com + +CATEGORY-COMPANIESacer-group.com acer.com acer.com.cn +cn typekit.com typekit.net10xfotolia.com 2o7.net acrobat.com adbecrsl.comadobe-aemassets-value.comadobe-audience-finder.com"adobe-video-partner-finder.com  adobe.com adobe.lyadobeaemcloud.comadobeaemcloud.netadobeawards.comadobecontent.ioadobecreativityawards.com adobedc.net adobedemo.com adobedtm.comadobeexchange.comadobeexperienceawards.com adobegov.comadobehiddentreasures.comadobejanus.com adobeku.comadobelanding.comadobelogin.com adobeoobe.comadobeplatinumclub.comadobeprojectm.com adobesc.com adobesign.comadobesigncdn.comadobespark.com adobess.comadobestock.com adobetag.comadobetarget.comadobetcstrialdvd.comadobetechcomm.comadobetechcommcallback.comadobetechcommdemo.comadobexdplatform.comassetsadobe.com authorxml.combusinesscatalyst.com ccnsite.com  ccpsx.com +demdex.netdollarfotoclub.comdollarphotoclub.comdollarphotosclub.comdouwriteright.com echocdn.com echosign.com edgefonts.netenablementadobe.com  ftcdn.net gostorego.comimagineecommerce.commacromedia.commagentoliveconference.commarketing-nirvana.com omniture.com +omtrdc.net photoshop.complacesdocs.comsundanceignite2016.comworldsecureemail.comworldsecuresystems.com adobe.iodevelopria.com behance.nets2stagehance.com adobecc.com adobecce.comadobeccstatic.comcreativecloud.comcreativesdk.com cotolia.com ffotolia.com fiotolia.com foftolia.com fonolia.com fotiolia.com fotoiia.comfotolia-noticias.com +fotolia.cc fotolia.com +fotolia.tv fotolja.com fptolia.com gfotolia.com motolia.com photolia.nettenbyfotolia.com votolia.combluefootcms.com mageconf.commageconf.com.ua magento.com magento.netmagentocommerce.commagentomobile.commarketing-cloud.com marketo.co.uk marketo.com marketo.net +marketo.tvmarketodesigner.commarketolive.com +mktdns.commkto-c0100.com mktorest.com mktroute.commobilemarketo.com&"revenue-performance-management.com toutapp.comcompresspdf.new pdf.new sign.newalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.com amazon-adsystem.com +adswholecitiesfoundation.orgwholefoodsmarket.comwholekidsfoundation.orgwholeplanetfoundation.orgaws amazonimdb kindle xn--cckwcxetdxn--jlq480n2rg yamaxun -zappos  amazon.ae  amazon.ca amazon.co.jp amazon.co.uk -amazon.com amazon.com.au amazon.com.br amazon.com.mx amazon.com.tr  amazon.de  amazon.es  amazon.fr  amazon.in  amazon.it amazon.jobs  amazon.jp  amazon.nl  amazon.sgamazontrust.com amzn.commedia-amazon.comssl-images-amazon.com amazonaws.comamplifyapp.com awsstatic.com awstrust.comcloudfront.netelasticbeanstalk.comamazonvideo.comprimevideo.comicloud-content.com  icloud.ch -icloud.com  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.lv  icloud.om -icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloude.com icloudo.com -icloudo.de icloudos.de!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.com itun.es  itunes.co itunes.co.th -itunes.com  itunes.mx +zapposaboutamazon.cn +cnaboutamazon.co.ukaboutamazon.comaboutamazon.com.auaboutamazon.deaboutamazon.esaboutamazon.euaboutamazon.fraboutamazon.inaboutamazon.itaboutamazon.jpaboutamazon.pl alexafund.cn +cnalexafund.com.cn +cn amaaozn.comamazon-fashions.comamazon-jp-recruiting.comamazon-lantern.comamazon-launchpad.com  amazon.ae  amazon.ca amazon.cn +cn amazon.co.jp amazon.co.uk +amazon.com amazon.com.au amazon.com.br amazon.com.mx amazon.com.tr  amazon.de  amazon.es  amazon.fr  amazon.in  amazon.it amazon.jobs  amazon.jp  amazon.nl +amazon.red  amazon.sgamazonalexavoxcon.comamazonauthorinsights.comamazonbusiness.cn +cn!amazonbusiness.com.cn +cnamazonbusiness.orgamazonbusinessblog.comamazonchoice.cn +cnamazonchoice.com.cn +cnamazonchoices.cn +cn amazonchoices.com.cn +cnamazondevicesupport.comamazonfctours.comamazonianblog.comamazonimages.comamazoninspire.cn +cn amazoninspire.com.cn +cnamazonlaunchpad.cn +cnamazonlaunchpad.com"amazonlaunchpad.com.cn +cn amazonlending.com.cn +cn!amazonliterarypartnership.comamazonlumberyard.wang amazonnow.cn +cnamazonnow.com.cn +cn amazonsdi.comamazonstudiosguilds.comamazontrust.comamazonvideodirect.com amzn.com amzn.to  amznl.comassoc-amazon.cn +cnassociates-amazon.comgameon-masters.comgdansk-amazon.commedia-amazon.com primeday.cn +cnprimeday.com.cn +cn primeday.infosiege-amazon.comssl-images-amazon.comueberamazon.de +yamaxun.cn +cn yamaxun.comz.cn +cn audible.comacmvalidations.comacmvalidationsaws.comaesworkshops.comamazonaws-china.com amazonaws.com amazonaws.tvamazonworkdocs.cn +cnamazonworkdocs.com!amazonworkdocs.com.cn +cnamplifyapp.comamplifyframework.comaws-iot-hackathon.comawsautopilot.comawsautoscaling.com awsbraket.comawscommandlineinterface.comawsedstart.comawseducate.comawseducate.netawseducate.orgawsloft-johannesburg.comawsloft-stockholm.comawssecworkshops.com awsstatic.comawsthinkbox.com awstrust.comcdkworkshop.comcloudfront.netcontainersonaws.comelasticbeanstalk.comthinkboxsoftware.com".+\.awsdns-[0-9][0-9]\.co\.uk$.+\.awsdns-[0-9][0-9]\.com$.+\.awsdns-[0-9][0-9]\.net$.+\.awsdns-[0-9][0-9]\.org$".+\.awsdns-cn-[0-9][0-9]\.biz$!.+\.awsdns-cn-[0-9][0-9]\.cn$".+\.awsdns-cn-[0-9][0-9]\.com$".+\.awsdns-cn-[0-9][0-9]\.net$ kindle.cn +cn kindle.co.jp kindle.co.uk +kindle.com  kindle.de  kindle.es  kindle.fr  kindle.in  kindle.it  kindle.jpkindleoasis.cn +cnkindleoasis.comkindleoasis.com.cn +cnkindleoasis.infokindleoasis.jpkindleoasis.orgkindleoasis.uskindleoasisnews.comkindleproject.comamazonprimevideo.cn +cn#amazonprimevideo.com.cn +cnamazonprimevideos.comamazonvideo.ccamazonvideo.comprime-video.com primevideo.ccprimevideo.comprimevideo.infoprimevideo.org primevideo.tv+images-cn.ssl-images-amazon.com +cn-!images-cn-8.ssl-images-amazon.com +cn amd.comamdfanstore.com +radeon.comiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +adscalendarserver.orgapple-cloudkit.com cups.orgdeveloper.apple.comdevimages-cdn.apple.comdevstreaming-cdn.apple.comfoundationdb.orgmacosforge.org macruby.com macruby.net macruby.orgapple-mapkit.complaygrounds-cdn.apple.com carekit.orgresearchandcare.orgresearchkit.cn +cnresearchkit.com.cn +cnresearchkit.hkresearchkit.netresearchkit.orgresearchkit.tvservicetalk.io +webkit.org webkitgtk.org wpewebkit.orgwebobjects.com-)appleworldwidedeveloper.hb-api.omtrdc.net)%appleworldwidedeveloper.sc.omtrdc.net#p-events-delivery.akamaized.net100beatscheap.com1monsterbeatsbydreus.com2013beatsbydrdreonline.com2013beatsbydrdreshop.com2013beatsbydreshop.com2013beatshdcybermonday.com2013cheapestbeats.com2013newbeatsworld.com2013pascherbeatsbydre.com2014cheapbeatsbydre.com 2beatsdre.com2buybeatsbydre.com2drdrebeats.com40shopping.com4beatsbydre.com5beatsbydre.comaaagradeheadphones.com +aanaan.comabcheadphones.comabeatsbydrdre.com aeasyshop.com +airmay.com +ajtalk.com albeats.com annstores.netaokwholesale.netaucheapbeats.comaudiobeatsau.comaudiobeatsbydre.comaudiomonsterbeatsonline.comauricularemonsterbeats.com#auricularesbeatsbaratosshop.comauricularesbeatsmarkt.comausbeatsbydrdre.combag-glasses1.com bandgirlz.com baxsound.com bbestmall.com +beatbd.combeatbydre2013.combeatbydremonster.com!beatbydreheadphonesonsale.combeatbydrekopen.combeatbydreuk2014.combeatdrdres.combeatfactoryoutlets.combeatmonstersaustralia.netbeats-by-dre-australia.combeats-bydrdre.netbeats-bydre-mall.combeats-bydrecheapsale.combeats-bydreoutletonline.combeats-bydreoutletsale.combeats-bydreoutletsale.netbeats-bydreoutletssale.netbeats-bydrestore.combeats-bydreuk.combeats-deal.combeats-dre-us.com"beats-headphones-buy-cheap.combeats-headphones.usbeats-sale.combeats-seller.combeats-soaho.com  beats1.cc beats1.cn +cn  beats1.tv beats1.com.cn +cn beats123.com beats2.com.cn +cn beats4.cn +cn +beats4.netbeats4outlets.combeats4salecheap.combeatsallsale.combeatsaudifonos.combeatsaudiobydre.combeatsaudiobydre.netbeatsaudios.netbeatsbeatsmonster.combeatsbestdeals.combeatsblackfridaydeals.netbeatsblackfridayretails.combeatsboxingdayuksale.combeatsbydrdre-headphones.combeatsbydrdre-officials5.combeatsbydrdre-online.combeatsbydrdre-onsale.combeatsbydrdre-store.combeatsbydrdre-store.usbeatsbydrdre4sale.combeatsbydrdrebiz.combeatsbydrdrecustom.combeatsbydrdredanmark.combeatsbydrdremall.combeatsbydrdreoutlet.combeatsbydrdres.combeatsbydrdresale.netbeatsbydrdrestore.combeatsbydrdreus.com!beatsbydre-beatsheadphone.combeatsbydre-chen.combeatsbydre-club.combeatsbydre-headphones.com!beatsbydre-headphonesshop.combeatsbydre-mall.combeatsbydre-outlet.combeatsbydre-outletsale.netbeatsbydre-outletstore.combeatsbydre-sell.combeatsbydre-store.combeatsbydre-studio.combeatsbydre-us.com beatsbydre.jpbeatsbydre2081.combeatsbydre411.combeatsbydre4usales.combeatsbydreauofficial.combeatsbydreausale.net beatsbydreaustralia-sale.com!beatsbydreaustraliaonline.com"beatsbydreaustraliaonlines.com beatsbydreaustraliasales.combeatsbydrebeatsby.com!beatsbydreblackfriday2013.com beatsbydreblackfridaypro.combeatsbydreboxingdayca.combeatsbydrecasquesfr.com#beatsbydrecheap-outletstore.combeatsbydrecheaper.com"beatsbydrecheaponlinesales.combeatsbydrecolors.com beatsbydrecustomwireless.com&"beatsbydrecybermondaydeals2013.com&"beatsbydrecybermondaydeals2013.netbeatsbydredanmarks.com"beatsbydredealsblackfriday.com"beatsbydredealscybermonday.combeatsbydrediscount.com beatsbydrediscountonline.netbeatsbydredr.combeatsbydreexecutivesale.com beatsbydreformall2013-nl.com beatsbydreforsalesonline.com beatsbydreforshop2013-nl.combeatsbydreforstore.combeatsbydreforyououtlet.combeatsbydrefr.com!beatsbydrefrcasquepascher.combeatsbydrefriday.combeatsbydregot.combeatsbydrehd.combeatsbydrehd.netbeatsbydreheadphones-nz.combeatsbydreheadphonesolo.combeatsbydrehut.combeatsbydreinexpensive.combeatsbydreireland-sales.com beatsbydreirelandonlines.combeatsbydreirelandsale.com beatsbydreirelandsonline.combeatsbydremall2013.com"beatsbydremonsteraustralia.combeatsbydrenls.combeatsbydrenorge1.net!beatsbydreofficialdanmark.combeatsbydreoksale.combeatsbydreol.combeatsbydreonlie2013-nl.com!beatsbydreonlines-ireland.combeatsbydreonlines-uk.combeatsbydreonlinesale-nz.combeatsbydreoordopjes.combeatsbydreoslo.combeatsbydreoutletsale.combeatsbydreoutletscheap.combeatsbydrerealstore.combeatsbydres-shop.combeatsbydresale-uk.combeatsbydresalemall2013.combeatsbydresales.us'#beatsbydresalesonline-australia.com beatsbydresaleonlines-nz.combeatsbydresdanmark.netbeatsbydreshop-uk.combeatsbydreshops.netbeatsbydresingapores.combeatsbydresingaporesale.combeatsbydrespeakers.combeatsbydresold.com%!beatsbydresolohdonline-canada.combeatsbydresonline-nz.combeatsbydrestorevip.combeatsbydressale.combeatsbydressolo.combeatsbydresstudio.com"beatsbydrestudio-australia.combeatsbydrestudio.combeatsbydretoutlet.combeatsbydreuk.combeatsbydreuk.netbeatsbydreus.combeatsbydrevipde.combeatsbydrew.combeatsbydrsmonsterinusa.combeatsbymusic.netbeatsbysdrbre.combeatsbysdrdres.combeatscasque-france.combeatscheap-nz.combeatscheap-uk.combeatscheapforsale.combeatscollection2014.combeatscustomblackfriday.combeatsdanmark2013.combeatsdrdre-headphones.combeatsdrdre-it.combeatsdrdre-solo.combeatsdrdre2014.combeatsdrdrecuffie.netbeatsdrdrekaufenschweiz.netbeatsdrdreneon.combeatsdre-monster.com beatsdre.netbeatsdre4cheap.combeatsdrecheap.combeatsdredreheadphones.combeatsdreforsale.combeatsdreinau.combeatsdremonster-uk.com!beatsdrenewcolorful4usale.combeatsdreoutletsale.combeatsdresale2013.combeatsdresalestore.combeatsdresolo2013.combeatsdreus.combeatsearbudsheadphoness.combeatsfacstore.combeatsfactoroutlets.combeatsfactorycollection.combeatsfactoryoutles.combeatsforcheap-usa.combeatsforme.combeatsfranceofficiel.combeatselectronic.netbeatselectronics.com +beatsep.cn +cn beatsep.com beatsep.net beatsheadphones-discount.combeatsheadphones1.combeatsheadphones2u.combeatsheadphonesale.combeatsheadphonesdealer.combeatsheadphonesforcheap.netbeatsheadphonesonline.combeatsheadphoness.combeatsheadphonestudio.combeatsheadphonesusamall.combestshoesale2014.netbeatshopuk.combeatsincanada.combeatsinsingapore.combeatsireland.net beatsjoy.combeatsmonstersales.combeatsmusic.combeatsmusic.wang beatsneon.combeatsnzsale.com beatsodre.combeatsofdre-usa.combeatsonblackfriday2013.com beatsone.netbeatsoutlet.netbeatsoutletanytime.combeatsoutletonlines.combeatspascher-bydre.combeatspascher-fr.netbeatspascher.netbeatspaschers.netbeatspillnewcolor.combeatspills.combeatspromonsterjp.combeatspromotions.combeatssales.combeatssaleus.combeatssaustraliabuy.combeatssbyaustralia.combeatssbydredanmark.combeatsshop-uk.combeatsshop-usa.combeatsshopstore.combeatssingapores.combeatssingaporeshop.com beatsstudiohodetelefoner.combeatsstudiosite.combeatstoreusa.com beatsua.combeatswholesale.usbeatswirelesscheap.combeatswirelesscuffie.combegin-trade.combestbeats4u.com +biitii.comblackfridaydrebeatsnew.comblackfridaydrebeatsshop.combloommicroventures.com bookonsky.net +bossae.combrandeasygo.combrandelectronic.combrandproducts1688.com brands098.combusinesswebwise.combuy-from-shanghai.combuybeatsbydre-uk.combuybeatsheadphonesbydre.combuycheapbeatsbus.combuycheapbeatsbydre.combuycheapbeatsbydreshop.combuycheapbeatsdreuk.combuydrdrebeatbox.combuyminibeatbox.combuyonlineheadphones.combuyshoponly.combuzzardflapper.combybeatsdre.combydrebeats.comcanada-beatsbydre.com casque-fr.com casquebeatsbydrdresolohd.comcasquebeatsdocteurdre.comcasquebeatsdre2013.comcasquebeatsenligne.comcasquebeatsfracheter.comcasquebeatsmer.netcasquebeatsofficiel-fr.comcasquebeatspascher2013.comcasquebeatssolo.netcasquedrdrebeatssfr.comcasquemonsterbeats.com#casquemonsterbeatsbydre2013.comcasquesbeatsaudio.comcheap-beats-by-dre.netcheap-beatsbydre.comcheapbagshoes.com cheapbeats.uscheapbeats365.comcheapbeats4sale.netcheapbeatsaustraliasale.comcheapbeatsbus.comcheapbeatsbydr.comcheapbeatsbydrdrepro.comcheapbeatsbydre-au.comcheapbeatsbydre99.comcheapbeatsbydrefau.comcheapbeatsbydremall.comcheapbeatsbydremonster.comcheapbeatsbydrenz.netcheapbeatsbydreonsale.com cheapbeatsbydreoutlet-nz.comcheapbeatsbydreoutlet.com"cheapbeatsbydreoutlets2013.comcheapbeatsbydresale.comcheapbeatsbydreshop.comcheapbeatsdrdresolo.com$ cheapbeatsbydrestudioedition.com"cheapbeatsbydrestudioutlet.comcheapbeatsdrestudios.comcheapbeatsheadphone2014.comcheapbeatsheadphones.uscheapbeatsie.comcheapbeatsla.comcheapbeatssale4u.comcheapbeatsshopbydre.comcheapcustombeatsbydre.comcheapdrdrebeats8.comcheapdrdrebeatsca.comcheapdrebeats8.netcheaperbeatsbydresale.comcheapestbeatsdrdre.comcheapheadphonesland.comcheapheadphonessale.comcheapheadsetmall.comcheapheadsetshop.com cheapmonsterbeatsbydrdre.com!cheapmonsterbeatsheadsets.com cheapmonstersbeatsonsale.comcheapmonsterbeatssale.comcheapmonsterbeatsusa.uscheapnewbeatsbydre.comcheapsalemonster.comcheapshoesvip.comcheapwireless04.comcheapwirelessbeats.comcheerwholesale.uschihair-straightener.comchinaclothesstore.comciattackers.com +cmhalq.com cnshopin.comcoolmonster.netcozydrdrebeats.com cqcorea.comcuffiesaldi.comcustombeatsbydrebuy.comcustombeatsdeals.comcustombeatsforcheap.comcustombeatsny.comcustombeatssbydreus.comcustomdrdrebeats.comcustomizedbeatbydre.comcustomizedbeatsbydre.comcustomizedbeatsdre.comcybermondaybeats4sale.comdanemarket.comdanmarkbeatsbydrdre.comdctbeatsbydre.comdealsbeatsblackfriday.comdetaliczny.comdiscountbeatsbydre-us.comdiscountbeatsstore.comdkbeatsbydre.comdrbeatsukmart.comdrdre-beats.comdrdrebeats-chen.comdrdrebeats-headphone.comdrdrebeats-usa.comdrdrebeatsale.comdrdrebeatsbillig.comdrdrebeatsdesale.comdrdrebeatsdiscount.comdrdrebeatsforu.comdrdrebeatsretail2013.comdrdrebeatssale7.comdrdrebeatsuk.comdrdreheadphonebeats.comdrdreheadphonekey.comdrdreheadphonesusstore.comdrdremonster-beats.comdrdremonsterdre.comdrdreprobeatssale.com drdrefnac.comdrebeats-australia.comdrebeats-france.comdrebeats-monster.com!drebeats-monsteraustralia.comdrebeats-monsterusa.comdrebeats-singapore.comdrebeats-singapore.netdrebeats-singaporecheap.comdrebeats-singaporecheap.netdrebeats-solo.comdrebeats-studio.comdrebeatsaustralia-cheap.comdrebeatsaustralia-cheap.netdrebeatsbuy.comdrebeatsbydreoutlet.comdrebeatscanada.comdrebeatsdeutschland.netdrebeatsforsaleus.comdrebeatsheadphones-nz.comdrebeatshome.comdrebeatsoutletstore.comdrebeatsoldes.comdrebeatspill.comdrebeatssite.com#drebeatssolocybermondaysale.comdrebeatsstudio2013.comdrebeatstudio.com drebyby.comdremonsterbeatsoutlets.comdreprobeats.com dreprofy.com +dtsell.comearphonescheapest.comebuyheadphones.comesbeatsbydrebuy.cometheadphones.comfamosascalvas.comfindmybeats.comfr-beatsbydrestore.comfrancecasquebeatssolde.comfrcasquesbeats.com free-aa.com free-sns.com frishoes.comgamebeforethegame.comgetdrebeatssale.comgmnetworks.net gobeatsye.comgobuyonlinestore.net goodsdunk.netheadphonepubs.comheadphones-cool.comheadphones-dre.com headphones-outlet-online.comheadphonesbeatsaudio.comheadphonesbeatsbydre.comheadphoneses.comheadphoneshome.comheadphoneshotsales.comheadphonesol.comheadphonesretailer.comheadphonessupply.comheadphonezip.comheadset987.comhellokittybeats.com highbolt.net highdefinitionbeatsbydre.com hipaa6020.com hipzoom.nethonawalaan.comhotbeatsonsale.comhotmonsterbeats.comhottestheadphonesonline.com  hrsaz.com ibeats-uk.comibeatsbydre.ccibeatsbydre.comigoshopping.net illianacomputerrecycling.comimonsterbeats.comincentivetravelgifts.comioffergift.com islamiccenterofnewlondon.comitaliabeatsbydrdre.com jkbeats.comkickshatchannel.comkobbeatssbydredk.comkopfhorergunstigshop.comleecountytimes.com lexuemei.comlovebeatsdr.com lovemarca.comluckyissue.com +lyzsxx.com mairbeats.com +makeeu.commallheadphone.commbeats-tech.commbheadphone.com +micstl.commmonsterheadphones.netmonbeats2013.commonster-beats-by-dr-dre.com monster-beats-headphones.commonsterbeats-cheap.commonsterbeats-headphone.commonsterbeats-onsale.commonsterbeats-solo.commonsterbeats-solo.netmonsterbeats365buy.commonsterbeats8beatsbydre.commonsterbeatsale.commonsterbeatsalestore.commonsterbeatssalg.commonsterbeatsau.commonsterbeatsbydrdre-nz.commonsterbeatsbydrdre-usa.com!monsterbeatsbydrdrecanada.com!monsterbeatsbydrdrestudio.commonsterbeatsbydre-nz.commonsterbeatsbydre-usa.commonsterbeatsbydre2015.com'#monsterbeatsbydreaustraliacheap.com!monsterbeatsbydrebilligde.com monsterbeatsbydrefactory.commonsterbeatsbydrenew.commonsterbeatsbydres.commonsterbeatsbydreshop.commonsterbeatscasques.commonsterbeatscommunity.commonsterbeatsdrdrecheap.commonsterbeatsfactory.netmonsterbeatsfinland.commonsterbeatsforsale.commonsterbeatsheadphone.commonsterbeatsheadphones.netmonsterbeatshere.commonsterbeatsitaly.commonsterbeatsmall.commonsterbeatsnegozi.netmonsterbeatsok.com!monsterbeatsonlinestoreuk.commonsterbeatsoutlet.usmonsterbeatspascher.netmonsterbeatsru.commonsterbeatssales.commonsterbeatsshops.netmonsterbeatsstore.com#monsterbeatssydneyaustralia.commonsterbeatstang.commonsterbeatstienda.commonsterbeatstudio.commonsterbydrebeat.com!monstercasquebeatspascher.netmonstercheapbeatss.commonsterdrebeats-canada.netmonsterdrebeats-usa.commonsterdrebeats-usa.netmonsterheadphone.netmonsterproduct.netmonstersbeatbydres.commonstersdebea.commonstershopcheapbeats.netmoreheadphones.com +ms4dre.commybeatsbydrestudio.commybeatsbydreuk.commybeatscheapbydre.commyferrariheadphones.comnamemybeats.com neborder.comnegozimonsterbeats.comnegoziomonsterbeats.comnewbeatsblackfriday.com newbemany.comnewdrediscount.comnewestbeatsbydre.comnewlysprung.netnewmonst1erbeatsto1re.com!newmonsterbeatsheadphones.comnewschristmasshopping.comnflhotsalejerseys.com nicesshop.netofferairjordanlebron.comofficialbeatsbydreshop.comofficialbeatsbydrestore.comofficialdrdre.comofficialheadphone.com ogameblog.comonbeatsbydresale.com onlinemonsterbeatsonsale.com onsalekey.comonsaletrend.comoutletbeatsshop.compascherbeatsmonster.compaulsimon-music.comperfectkickz.netpersoneelsland.compicknicekicks.netpickshoesclothes.com pillbeatsblackfridaysale.compocketbiketrader.compowerbeats2wireless.compowerbeatsbydrdre.compowerbeatsbydre.compromonsterbeatsbydre.comprostudiobeatscybersale.com  rbsgr.comrepsneakermall.com repswing.com!salebeatslasteststyle4you.comsaleblackfridaydrebeats.comsalecheaphandbags.com samebags.com sanvaras.com +scnshop.cc +shoers.com shoestop2.comshop-headphones.netshopbeatsdre.com shopbydre.comshopcustomizedbeats.comshopdrebeats.comshopmonsterbeats.comshopping-days.netshoppinguheadphones.comsneaker666.comsneakerpage.netsneakerskick.comsolostudioksale.com soso7778.comspecialtyheadphones.comspiritclubs.comstraightouttasomewhere.comstudiobeatsbydrdre.comsulwerphoto.comsunglassessale2014.comsuperearsenjoy.comsupplybestjerseys.comsustainthesound.comsverigebeatsbydrdre.com szcheapmonsterheadphones.comszwinnertechnology.com takegoto.comthe-monster-beats.comthebeatsbydre.comthebeatsbydre.netthebeatsheadphonesale.com +theuab.nettopbeatsbydrdreoutlet.comtopbeatsdealer.comtopbeatsforsale.com tradevip1.com tteshop.com ubnw.net +unstyle.us&"usa-beatsbydreheadphonesonsale.net  v-has.com vip-beats.comvipbeatsbydre.comvipheadphones.com vipshoes2.com  wasdj.comwholesale-exporter1.comwholesalediscountpurses.comwholesalefine.comwholesaleonlinemart.comworldcoinpay.comyourmonsterbeats.com%!beatselectronicsllc.tt.omtrdc.netapple-icloud.cn +cnappleicloud.cn +cnapplemx-icloud.comicloud-apple.cn +cnicloud-content.comicloud-isupport.com  icloud.ch +icloud.com icloud.com.cn +cn  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.jp  icloud.lv icloud.net.cn +cn  icloud.om +icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloudads.neticloudapple.cn +cn icloudbox.neticloudbrowser.net icloude.comicloudhome.comicloudmail.neticloudmusic.net icloudnet.net icloudpay.net icloudo.com +icloudo.de icloudo.net icloudos.de icloudos.neticloudsecure.neticloudsetup.comios-icloud.com +me.com myicloud.net mylcloud.net wwwicloud.com!www-cdn.icloud.com.akadns.net!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.comapple-itunes.cn +cn itun.es itunbes.com ituneas.comitunes-apple.cn +cnitunes-radio.net  itunes.ca  itunes.co itunes.co.th +itunes.com  itunes.hk  itunes.mx itunes.org -itunes.rioitunesessentials.comitunesfestivals.comituneslatino.comituneslogin.netitunesmatch.comitunesradio.rioitunesstore.co itunesu.comitunes-apple.com.akadns.net  swift.org apple apple.ae apple.at apple.be apple.bg apple.bs apple.ca apple.ch apple.cl apple.cm apple.co.cr apple.co.hu apple.co.jp apple.co.kr apple.co.mz apple.co.nz apple.co.th apple.co.uk  apple.com apple.com.af apple.com.au apple.com.bo apple.com.br apple.com.co apple.com.de apple.com.do apple.com.gr apple.com.jm apple.com.lk apple.com.mg apple.com.mx apple.com.my apple.com.pa apple.com.pe apple.com.pl apple.com.pr apple.com.pt apple.com.py apple.com.sg apple.com.sv apple.com.tr apple.com.tw apple.com.uy apple.cz apple.de apple.dk apple.ee apple.es apple.eu apple.fi apple.fr apple.hamburg apple.hn apple.hr apple.hu apple.ie apple.in apple.is apple.it apple.jo apple.kr apple.lk apple.lt apple.lv apple.me apple.my  apple.net apple.net.gr apple.nl apple.no apple.pk apple.pl apple.pt apple.ro apple.rs apple.ru apple.sa apple.se apple.sg apple.si apple.sk apple.so apple.tt apple.uk  apple.xyz applestore.bg applestore.ch applestore.cmapplestore.co.huapplestore.co.jpapplestore.co.ugapplestore.co.ukapplestore.com.auapplestore.com.bnapplestore.com.eeapplestore.com.egapplestore.com.grapplestore.com.hkapplestore.com.hrapplestore.com.joapplestore.com.myapplestore.com.phapplestore.com.plapplestore.com.ptapplestore.com.roapplestore.com.ruapplestore.com.snapplestore.com.tw applestore.de applestore.hk applestore.kr applestore.meapplestore.net.gr applestore.ph applestore.qa applestore.sgapplestorepro.eu  appsto.reappstore.co.id appstore.hk appstore.my appstore.ph asto.reimac-apple.comimac-applecomputer.com imac.co -imac.co.nz imac.com imac.eu imac.gr imac.one imac.rs imacapple.comimacapplecomputer.com euroipad.com indiaipad.com -ipad.co.kr ipad.de  ipad.host  ipad3.com +itunes.rio  itunes.usitunes12days.comitunesapple.cn +cnitunesessentials.comitunesfestivals.comitunesiradio.comituneslatino.comituneslogin.netitunesmatch.comitunesparty.comitunesradio.cn +cnitunesradio.comitunesradio.com.cn +cnitunesradio.rioitunesradio.tvitunesradio.twitunesstore.co itunesu.com itunesu.net iutunes.com wwwitunes.comitunes-apple.com.akadns.netappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cn apple apple.ae apple.at apple.be apple.bg apple.bs apple.ca apple.ch apple.cl apple.cmapple.cn +cn apple.co apple.co.cr apple.co.hu apple.co.jp apple.co.kr apple.co.mz apple.co.nz apple.co.th apple.co.uk  apple.com apple.com.af apple.com.au apple.com.bo apple.com.br apple.com.cn +cn apple.com.co apple.com.de apple.com.do apple.com.gr apple.com.gy apple.com.jm apple.com.lk apple.com.mg apple.com.mx apple.com.my apple.com.pa apple.com.pe apple.com.pl apple.com.pr apple.com.pt apple.com.py apple.com.sg apple.com.sv apple.com.tr apple.com.tw apple.com.uy apple.cz apple.de apple.dk apple.ee apple.es apple.eu apple.fi apple.fr apple.hamburg apple.hn apple.hr apple.hu apple.ie apple.in apple.is apple.it apple.jo apple.jp apple.kr apple.lk apple.lt apple.lv apple.me apple.my  apple.net apple.net.gr apple.nl apple.no apple.pk apple.pl apple.pt apple.ro apple.rs apple.ru apple.sa apple.se apple.sg apple.si apple.sk apple.so apple.tt apple.tw apple.uk apple.usapple.xn--czr694bapple.xn--fiqs8s  apple.xyz aplestore.comapple-store.cn +cnapple-store.netapple-store.wang applestor.com applestore.bg applestore.cc applestore.ch applestore.cm applestore.cn +cnapplestore.co.huapplestore.co.jpapplestore.co.ugapplestore.co.ukapplestore.comapplestore.com.auapplestore.com.bnapplestore.com.cn +cnapplestore.com.eeapplestore.com.egapplestore.com.grapplestore.com.hkapplestore.com.hrapplestore.com.joapplestore.com.myapplestore.com.phapplestore.com.plapplestore.com.ptapplestore.com.roapplestore.com.ruapplestore.com.snapplestore.com.tw applestore.de applestore.hk applestore.kr applestore.meapplestore.netapplestore.net.gr applestore.ph applestore.qa applestore.sgapplestore.wangapplestoreonline.comapplestorepro.euonlineapplestore.comapp-store.wangappe-store.comapple-appstore.cn +cnappleappstore.cn +cnappleappstore.netappleappstore.tv  appsto.reappstore.co.id appstore.hk appstore.my appstore.phappstoreapple.cn +cn asto.retvappstore.netapple-imac.com appleimac.comimac-apple.comimac-applecomputer.com imac.co +imac.co.nz imac.com imac.eu imac.gr imac.one imac.rs imacapple.comimacapplecomputer.comebookforipad.com euroipad.comfindmyipad.com indiaipad.com +ipad.co.kr ipad.de  ipad.host  ipad.wang  ipad3.com ipadair.cl ipadair.cmipadair.com.bripadair.com.es ipadair.fr @@ -4512,87 +7113,381 @@ ipadair.hk ipadair.ie ipadair.jp ipadair.twipadaustralia.com ipadmini.cmipadmini.com.lk ipadmini.lk ipadpro.buzz -ukipad.comappleiphone.hu  iphone.cm -iphone.com iphone.com.au iphone.com.gr  iphone.es iphone.host iphone.net.gr  iphone.pt  iphone.rs  iphone.ru iphone4.comiphone4.com.br iphone4s.comiphoneacessorios.com.briphoneclaro.com.br iphonefc.comiphonegermany.com ipod.ca ipod.ch ipod.cm ipod.co +ukipad.comappleiphone.huappleiphone.netappleiphonecell.combestiphonestuff.comcooliphonecasesstore.comcustom-iphonecase.comdesigneriphonescases.com dl-iphone.comfundaiphone5s.com hebiphone.com hf-iphone.com +iphine.comiphone-8.com.cn +cn iphone-cd.com iphone-cn.com iphone-sh.comiphone-vip1.comiphone-vip2.comiphone-vip3.comiphone-vip4.comiphone-vip5.com iphone-x.tv iphone-yh.com iphone-zh.com  iphone.cm +iphone.com iphone.com.au iphone.com.gr  iphone.es iphone.host iphone.net.gr  iphone.pt  iphone.rs  iphone.ru iphone.wang iphone4.comiphone4.com.br iphone4s.com iphone5.comiphone5casescovers.comiphone5s5case.comiphoneacessorios.com.briphonecase2013.comiphonecase5.comiphonecases100.comiphonecases5.comiphoneclaro.com.briphonecollcase.com iphonefc.comiphonegermany.comiphonehangzhou.comiphoneimessage.comiphoneplus.wang iphonerip.net iphonese.tviphoneunlockimei.com iphonexs.tvonlyiphone5case.comaplleipods.comappleclassicipod.comdownloadsforipod.com ipod.ca ipod.ch ipod.cm ipod.co ipod.co.nz ipod.co.uk -ipod.co.za ipod.com ipod.com.au ipod.com.fr ipod.com.hk ipod.com.sg ipod.de ipod.es ipod.eu ipod.fr ipod.gr ipod.hk ipod.is ipod.no ipod.pk ipod.rs ipod.ru ipod.tw ipodcentre.nlipodcleaner.com ipodnano.comipodprices.com -ipodrip.caipodrocks.com.au  ipods.comipodshop.com.au ipodtouch.co +ipod.co.za ipod.com ipod.com.au ipod.com.cn +cn ipod.com.fr ipod.com.hk ipod.com.sg ipod.com.tw ipod.de ipod.es ipod.eu ipod.fr ipod.gr ipod.hk ipod.is ipod.net ipod.no ipod.pk ipod.rs ipod.ru ipod.tw ipodcentre.nlipodcleaner.comipoditouch.com ipodnano.com ipodnano.netipodprices.com +ipodrip.caipodrocks.com.au  ipods.comipodshop.com.au ipodtouch.co ipodtouch.com +myipod.netoffrezdesipods.comsimplyipod.comwwwipodlounge.comimacsources.comlaunchpad.wang mac.wang macbook.co macbook.hk -macbook.twmacbookair.co.krmacbookair.co.ukmacbookair.commacbookair.com.aumacbookair.com.es macbookair.es macbookair.hk macbookair.kr macbookair.jp macbookpro.comacbookpro.commacbookpro.com.au macbookpro.usapplemusic.berlinapplemusic.comapplemusic.com.auapplemusic.hamburgapplemusicfestival.comappleenews.comapplenews.berlinapplenews.hamburg apple-pay.rsapplepay.berlinapplepay.co.rsapplepay.hamburg applepay.info applepay.rs!applepaymerchantsupplies.infoapplepaysupplies.berlinapplepaysupplies.info ibook.co.nz ibook.euibookpartner.com  iphoto.eu  iphoto.no  iphoto.se  imovie.euimoviegallery.comimoviestage.comapplecare.berlin applecare.cc applecare.euapplecare.hamburg1to1computing.com.au1to1conference.com.auairport.brussels -airport.euairsupportapp.com airtunes.infoalchemysynth.comapple-cloudkit.comapple-darwin.comapple-darwin.netapple-darwin.org apple-dns.netapple-enews.comapple-expo.com apple-expo.eu apple-hk.com apple-inc.netapple-watch.com.ruappleaustralia.comappleaustralia.com.auappleaustralia.net.auapplecarbon.comapplecentar.co.rsapplecentar.rsapplecentre.com.auapplecentre.infoappleclub.com.hk applecom.comapplecomputer-imac.comapplecomputer.co.inapplecomputer.co.nzapplecomputer.com.hkapplecomputer.com.twapplecomputer.huapplecomputer.krapplecomputerimac.comapplecomputerinc.infoapplecomputers.co.nzappledarwin.comappledarwin.net appleexpo.euappleexpo.infoapplefilmaker.comapplefilmmaker.comapplefinalcutproworld.comapplefinalcutproworld.netapplefinalcutproworld.orgapplehongkong.comapplehongkong.com.hkappleid.berlinappleid.hamburgappleipodsettlement.comappleiservices.comapplemalaysia.com.myapplemasters.infoapplepodcasts.comapplepremiumreseller.com.au applepremiumresellers.com.auapplereach.comapplereach.net apples-msk.ruapplescript.infoappleshare.infoappleshop.co.ukappletaiwan.com -appletv.fr appleweb.net applexpo.netappmediagroup.combraeburncapital.com burstly.netburstlyrewards.com buyaapl.com buyaapl.net buyaple.comcalendarserver.org camelphat.comcamelspaceeffect.com carekit.org cdn-apple.com  chomp.com cups.orgdarwinsource.comdarwinsource.orgdarwinsourcecode.comdesktopmovie.comdesktopmovie.netdesktopmovie.orgdesktopmovies.netdesktopmovies.orgdigitalhub.com +macbook.tw macbook.wang macbookair.cn +cnmacbookair.co.krmacbookair.co.ukmacbookair.commacbookair.com.aumacbookair.com.cn +cnmacbookair.com.es macbookair.es macbookair.hk macbookair.kr macbookair.jpmacbookair.net macbookpro.comacbookpro.commacbookpro.com.aumacbookpro.net macbookpro.usmacbookpros.commacbooksale.comwwwmacbookair.comapple-watch.com.ru applewatch.hk applewatch.tv applewatch.twapplewatch.wangapplewatchedition.comapplewatchseries3.netapplewatchsport.comapplemusic.berlinapplemusic.comapplemusic.com.auapplemusic.hamburgapplemusic.wangapplemusicconnect.comapplemusicfestival.com musickit.netwwwapplemusic.comapple.comscoreresearch.com +apple.newsappleenews.comapplenews.berlinapplenews.hamburg applenews.tvapplenewsformat.com apple-pay.com apple-pay.rsapple-pay.wangapplepay.berlinapplepay.co.rsapplepay.com.twapplepay.hamburg applepay.hk applepay.info applepay.jp applepay.rs applepay.tvapplepaycash.cn +cnapplepaycash.com.cn +cnapplepaycash.netapplepaycash.tv!applepaymerchantsupplies.infoapplepaysupplies.berlinapplepaysupplies.cn +cnapplepaysupplies.com#applepaysupplies.com.cn +cnapplepaysupplies.infoapplepaysupplies.netapplepaysupplies.tvapplewallet.comapplewallet.tv +i-book.com +i-book.net ibook.co.nz  ibook.com ibook.eu  ibook.netibookpartner.comibooksauthor.com  iphoto.eu  iphoto.no  iphoto.se iphoto.wang  imovie.euimoviegallery.comimoviestage.comapplecare.berlin applecare.cc applecare.euapplecare.hamburgapplecare.wangappledarwin.comappledarwin.netdarwinsource.comdarwinsource.orgdarwinsourcecode.comappleaccount.netappleid-applemx.comappleid-applemx.usappleid-iclou.com appleid-uk.usappleid.berlin appleid.comappleid.hamburg +appleid.hk ids-apple.com myappleid.com appletv.com +appletv.fr appletv.wang appletv4.cn +cnappletv4.com.cn +cnappletvapp.appleappleone.audio appleone.blog appleone.chatappleone.cloud appleone.clubappleone.community appleone.filmappleone.guide appleone.hostappleone.space appleone.techappleone.website +shazam.com1to1computing.com.au1to1conference.com.au 5lml.com +a0pple.net aapl.twairport.brussels airport.com +airport.euairsupportapp.com airtunes.com airtunes.info airtunes.netalchemysynth.com  ap0le.com aple.com  apole.com +app0le.com +appl-e.com appl.com +appl4e.com  appla.comapple-darwin.comapple-darwin.netapple-darwin.org apple-dns.cn +cn apple-dns.comapple-dns.com.cn +cn apple-dns.netapple-enews.comapple-expo.com apple-expo.eu apple-hk.comapple-ibooks.cn +cn apple-inc.netapple-livephotoskit.com apple-maps.cn +cnapple-online.com apple-usa.netappleafrica.comappleantilles.comappleaustralia.comappleaustralia.com.auappleaustralia.net.au applebk.netapplecarbon.com applecard.tvapplecentar.co.rsapplecentar.rsapplecenter.cn +cnapplecenter.com.cn +cnapplecentre.com.auapplecentre.infoappleclub.com.hk applecom.comapplecomputer-imac.comapplecomputer.cn +cnapplecomputer.co.inapplecomputer.co.nzapplecomputer.com applecomputer.com.cn +cnapplecomputer.com.hkapplecomputer.com.twapplecomputer.huapplecomputer.krapplecomputerimac.comapplecomputerinc.infoapplecomputers.co.nzapplecoronavirus.com appledns.cn +cnappledns.com.cn +cn appleexpo.euappleexpo.infoapplefilmaker.comapplefilmmaker.comapplefinalcutproworld.comapplefinalcutproworld.netapplefinalcutproworld.orgapplehongkong.comapplehongkong.com.hkappleinclegal.comappleipodsettlement.comappleiservices.com applelink.comapplemagickeyboard.comapplemalaysia.com.myapplemasters.infoappleonline.comappleonline.net appleoriginalproductions.com +appleos.tvapplepencil.netapplepodcasts.comapplepremiumreseller.com.au applepremiumresellers.com.auapplereach.comapplereach.net apples-msk.ruapplescreensavers.comapplescript.infoappleshare.infoappleshop.co.uk applesiri.cn +cnapplesurveys.comappletaiwan.com appletips.net appleweb.net applexpo.net applezh.com  applf.com +applfe.com +applle.com  applw.comappmediagroup.com +appule.com  appye.com  apyle.com  beddit.tvbraeburncapital.com burstly.netburstlyrewards.com buyaapl.com buyaapl.net buyaple.com camelphat.comcamelspaceeffect.com +carbon.com catalina.hk cdn-apple.com  chomp.com +coreml.netdashwood360.comdesktopmovie.comdesktopmovie.netdesktopmovie.orgdesktopmovies.netdesktopmovies.orgdeveloper-advisor.comdevice-manager.usdigitalhub.comdiscussionsapple.com dot-mac.de  dotmac.dedvdstudiopro.bizdvdstudiopro.comdvdstudiopro.infodvdstudiopro.netdvdstudiopro.orgdvdstudiopro.us -earpod.netedu-research.org -emac.co.in emac.in  emagic.de firewire.cl firewire.eu geoport.com ichat.co.in idvd.eu  ikids.comilecture.co.nz ilife.eu ilife.grinsidemacintosh.comipa-iphone.net ischool.com itools.info iwork.sejetfuelapp.comjetfuelapps.comlojaiphone.com.br +earpod.net ecgapp.com.cn +cn +ecgapp.netedu-research.org +emac.co.in emac.in  emagic.de +eworld.com faceid99.com faceid99.netfaceidglobal.com faceshift.cn +cn facetime.netfinalcutpro.comfind-apple.com firewire.cl firewire.eu geoport.com +homepod.cn +cn +hopstop.tv ichat.co.in idvd.eu  ikids.comilecture.co.nz ilife.eu ilife.gr +ilife.wang imessage.tv insidear.cn +cninsidemacintosh.comiosinthecar.comipa-iphone.net  ipple.com ischool.com itools.info  iwork.com iwork.se +iwork.wangjetfuelapp.comjetfuelapps.comlatticedata.com livephotos.cn +cnlivephotos.com.cn +cn livephotos.tvlojaiphone.com.br mac-mini.com mac.com mac.com.au mac.eu -mac.rs macappsto.re mach-os.com mach-os.net -machos.net macintosh.eumacintoshsoftware.com macos.com.aumacosforge.org macosx.info macreach.com macreach.net mobileme.dk mzstatic.com powerbook.euquicktime.com.au quicktime.euresearchkit.orgtruedepth3d.comwebobjects.co.uk webobjects.de webobjects.euapple.com.akadns.net%!courier-push-apple.com.akadns.netpush-apple.com.akadns.net!developer.apple.com -@dev%devimages-cdn.apple.com -@dev(devstreaming-cdn.apple.com -@dev'playgrounds-cdn.apple.com -@dev atlassian.com bitbucket.org statuspage.io -trello.com trellocdn.combmwbmw-abudhabi.com bmw-asia.com bmw-dubai.com bmw-ghana.combmw-golfsport.com bmw-int1.combmw-kuwait.combmw-lebanon.com -bmw-me.combmw-motorsport.combmw-nigeria.com bmw-oman.combmw-pakistan.combmw-pma.com.sg bmw-qatar.combmw-saudiarabia.combmw-special-sales.combmw-yachtsport.com -bmw.am -bmw.bb -bmw.bg -bmw.bm -bmw.bs -bmw.by -bmw.ca -bmw.cc -bmw.ch -bmw.cl  bmw.co.ao  bmw.co.cr  bmw.co.id  bmw.co.jp  bmw.co.nz bmw.com -bmw.com.ar -bmw.com.au -bmw.com.bn -bmw.com.cn -bmw.com.kh -bmw.com.mt -bmw.com.my -bmw.com.ph -bmw.dk -bmw.ee -bmw.fi -bmw.gr -bmw.hn -bmw.ht -bmw.hu -bmw.ie -bmw.in -bmw.lc -bmw.lk -bmw.lt -bmw.lv -bmw.ma -bmw.mu -bmw.no -bmw.pl -bmw.pt -bmw.ro -bmw.se -bmw.si -bmw.sk -bmw.sn -bmw.tt -bmw.uz -bmw.vn  bmwbkk.de bmwgroup.com  bmwhk.combmwjamaica.com -bmwlat.combmwmyanmar.com mini.com canon c-ij.com canon-cee.comcanon-cmos-sensors.com canon-cna.comcanon-ebm.com.hkcanon-emea.comcanon-emirates.aecanon-europa.comcanon-europe.com canon-me.com canon-ois.qacanon-se.com.tw canon.am canon.at canon.az canon.ba canon.be canon.bg canon.ca canon.ch canon.co.il canon.co.uk canon.co.za  canon.com canon.com.al canon.com.au canon.com.by canon.com.cy canon.com.hk canon.com.mk canon.com.mt canon.com.my canon.com.tr canon.com.tw canon.cz canon.de canon.dk canon.ee canon.es canon.fi canon.fr canon.ge canon.gr canon.hr canon.hu canon.ie canon.it canon.kz canon.lt canon.lu canon.lv canon.me  canon.net canon.nl canon.no canon.pl canon.pt canon.ro canon.rs canon.ru canon.se canon.si canon.sk canon.tj canon.ua canon.uzcanonfoundation.orgcanonproprinters.com cisco  cisco.commediafiles-cisco.comstatic-cisco.comcisco.evergage.comciscolivehls-i.akamaihd.net -cloudc.one cloudcone.comdelldell-brand.com dell.com dellcdn.com facebook.br facebook.comfacebook.design facebook.net facebook.hu facebook.in facebook.nl facebook.se -fb.com fb.me  fbcdn.net  fbsbx.comm.me messenger.com -oculus.com oculuscdn.com rocksdb.orgthefacebook.com whatsapp.com whatsapp.netfbcdn-a.akamaihd.netcdninstagram.com  igcdn.com igsonar.com instagram.cominstagram-press.com  aorus.com gigabyte.comgigabyte2.azureedge.netsa78gs.wpc.edgecastcdn.net"sni1dcb6gl.wpc.edgecastcdn.net godaddy.comx.co godaddy amp.devampproject.comampproject.netampproject.org android.comandroidify.com blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn dart.dev dartlang.org dartpad.dev fastlane.cifastlane.tools flutter.devflutterapp.com go-lang.com go-lang.net go-lang.org +mac.rs macappsto.re macboxset.com mach-os.com mach-os.net +machos.net macintosh.eumacintoshsoftware.com macmini.com macos.com.aumacossierra.com macosx.infomacosxlion.com macpazar.com macreach.com macreach.net mobileme.dkmr-apple.com.tw mzstatic.com +newton.com next.com overapple.com powerbook.eupullstring.netquatrowireless.com quicktime.cc quicktime.comquicktime.com.au quicktime.eu quicktime.net quicktime.tvreform-apple.comservices-apple.net siri.com spektral.cc texture.comthinkdifferent.us +touchid.tv touchid.wangtracking-location.comtruedepth3d.com tryrating.comwebobjects.co.uk webobjects.de webobjects.euwebobjects.net wuxiapple.com wwapple.netwww-sms-apple.com wwwapple.com wwwapple.net wwwlapple.comxn--czrs0t4phtr3a.cnxn--fiqs8sxootzz.cn xn--fiqs8sxootzz.xn--hxt814e!xn--gtvq61aiijy0b.xn--hxt814exn--gtvz22d.wangxn--gtvz22d.xn--hxt814exn--hxtr4rozx.xn--czr694b xn--kput3imi374g.xn--hxt814e#xn--ohq11k7pl25iyo8a.cn +cn xn--ruq8a011kt6y.xn--hxt814e, adcdownload.apple.com.akadns.net +cn!adcdownload.apple.com +cn."amp-api-search-edge.apps.apple.com +cn"amp-api.apps.apple.com +cn aod.itunes.apple.com +cn#api-edge.apps.apple.com +cnappldnld.apple.com +cn"appldnld.g.aaplimg.com +cnapps.apple.com +cnapps.mzstatic.com +cn(apptrailers.itunes.apple.com +cn bag.itunes.apple.com +cn'bookkeeper.itunes.apple.com +cnbooks.apple.com +cn!cds-cdn.v.aaplimg.com +cn$cds.apple.com.akadns.net +cn cds.apple.com +cncl2-cn.apple.com +cn<0cl2.apple.com.edgekey.net.globalredir.akadns.net +cncl4-cn.apple.com +cn'client-api.itunes.apple.com +cn+clientflow.apple.com.akadns.net +cn clientflow.apple.com +cn cma.itunes.apple.com +cn."configuration.apple.com.akadns.net +cn#configuration.apple.com +cn!communities.apple.com +cncstat.apple.com +cn."dd-cdn.origin-apple.com.akadns.net +cn(discussionschinese.apple.com +cn(download.developer.apple.com +cnfides-pol.apple.com +cngs-loc-cn.apple.com +cngs-loc.apple.com +cn%gsp10-ssl-cn.ls.apple.com +cn!gsp11-cn.ls.apple.com +cn!gsp12-cn.ls.apple.com +cn!gsp13-cn.ls.apple.com +cnC7gsp4-cn.ls.apple.com.edgekey.net.globalredir.akadns.net +cn, gsp4-cn.ls.apple.com.edgekey.net +cn gsp4-cn.ls.apple.com +cn gsp5-cn.ls.apple.com +cn(gspe11-2-cn-ssl.ls.apple.com +cn&gspe12-cn-ssl.ls.apple.com +cn&gspe19-cn-ssl.ls.apple.com +cn-!gspe19-cn.ls-apple.com.akadns.net +cn"gspe19-cn.ls.apple.com +cn#gspe21-ssl.ls.apple.com +cngspe21.ls.apple.com +cn#gspe35-ssl.ls.apple.com +cn&gspe85-cn-ssl.ls.apple.com +cniadsdk.apple.com +cn, icloud-cdn.icloud.com.akadns.net +cn icloud.cdn-apple.com +cn'images.apple.com.akadns.net +cn?3images.apple.com.edgekey.net.globalredir.akadns.net +cnimages.apple.com +cn3'init-p01md-lb.push-apple.com.akadns.net +cn init-p01md.apple.com +cn3'init-p01st-lb.push-apple.com.akadns.net +cn%init-p01st.push.apple.com +cn3'init-s01st-lb.push-apple.com.akadns.net +cn%init-s01st.push.apple.com +cn!init.itunes.apple.com +cn$iosapps.itunes.apple.com +cn(iosapps.itunes.g.aaplimg.com +cniphone-ld.apple.com +cn'itunes-apple.com.akadns.net +cnitunes.apple.com +cn#itunesconnect.apple.com +cn"js-cdn.music.apple.com +cn km.support.apple.com +cnmaps.apple.com +cn)mesu-cdn.apple.com.akadns.net +cn+mesu-china.apple.com.akadns.net +cnmesu.apple.com +cnmusic.apple.com +cn(ocsp-lb.apple.com.akadns.net +cnocsp.apple.com +cnoscdn.apple.com +cn-!oscdn.origin-apple.com.akadns.net +cn$osxapps.itunes.apple.com +cnpancake.apple.com +cn, pancake.cdn-apple.com.akadns.net +cnpd.itunes.apple.com +cnphobos.apple.com +cn!play.itunes.apple.com +cn1%prod-support.apple-support.akadns.net +cn$se-edge.itunes.apple.com +cn se2.itunes.apple.com +cn#search.itunes.apple.com +cn1%sf-api-token-service.itunes.apple.com +cnsp.itunes.apple.com +cn4(stocks-sparkline-lb.apple.com.akadns.net +cn&stocks-sparkline.apple.com +cn>2store.apple.com.edgekey.net.globalredir.akadns.net +cn'store.apple.com.edgekey.net +cnstore.apple.com +cn2&store.storeimages.apple.com.akadns.net +cn+store.storeimages.cdn-apple.com +cn+streamingaudio.itunes.apple.com +cnsu.itunes.apple.com +cn2&support-china.apple-support.akadns.net +cnsupport.apple.com +cn."swcatalog-cdn.apple.com.akadns.net +cnswcatalog.apple.com +cnswcdn.apple.com +cnswcdn.g.aaplimg.com +cn'swdist.apple.com.akadns.net +cnswdist.apple.com +cn+swscan-cdn.apple.com.akadns.net +cnswscan.apple.com +cn!sync.itunes.apple.com +cn1%updates-http.cdn-apple.com.akadns.net +cn&updates-http.cdn-apple.com +cn upp.itunes.apple.com +cnvalid.apple.com +cn-!valid.origin-apple.com.akadns.net +cn"weather-data.apple.com +cn<0www.apple.com.edgekey.net.globalredir.akadns.net +cn%www.apple.com.edgekey.net +cn www.apple.com +cn#^a[1-5]\.mzstatic\.com$ +cn0$^cdn(-cn)?[1-4]?\.apple-mapkit\.com$ +cn9-^cl[1-5]-cdn\.origin-apple\.com\.akadns\.net$ +cn!^cl[1-5]\.apple\.com$ +cn+^is[1-5](-ssl)?\.mzstatic\.com$ +cn$^s[1-5]?\.mzstatic\.com$ +cnapple.com.akadns.net%!courier-push-apple.com.akadns.netpush-apple.com.akadns.net asus.com asus.com.cn +cn atlassian.com bitbucket.org statuspage.io +trello.com trellocdn.comaccbusiness.com +atandt.comatt-bundles.com att-japan.com att-mail.comatt-promotions.com att-rsvp.comatt.cn +cn att.com att.jobs att.net +att.tvattalascom.comattbelieves.comattbusiness.net attcenter.comattcollaborate.com +attcorp.cn +cnattexperts.com attglobal.netattinnovationspace.comattinternetservice.com +attjoy.comattnetclient.comattonlineoffers.com attproxy.comattpublicpolicy.comattpurchasing.comattsavings.comattspecial.com +attssl.comattstadium.comattsuppliers.com atttvnow.comattuverseoffers.comattuverseonline.com attvoip.com attwifi.comattwirelessinternet.comattwirelessonline.comattwirelesssolutions.com bellsouth.net +budatt.com +cobatt.com currently.com currently.netdirectvbusinessmarket.comenterprisepaging.com itcanwait.com mymmode.comnaturalvoices.comnettyinternet.comopenapiplatform.comopenapiservice.compatentgold.netpaygonline.comraponlinereview.com signalbar.comsundayready.com synaptic.netthanksloyalty.com tvpromise.com +uverse.comwebhosting.com att-idns.net +attdns.com +attdns.netna-att-idns.netaudiencenetwork.comaudiencenetwork.tvcabletvdirectv.com dierectv.com +dirctv.com direcpath.com direcpath.netdirecttv-deals.tvdirecttv-dish.com dkrecttv.com directtv.netdirecttvdeals.tvdirecttvreviews.comdirectv-4-you.comdirectv-newyork.com directv.comdirectvadsales.comdirectvatlantaga.comdirectvboston.comdirectvbundles.comdirectvbusiness.comdirectvcincinnatioh.comdirectvcinema.comdirectvconnect.comdirectvcookevilletn.comdirectvcrossvilletn.comdirectvdealer.comdirectvdeals.comdirectvdealsnow.com directvdsl.tvdirectvforhotels.comdirectvgrandslam.comdirectvhouston.comdirectvinternet.comdirectvkentucky.comdirectvlebanontn.comdirectvlosangeles.comdirectvmetropolisil.comdirectvmonitoring.comdirectvmurfreesborotn.comdirectvnewhampshire.comdirectvnow.comdirectvoffercodes.comdirectvonline.comdirectvplans.comdirectvpomise.comdirectvpromise.comdirectvpromotions.comdirectvrebate.comdirectvrichmond.comdirectvsavings.comdirectvsports.comdirectvsundayticket.com direectv.com +diretv.comdtv2009offers.comfreedirecttvspecial.com getdirect.tv hddirectv.com le-direct.tvmydirectgroove.commydirectvchannels.comredzonechannel.com txdirectv.com  xandr.combandwagonhost.com bwh1.net bwh8.net  bwh88.net canon c-ij.com canon-cee.comcanon-cmos-sensors.com canon-cna.comcanon-ebm.com.hkcanon-emea.comcanon-emirates.aecanon-europa.comcanon-europe.com canon-me.com canon-ois.qacanon-se.com.tw canon.am canon.at canon.az canon.ba canon.be canon.bg canon.ca canon.chcanon.cn +cn canon.co.il canon.co.uk canon.co.za  canon.com canon.com.al canon.com.au canon.com.by canon.com.cn +cn canon.com.cy canon.com.hk canon.com.mk canon.com.mt canon.com.my canon.com.tr canon.com.tw canon.cz canon.de canon.dk canon.ee canon.es canon.fi canon.fr canon.ge canon.gr canon.hr canon.hu canon.ie canon.it canon.kz canon.lt canon.lu canon.lv canon.me  canon.net canon.nl canon.no canon.pl canon.pt canon.ro canon.rs canon.ru canon.se canon.si canon.sk canon.tj canon.ua canon.uzcanonfoundation.orgcanonproprinters.com webex.ca webex.co.in webex.co.it webex.co.jp webex.co.kr webex.co.nz webex.co.uk  webex.com webex.com.au webex.com.br webex.com.cn +cn webex.com.hk webex.com.mx webex.de webex.es webex.fr ciscoacademynetriders.comcciernslabs.comcciesecuritylabs.comccievoicelabs.com  ccna5.netcisco-returns.comcisco-warrantyfinder.comcisco.cn +cn  cisco.com cisco.com.cn +cn +cisco.mobiciscoccservice.comciscoconnectcloud.comciscoconnectcloud.netciscoconnectcloud.orgciscocontest.comciscoerate.com ciscofax.comciscoinvestments.comciscojabbervideo.netciscokinetic.comciscoknowledgenetwork.comciscolearningsociety.orgciscolearningsystem.com ciscolive.comcisconetspace.comcisconetspace.infocisconetspace.netcisconetapp.comciscopartnermarketing.comciscopowercube.comciscoprice.comciscoresearch.comciscosoftware.com ciscospark.caciscospark.com ciscospark.jpciscotaccc.com ciscotr.com ciscoturk.netciscovideo.comciscowebseminars.com cloudlock.com cloupia.com cloupia.netconnect-in-canada.comcoreoptics.net cs.co +devm2m.com dnaspaces.io flipshare.comgpstheseries.com inlethd.cominternetofeverything.com ioe.com kscisco.com m2m.com +mcisco.commediafiles-cisco.com metacloud.com mindmeld.commultiplydiversity.commyciscobenefits.com  mysdn.com +mysdn.info  mysdn.net netacad.com netacad.netnetwork-auth.cn +cnobservable.net obsrvbl.com parstream.com parstream.net parstream.orgservices-exchange.comstatic-cisco.comtandberg-china.com tandberg.com +versly.comvideochampion.com virtuata.comwballiance.com!whyiwantciscotelepresence.com wifi-mx.comyoutubecisco.comapp-dynamics.comappdynamics.co.ukappdynamics.comappdynamics.deappdynamics.frappdynamics.infoappdynamics.jpappdynamics.org +mearki.com meraki-go.com  meraki.hk merakigo.com +tail-f.com  tailf.comcisco.evergage.comciscolivehls-i.akamaihd.net clco.cc +cloudc.one cloudcone.com cloudcone.net +cfblob.comcloudchoose.comcloudvolumes.com +cmpaas.com +cpedge.comcrit-staging.comexperience-vmware.com gemfire.netgeodesummit.com getboxer.com gitstar.com gitstar.net gopivotal.net greenplum.net hwslabs.com immidio.comitfromtheinside.comlatamvmwareforum.compivotalinitiative.comsnapvolumes.com ssdevrd.com vcanedge.com vcloudair.net vfabric.netvidmpreview.com +virsto.com +virsto.net vmglobal.net +vmmark.comvmtestdrive.com vmw.comvmware-cloudmanagement.comvmware-techcenter.comvmware20mosaic.comvmwareausnews.com!vmwarecertificationvideos.comvmwarecloud.comvmwaredemandcenter.comvmwareemeablog.comvmwaregrid.comvmwarehorizon.comvmwareidentity.comvmwarelearning.comvmwarelearningplatform.comvmwarestuff.comvmwareusergroupstore.comvmwareviewpoint.com vmwarevmc.com vmwdemo.com vmwgcomms.comvmwhorizonair.comvmwidm-ads.com +vmwidm.comvmwlabconnect.comvmwlearningplatform.com vmworld.comvmworld2010.comvmworld2013.comvmwsalesrewards.comvmwservices.com +vnware.netwhychoosehorizon.comwhychooseview.comwhychoosevmwareeuc.comwindowsuem.comworkspaceair.com xlstudio.comavinetworks.com +badaas.com bitnami.combitnamiapp.combitnamistudio.comdockerizer.comcloudcredibility.comcloudhealthtech.com cloudlive.comkubeacademy.com kubeapps.com +nyansa.com velocloud.com gopivotal.com heptio.cn +cn +heptio.com aliveipc.com aliveitsm.comaliveprofiler.com alivercm.comaliverewind.com alivertsm.com alivevm.com alivevmax.com alivevue.com vsphere.com vsphere.net air-watch.comairwatchexpress.comairwatchqa.com +getws1.com getwsone.comwhatisairwatch.comwhatisworkspaceone.comworkspaceone.comvmware.tt.omtrdc.netdelldell-brand.com dell.com dellcdn.comaccountkit.comatscaleconference.com botorch.org +buck.build buckbuild.comcomponentkit.org draftjs.org +f8.comfacebookappcenter.infofacebookappcenter.netfacebookappcenter.orgfacebookconnect.comfacebookdevelopergarage.comfaciometrics.com fasttext.cc fbf8.com fbinfer.com fblitho.com fbredex.com +fbrell.com flow.dev flow.org flowtype.org frescolib.org hacklang.org hhvm.commakeitopen.com mcrouter.net mcrouter.orgmessengerdevelopers.com +ogp.meopengraphprotocol.comopengraphprotocol.org  parse.com pyrobot.org  react.com reactjs.com reactjs.org recoiljs.org rocksdb.com rocksdb.net rocksdb.orgyogalayout.comdevelopers.facebook.com!achat-followers-instagram.com#acheter-followers-instagram.com$ acheterdesfollowersinstagram.com!acheterfollowersinstagram.combookstagram.comcarstagram.comcdninstagram.comchickstagram.com ig.me  igcdn.com igsonar.com igtv.com imstagram.com imtagram.cominstaadder.cominstachecker.cominstafallow.cominstafollower.cominstagainer.com instagda.com instagify.cominstagmania.com instagor.cominstagram-brand.cominstagram-engineering.cominstagram-help.cominstagram-press.cominstagram-press.net instagram.cominstagramci.cominstagramcn.cominstagramdi.cominstagramhashtags.netinstagramhilecim.cominstagramhilesi.orginstagramium.cominstagramizlenme.cominstagramkusu.cominstagramlogin.cominstagramm.cominstagramn.cominstagrampartners.cominstagramphoto.cominstagramq.cominstagramsepeti.cominstagramtakipcisatinal.netinstagramtakiphilesi.cominstagramtips.cominstagramtr.com instagran.cominstagranm.com instagrem.com instagrm.cominstagtram.com instagy.cominstamgram.cominstangram.cominstanttelegram.cominstaplayer.net instastyle.tv instgram.com intagram.com intagrm.com intgram.comkingstagram.comlnstagram-help.comtheinstagramhack.comoninstagram.comonline-instagram.comonlineinstagram.comweb-instagram.netwwwinstagram.comfbmessenger.comm.me messenger.com +nbabot.net binoculus.com buyoculus.com ocul.usoculus-china.com +oculus.comoculus2014.com oculus3d.comoculusblog.comoculusbrand.comoculuscasino.net oculuscdn.comoculusconnect.comoculusdiving.comoculusforbusiness.comoculusrift.com oculusvr.compowersunitedvr.com wa.mewhatsapp-plus.infowhatsapp-plus.mewhatsapp-plus.net whatsapp.cc whatsapp.com whatsapp.info whatsapp.net whatsapp.org whatsapp.tvwhatsappbrand.comaboutfacebook.com accessfacebookfromschool.com acebooik.com acebook.comadvancediddetection.comaskfacebook.netaskfacebook.org +atdmt2.com atlasdmt.comatlasonepoint.combuyingfacebooklikes.comcareersatfb.comcelebgramme.comchina-facebook.com click-url.comcomo-hackearfacebook.comcrowdtangle.com dacebook.comdlfacebook.comdotfacebook.comdotfacebook.netexpresswifi.com faacebok.com faacebook.com faasbook.com facbebook.com facbeok.com +facboo.com facbook.com facbool.com facboox.com faccebook.comfaccebookk.com facdbook.com facdebook.com face-book.com faceabook.com facebboc.com facebbook.comfacebboook.com facebcook.com facebdok.com facebgook.com facebhook.com facebkkk.com facebo-ok.com faceboak.com facebock.com facebocke.com facebof.com faceboik.com facebok.comfacebokbook.com facebokc.com facebokk.com facebokok.com faceboks.com facebol.com facebolk.com facebomok.com faceboo.com facebooa.com faceboob.comfaceboobok.com facebooc.com faceboock.com facebood.com facebooe.com faceboof.com facebooi.com facebooik.com facebooik.org facebooj.comfacebook-corp.comfacebook-covid-19.comfacebook-ebook.comfacebook-forum.comfacebook-inc.comfacebook-login.comfacebook-newsroom.comfacebook-newsroom.orgfacebook-pmdcenter.comfacebook-pmdcenter.netfacebook-pmdcenter.orgfacebook-privacy.comfacebook-program.comfacebook-studio.comfacebook-support.orgfacebook-texas-holdem.comfacebook-texas-holdem.net facebook.br facebook.ca facebook.cc facebook.comfacebook.design facebook.net facebook.hu facebook.in fecebook.net facebook.nl facebook.org facebook.se facebook.shop facebook.tv facebook.us facebook.wangfacebook123.orgfacebook30.comfacebook30.netfacebook30.orgfacebook4business.comfacebookads.com"facebookadvertisingsecrets.comfacebookatschool.comfacebookawards.comfacebookblueprint.netfacebookbrand.comfacebookbrand.net3/facebookcanadianelectionintegrityinitiative.comfacebookcareer.comfacebookcheats.comfacebookck.comfacebookclub.comfacebookcom.comfacebookconsultant.orgfacebookcoronavirus.comfacebookcovers.orgfacebookcredits.infofacebookdating.netfacebookdusexe.orgfacebookemail.comfacebookenespanol.comfacebookexchange.comfacebookexchange.netfacebookfacebook.comfacebookflow.comfacebookgames.comfacebookgraphsearch.comfacebookgraphsearch.infofacebookgroups.comfacebookhome.ccfacebookhome.comfacebookhome.infofacebookhub.com facebooki.comfacebookinc.comfacebookland.comfacebooklikeexchange.comfacebooklive.comfacebooklivestaging.netfacebooklivestaging.orgfacebooklogin.comfacebooklogin.infofacebookloginhelp.netfacebooklogs.comfacebookmail.comfacebookmail.tvfacebookmanager.infofacebookmarketing.info facebookmarketingpartner.com!facebookmarketingpartners.comfacebookmobile.comfacebookmsn.comfacebooknews.comfacebooknfl.comfacebooknude.comfacebookofsex.comfacebookook.comfacebookpaper.comfacebookpay.comfacebookphonenumber.netfacebookphoto.comfacebookphotos.comfacebookpmdcenter.comfacebookpoke.netfacebookpoke.orgfacebookpoker.infofacebookpokerchips.infofacebookporn.netfacebookporn.orgfacebookporno.netfacebookportal.com facebooks.comfacebooksafety.comfacebooksecurity.netfacebookshop.comfacebooksignup.netfacebooksite.netfacebookstories.comfacebookstudios.netfacebookstudios.orgfacebooksupplier.comfacebooksuppliers.comfacebookswagemea.comfacebookswagstore.comfacebooksz.comfacebookthreads.netfacebooktv.netfacebooktv.orgfacebookvacation.com facebookw.comfacebookworld.com facebool.com facebool.info facebooll.com faceboom.com faceboon.com faceboonk.comfaceboooik.com faceboook.com faceboop.com faceboot.com faceboox.com facebopk.com facebpook.com facebuk.com facebuok.com facebvook.com facebyook.com facebzook.comfacecbgook.com facecbook.com facecbook.org facecook.com facecook.org facedbook.com faceebok.com faceebook.com faceebot.com facegbok.com facegbook.com faceobk.com faceobok.com faceobook.com faceook.comfacerbooik.com facerbook.com facesbooc.comfacesounds.com facetook.com facevbook.com facewbook.co facewook.comfacfacebook.com facfebook.com fackebook.com facnbook.com facrbook.com facvebook.com facwebook.com facxebook.com fadebook.com +faebok.com faebook.com faebookc.com faeboook.com faecebok.com faesebook.comfafacebook.com faicbooc.com fasebokk.com fasebook.com faseboox.com favebook.com faycbok.com +fb.careers +fb.com fb.me fbacebook.com fbbmarket.comfbboostyourbusiness.com  fbcdn.com  fbcdn.netfbfeedback.com +fbhome.com fbidb.io  fbinc.comfbinnovation.comfbmarketing.com  fbreg.com +fbrpms.com  fbsbx.com  fbsbx.netfbsupport-covid.netfbthirdpartypixel.comfbthirdpartypixel.netfbthirdpartypixel.org  fburl.comfbworkmail.com fcacebook.com fcaebook.com fcebook.com fcebookk.comfcfacebook.comfdacebook.info feacboo.com feacbook.com feacbooke.com feacebook.com fecbbok.com fecbooc.com fecbook.com feceboock.com feceboox.com fececbook.com  feook.com ferabook.com fescebook.com fesebook.com ffacebook.com fgacebook.com ficeboock.com fmcebook.com fnacebook.com fosebook.com fpacebook.com fqcebook.com fracebook.com  freeb.comfreebasics.comfreebasics.net +freebs.comfreefacebook.comfreefacebook.netfreefacebookads.netfreefblikes.comfreindfeed.comfriendbook.info friendfed.comfriendfeed-api.comfriendfeed-media.comfriendfeed.comfriendfeedmedia.com fsacebok.com fscebook.comfundraisingwithfacebook.comfunnyfacebook.orgfutureofbusinesssurvey.org gacebook.com gameroom.comgfacecbook.com +groups.comhackerfacebook.comhackfacebook.comhackfacebookid.comhifacebook.info!howtohackfacebook-account.comhsfacebook.comhttpfacebook.comhttpsfacebook.comhttpwwwfacebook.com i.org internet.org klik.me liverail.com liverail.tvlogin-account.netmarkzuckerberg.commidentsolutions.commobilefacebook.commoneywithfacebook.com myfbfans.com newsfeed.com nextstop.comonline-deals.netopencreate.orgreachtheworldonfacebook.com rocksdb.orgshopfacebook.comsportsfacebook.comsportstream.comsupportfacebook.comterragraph.comthefacebook.comthefacebook.net thefind.comtoplayerserver.comviewpointsfromfacebook.comwhyfacebook.com worldhack.comwww-facebook.comwwwfacebok.comwwwfacebook.comwwwmfacebook.comzuckerberg.comzuckerberg.netfacebookwork.com +redkix.com workplace.comworkplaceusecases.comfbcdn-a.akamaihd.net  aorus.com aoruszone.cn +cn gigabyte.cn +cn gigabyte.comgigabyte2.azureedge.netsa78gs.wpc.edgecastcdn.net"sni1dcb6gl.wpc.edgecastcdn.net godaddy.comx.co godaddy android.comandroidify.com blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn dart.dev dartlang.org dartpad.dev fastlane.cifastlane.tools flutter.devflutterapp.com go-lang.com go-lang.net go-lang.org go.dev  godoc.org golang.com golang.net -golang.org  admob.com adsense.comadservice.google.comadvertisercommunity.comadvertiserscommunity.comadwords-community.com adwords.comadwordsexpress.comapp-measurement.comclickserver.googleads.comdoubleclick.comdoubleclick.netgoogle-analytics.comgoogleadapis.comgoogleadservices.comgoogleanalytics.comgoogleoptimize.comgooglesyndication.comgoogletagmanager.comgoogletagservices.comgoogletraveladservices.com -urchin.compolymer-project.orgpolymerproject.org -v8.dev v8project.org  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com youtube.comyoutubeeducation.comyoutubegaming.comyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.comand +golang.org2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +adscharlestonroadregistry.comregistry.google get.app get.dev get.how get.page iam.soyxn--p8j9a0d9c9a.xn--q9jyb4cscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.skpolymer-project.orgpolymerproject.org +v8.dev v8project.org youtubeggpht.cn +cn  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com +youtube.ae +youtube.al +youtube.am +youtube.at +youtube.az +youtube.ba +youtube.be +youtube.bg +youtube.bh +youtube.bo +youtube.by +youtube.ca youtube.cat +youtube.ch +youtube.cl +youtube.co youtube.co.ae youtube.co.at youtube.co.cr youtube.co.hu youtube.co.id youtube.co.il youtube.co.in youtube.co.jp youtube.co.ke youtube.co.kr youtube.co.ma youtube.co.nz youtube.co.th youtube.co.tz youtube.co.ug youtube.co.uk youtube.co.ve youtube.co.za youtube.co.zw youtube.comyoutube.com.aryoutube.com.auyoutube.com.azyoutube.com.bdyoutube.com.bhyoutube.com.boyoutube.com.bryoutube.com.byyoutube.com.coyoutube.com.doyoutube.com.ecyoutube.com.eeyoutube.com.egyoutube.com.esyoutube.com.ghyoutube.com.gryoutube.com.gtyoutube.com.hkyoutube.com.hnyoutube.com.hryoutube.com.jmyoutube.com.joyoutube.com.kwyoutube.com.lbyoutube.com.lvyoutube.com.lyyoutube.com.mkyoutube.com.mtyoutube.com.mxyoutube.com.myyoutube.com.ngyoutube.com.niyoutube.com.omyoutube.com.payoutube.com.peyoutube.com.phyoutube.com.pkyoutube.com.ptyoutube.com.pyyoutube.com.qayoutube.com.royoutube.com.sayoutube.com.sgyoutube.com.svyoutube.com.tnyoutube.com.tryoutube.com.twyoutube.com.uayoutube.com.uyyoutube.com.ve +youtube.cr +youtube.cz +youtube.de +youtube.dk +youtube.ee +youtube.es +youtube.fi +youtube.fr +youtube.ge +youtube.gr +youtube.gt +youtube.hk +youtube.hr +youtube.hu +youtube.ie +youtube.in +youtube.iq +youtube.is +youtube.it +youtube.jo +youtube.jp +youtube.kr +youtube.kz +youtube.la +youtube.lk +youtube.lt +youtube.lu +youtube.lv +youtube.ly +youtube.ma +youtube.md +youtube.me +youtube.mk +youtube.mn +youtube.mx +youtube.my +youtube.ng +youtube.ni +youtube.nl +youtube.no +youtube.pa +youtube.pe +youtube.ph +youtube.pk +youtube.pl +youtube.pr +youtube.pt +youtube.qa +youtube.ro +youtube.rs +youtube.ru +youtube.sa +youtube.se +youtube.sg +youtube.si +youtube.sk +youtube.sn youtube.soy +youtube.sv +youtube.tn +youtube.tv +youtube.ua +youtube.ug +youtube.uy +youtube.vnyoutubeeducation.comyoutubefanfest.comyoutubegaming.comyoutubego.co.idyoutubego.co.in youtubego.comyoutubego.com.br youtubego.id youtubego.inyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.comand chromedclkgbizgle gmailgoogoog googleguge hangout nexus xn--qcka1pmc  google.ad  google.ae  google.al  google.am  google.as  google.at  google.az  google.ba  google.be  google.bf  google.bg  google.bi  google.bj  google.bs  google.bt  google.by  google.ca -google.cat  google.cd  google.cf  google.cg  google.ch  google.ci  google.cl  google.cm google.co.ao google.co.bw google.co.ck google.co.cr google.co.id google.co.il google.co.in google.co.jp google.co.ke google.co.kr google.co.ls google.co.ma google.co.mz google.co.nz google.co.th google.co.tz google.co.ug google.co.uk google.co.uz google.co.ve google.co.vi google.co.za google.co.zm google.co.zw +google.cat  google.cd  google.cf  google.cg  google.ch  google.ci  google.cl  google.cm google.cn +cn google.co.ao google.co.bw google.co.ck google.co.cr google.co.id google.co.il google.co.in google.co.jp google.co.ke google.co.kr google.co.ls google.co.ma google.co.mz google.co.nz google.co.th google.co.tz google.co.ug google.co.uk google.co.uz google.co.ve google.co.vi google.co.za google.co.zm google.co.zw google.com google.com.af google.com.ag google.com.ai google.com.ar google.com.au google.com.bd google.com.bh google.com.bn google.com.bo google.com.br google.com.bz google.com.co google.com.cu google.com.cy google.com.do google.com.ec google.com.eg google.com.et google.com.fj google.com.gh google.com.gi google.com.gt google.com.hk google.com.jm google.com.kh google.com.kw google.com.lb google.com.ly google.com.mm google.com.mt google.com.mx google.com.my google.com.na google.com.ng google.com.ni google.com.np google.com.om google.com.pa google.com.pe google.com.pg google.com.ph google.com.pk google.com.pr google.com.py google.com.qa google.com.sa google.com.sb google.com.sg google.com.sl google.com.sv google.com.tj google.com.tr google.com.tw google.com.ua google.com.uy google.com.vc google.com.vn  google.cv  google.cz  google.de  google.dj  google.dk  google.dm  google.dz  google.ee  google.es  google.fi  google.fm  google.fr  google.ga  google.ge  google.gg  google.gl  google.gm  google.gr  google.gy  google.hn  google.hr  google.ht  google.hu  google.ie  google.im  google.iq  google.is  google.it  google.je  google.jo  google.kg  google.ki  google.kz  google.la  google.li  google.lk  google.lt  google.lu  google.lv  google.md  google.me  google.mg  google.mk  google.ml  google.mn  google.ms  google.mu  google.mv  google.mw  google.ne  google.nl  google.no  google.nr  google.nu  google.pl  google.pn  google.ps  google.pt  google.ro  google.rs  google.ru  google.rw  google.sc  google.se  google.sh  google.si  google.sk  google.sm  google.sn  google.so  google.sr  google.st  google.td  google.tg  google.tl  google.tm  google.tn  google.to  google.tt  google.vg  google.vu  google.ws 0emm.com  1e100.net  1ucrs.com 466453.com abc.xyz adgoogle.net admeld.comangulardart.org @@ -4601,63 +7496,241 @@ apigee.com appbridge.ca appbridge.io appbridge.it appspot.co apture.com area120.com asp-cc.com autodraw.com bandpage.combaselinestudy.combaselinestudy.org bazel.build bdn.devbeatthatquote.com  blink.org blogblog.com blogger.combrocaproject.com brotli.org bumpshare.com -bumptop.ca bumptop.com bumptop.net bumptop.org bumptunes.comcampuslondon.com certificate-transparency.org chat.gle -chrome.comchromebook.comchromecast.com chromium.orgcloudburstresearch.comcloudfunctions.netcloudrobotics.comcobrasearch.com codespot.com conscrypt.com conscrypt.orgcookiechoices.org  coova.com  coova.net  coova.orgcrossmediapanel.com crr.com  cs4hs.comdartsearch.netdataliberation.org  debug.comdebugproject.com deepmind.comdevsitetest.howdialogflow.comdigitalassetlinks.org episodic.comfeedburner.com -fflick.comfinanceleadsonline.comfirebaseapp.com -foofle.com froogle.com fuchsia.dev  g-tun.comg.co g.dev -g.pagegerritcodereview.comgetbumptop.com ggoogle.com gipscorp.com globaledu.org  gmail.com gmodules.com  gogle.com +bumptop.ca bumptop.com bumptop.net bumptop.org bumptunes.comcampuslondon.com certificate-transparency.org +chrome.comchromebook.comchromecast.com chromeos.dev chromium.orgchronicle.securitychroniclesec.comcloudburstresearch.comcloudfunctions.netcloudrobotics.comcobrasearch.com codespot.com conscrypt.com conscrypt.orgcookiechoices.org  coova.com  coova.net  coova.orgcrossmediapanel.com crr.com  cs4hs.comdartsearch.netdataliberation.org  debug.comdebugproject.com deepmind.comdevsitetest.howdialogflow.comdigitalassetlinks.org episodic.comfeedburner.com +fflick.comfinanceleadsonline.comfirebaseapp.comfirebaseio.com +foofle.com froogle.com fuchsia.dev  g-tun.comg.cn +cng.co g.dev +g.page gateway.devgerritcodereview.comgetbumptop.com ggoogle.com gipscorp.com gkecnapps.cn +cn globaledu.org  gmail.com gmodules.com  gogle.com gogole.comgonglchuangl.net goo.gl googel.com googil.com  googl.comgoogle-syndication.com google.berlin google.dev google.net -google.orggoogle.ventures"googleacquisitionmigration.comgoogleapis.comgoogleapps.comgooglearth.comgoogleblog.com googlebot.comgooglecapital.comgooglecert.netgooglecode.comgooglecommerce.comgooglecompare.co.ukgoogledanmark.comgoogledomains.comgoogledrive.com googlee.comgoogleearth.comgooglefiber.netgooglefinland.comgooglemail.comgooglemaps.comgooglepagecreator.comgooglephotos.comgoogleplay.comgoogleplus.comgooglescholar.comgooglesource.comgooglestore.comgooglesverige.comgoogleusercontent.comgoogleventures.com +google.orggoogle.ventures"googleacquisitionmigration.com googleapis.cn +cngoogleapis.comgoogleapps.comgooglearth.comgoogleblog.com googlebot.comgooglecapital.comgooglecert.netgooglecnapps.cn +cngooglecode.comgooglecommerce.comgooglecompare.co.ukgoogledanmark.comgoogledomains.comgoogledrive.com googlee.comgoogleearth.comgooglefiber.netgooglefinland.comgooglemail.comgooglemaps.comgooglepagecreator.comgooglephotos.comgoogleplay.comgoogleplus.comgooglesource.comgooglestore.comgooglesverige.comgoogleusercontent.comgoogleventures.com googlr.com -goolge.com gooogle.com gridaware.app gsrc.io gstatic.com +goolge.com gooogle.com gridaware.app gsrc.io +gstatic.cn +cn gstatic.comgstaticcnapps.cn +cn gsuite.com -gv.com gvt0.com gvt1.com gvt2.com gvt3.com gvt5.com gvt6.com gvt7.com gvt9.comhdrplusdata.org hey.gle hindiweb.comhowtogetmo.co.ukhtml5rocks.com hwgo.comiamremarkable.org igoogle.com impermium.com +gv.com gvt0.com gvt1.com gvt2.com gvt3.com gvt5.com gvt6.com gvt7.com gvt9.comhdrplusdata.org hindiweb.comhowtogetmo.co.ukhtml5rocks.com hwgo.comiamremarkable.org igoogle.com impermium.com j2objc.orgjibemobile.com keyhole.comkeytransparency.comkeytransparency.fookeytransparency.org lanternal.com like.commadewithcode.com material.io mdialog.com meet.newmfg-inspector.commobileview.pagemoodstocks.com near.by nest.com nomulus.foo -oauthz.com -ok.gle on.here on2.comonefifteen.netonefifteen.orgoneworldmanystories.com openthread.io openweave.io orbitera.com  page.linkpagespeedmobilizer.com pageview.mobi panoramio.compartylikeits1986.orgpaxlicense.org +oauthz.com on.here on2.comonefifteen.netonefifteen.orgoneworldmanystories.com openthread.io openweave.io orbitera.com  page.linkpagespeedmobilizer.com pageview.mobi panoramio.compartylikeits1986.orgpaxlicense.org picasa.com picasaweb.com picasaweb.net picasaweb.org -picnik.com pittpatt.com postini.comprojectara.comprojectbaseline.compublishproxy.comquestvisual.comquickoffice.com quiksee.com recaptcha.net +picnik.com pittpatt.com +pixate.com postini.comprojectara.comprojectbaseline.compublishproxy.comquestvisual.comquickoffice.com quiksee.com revolv.comridepenguin.com run.appsavethedate.foo saynow.com schemer.comscreenwisetrends.comscreenwisetrendspanel.com snapseed.com solveforx.com stadia.devstcroixmosquito.comstcroixmosquitoproject.comstudywatchbyverily.comstudywatchbyverily.orgstxmosquito.comstxmosquitoproject.comstxmosquitoproject.netstxmosquitoproject.org synergyse.comtensorflow.org  tfhub.devthecleversense.comthegooglestore.comthinkquarterly.co.ukthinkquarterly.comthinkwithgoogle.com tiltbrush.com txcloud.net  txvia.comunfiltered.news useplannr.comusvimosquito.comusvimosquitoproject.comvelostrata.com verily.comverilylifesciences.comverilystudyhub.comverilystudywatch.comverilystudywatch.org -wallet.com  waymo.com waze.com web.appwebappfieldguide.comwebmproject.orgwebpkgcache.com +wallet.com  waymo.com waze.com web.app web.devwebappfieldguide.comwebmproject.orgwebpkgcache.com webrtc.orgweltweitwachsen.dewhatbrowser.org widevine.comwithgoogle.com womenwill.comwomenwill.com.br womenwill.id womenwill.in womenwill.mx  x.company -x.team xn--9kr7l.comxn--9trs65b.comxn--flw351e.com xplr.cozukunftswerkstatt.de  hinet.net -hp.comhpstore-china.com hpstore.com www8-hp.comhpstore.corpmerchandise.comibmweatherchannel weather bluemix.com bluemix.net ibm.com +x.team xn--9kr7l.comxn--9trs65b.comxn--flw351e.comxn--ggle-55da.comxn--gogl-0nd52e.comxn--gogl-1nd42e.com xplr.cozukunftswerkstatt.de265.com +cn2mdn.net +cn adservice.google.com +cnapp-measurement.com +cn beacons.gcp.gvt2.com +cnbeacons.gvt2.com +cnbeacons3.gvt2.com +cn c.admob.com +cn(c.android.clients.google.com +cn!cache.pack.google.com +cncheckin.gstatic.com +cn%clickserve.dartsearch.net +cn)clientservices.googleapis.com +cn)connectivitycheck.gstatic.com +cncorp.google.com +cn crl.pki.goog +cn"csi-china.l.google.com +cncsi.gstatic.com +cn dl.google.com +cndl.l.google.com +cndoubleclick.net +cn-!firebase-settings.crashlytics.com +cn fonts.googleapis.com +cnfonts.gstatic.com +cn google-analytics.com +cn googleadservices.com +cngoogleanalytics.com +cn!googlesyndication.com +cn googletagmanager.com +cn!googletagservices.com +cngtm.oasisfeng.com +cn!imasdk.googleapis.com +cn kh.google.com +cn ocsp.pki.goog +cn, pagead-googlehosted.l.google.com +cn!pki-goog.l.google.com +cn recaptcha.net +cnredirector.gvt1.com +cn)safebrowsing-cache.google.com +cn'safebrowsing.googleapis.com +cn$settings.crashlytics.com +cn-!ssl-google-analytics.l.google.com +cnssl.gstatic.com +cn%toolbarqueries.google.com +cntools.google.com +cntools.l.google.com +cn$translate.googleapis.com +cn!update.googleapis.com +cn-!www-googletagmanager.l.google.com +cnwww.gstatic.com +cnwww.recaptcha.net +cn0$^khm([0-3]|db)?\.google(apis)?\.com$ +cn  hinet.net +123-hp.com123hplaserjet.com8008206616.com as-hp.cabaterias-hp.com campushp.comcolorprotechnology.com +compaq.orgdavid-laserscanner.com demoprint.comdigitalpack.com eprintsw.comgaming-notebooks.comgetprintersupports.comhp-imagine.comhp-infolab.com hp-invent.comhp-invent.info +hp-mns.comhp-printing.comhp-webplatform.com  hp-ww.com +hp.com +hp.company hp.io hp3d.comhp3dmetals.comhp3dprinter.comhp3dsamplepromo.comhpallinoneprinter.comhpapplicationscenter.com hpbestbuy.comhpbluecarpet.comhpbluecarpet.nethpbuiltforlearning.com hpbundle.com hpcampus.comhpcatridge.com  hpccp.com  hpceo.com  hpcmw.nethpcodewarsbcn.comhpcomputers.comhpcomputerservices.comhpconnected.comhpconnected.nethpconnected.orghpconnected.ushpconnectedstage.comhpcontinuum.com  hpcpi.com hpcu.orghpcustomersupport.comhpcustomersupport.net +hpdaas.comhpdesignjetl25500.comhpdesktopcomputer.comhpdownloadstore.comhpdreamcolor.com hpdriver.com hpdrivers.com hpdrivers.org hpeclipse.com hpengage.com hpeprint.comhpeprintcenter.com hpeurope.comhpeventcenter.com +hpfaqs.comhpfeedback.com +hpgift.com +hpgpas.comhpgraphicspartners.com  hpiie.org +hpinc.info  hpinc.nethpindigopress.com hpinkjet.comhpinstantink.cahpinstantink.comhpkeyboard.com hplaptop.comhplaptopbattery.comhplargeformatremote.comhplatexknowledgecenter.com hplfmedia.com  hplip.nethplipopensource.comhpmarketplace.comhpmemorychips.comhpmicrcartridge.com +hpmini.com hpmobile.comhpofficejetprinter.comhponlinehelp.comhponlineprinting.comhppage5000.comhppavillionlaptop.comhpphotoscanners.comhpprinterdrivers.comhpprinterinstalls.comhpprintersupplies.comhpsalescentral.com hpserver.comhpservices.comhpshooping.com +hpshop.com hpshoping.com hpshopping.hk hpsignage.com hpsmart.com hpsmarts.comhpsmartstage.comhpsmartupdate.comhpsoftware.com hpspeaker.comhpsprocket.com  hpsso.comhpstore-china.comhpstore-emea.com +hpstore.cn +cn hpstore.comhpstorethailand.com hpsupport.comhpsuresupply.comhptechventures.com hpto.net hptouch.comhptouchpointmanager.comhptrainingcenter.com  hpuae.comhpuniversity.infohpusertraining.com +hpveer.comhpvirtualthin.com hpwallart.comhpwellnesscentral.com  hpwsn.com i-123-hp.com inkchoice.cominstantink.comleavinghpinc.comlife-global.orgmyhpsupport.com printeron.comprintersetupsupport.comprintspots.comprintspots.netserviceshp.comthecompaqstore.comtouchsmartpc.comtouchsmartpc.nettouchsmartpc.orgworkstations.tv www8-hp.comxn--6eup7j.comxn--6eup7j.nethpstore.corpmerchandise.comibmweatherchannel weather bluemix.com bluemix.net ibm.com ibm.eu ibm.net -ibm.us s-bluemix.net s81c.com intel intc.com intel.ca intel.co.id intel.co.il intel.co.jp intel.co.kr intel.co.uk intel.co.za  intel.com intel.com.au intel.com.br intel.com.tr intel.com.tw intel.de intel.es intel.eu intel.fr intel.ie intel.in intel.it intel.la intel.me intel.ph intel.pl intel.ru intel.se intel.sg intel.vnintelrealsense.comresearchintel.com linkedin.com  licdn.com azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-test.net  azure.com  azure.netazurecomcdn.netazurecontainer.ioazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazurewebsites.net  microsoft azurebing hotmail -office skype windowsxbox microsoft.az microsoft.be microsoft.by microsoft.ca microsoft.cat microsoft.ch microsoft.cl microsoft.com microsoft.cz microsoft.de microsoft.dk microsoft.ee microsoft.es microsoft.eu microsoft.fi microsoft.ge microsoft.hu microsoft.io microsoft.is microsoft.it microsoft.jp microsoft.lt microsoft.lu microsoft.lv microsoft.md microsoft.pl microsoft.pt microsoft.ro microsoft.rs microsoft.ru microsoft.se microsoft.si microsoft.tv microsoft.ua microsoft.uz microsoft.vn 1drv.com 1drv.ms -aka.ms appcenter.msapplicationinsights.ioapplicationinsights.net asp.net aspnetcdn.com bing.com bing.net bingads.combingsandbox.combotframework.com breakdown.mecentralvalidation.com -ch9.ms cloudapp.netcloudappsecurity.comcortanaanalytics.comcrmdynint-gcc.com crmdynint.com docs.com dot.net dynamics.com efproject.net +ibm.us s-bluemix.net s81c.com +01.org hyperscan.iointellinuxgraphics.comintellinuxgraphics.net +oneapi.comopenvinotoolkit.orgsnap-telemetry.io +acpica.com clearlinux.cn +cnclearlinux.org +ospray.net +ospray.org intel intel.ac intel.ae intel.af intel.ag intel.ai intel.ar intel.at intel.az intel.ba intel.bg intel.bh intel.bi intel.bo intel.bs intel.by intel.ca intel.cc intel.cg intel.ch intel.cl intel.cmintel.cn +cn intel.co.ae intel.co.cr intel.co.id intel.co.il intel.co.jp intel.co.kr intel.co.uk intel.co.za  intel.com intel.com.ar intel.com.au intel.com.bo intel.com.br intel.com.cn +cn intel.com.co intel.com.ec intel.com.hk intel.com.jm intel.com.mx intel.com.my intel.com.pe intel.com.ph intel.com.pr intel.com.py intel.com.tr intel.com.tw intel.com.uy intel.com.ve intel.cr intel.cu intel.cz intel.de intel.dk intel.dz intel.ec intel.ee intel.eg intel.es intel.eu intel.fi intel.fr intel.ga intel.gd intel.ge intel.gl intel.gm intel.gr intel.gs intel.gt intel.gy intel.hk intel.hn intel.ht intel.hu intel.ie intel.in intel.io intel.it intel.je intel.jo intel.jp intel.ke intel.la intel.lc intel.lk intel.lt intel.lu intel.ly intel.ma intel.md intel.me intel.mg intel.mk intel.mn intel.mp intel.mt intel.mu intel.mw intel.mx intel.my intel.ng intel.nl intel.nu intel.nz intel.pa intel.pe intel.ph intel.pl intel.pn intel.re intel.ro intel.ru intel.rw intel.sa intel.sc intel.se intel.sg intel.si intel.sk intel.sn intel.sr intel.st intel.sv intel.sx intel.sy intel.tf intel.tj intel.tl intel.tm intel.tn intel.tt intel.tv intel.tw intel.ua intel.uk intel.us intel.uy intel.uz intel.vg intel.vn intel.vu intel.wf intel.yt +altera.comalteraforum.comalteraforums.comalteraforums.netalterauserforum.comalterauserforum.netalterauserforums.comalterauserforums.net buyaltera.com celeron.com celeron.net centrino.com centrino.net  chips.com cilk.com cilk.netcloudinsights.comclusterconnection.com coreduo.comcoreextreme.comcrosswalk-project.comcrosswalk-project.netdoceapower.com  easic.com enpirion.comexascale-tech.comexploreintel.comgordonmoore.cominsidefilms.com intc.comintel-research.net&"intel-university-collaboration.netintelamericasstore.comintelapacstore.com intelatom.netintelcapital.comintelcapital.netintelcloudbuilders.comintelcloudfinder.comintelemeastore.cominteleventexpress.comintelforchange.comintelfreepress.com intelgo.netintelinsight.cominteliotmarketplace.com +intell.comintellearningseries.comintellinuxwireless.netintelnervana.comintelnet.component intelplay.comintelquark.comintelrealsense.cn +cnintelrealsense.com intelrxt.comintelsalestraining.comintelsecurity.comintelserveredge.comintelsoftwarenetwork.comintelstore.cominteltechnologyprovider.com intelvmwarecybersecurity.com  itnel.comlatencytop.comlookinside.commakebettercode.commakesenseofdata.com movidius.com movidius.netnervanasys.com  nevex.comnextgenerationcenter.com +niosii.com +niosii.netomekinteractive.com +omnitek.tv openamt.comopendroneid.orgoptanedifference.com +pc.com pentium.com pentium.net pintool.compoweredbyintel.comreconinstruments.com reconjet.comresearchintel.comsaffrontech.comsensorynetworks.com +siport.comsmart-edge.comtheintelstore.comthunderbolttechnology.nettrustedanalytics.comtrustedanalytics.net +vokevr.com vpro.com vpro.net xeon.comxn--ztsq84g.cn +xscale.combarefootnetworks.com +lg.com lgappstv.com  lge.co.kr lge.comlgecareers.com +lghvac.comlghvacstory.comlgrecyclingprogram.comlgsalesportal.comlgelectronics.122.2o7.net linkedin.com  licdn.com logi.comlogicool.co.jp logicoolg.com logitech.biz logitech.com logitech.fr logitechg.com logitechg.frworldsfastestgamer.net azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-sphere.comazure-test.netazure.cn +cn  azure.com  azure.netazurecomcdn.netazurecontainer.ioazurecosmos.netazurecosmosdb.comazurecosmosdb.infoazurecosmosdb.netazuredatabricks.netazuredevopslaunch.comazuredigitaltwin.comazuredigitaltwins.comazuredigitaltwins.netazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazureiotcentral.comazureiotsolutions.comazureiotsuite.comazureplanetscale.infoazureplanetscale.netazureserviceprofiler.comazuresmartspaces.netazurestackvalidation.comazurewebsites.netchinacloudapi.cn +cnchinacloudapp.cn +cnchinacloudsites.cn +cn cosmosdb.info cosmosdb.net devopsms.com gotcosmos.commicrosofteca.commicrosoftiotcentral.comserverlesslibrary.nettryfunctions.comwindowsazure.cn +cnwindowsazure.comazure.microsoft.com"azuremarketplace.microsoft.combing bing.com bing.com.cn +cn bing.net bingads.combingagencyawards.combingapistatistics.combingsandbox.combingvisualsearch.com bingworld.combluehatnights.com +dictate.msflipwithsurface.commasalladeloslimites.commicrosoft-give.commicrosoftcloudsummit.commicrosoftdiplomados.commicrosoftlatamholiday.commicrosoftmxfilantropia.com!microsoftpartnersolutions.commsunlimitedcloudsummit.comoffice365love.comoffice365tw.comrenovacionoffice.comsprinklesapp.com cn.bing.com +cn cn.bing.net +cn ditu.live.com +cnbj1.api.bing.com +cnemoi-cncdn.bing.com +cn atom.io  npmjs.com npm.communitydependabot.com +git.io github.blog +github.comgithub.community  github.io githubapp.comgithubassets.comgithubhackathon.comgithubstatus.comgithubusercontent.com/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.comadaptivecards.ioapi-extractor.com +apisof.net appcenter.ms +blazor.netbotframework.comcodethemicrobit.comdevopsassessment.net dot.netgamesstack.comgraphengine.ioinsiderdevtour.com +jwt.ms microbit.orgmicrosoftadc.commicrosoftgamestack.commicrosoftiotinsiderlabs.commicrosoftreactor.cn +cn#microsoftreactor.com.cn +cnmicrosoftreactor.infomicrosoftreactor.netmicrosoftreactor.orgmicrosoftsilverlight.commicrosoftsilverlight.orgmicrosoftsilverlight.netmicrosoftsqlserver.com  mmdnn.commono-project.com msdn.commsinnovationchallenge.commspairlift.commsropendata.com  nuget.org nugettest.orgopentranslatorstothings.orgposhtestgallery.compwabuilder.comreactorms.com.cn +cn +sankie.netsqlserveronlinux.comtimelinestoryteller.comuwpcommunitytoolkit.comvisualstudio-staging.comvisualstudio.comvisualstudio.covisualstudio.co.ukvisualstudio.euvisualstudio.net vfsforgit.com vfsforgit.org vsassets.io xamarin.comdeveloper.microsoft.comdtlgalleryint.cloudapp.net poshtestgallery.cloudapp.net"psg-int-centralus.cloudapp.netpsg-int-eastus.cloudapp.netmicrosoftnews.ccmicrosoftnews.cn +cnmicrosoftnews.commicrosoftnews.netmicrosoftnews.orgmicrosoftnewsforkids.commicrosoftnewsforkids.netmicrosoftnewsforkids.orgmicrosoftnewskids.commicrosoftnewskids.netmicrosoftnewskids.org msn.commsnewskids.commsnewskids.netmsnewskids.org msnkids.com 1drv.com 1drv.mslivefilestore.com onedrive.coonedrive.co.uk onedrive.com onedrive.eu onedrive.net onedrive.orgonedrive.live.comstorage.live.com +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.comcallersbane.com minecraft.netminecraftshop.com +mojang.comforzamotorsport.netforzaracingchampionship.com forzarc.comorithegame.comrenovacionxboxlive.comtellmewhygame.com xbox.co xbox.com xbox.eu xbox.org +xbox360.co xbox360.com +xbox360.eu xbox360.org +xboxab.comxboxgamepass.comxboxgamestudios.com xboxlive.cn +cn xboxlive.com +xboxone.co xboxone.com +xboxone.euxboxplayanywhere.comxboxstudios.com +xbx.lv  microsoft azure hotmail +office skype windowsxbox microsoft.az microsoft.be microsoft.by microsoft.ca microsoft.cat microsoft.ch microsoft.cl microsoft.com microsoft.cz microsoft.de microsoft.dk microsoft.ee microsoft.es microsoft.eu microsoft.fi microsoft.ge microsoft.hu microsoft.io microsoft.is microsoft.it microsoft.jp microsoft.lt microsoft.lu microsoft.lv microsoft.md microsoft.pl microsoft.pt microsoft.red microsoft.ro microsoft.rs microsoft.ru microsoft.se microsoft.si microsoft.tv microsoft.ua microsoft.uz microsoft.vnfemalefounderscomp.com +m12.vc +aka.msankarazirvesi2018.comapplicationinsights.ioapplicationinsights.net aria.ms asp.net aspnetcdn.com +binads.com bluehatil.combrazilpartneruniversity.com breakdown.mecentralvalidation.com +ch9.mscharticulator.com cloudapp.netcloudappsecurity.comcortanaanalytics.comcortanaskills.comcrmdynint-gcc.com crmdynint.comcrossborderexpansion.com docs.com dynamics.com efproject.netazuredigitaltwin.comfasttrackreadysupport.comfluidpreview.comgameuxmasterguide.com +gears5.com gearspop.comgearstactics.com gfx.ms -gigjam.com hololens.com hotmail.com imaginecup.pl live.com live.com.au live.netmicrosoft-int.commicrosoft-ppe.commicrosoft-sbs-domains.commicrosoft365.commicrosoftadvertising.commicrosoftaffiliates.commicrosoftcloud.commicrosoftedge.commicrosoftlinc.commicrosoftonline-p.commicrosoftonline.commicrosoftstore.commicrosoftstore.com.hkmicrosofttranslator.commicrosoftuwp.commono-project.comms-studiosmedia.com  msads.net -msauth.net msdn.com +gigjam.com hololens.com +hotmail.co hotmail.com +hotmail.eu hotmail.net hotmail.orghummingbird.ms +ie8.co ie9.com ie10.com ie11.cominternetexplorer.cointernetexplorer.com imaginecup.pl +ingads.comintunewiki.comiotinactionevents.com +kidgrid.tvlatampartneruniversity.com live.com live.com.au live.eu live.netlivingyourambition.com makecode.orgmanagedmeetingrooms.commeetfasttrack.commeetyourdevices.com mepn.commicrosoft-int.commicrosoft-ppe.commicrosoft-sap-events.commicrosoft-sbs-domains.commicrosoft-smb.cn +cnmicrosoft365.commicrosoftaccountguard.commicrosoftads.commicrosoftadvertising.com*µsoftadvertisingregionalawards.commicrosoftaffiliates.commicrosoftcloud.commicrosoftcloudworkshop.com"microsoftcommunitytraining.commicrosoftedge.commicrosofthouse.commicrosofthouse.netmicrosoftinternetsafety.netmicrosoftlatamaitour.commicrosoftlinc.commicrosoftonline-p.commicrosoftonline.com!microsoftpartnercommunity.commicrosoftready.commicrosoftsiteselection.commicrosoftstore.commicrosoftstore.com.hkmicrosoftstream.commicrosoftteams.commicrosofttradein.commicrosofttranslator.commicrosoftuwp.commomentumms.commorphcharts.commpnevolution.comms-studiosmedia.comms365surfaceoffer.com  msads.net msauth.cn +cn +msauth.netmschallenge2018.com msecnd.net -msedge.net  msft.info msft.net msftauth.net msftnet.org msn.com +msedge.net  msft.info msft.net msftauth.cn +cn msftauth.netmsfteducation.ca msftnet.orgmsgamesresearch.com msocdn.com -msocsp.commymicrosoft.com  nuget.org nugettest.orgo365weve-dev.como365weve-ppe.com o365weve.com +msocsp.com msturing.orgmsudalosti.commymicrosoft.comnextechafrica.net nxta.orgo365weve-dev.como365weve-ppe.com o365weve.com office.com -office.net office365.com onedrive.com onenote.com onenote.net onestore.ms outlook.com passport.netpowerappscdn.net powerbi.compowershellgallery.coms-microsoft.com  s-msn.com sfbassets.com sfbassets.net -sfx.mssharepointonline.com  skype.com  skype.netskypeassets.comskypeassets.net surface.com sway-cdn.com sway.comsysinternals.com tfsallin.netvideobreakdown.comvideoindexer.aivirtualearth.netvisualstudio-staging.comvisualstudio.com vsallin.net vsassets.iowindows-int.net windows.com windows.net -windows.nlwindowsmarketplace.comwindowsphone-int.comwindowsphone.comwindowssearch.comwindowsupdate.com +office.net office365.com onenote.com onenote.net onestore.msopticsforthecloud.netoutingsapp.com outlook.com passport.net +pixapp.netpowerappscdn.netpowerautomate.com powerbi.compowershellgallery.comprojectmurphy.netprojectsangam.com +pxt.ios-microsoft.com  s-msn.com sfbassets.com sfbassets.net +sfx.ms sharepoint.cn +cnsharepoint.comsharepointonline.com  skype.com  skype.netskypeassets.comskypeassets.net staffhub.mssuccesswithteams.com surface.com sway-cdn.com sway.comsysinternals.comtailwindtraders.com +techhub.ms tfsallin.nettrafficmanager.nettranslatetheweb.comunlocklimitlesslearning.com +userpxt.iovideobreakdown.comvideoindexer.aivirtualearth.net vsallin.net +wbd.ms what-fan.netwindows-int.net windows.com windows.net +windows.nl windows8.hkwindowscommunity.netwindowsmarketplace.comwindowsphone-int.comwindowsphone.comwindowssearch.comwindowsupdate.com winhec.com -winhec.net xamarin.com xbox.com -xboxab.com xboxlive.com -yammer.com/+img-prod-cms-rt-microsoft-com.akamaized.netmwf-service.akamaized.net)%officecdn-microsoft-com.akamaized.netmozilla.community mozilla.net mozilla.org bugzilla.org getpocket.comseamonkey-project.orgthunderbird.net firefox.comdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud rust-lang.org  rustup.rs  crates.io docs.rs geforce.co.kr geforce.co.uk geforce.comgeforce.com.twgputechconf.co.krgputechconf.comgputechconf.com.augputechconf.com.twgputechconf.eugputechconf.ingputechconf.jp nvidia.asia  nvidia.be  nvidia.ch nvidia.co.jp nvidia.co.kr -nvidia.com nvidia.com.au nvidia.com.br nvidia.com.tr nvidia.com.tw  nvidia.cz  nvidia.de  nvidia.dk  nvidia.es  nvidia.eu  nvidia.fi  nvidia.fr  nvidia.it  nvidia.lu  nvidia.nl  nvidia.no  nvidia.pl  nvidia.ro  nvidia.ru  nvidia.seshotwithgeforce.com +winhec.net +yammer.comcdn.office.net +cn(dl.delivery.mp.microsoft.com +cn&download.windowsupdate.com +cn'bg.v4.a.dl.ws.microsoft.com +cn(bg4.v4.a.dl.ws.microsoft.com +cn2&cdn.marketplaceimages.windowsphone.com +cn cn.windowssearch.com +cn#ctldl.windowsupdate.com +cn#developer.microsoft.com +cndocs.microsoft.com +cn"download.microsoft.com +cn/#download.visualstudio.microsoft.com +cnfs.microsoft.com +cn(msgr.dlservice.microsoft.com +cn, msgruser.dlservice.microsoft.com +cn#officecdn.microsoft.com +cn&qh.dlservice.microsoft.com +cnsdx.microsoft.com +cn/#silverlight.dlservice.microsoft.com +cn, slupdate.dlservice.microsoft.com +cn, storeedgefd.dsx.mp.microsoft.com +cn&wl.dlservice.microsoft.com +cn&wscont1.apps.microsoft.com +cn&wscont2.apps.microsoft.com +cnwww.microsoft.com +cn&xb.dlservice.microsoft.com +cn/+img-prod-cms-rt-microsoft-com.akamaized.netimg-s-msn-com.akamaized.netmwf-service.akamaized.net)%officecdn-microsoft-com.akamaized.net3/statics-marketingsites-eus-ms-com.akamaized.net40statics-marketingsites-wcus-ms-com.akamaized.net firefox.comdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud rust-lang.org  rustup.rs  crates.io docs.rsmozilla.community mozilla.net mozilla.org bugzilla.org getpocket.comseamonkey-project.orgthunderbird.net +lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net +nhncorp.jp grafolio.com  naver.com naver.jp  naver.net navercorp.com  plug.game pstatic.net neuralink.com +geforce.cn +cn geforce.co.kr geforce.co.uk geforce.comgeforce.com.twgputechconf.cn +cngputechconf.co.krgputechconf.comgputechconf.com.augputechconf.com.twgputechconf.eugputechconf.ingputechconf.jp nvidia.asia  nvidia.be  nvidia.ch nvidia.cn +cn nvidia.co.jp nvidia.co.kr +nvidia.com nvidia.com.au nvidia.com.br nvidia.com.tr nvidia.com.tw  nvidia.cz  nvidia.de  nvidia.dk  nvidia.es  nvidia.eu  nvidia.fi  nvidia.fr  nvidia.it  nvidia.lu  nvidia.nl  nvidia.no  nvidia.pl  nvidia.ro  nvidia.ru  nvidia.seshotwithgeforce.comnvidia.tt.omtrdc.net oracle oracle.comoraclecloud.comoraclefoundation.org oracleimg.comateam-oracle.com -bronto.comcovid19-rx.org covid19rx.org sun.com addthis.comaddthiscdn.comaddthisedge.comjava java.com java.net appcloud.comappexchange.com attic.iobeyondcore.combuddymedia.com chatter.comcloudcraze.com cotweet.com data.comdemandware.com desk.comdocumentforce.comdreamforce.com einstein.comexacttarget.com  force.com govforce.comgravitytank.com heywire.com krux.commarketingcloud.com metamind.io +bronto.comcovid19-rx.org covid19rx.org sun.com addthis.comaddthiscdn.comaddthisedge.comjava java.com java.net  panasonic panasonic.cn +cn panasonic.com panasonic.jp technics.comairgonetworks.comberkanawireless.comdragoniscoming.comgobianywhere.comhellosmartbook.com imod.comipleadership.org +iskoot.commeetsmartbook.compatenttruth.org pixtronix.comqctconnect.com +qprize.comqualcomm-email.com qualcomm.cnqualcomm.co.idqualcomm.co.inqualcomm.co.jpqualcomm.co.krqualcomm.co.uk qualcomm.comqualcomm.com.brqualcomm.com.tw qualcomm.de qualcomm.frqualcommhalo.comqualcommlabs.comqualcommmea.comqualcommretail.comqualcommventures.cnqualcommventures.com qualphone.com quicinc.com snapdragon.cnsnapdragonbooth.com +uplinq.com wipower.comwirelessreach.com +brewmp.comqualcomm.sc.omtrdc.net  razer.comrazersupport.com razerzone.com razerzone.jprespawnbyrazer.com appcloud.comappexchange.com attic.iobeyondcore.combuddymedia.com chatter.comcloudcraze.com cotweet.com data.comdemandware.com desk.comdocumentforce.comdreamforce.com einstein.comexacttarget.com  force.com govforce.comgravitytank.com heywire.com krux.commarketingcloud.com metamind.io pardot.com quotable.com radian6.com relateiq.comsalesforce.comsalesforce.orgsalesforceiq.comsalesforceliveagent.com salesforcemarketingcloud.com sequence.comsfdcstatic.com sforce.com site.com social.comsteelbrick.com twinprime.comweinvoiceit.com samsung -xn--cg4bkigalaxyappstore.comgalaxymobile.jpgame-platform.net knoxemm.com samsung.comsamsungapps.comsamsungcloud.com samsungdm.comsamsunggalaxyfriends.comsamsungknox.comsamsungqbe.com playstationplaystation.complaystation.net sonyentertainmentnetwork.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com +xn--cg4bkigalaxyappstore.comgalaxymobile.jpgame-platform.net knoxemm.com samsung.comsamsungapps.comsamsungcloud.com samsungdm.comsamsungeshop.com.cn +cnsamsunggalaxyfriends.comsamsungknox.comsamsungqbe.com playstationplaystation.complaystation.net sonyentertainmentnetwork.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com wwtbam.comyourfantasybeginsnow.comsonyginzasonypark.jpsony-africa.com sony-asia.comsony-europe.comsony-hes.co.jpsony-latin.com sony-mea.comsony-olympus-medical.comsony-promotion.eusony-semicon.co.jp sony.at sony.ba sony.be sony.bg sony.ca sony.ch sony.cl sony.co.cr sony.co.id @@ -4667,10 +7740,17 @@ sony.co.kr sony.co.nz sony.co.th sony.co.uk sony.com sony.com.ar sony.com.au sony.com.bo sony.com.br sony.com.co sony.com.do sony.com.ec sony.com.gt sony.com.hk sony.com.hn sony.com.mk sony.com.mx sony.com.my sony.com.ni sony.com.pa sony.com.pe sony.com.ph sony.com.sg sony.com.sv sony.com.tr sony.com.tw sony.com.vn sony.cz sony.de sony.dk sony.ee sony.es sony.eu sony.fi sony.fr sony.gr sony.hr sony.hu sony.ie sony.it sony.kz sony.lt sony.lu sony.lv sony.net sony.nl sony.no sony.pl sony.pt sony.ro sony.rs sony.ru sony.se sony.si sony.sk sony.ua sonybo.co.jp sonybsc.comsonybuilding.jpsonydesign.com sonydna.comsonyglobalsolutions.jp sonykigyo.jpsonylatvija.com -sonypcl.jpsonyprotechnosupport.co.jpsonystoragemedia.co.jp sonytc.co.jp  sovec.netads-twitter.com periscope.tv pscp.tvt.co tellapart.com tweetdeck.com  twimg.com twitpic.com twitter.comtwitteroauth.comtwitterstat.us -twitter.jp vine.co twtrdns.net uber.comuber-assets.comg-technology.com +sonypcl.jpsonyprotechnosupport.co.jpsonystoragemedia.co.jp sonytc.co.jp  sovec.net +spacex.comboringcompany.com x.comads-twitter.com periscope.tv pscp.tvt.co tellapart.com tweetdeck.com  twimg.com twitpic.com twitter.com +twitter.jptwitterinc.comtwitteroauth.comtwitterstat.us twtrdns.net vine.couber-assets.com uber.com ubereats.com +oath.cloud oath.com ouroath.comstatic-verizon.com verizon.com verizon.netverizonbusinessfios.comverizonenterprise.comverizonfios.comverizonmedia.comverizonwireless.com vzw.com +xo.com mvk.com userapi.com  vk-cdn.me vk-portal.net vk.cc +vk.com  vk.design vk.link vk.me vkcache.com vkgo.app +vklive.appvkmessenger.comvkmessenger.app vkontakte.ruvkuseraudio.comvkuserlive.netvkuservideo.comvkuservideo.netg-technology.com sandisk.ae -sandisk.it sandisk.co.jp sandisk.co.kr sandisk.co.uk sandisk.comsandisk.com.ausandisk.com.brsandisk.com.trsandisk.com.tw +sandisk.it +sandisk.cn +cn sandisk.co.jp sandisk.co.kr sandisk.co.uk sandisk.comsandisk.com.ausandisk.com.brsandisk.com.trsandisk.com.tw sandisk.de sandisk.es sandisk.fr @@ -4679,244 +7759,402 @@ sandisk.id sandisk.in sandisk.nl sandisk.sg -wd.com wdc.comwesterndigital.com yahoo -myguide.hkyahoo-news.com.hk yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cm yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yimg.com  ymail.com +wd.com wdc.comwesterndigital.com flickr flickr.com -flickr.netstaticflickr.com ads.yahoo.com -@adsgemini.yahoo.com -@adsxn--d1acpjx3f.xn--p1ai  yandex.az  yandex.by yandex.co.il +flickr.netstaticflickr.com ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +ads yahoo yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cmyahoo.cn +cn yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.cn +cn yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws maktoob.com +myguide.hkyahoo-news.com.hk yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yho.com yimg.com  ymail.comxn--d1acpjx3f.xn--p1ai  yandex.az  yandex.by yandex.co.il yandex.com yandex.com.am yandex.com.ge yandex.com.tr  yandex.ee  yandex.kg  yandex.kz  yandex.lt  yandex.lv  yandex.md yandex.net  yandex.ru  yandex.st  yandex.sx  yandex.tj  yandex.tm  yandex.ua  yandex.uzyandexcloud.net yastatic.net -yandexcloudflare-dns.comcloudflare-ipfs.comcloudflare.comcloudflareapps.comcloudflareinsights.comcloudflareok.comcloudflaressl.comcloudflarestatus.comcloudflarestream.comcloudflaretest.com one.one.onetrycloudflare.comvideodelivery.net workers.dev -fastly.com -fastly.netfastlylabs.com fastlylb.netfastly-terrarium.com pagecdn.com -pagecdn.io quantil.com stackpath.com stackpath.devbuypass-ssl.com buypass.com -buypass.no -buypass.se minid.no -comodo.com comodoca.com comodoca2.com comodoca3.com comodoca4.comcybertrust.co.jpcybertrust.ne.jp digicert.com freessl.com geotrust.com rapidssl.com -thawte.com  thawte.de  thawte.fr entrust.netentrustdatacard.comglobalsign-media.com globalsign.be globalsign.chglobalsign.co.ukglobalsign.comglobalsign.com.auglobalsign.com.hkglobalsign.com.sg globalsign.es globalsign.eu globalsign.frglobalsign.net globalsign.nl identrust.comidentrust.co.uk identrust.netletsencrypt.org secom.co.jpsecomtrust.net sectigo.comenterprisessl.comhackerguardian.cominstantssl.comoptimumssl.compositivessl.com digital-id.ch digitalid.chmanaged-pki.chmanaged-pki.de pki-post.ch pki-posta.ch pki-poste.chroot-signing.chrootsigning.comssl-certificate.ch -swissid.ch swissign.com swissign.liswisssign-group.chswisssign-group.comswisssign-group.li swisssign.ch swisssign.com swisssign.li swisssign.net swisssign.orgswisssigner.chswisssigner.comswisssigngroup.chswisssigngroup.comswissstick.com swisstsa.ch swisstsa.li trustdoc.ch trustsign.ch zert.ch telekom.com -telekom.de trustwave.com verisign.asia verisign.biz verisign.chverisign.co.inverisign.co.uk verisign.comverisign.com.auverisign.com.brverisign.com.esverisign.com.hkverisign.com.sgverisign.com.twverisign.com.vn verisign.de verisign.dk verisign.es verisign.fr verisign.hk verisign.in verisign.info verisign.jobs verisign.mobi verisign.name verisign.net verisign.org verisign.pro verisign.se verisign.sg verisign.tw verisign.us verisign.vnverisigninc.com addthis.comaddthiscdn.comaddthisedge.com addtoany.com apkpure.com cdnpure.com pureapk.com -winudf.com -bit.ly  bitly.com bitly.is bitwarden.com cutt.lydigitalocean.comdigitaloceanspaces.com -disqus.com disquscdn.comdisqusservice.com db.ttdropbox-dns.com dropbox.com dropbox.techdropboxapi.comdropboxbusiness.comdropboxcaptcha.comdropboxforum.comdropboxforums.comdropboxinsiders.comdropboxmail.comdropboxpartners.comdropboxstatic.comdropboxusercontent.comgetdropbox.com&"paper-attachments.s3.amazonaws.comduckduckgo.com duck.com -ddg.ggspreadprivacy.comentermediadb.netentermediadb.org evernote.com faststone.org -feedly.com  figma.com gofundme.com gravatar.com  heroku.co -heroku.com  heroku.me herokuapp.com herokucdn.comherokucharge.com herokussl.comheroku-app.comheroku-charge.com codei.sh -codeish.co -codeish.io  imgur.com imgurinc.cominfrapedia.com inoreader.com is.gdv.gd -jwpcdn.comjwplatform.com jwplayer.com -jwpltx.com -jwpsrv.comlongtailvideo.com linguee.com  deepl.com -mega.co.nz mega.nz netlify.combitballoon.com  notion.sonotion-static.com osdn.net patreon.com pics.ee  picsee.co -picsee.pro pise.pw pros.ee -pse.is -pin.it -pinimg.com pinterest.at pinterest.be pinterest.ca pinterest.ch pinterest.cl pinterest.copinterest.co.atpinterest.co.inpinterest.co.krpinterest.co.nzpinterest.co.uk pinterest.compinterest.com.aupinterest.com.bopinterest.com.ecpinterest.com.mxpinterest.com.pepinterest.com.pypinterest.com.uypinterest.com.vn pinterest.de pinterest.dk pinterest.ecpinterest.engineering pinterest.es pinterest.fr pinterest.hu pinterest.id pinterest.ie pinterest.inpinterest.info pinterest.it pinterest.jp pinterest.kr pinterest.mx pinterest.nl pinterest.nz pinterest.pe pinterest.ph pinterest.pt pinterest.ru pinterest.se pinterest.th pinterest.tw pinterest.uk pinterest.vnpinterestmail.com protonmail.chprotonmail.comprotonstatus.com pm.me quip-cdn.com quip.comquipelements.com rb.gy rebrandly.com reurl.cc sharethis.com shopify.com shopify.devshopifysvc.com shorturl.atsourceforge.comsourceforge.net -sf.net fsdn.com startpage.com ixquick.com steemit.com -stripe.comstripe.network stripecdn.com tinyurl.com -trello.com trellocdn.com -tumblr.com -now.shvercel-dns.comvercel-status.com -vercel.app -vercel.comzeit-world.co.ukzeit-world.comzeit-world.netzeit-world.org zeit.co zeit.sh zeitworld.com webflow.com wix.com  wixmp.com wixsite.com wixstatic.comvideopress.com w.org wordpress.com wordpress.org wordpress.tv wp-themes.com -wp.com  wpvip.com -zeplin.dev  zeplin.io zoho.com zoho.com.au zoho.eu zoho.in zohocdn.comzohomeetups.comzohomerchandise.comzohopublic.comzohoschools.comzohostatic.com zohostatic.inzohouniversity.comzohowebstatic.com zoom.com zoom.us mastercard.ae mastercard.at mastercard.az mastercard.ba mastercard.be mastercard.bg mastercard.by mastercard.ca mastercard.ch mastercard.clmastercard.co.idmastercard.co.ilmastercard.co.inmastercard.co.jpmastercard.co.kemastercard.co.krmastercard.co.nzmastercard.co.thmastercard.co.ukmastercard.co.vemastercard.co.zamastercard.commastercard.com.armastercard.com.aumastercard.com.bhmastercard.com.brmastercard.com.bzmastercard.com.cnmastercard.com.comastercard.com.cymastercard.com.egmastercard.com.gemastercard.com.gtmastercard.com.hkmastercard.com.kwmastercard.com.lbmastercard.com.mxmastercard.com.mymastercard.com.ngmastercard.com.pemastercard.com.phmastercard.com.samastercard.com.sgmastercard.com.trmastercard.com.twmastercard.com.vemastercard.com.vn mastercard.cz mastercard.de mastercard.dk mastercard.es mastercard.eu mastercard.fi mastercard.fr mastercard.gr mastercard.hr mastercard.hu mastercard.ie mastercard.it mastercard.jo mastercard.ke mastercard.kz mastercard.lu mastercard.md mastercard.my mastercard.nl mastercard.no mastercard.om mastercard.pl mastercard.pt mastercard.qa mastercard.ro mastercard.rs mastercard.ru mastercard.se mastercard.si mastercard.sk mastercard.ua mastercard.us visa.be visa.ca visa.cl -visa.co.ao -visa.co.cr -visa.co.id -visa.co.il -visa.co.in -visa.co.jp -visa.co.ke -visa.co.ni -visa.co.nz -visa.co.th -visa.co.uk -visa.co.ve -visa.co.za visa.com visa.com.ag visa.com.ai visa.com.ar visa.com.au visa.com.az visa.com.bo visa.com.br visa.com.bs visa.com.bz visa.com.cn visa.com.co visa.com.cy visa.com.dm visa.com.do visa.com.ec visa.com.ge visa.com.gt visa.com.gy visa.com.hk visa.com.hn visa.com.hr visa.com.jm visa.com.kh visa.com.kn visa.com.kz visa.com.lc visa.com.lk visa.com.ms visa.com.mx visa.com.my visa.com.ng visa.com.pa visa.com.pe visa.com.ph visa.com.pr visa.com.py visa.com.ru visa.com.sg visa.com.sv visa.com.tr visa.com.tt visa.com.tw visa.com.ua visa.com.uy visa.com.vc visa.com.vi visa.com.vn visa.cz visa.de visa.dk visa.es visa.fi visa.fr visa.gd visa.gp visa.gr visa.hu visa.ie visa.is visa.ky visa.lt visa.lv visa.mn visa.mq visa.nl visa.no visa.pl visa.pt visa.ro visa.se visa.sk visa.sx visa.tc -visabg.com visaeurope.at visaeurope.ch visaeurope.lu visaeurope.sivisaitalia.com visakorea.comvisamiddleeast.comvisasoutheasteurope.com discord.com -discord.gg discord.mediadiscordapp.comdiscordapp.net -lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net -nhncorp.jp -signal.orgslack-edge.comslack-imgs.com  slack.com -slackb.comslackcertified.com slackdemo.com slackhq.comt.me tdesktop.com -telegra.ph -telesco.pe telegram.me telegram.org telegram.dog  graph.org  adidas.at  adidas.be  adidas.ch adidas.co.in adidas.co.uk -adidas.com adidas.com.sa adidas.com.tw  adidas.cz  adidas.de  adidas.dk  adidas.hu  adidas.ie  adidas.it  adidas.nl  adidas.pl  adidas.ru  adidas.sebbycastatic.ca bbystatic.combestbuy-jobs.com -bestbuy.ca bestbuy.combestbuy.com.mx dmm.com  dmm.co.jpdmm-extension.com e-bay.it ebay-us.com ebay.at ebay.be ebay.ca ebay.ch ebay.cn -ebay.co.nz -ebay.co.uk -ebay.co.ve -ebay.co.za ebay.com ebay.com.ar ebay.com.au ebay.com.ec ebay.com.hk ebay.com.mt ebay.com.ph ebay.com.sg ebay.de ebay.es ebay.fr ebay.ie ebay.in ebay.it ebay.lt ebay.nl ebay.ph ebay.pk ebay.pl ebaycdn.net ebayimg.com ebayinc.comebaymainstreet.comebayprivacycenter.com ebayrtm.comebaystatic.com guccichimeforchange.org  gucci.comguccimuseo.comguccitimeless.comregiongold.comnike nike.com nike.com.br nike.com.hk nikecdn.com nikecloud.comnikestore.com.auniketracking.comstatic-nike.com swoo.sh -swoosh.com shopee.co.id shopee.co.th -shopee.com shopee.com.br shopee.com.my  shopee.ph  shopee.sg  shopee.tw  shopee.vnshopeemobile.com -shp.ee abema.io abema.tv ameba.jp ao3.orgarchiveofourown.orgarchiveofourown.comarchiveofourown.net -att.tv atttvnow.comattwatchtv.com directv.com  dtvce.comnettyinternet.com bandcamp.com -bcbits.com  castro.fmdeviantart.comdeviantart.net da-files.comadventuresbydisney.com -babble.com -dilcdn.comdisney-plus.net  disney.ca -disney.com disney.com.br  disney.iodisneyaulani.comdisneybaby.comdisneyjunior.comdisneylatino.comdisneymovieinsiders.comdisneyplus.com disneynow.comdisneyredirects.comdisneystore.com -dssott.com -go.commoviesanywhere.complaymation.comshopdisney.com starwars.comthestationbymaker.comthisispolaris.combattlebreakers.com epicgames.com fortnite.com paragon.complayparagon.comroborecall.comshadowcomplex.com spyjinx.comunrealengine.comunrealtournament.com*&^epicgames-download\d\.akamaized\.net$.*^cdn\d-epicgames-\d+\.file\.myqcloud\.com$3/^epicgames-download\d-\d+\.file\.myqcloud\.com$ fireside.fm cinemax.comforthethrone.com hbo.com hboasia.com  hbogo.com hbogoasia.com hbogoasia.hk -hbomax.com -hbonow.com  maxgo.com hulu.com -huluad.com -huluim.com -huluqa.comhulustream.com imdb.com imdb.tomedia-imdb.comkingkong.com.twkingkongapp.com litv.tv megaphone.fm moov.hk fast.com -netflix.ca netflix.com netflix.netnetflixinvestor.com nflxext.com nflximg.com nflximg.netnflxsearch.net -nflxso.net nflxvideo.netnico -nicodic.jp nicomanga.jp niconico.com nicoseiga.jp nicovideo.jp nimg.jp simg.jpnintendo-europe.com nintendo.at nintendo.be nintendo.chnintendo.co.jpnintendo.co.krnintendo.co.uknintendo.co.za nintendo.comnintendo.com.hknintendo.com.pt nintendo.de nintendo.dk nintendo.es nintendo.eu nintendo.fi nintendo.fr nintendo.it nintendo.net nintendo.nl nintendo.no nintendo.pt nintendo.ru nintendo.se nintendo.twnintendoeurope.com overcast.fm  pixiv.net  pixiv.org pixiv.co.jp  pximg.net playstationplaystation.complaystation.net sonyentertainmentnetwork.com -pca.stpocketcasts.com dishworld.comslinginternational.com  sling.commovenetworks.com -movetv.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com -wwtbam.comyourfantasybeginsnow.comsoundcloud.com -sndcdn.com byspotify.com pscdn.co scdn.co spoti.fispotify-everywhere.com spotify.comspotify.designspotifycdn.comspotifycharts.comspotifycodes.comspotifyforbrands.comspotifyjobs.com fanatical.comhumblebundle.complayartifact.comsteam-chat.comsteamcommunity.comsteamcontent.comsteamgames.comsteampowered.comsteamstatic.comsteamusercontent.comunderlords.comvalvesoftware.com dl.steam.ksyna.com -@cdn"st.dl.bscstorage.net -@cdnst.dl.eccdnx.com -@cdn#st.dl.pinyuncloud.com -@cdn(steampowered.com.8686c.com -@cdn'steamstatic.com.8686c.com -@cdn steambroadcast.akamaized.netsteamcdn-a.akamaihd.net!steamcommunity-a.akamaihd.netsteamstore-a.akamaihd.net#steamusercontent-a.akamaihd.net"steamuserimages-a.akamaihd.netsteamunlocked.net -muscdn.com -musical.ly -tiktok.com tiktokcdn.com tiktokv.com#p16-tiktokcdn-com.akamaized.net ext-twitch.tv  jtvnw.net  ttvnw.net  twitch.tv twitchcdn.net twitchsvc.net ubi.com ubisoft.com  uplay.com -vhx.tv -vhxqa1.com -vhxqa2.com -vhxqa3.com -vhxqa4.com -vhxqa6.comvimeo-staging.comvimeo-staging2.com  vimeo.com vimeo.frvimeobusiness.com vimeocdn.comvimeogoods.comvimeoondemand.comvimeostatus.comlivestream.com viu.com -viu.tv -weverse.io yande.re -got001.com -got002.com jstucdn.com playcvn.com rrys.tv rrys2019.com rrysapp.com  yyets.com zmz2019.com -zmzapi.com cvnad.com -@ads -iyoowi.com -@ads dcard.io dcard.tw -lih.kg  lihkg.com pincong.rocks  quora.com quoracdn.net qr.ae -reddit.comredditstatic.comredditmedia.com redd.it archive.org -change.org csis.orgcsis-prod.s3.amazonaws.comglobalsecurity.orgrolfoundation.orgrolsociety.org -un.org who.int mediawiki.org wikibooks.org wikidata.orgwikimediafoundation.org wikimedia.org wikinews.org wikipedia.org wikiquote.orgwikisource.orgwikiversity.orgwikivoyage.orgwiktionary.orgwmfusercontent.org -w.wiki toolforge.orgwikimediacloud.org wmcloud.org wmflabs.org wto.org pubmatic.compubmatic.co.jpads.pubmatic.com -@ads taboola.com  fonts.com  fonts.net hkedcity.nethkreadingcity.nethuanghuagang.orgmcd  mcdonalds4008-517-517.cnaboutmcdonalds.comhappymeal.co.nzhappymeal.com.au mcd.commcdelivery.co.idmcdelivery.co.krmcdelivery.com.aumcdelivery.com.mymcdelivery.com.sgmcdelivery.com.twmcdindonesia.com mcdonalds.camcdonalds.co.uk mcdonalds.commcdonalds.com.hk mcdonalds.hk mcdonalds.it mcdonalds.no mcdonalds.semcdonaldsarabia.commcdonaldsparties.co.nzmcdonaldsparties.com.au!xn--qhrx81fxh2a.xn--55qx5d.hk rarbg.me rarbg.to rarbg.israrbgaccess.org rarbggo.orgrarbgmirror.comrarbgmirror.orgrarbgproxy.org rarbgprx.orgrarbgunblock.com starbucks.castarbucks.co.uk starbucks.com starbucks.de starbucks.fr starbucks.ie -tsquare.tv  windy.com xdty.org  xingrz.me - - CHINAMOBILE 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn -cmvideo.cn miguvideo.com andfx.cn  andfx.net -cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com - -CNcn citic baidu -unicomsohu -xn--fiqs8s -xn--fiqz9s xn--1qqw23a xn--xhq521b xn--8y0a063a xn--6frz82g -xn--fiq64b xn--estv75g xn--vuq861b xn--zfr164b 3304399.net 4399.com 4399api.com 4399dmw.com -4399er.com4399youpai.com 5054399.com img4399.com  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn +yandex +F + IDENTRUST identrust.comidentrust.co.uk identrust.net +P + KUAISHOU-ADS log-sdk.gifshow.com +adswlog.kuaishou.com +ads + +SINA  97973.com +picself.cn sina.cn sina.com sina.com.cn sina.net sinaapp.com sinaedge.com +sinaimg.cn sinaimg.com  sinajs.cn +sinajs.comt.cn videoself.cn  wbimg.com wbimg.cn wcdn.cn weibo.cn  weibo.com weibo.com.cn weibocdn.com xhaiwai.com 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +ads +- + PUBMATIC-ADSads.pubmatic.com +ads +* + +FLURRY-ADSdata.flurry.com +ads +' +FOXfoxfox-corporation.com fox-news.com fox.com +fox.tv fox10.tv fox10news.comfox10phoenix.com  fox11.comfox13memphis.com fox13news.com  fox23.comfox23maine.com +fox247.com  fox247.tv  fox26.comfox26houston.comfox28media.com  fox29.comfox2detroit.com fox2news.com  fox32.comfox32chicago.comfox35orlando.comfox38corpuschristi.com fox42kptm.com  fox46.comfox46charlotte.com  fox47.com fox49.tv fox4news.com fox51tns.netfox5atlanta.com +fox5dc.com +fox5ny.com fox5storm.com fox6now.com fox7.comfox7austin.com fox9.comfoxacrossamerica.comfoxaffiliateportal.comfoxandfriends.com +foxbet.comfoxbusiness.comfoxbusiness.tvfoxbusinessgo.comfoxcanvasroom.comfoxcareers.comfoxcharlotte.com foxcincy.com foxcincy.jobs foxcincy.netfoxcollegesports.comfoxcorporation.comfoxcreativeuniversity.com foxcredit.com foxcredit.org foxd.tv +foxdcg.comfoxdeportes.comfoxdeportes.netfoxdeportes.tvfoxdigitalmovies.com foxdoua.comfoxentertainment.com +foxest.com +foxfaq.com +foxfdm.com foxfiles.com +foxinc.com foxkansas.com  foxla.com foxla.tvfoxlexington.comfoxmediacloud.com foxnation.comfoxnebraska.com +foxneo.comfoxneodigital.comfoxnetworks.infofoxnetworksinfo.com +foxnews.cc foxnews.com foxnews.net foxnews.org +foxnews.tvfoxnewsaffiliates.comfoxnewsaroundtheworld.comfoxnewsb2b.comfoxnewschannel.com foxnewsgo.net foxnewsgo.org foxnewsgo.tvfoxnewshealth.comfoxnewslatino.comfoxnewsmagazine.comfoxnewsnetwork.comfoxnewsopinion.comfoxnewspodcasts.comfoxnewspolitics.comfoxnewsradio.comfoxnewsrundown.comfoxnewssunday.com  foxon.comfoxphiladelphia.com foxpoker.com  foxrad.io foxredeem.comfoxrelease.comfoxrichmond.com foxrobots.comfoxsmallbusinesscenter.comfoxsmallbusinesscenter.netfoxsmallbusinesscenter.org foxsoccer.net foxsoccer.tvfoxsoccermatchpass.comfoxsoccerplus.comfoxsoccerplus.netfoxsoccerplus.tvfoxsoccershop.comfoxsports-chicago.comfoxsports-newyork.comfoxsports-world.com foxsports.cl foxsports.cofoxsports.co.ve foxsports.comfoxsports.com.arfoxsports.com.bofoxsports.com.brfoxsports.com.cofoxsports.com.ecfoxsports.com.gtfoxsports.com.mxfoxsports.com.pefoxsports.com.pyfoxsports.com.uyfoxsports.com.ve foxsports.gtfoxsports.info foxsports.netfoxsports.net.br foxsports.pe foxsports.sv foxsports.uyfoxsports2.comfoxsportsflorida.comfoxsportsgo.comfoxsportsla.comfoxsportsnetmilwaukee.comfoxsportsneworleans.comfoxsportsracing.comfoxsportssupports.comfoxsportsuniversity.comfoxsportsworld.comfoxstudiolot.com foxsuper6.com +foxtel.com foxtel.com.aufoxtelevisionstations.com  foxtv.com foxtvdvd.com  foxuv.comfoxweatherwatch.com  fssta.com +fxn.ws fxnetwork.comfxnetworks.com bentobox.tv kicu.tv ktvu.commyfoxsanfran.comafewmomentswith.com +anidom.comcasoneexchange.comcoronavirusnow.com +fse.tvgeraldoatlarge.comgooddaychicago.com joeswall.comkilmeadeandfriends.commaskedsingerfox.com +my13la.com +my20dc.commy20houston.com +my29tv.com my45.com  my9nj.commyfoxatlanta.commyfoxaustin.commyfoxboston.commyfoxcharlotte.commyfoxchicago.com myfoxdc.commyfoxdetroit.com myfoxdfw.commyfoxhouston.commyfoxhurricane.com myfoxla.commyfoxlosangeles.commyfoxlubbock.commyfoxmaine.com myfoxny.commyfoxorlando.commyfoxphilly.commyfoxphoenix.commyfoxtampa.commyfoxtampabay.commyfoxtwincities.com myfoxzone.com myq2.comnewsnowfox.comorlandohurricane.comparadisehotelquizfox.com q13.com +q13fox.comrealamericanstories.comrealamericanstories.inforealamericanstories.netrealamericanstories.orgrealamericanstories.tvrealmilwaukeenow.com rprimelab.comshopspeedtv.comsoccermatchpass.comspeeddreamride.comspeedfantasybid.comspeedracegear.com speedxtra.comteenchoice.com testonfox.comtheclasshroom.comthefoxnation.comthegeorgiascene.comwhatthefox.comwhosthehost.com wofl.tvwoflthenewsstation.com wogx.com foxnewsplayer-a.akamaihd.net +r + +PURIKONEJP"api-priconne-redive.cygames.jpomotenashi.cygames.jp%!prd-priconne-redive.akamaized.net + + ALIBABACLOUDalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.com +/ +CLEARBITJS-ADSx.clearbitjs.com +ads + + FASTSTONE faststone.org + +GEOLOCATION-CN +42r.cn +5566ua.com aurorapush.cn +e0n.cn japps.cn jchat.io +jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com +jsurvey.cn  jvoice.cn +kc9.cn +n0q.cn pushcfg.com +s0n.cn mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com +uyunad.comwhalecloud.comalog.umeng.com +ads alog.umengcloud.com +ads +w.cnzz.com +ads bootcss.com +bootcdn.cnphpcomposer.com +maoyun.commaoyuncloud.cnmaoyuncloud.comstaticfile.org qbox.me  qiniu.com qiniucdn.com qiniudn.com qiniudns.com  qnssl.com  ucloud.cn ufileos.com  aicdn.com upai.com upaiyun.com  upcdn.net  upyun.com  8686c.comchinanetcenter.com +wangsu.com ourdvsss.com yfcache.com +yfcalc.com yfcloud.com  yfdts.net  yfp2p.net +yfscdn.net yunfancdn.com +boc.cnbankofchina.combocaviation.com  boccfc.cn  bocgi.com bocgins.com  bochk.com bocichina.com bocigroup.com  bocim.combocservices.com.cn cignacmb.comcmb-leasing.com cmbchina.com cmbi.com.hkcmbwinglungbank.comicbc icbc-ltd.com icbc-us.com icbc.com.cn  95516.com unionpay.comunionpayintl.comunionpaysecure.com abchina.com  whccb.com cebbank.com ceblease.com +eb-ind.com ebasset.com ebchina.comebchinaintl.com +ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.comdanjuanfunds.com +xueqiu.com 58.com  58.com.cn 5858.com  58che.com 58xueche.com anjuke.comanjukestatic.com chinahr.com -daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com acfun.cn aixifan.com!apilog-web.acfun.cn -@ads -acplay.netdandanplay.com alibaba +daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn +skysea.com  suanya.cn +suanya.com +tieyou.com +toptown.cn toursbms.com trip.com tripcdn.com +vipdlt.com dangdang.com ddimg.cn +ele.me elemecdn.com eleme.cn  ganji.comganjistatic1.com3.cn  300hu.com +360buy.com 360buyimg.com +360top.com +7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn +dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com +jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com +jd-app.com  jd-ex.com jd.cn jd.co.th +jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com +jingxi.com +jkcsjd.com +joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn +paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com +vg.com wangyin.com  wdfok.com yhd.com yihaodian.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads lianjia.com  ljcdn.com manmanbuy.com dianping.com +maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com mogu.com mogucdn.com mogujie.com +pddpic.com pinduoduo.com yangkeduo.com  smzdm.com +zdmimg.com cnsuning.com +suning.comsuningcloud.comsuningestate.comsuningholdings.com 40017.cn +17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com +ly.com  vancl.com vanclimg.com  vcimg.com +youzan.com yzcdn.cn youzanyun.com +ziroom.comziroomapartment.com 3dmgame.com 3304399.net 4399.com 4399api.com 4399dmw.com +4399er.com4399youpai.com 5054399.com img4399.com acfun.cn aixifan.com apilog-web.acfun.cn +ads +acplay.netdandanplay.com +ali213.net +acg.tv acgvideo.com +b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com +mincdn.com$ upos-hz-mirrorakam.akamaized.net biji.com +ddmogo.com +igetget.cn igetget.com luojilab.com  mogoo.com +sao.cn saolife.com dmzj.com  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com gamersky.com +gcores.com gitv.cn gitv.tv huya.com msstatic.com 71.am  iqiyi.com iqiyipic.com +pps.tv +ppsimg.com qiyi.com qiyipic.com +qy.net +71edge.coma.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +ads  jjwxc.net ku6.com +ku6cdn.com +ku6img.com kkmh.comkuaikanmanhua.com gifshow.com ksapisrv.com kuaishou.com +yximgs.com log-sdk.gifshow.com +adswlog.kuaishou.com +ads  kgimg.com  kugou.com +le.com lecloud.com +lemall.com letv.com letvcdn.com letvimg.com miaopai.com +mihoyo.com bh3.com  pplive.cn +pplive.com pptv.com qingting.fm  sfacg.com +61.com +taomee.com +tapimg.com +taptap.com  tgbus.com tiancity.comtiancitycdn.com u17.com u17i.com u17t.com +vgtime.com ximalaya.com  xmcdn.com +kumiao.com  youku.com  ykimg.com +mmstat.com soku.com +cibntv.net +duowan.com dwstatic.com +yy.com yystatic.com +heytea.com chiphell.com +douban.com  douban.fm doubanio.com erji.net +hacpai.com  ld246.com +nga.cn 178.com +ngabbs.com ngacn.cc saraba1st.com  zhihu.com  zhimg.com  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.comsf-financial.com sf-saas.comsf-tech.com.cn sfcar.hk sffix.cn sfgy.org 36kr.com 36krcdn.com  dgtle.comhoopchina.com.cn hupu.com hupucdn.com  shihuo.cn coolbuy.com  ifanr.com ifanr.inifanrusercontent.com +ifanrx.com +minapp.com +caixin.com cctv.cn cctv.com cctvpic.com chinaepg.cn chinalive.com citv.net.cn cnms.net.cn cntv.cn cntv.com.cn +cctvlib.cncctvlibrary.cncctvlib.com.cncctvlibrary.com.cn +cctvpro.cncctvpro.com.cn  cntvwb.cn gjgbdszt.cngjgbdszt.com.cngjgbdszt.net.cn  ipanda.cn +ipanda.com ipanda.com.cn +ipanda.net livechina.cn livechina.comolympicchannelchina.cn tvcc.cn tvcc.com.cn%!xn--fiq53l6wcx3kp9bc7joo6apn8a.cn%!xn--fiq53l90et9fpncc7joo6apn8a.cn-)xn--fiq53l6wcx3kp9bc7joo6apn8a.xn--fiqs8s%!xn--kprv4ewxfr9cpxcc7joo6apn8a.cn-)xn--kprv4ewxfr9cpxcc7joo6apn8a.xn--fiqs8s zggbdszt.cnzggbdszt.com.cnzggbdszt.net.cnzygbdszt.net.cn chinanews.comchinanews.com.cn +cns.com.cn ecns.cn geekpark.net jiemian.comjiemian.com.cn +lancdn.comlandiannews.com  wsoso.com  ifeng.com ifengimg.comphoenixcenter.cn fengedu.comifengweekly.com 6655.com cooldock.com +ithome.com lapin365.com ruanmei.com +saayaa.com win7china.com win8china.com sohu.com +sohucs.com +itc.cn solidot.org  sspai.com tmtpost.com chaindd.com +72whys.com checkzeit.com +tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com feng.com fengimg.com wfdata.club ynet.cn ynet.com ynet.com.cnhainanairlines.com hnacargo.com  hnair.com 10044.cnsinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com +csdl.ac.cn  las.ac.cn  fuwai.com pkuh6.cn puh3.net.cnhospital.pku.edu.cnss.bjmu.edu.cn 115.com 3type.cn 4paradigm.com  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn +afdian.net afdiancdn.com agora.io +agoraio.cn agoralab.co +antutu.com bitauto.combitautoimg.com cheyisou.com  yiche.com  yccdn.com shimo.im  yuque.com chinaso.com +pg0.cn +chinaz.com +chinaz.net caiyunai.com caiyunapp.com coolapk.comcoolapkmarket.comcoolapkmarket.net c-t.workcowtransfer.com geetest.com#geetest.datasink.sensorsdata.cn hellofont.cnhellowebfont.com0,hellofontpreview.oss-cn-beijing.aliyuncs.com-)hellowebfonts.oss-cn-beijing.aliyuncs.com hanyi.com.cnfontstar.com.cnfoundertype.com ipip.net jianshu.com +jianshu.io jinshuju.netjinshujucdn.com gotokeep.com keepcdn.com  lagou.com lgstatic.com baidupan.com +lanzou.com lanzous.com woozooo.com +liepin.com +lietou.comlietou-static.com mafengwo.cn mafengwo.com mafengwo.net  meitu.com meitudata.com moji.com mojichina.com  polyv.net videocc.net +renren.comrenren-inc.com vaptcha.com vaptcha.net wamawama.com +wiwide.com +sojump.com +wjx.cn wjx.com wjx.top zcmbc.com.cn zdns.cn zdns.net.cn zdns.org.cn zdnscloud.biz zdnscloud.cn zdnscloud.comzdnscloud.com.cnzdnscloud.info zdnscloud.netzdnscloud.net.cnzdnscloud.org.cnchinesemooc.org +cnmooc.orgicourse163.org icourses.cn mooc.cnopenlearning.com pmphmooc.commoocs.unipus.cnopencourse.pku.edu.cn study.163.com cnki.net  apabi.comcnthinkers.com  cqvip.comhuijistatic.com huijiwiki.com moegirl.orgmoegirl.org.cn  guokr.comwanfangdata.com.cn speiyou.com +xesimg.com xueersi.com banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com zhihuishu.com  coding.me +coding.net csdn.net +csdnimg.cn  deepin.cn +deepin.com  deepin.io +deepin.org  gitee.comjinrishici.com  juejin.imb-gold-cdn.xitu.iomirror-gold-cdn.xitu.iop1-juejin.byteimg.comp2-juejin.byteimg.comp3-juejin.byteimg.comp4-juejin.byteimg.comp5-juejin.byteimg.comp6-juejin.byteimg.comp7-juejin.byteimg.comp8-juejin.byteimg.comp9-juejin.byteimg.com oschina.netruby-china.orgrubyconfchina.org mysxl.cn +sxl.cn  sxlcdn.cnsegmentfault.com  sifou.com +tipdim.orgxueyuanjun.com alibaba alipay -taobao tmall a.alimama.cn -@adsacjs.aliyun.com -@ads adash.m.taobao.com -@ads"adashbc.m.taobao.com -@ads#adashbc.ut.taobao.com -@ads#adash-c.ut.taobao.com -@ads!adashx.m.taobao.com -@ads%adashx4ae.ut.taobao.com -@ads$adashx4yt.m.taobao.com -@ads$adashxgc.ut.taobao.com -@adsadsh.m.taobao.com -@adsafp.adchina.com -@adsafp.alicdn.com -@ads!agoodm.m.taobao.com -@ads$agoodm.wapa.taobao.com -@ads alipaylog.com -@adsamdc.alipay.com -@adsamdc.m.taobao.com -@ads!api.wapa.taobao.com -@ads$api.waptest.taobao.com -@ads apoll.m.taobao.com -@ads$appdownload.alicdn.com -@adsatanx.alicdn.com -@adsatanx2.alicdn.com -@adscbu01.alicdn.com -@adscdn0.mobmore.com -@adsclick.aliyun.com -@ads'click.mz.simba.taobao.com -@adscm.ipinyou.com -@ads cm.mlt01.com -@ads"dsp.simba.taobao.com -@adserr.taobao.com -@adsex.mobmore.com -@ads ex.puata.info -@ads"fav.simba.taobao.com -@ads%feedback.whalecloud.com -@adsff.win.taobao.com -@ads fm.p0y.cn -@ads g.click.taobao.com -@ads -g.tbcdn.cn -@adsgma.alicdn.com -@adsgtms01.alicdn.com -@adsgtms02.alicdn.com -@adsgtms03.alicdn.com -@adsgtms04.alicdn.com -@adshydra.alibaba.com -@ads(hz.pre.tbusergw.taobao.net -@ads$hz.tbusergw.taobao.net -@ads i.ipinyou.com -@adsinit.phpwind.com -@ads"intl.wapa.taobao.com -@ads%intl.waptest.taobao.com -@ads#jxlog.istreamsche.com -@adslog.umtrack.com -@adsm.intl.taobao.com -@ads m.simba.taobao.com -@ads match.p4p.1688.com -@ads&material.istreamsche.com -@ads mlt01.com -@ads'nbsdk-baichuan.alicdn.com -@ads'nbsdk-baichuan.taobao.com -@ads#osfota.cdn.aliyun.com -@ads!osupdate.aliyun.com -@ads'osupdateservice.yunos.com -@ads&pindao.huoban.taobao.com -@ads push.wandoujia.com -@adsre.m.taobao.com -@ads re.taobao.com -@ads'redirect.simba.taobao.com -@adsrj.m.taobao.co -@adsrj.m.taobao.com -@ads sdkinit.taobao.com -@ads show.re.taobao.com -@adssimaba.taobao.com -@ads simba.m.taobao.com -@ads"srd.simba.taobao.com -@adsstats.ipinyou.com -@ads!strip.taobaocdn.com -@ads%tanxlog.istreamsche.com -@adstejia.taobao.com -@adstemai.taobao.com -@ads"tns.simba.taobao.com -@ads!tongji.linezing.com -@ads!tvupgrade.yunos.com -@adstyh.taobao.com -@adsuserimg.qunar.com -@adsw.m.taobao.com -@adsyiliao.hupan.com -@adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com +taobao tmall a.alimama.cn +adsacjs.aliyun.com +adsadash.m.taobao.com +ads!adashbc.m.taobao.com +ads"adashbc.ut.taobao.com +ads"adash-c.ut.taobao.com +ads adashx.m.taobao.com +ads$adashx4ae.ut.taobao.com +ads#adashx4yt.m.taobao.com +ads#adashxgc.ut.taobao.com +adsadsh.m.taobao.com +adsafp.adchina.com +adsafp.alicdn.com +ads agoodm.m.taobao.com +ads#agoodm.wapa.taobao.com +ads alipaylog.com +adsamdc.alipay.com +adsamdc.m.taobao.com +ads api.wapa.taobao.com +ads#api.waptest.taobao.com +adsapoll.m.taobao.com +ads#appdownload.alicdn.com +adsatanx.alicdn.com +adsatanx2.alicdn.com +adscbu01.alicdn.com +adscdn0.mobmore.com +adsclick.aliyun.com +ads&click.mz.simba.taobao.com +adscm.ipinyou.com +ads cm.mlt01.com +ads!dsp.simba.taobao.com +adserr.taobao.com +adsex.mobmore.com +ads ex.puata.info +ads!fav.simba.taobao.com +ads$feedback.whalecloud.com +adsff.win.taobao.com +ads fm.p0y.cn +adsg.click.taobao.com +ads +g.tbcdn.cn +adsgma.alicdn.com +adsgtms01.alicdn.com +adsgtms02.alicdn.com +adsgtms03.alicdn.com +adsgtms04.alicdn.com +adshydra.alibaba.com +ads'hz.pre.tbusergw.taobao.net +ads#hz.tbusergw.taobao.net +ads i.ipinyou.com +adsinit.phpwind.com +ads!intl.wapa.taobao.com +ads$intl.waptest.taobao.com +ads"jxlog.istreamsche.com +adslog.umtrack.com +adsm.intl.taobao.com +adsm.simba.taobao.com +adsmatch.p4p.1688.com +ads%material.istreamsche.com +ads mlt01.com +ads&nbsdk-baichuan.alicdn.com +ads&nbsdk-baichuan.taobao.com +ads"osfota.cdn.aliyun.com +ads osupdate.aliyun.com +ads&osupdateservice.yunos.com +ads%pindao.huoban.taobao.com +adspush.wandoujia.com +adsre.m.taobao.com +ads re.taobao.com +ads&redirect.simba.taobao.com +adsrj.m.taobao.co +adsrj.m.taobao.com +adssdkinit.taobao.com +adsshow.re.taobao.com +adssimaba.taobao.com +adssimba.m.taobao.com +ads!srd.simba.taobao.com +adsstats.ipinyou.com +ads strip.taobaocdn.com +ads$tanxlog.istreamsche.com +adstejia.taobao.com +adstemai.taobao.com +ads!tns.simba.taobao.com +ads tongji.linezing.com +ads tvupgrade.yunos.com +adstyh.taobao.com +adsuserimg.qunar.com +adsw.m.taobao.com +adsyiliao.hupan.com +adsalibabacloud.co.inalibabacloud.comalibabacloud.com.aualibabacloud.com.hkalibabacloud.com.myalibabacloud.com.sgalibabacloud.com.tw alicloud.comalibabadns.com alicdn.com alidayu.com alidns.comaliyun-inc.comaliyun-iot-share.com -aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.to -ele.me elemecdn.com eleme.cnteambition.comteambition.netteambitionapis.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads 25pp.com  56che.com  95095.com 9game.cn -aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.comaliexpress.com alifanyi.comalihealth.com.cn alihealth.hk +aliyun.com aliyuncdn.com aliyuncs.com hichina.comica-alliance.org mxhichina.com ddurl.to dingding.xin dingtalk.cn dingtalk.com dingtalk.netdingtalkapps.com laiwang.com lwurl.toteambition.comteambition.netteambitionapis.com 25pp.com  56che.com  95095.com 9game.cn +aliapp.orgalibaba-inc.com alibaba.comalibabacapital.comalibabacorp.comalibabadoctor.comalibabafuturehotel.comalibabagroup.comalibabaplanet.comalibabaued.comalibabausercontent.com alifanyi.comalihealth.com.cn alihealth.hk aliimg.com alikmd.com alimama.com alimebot.com alimei.com alios.cn @@ -4933,465 +8171,367 @@ jhgtgb.com kanbox.com lazada.comliangxinyao.com m-now.cn maitix.com  mdeer.com mei.commiaostreet.com  mshare.cc nic.xinphilanthropy.xin phpwind.com phpwind.netqingtingtrip.com  rexpos.cn saee.org.cn shenjing.com  shuqi.comshuqireader.com sparenode.com  supet.com  ttpod.com wandoujia.comxinlingshou.cn yowhale.com yunos-inc.com  yunos.comyushanfang.com -zuodao.com sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com +zuodao.comaliexpress.com aliexpress.ru sm.cn cainiao.comcainiao.com.cncainiao-inc.com freshhema.com hemamax.com hemaos.com hemashare.cn shyhhema.com 1688.com etao.com juhuasuan.comlingshoujia.com mashort.cn pailitao.com taobao.com -taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmalltv.com tmjl.ai alitrip.com  feizhu.cn +taobao.org taobaocdn.comtaobizhong.comtaopiaopiao.com tb.cn tbcache.com tburl.in  tmall.com tmall.ru tmalltv.com tmjl.ai alitrip.com  feizhu.cn feizhu.com fliggy.com  fliggy.hk -iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net baidu +iuynfg.com amap.com amapauto.com autonavi.com  gaode.com  xiami.com xiami.fm  xiami.net  b3log.org a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +ads zuoyebang.cc zuoyebang.com +zybang.com baidu 91.com aipage.com apollo.auto baidu.cn  baidu.com baidu.com.cn baidubce.combaiducontent.com baidupcs.combaidustatic.com -baifae.com baifubao.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn +baifae.com baifubao.com +bcebos.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn +bdydns.com bdydns.net chuanke.com  dlnel.com  dlnel.org duapps.com dwz.cn hao123.com hao123img.com hao222.com haokan.com jomocdn.net jomodns.com -mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@ads zuoyebang.cc zuoyebang.com -zybang.com -acg.tv acgvideo.com -b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com -mincdn.com$ upos-hz-mirrorakam.akamaized.net +mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com bytecdn.cn bytedance.com bytedance.net bytedns.net byteimg.com douyin.com huaxiong.comjokecommunity.comneihanshequ.com pstatp.com snssdk.com toutiao.comtoutiaocdn.comtoutiaocloud.comtoutiaohao.comtoutiaohao.net toutiaoimg.cntoutiaoimg.comtoutiaoimg.nettoutiaopage.com -wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com -ixigua.com ixgvideo.com  365yg.com -csdl.ac.cn  las.ac.cn cctv.cn cctv.com cctvpic.com chinalive.com cntv.cn cntv.com.cn  cntvwb.cn  ipanda.cn -ipanda.com ipanda.com.cn -ipanda.net livechina.cn livechina.comolympicchannelchina.cn 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn -cmvideo.cn miguvideo.com andfx.cn  andfx.net -cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com -ctexcel.ca ctexcel.comctexcel.com.hk -ctexcel.fr -ctexcel.us -189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com -chntel.com  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cn cnki.net  coding.me -coding.net coolapk.comcoolapkmarket.comcoolapkmarket.net c-t.workcowtransfer.com csdn.net -csdnimg.cn c-ctrip.com colinker.com ctrip.cn ctrip.co.id ctrip.co.kr ctrip.co.th  ctrip.com ctrip.com.hk ctrip.my ctrip.sg ctripbiz.com ctripbuy.hk ctripteam.com doticloud.com easytrip.com hhtravel.comhhtravel.com.tw izuchebao.com  lvtds.com  shuntu.cn -skysea.com  suanya.cn -suanya.com -tieyou.com -toptown.cn toursbms.com trip.com tripcdn.com -vipdlt.com biji.com -ddmogo.com -igetget.cn igetget.com luojilab.com  mogoo.com -sao.cn saolife.com  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com -ele.me elemecdn.com eleme.cn erji.net cebbank.com ceblease.com -eb-ind.com ebasset.com ebchina.comebchinaintl.com -ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com  ganji.comganjistatic1.com -gcores.com gitv.cn gitv.tv hicloud.com hihonor.com honor.cn -huawei.comhuaweicloud.com  vmall.com vmallres.com hupu.com hupucdn.com huya.com msstatic.comicbc icbc-ltd.com icbc-us.com icbc.com.cn coolbuy.com  ifanr.com ifanr.inifanrusercontent.com -ifanrx.com -minapp.com 71.am  iqiyi.com iqiyipic.com -pps.tv -ppsimg.com qiyi.com qiyipic.com -qy.net -71edge.coma.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@ads3.cn  300hu.com -360buy.com 360buyimg.com -360top.com -7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn -dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com -jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com -jd-app.com  jd-ex.com jd.cn jd.co.th -jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com -jingxi.com -jkcsjd.com -joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn -paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com -vg.com wangyin.com  wdfok.com yhd.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com -@ads c-nfa.jd.com -@adscps.360buy.com -@ads -jzt.jd.com -@ads stat.m.jd.com -@ads img-x.jd.com -@ads -42r.cn -5566ua.com aurorapush.cn -e0n.cn japps.cn jchat.io -jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com -jsurvey.cn  jvoice.cn -kc9.cn -n0q.cn pushcfg.com -s0n.cn jiemian.comjiemian.com.cnjinrishici.com jinshuju.netjinshujucdn.com jsdelivr.net jsdelivr.com gotokeep.com keepcdn.com gifshow.com ksapisrv.com kuaishou.com -yximgs.com!log-sdk.gifshow.com -@adswlog.kuaishou.com -@ads  lagou.com lgstatic.com -lancdn.comlandiannews.com  wsoso.com baidupan.com -lanzou.com lanzous.com woozooo.com -liepin.com -lietou.comlietou-static.com mafengwo.cn mafengwo.com mafengwo.net manmanbuy.com  meitu.com meitudata.com dianping.com -maoyan.com meituan.com meituan.net  mtyun.com  neixin.cn sankuai.com flyme.cn meizu.cn  meizu.com  mzres.com -mihoyo.com bh3.com 126.com 126.link 126.net 127.net 163.com163industry.com 163mail.com 163qiyukf.com +wukong.comwukongwenda.cnwukongwenda.com zijiecdn.com zijiecdn.net  zjcdn.com  baike.com +ixigua.com ixgvideo.com  365yg.com didi-food.comdidiaustralia.blogdidichuxing.comdidiglobal.comdidimobility.co.jpdidistatic.comxiaojukeji.com  dbank.com dbankcdn.com harmonyos.com hicloud.com hihonor.com honor.cn +huawei.comhuaweicloud.com  vmall.com vmallres.com cmcm.com cmcmcdn.com  liebao.cn duba.com duba.net ijinshan.comseasungames.com xishanju.com xoyo.com testplus.cn +wps.cn  51dzt.com  iciba.com  docer.com kdocs.cn papocket.com  wpspdf.cn kimg.cn kingsoft.com ksmobile.com +ks-cdn.com  ksyun.com ksyungslb.com flyme.cn meizu.cn  meizu.com  mzres.com 126.com 126.link 126.net 127.com 127.net 163.com163industry.com 163mail.com 163qiyukf.com 163yun.com 166.net haowu.linkicourse163.org  kaola.com lofter.com  nease.netnetease-inc.com netease.com netease.im qiyukf.com ydstatic.com yeah.net -youdao.com g.163.com -@ads -nga.cn 178.com -ngabbs.com ngacn.cc oneplus.com -oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com coloros.com finzfin.com h2os.com +youdao.comanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads coloros.com finzfin.com heytap.com heytapcs.comheytapdownload.comheytapimage.com -myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobi  oppoer.meoppomobile.com oppopay.com opposhop.cn -realme.com realmebbs.comrealmemobile.com -pddpic.com pinduoduo.com yangkeduo.com  pplive.cn -pplive.com pptv.com +myoppo.com nearme.com.cn oppo.cn oppo.com  oppo.mobioppodigital.com  oppoer.meoppomobile.com oppopay.com opposhop.cn +realme.com realmebbs.comrealmemobile.com oneplus.com +oneplus.cn oneplus.net opstatics.comoneplusbbs.com h2os.com 75.team +75team.com baomitu.com 360.cn 360.com 360-jr.com 360chou.com360daikuan.com360huzhubao.com 360jie.com360jinrong.net -360kan.com 360kuai.com  360os.com 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com +360kan.com 360kuai.com  360os.com 360panyun.cn 360safe.com 360shouji.com 360taojin.com360totalsecurity.com 360tpcdn.com360webcache.com anquanke.com  haoso.com haosou.com haosou.com.cn -haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com qihucdn.com  qihoo.com qikucdn.com -so.com sou.comxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com -youhua.com 6655.com cooldock.com -ithome.com lapin365.com ruanmei.com -saayaa.com win7china.com win8china.com  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.com sf-saas.comsf-tech.com.cn sffix.cn sfgy.org  sfacg.com  97973.com sina.com -sinaimg.cn sina.com.cn  sinajs.cn sina.cn sinaapp.com sinaedge.com sinaimg.com -sinajs.com  weibo.com weibo.com.cn weibo.cn weibocdn.com xhaiwai.com 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@adssinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com -go2map.com sogo.com  sogou.com sogoucdn.com saraba1st.com cnsuning.com -suning.comsuningcloud.comsuningestate.comsuningholdings.com taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.com -tapimg.com -taptap.com -apcdns.net foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn imqq.com  myapp.com myqcloud.com +haosou.net i360mall.com ludashi.com nicaifu.com  nzwgs.com  qhimg.com qhimgs0.com qhimgs1.com qhimgs2.com qhimgs3.com qhimgs4.com qhimgs5.com qhimgs6.com  qhmsg.com  qhres.com qhstatic.com qhupdate.com +qihuapi.cn qihucdn.com  qihoo.com qikucdn.com +so.com sou.com urlqh.cnxiaoluyouxuan.comxiaoluzhidian.com xjietiao.com +youhua.com  yunpan.cn  97973.com +picself.cn sina.cn sina.com sina.com.cn sina.net sinaapp.com sinaedge.com +sinaimg.cn sinaimg.com  sinajs.cn +sinajs.comt.cn videoself.cn  wbimg.com wbimg.cn wcdn.cn weibo.cn  weibo.com weibo.com.cn weibocdn.com xhaiwai.com 2016.sina.cn +adsad.sina.com.cn +adsadbox.sina.com.cn +ads!adimages.sina.com.hk +ads!adimg.mobile.sina.cn +ads adimg.uve.weibo.com +ads!adm.leju.sina.com.cn +ads ads.sina.com +adsalitui.weibo.com +adsapi.apps.sina.cn +ads appgift.sinaapp.com +ads#appsupdate.sinaapp.com +ads atm.sina.com +adsbeacon.sina.com.cn +ads biz.weibo.com +adsc.biz.weibo.com +ads!c.wcpt.biz.weibo.com +ads%click.uve.mobile.sina.cn +ads click.uve.weibo.com +adscm.dmp.sina.cn +ads0#contentrecommend-out.mobile.sina.cn +ads$count.video.sina.com.cn +ads counter.sina.com.cn +adscre.dp.sina.cn +adscre-dp.sina.cn +adsd00.sina.com.cn +adsdcads.sina.com.cn +adsdl.kjava.sina.cn +ads dmp.sina.cn +adsdp.im.weibo.cn +ads game.weibo.cn +adsgame.weibo.com +ads"gw5.push.mcp.weibo.cn +ads"gw6.push.mcp.weibo.cn +ads"img.adbox.sina.com.cn +ads#img.amp.ad.sina.com.cn +ads"int.dpool.sina.com.cn +ads%interest.mix.sina.com.cn +ads)log.interest.mix.sina.com.cn +ads log.mix.sina.com.cn +ads log.sina.cn +ads!m.beacon.sina.com.cn +adsm.game.weibo.cn +ads!mg.games.sina.com.cn +ads!motu.p4p.sina.com.cn +adsnewspush.sinajs.cn +ads oascentral.sina.com +ads#oascentral.sina.com.hk +adsp4p.sina.com.cn +adspalmnews.sina.cn +adspay.mobile.sina.cn +adspfp.sina.com.cn +adspfpip.sina.com +ads!promote.biz.weibo.cn +ads r.dmp.sina.cn +adsrm.sina.com.cn +ads rs.sinajs.cn +adss.alitui.weibo.com +ads"s.img.mix.sina.com.cn +ads sapi.sina.cn +ads sax.sina.cn +adssax.sina.com.cn +adssaxn.sina.com.cn +adssaxs.sina.com.cn +ads sbeacon.sina.com.cn +ads"sdkapp.mobile.sina.cn +ads!sdkapp.uve.weibo.com +ads$sdkclick.mobile.sina.cn +ads slog.sina.cn +adsslog.sina.com.cn +ads'staticadm.leju.sina.com.cn +adstjs.sjs.sinajs.cn +ads"trends.mobile.sina.cn +ads"u1.img.mobile.sina.cn +ads&wapwbclick.mobile.sina.cn +ads!wbapp.mobile.sina.cn +ads wbapp.uve.weibo.com +ads#wbclick.mobile.sina.cn +ads$wbpctips.mobile.sina.cn +adswidget.weibo.com +ads woocall.sina.com.cn +adszc.biz.weibo.com +adszymo.mps.weibo.com +ads +go2map.com sogo.com  sogou.com sogoucdn.com dns.pub  dnsapi.cn  dnspod.cn +dnspod.com dnspod.com.cn +dnspod.net +dnspod.org  dnsv1.com  dnsv2.com  dnsv3.com  dnsv4.com  dnsv5.com doh.pub ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads +yuewen.com hongxiu.com lrts.me qdmm.com +qidian.com readnovel.com tingbook.com webnovel.com +xs8.cn xxsy.net +apcdns.net  cdn-go.cn cdntips.com foxmail.comfoxmail.com.cn gtimg.cn  gtimg.com gtimg.com.cn idqqimg.com imqq.com  myapp.com myqcloud.com qcloud.com qcloudimg.com qlogo.cn qpic.cn qq.com -qqmail.com  qzone.comservicewechat.com smtcdns.com +qqmail.com  qzone.com +rtx.com.cnservicewechat.com smtcdns.com smtcdns.net tencent.cn tencent.comtencent.com.cntencent.com.hktencent.net.cntencent-cloud.comtencentmusic.comtencentyun.com tenpay.com wechat.com -wegame.com -weiyun.com ad.qq.com -@ads ad.qun.qq.com -@ads"adfilter.imtt.qq.com -@ads adping.qq.com -@adsadpm.app.qq.com -@adsadsclick.qq.com -@adsadsfile.qq.com -@adsadshmmsg.qq.com -@adsadslvfile.qq.com -@adsadslvseed.qq.com -@ads&adsmind.apdcdn.tc.qq.com -@adsadsqqclick.qq.com -@ads adstestview.qq.com -@adsadsview.qq.com -@adsadsview2.qq.com -@adsadv.app.qq.com -@ads adver.qq.com -@ads btrace.qq.com -@adse.qq.com -@adslog.tbs.qq.com -@ads mpush.qq.com -@ads mtrace.qq.com -@ads push.qq.com -@ads pgdt.gtimg.cn -@ads tiancity.comtiancitycdn.com -tipdim.org tmtpost.com chaindd.com -72whys.com checkzeit.com -tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com 40017.cn -17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com -ly.com mobmore.com  umeng.comumengcloud.com  umsns.com umtrack.com -uyunad.comwhalecloud.comalog.umeng.com -@ads!alog.umengcloud.com -@ads  95516.com unionpay.comunionpayintl.comunionpaysecure.comwanfangdata.com.cn -sojump.com -wjx.cn wjx.com wjx.top +wegame.com wegame.com.cn +weiyun.com alloyteam.com imweb.io ivweb.io mi.com mi-img.com  mifile.cn miui.com miwifi.com  xiaomi.cn xiaomi.com -xiaomi.netxiaomiyoupin.com ximalaya.com  xmcdn.com speiyou.com -xesimg.com xueersi.comdanjuanfunds.com -xueqiu.com  00cdn.com  88cdn.com +xiaomi.netxiaomiyoupin.com  00cdn.com  88cdn.com sandai.netthunderurl.com -xunlei.com ynet.cn ynet.com ynet.com.cn -kumiao.com  youku.com  ykimg.com -mmstat.com soku.com -cibntv.net -youzan.com yzcdn.cn youzanyun.com banmaaike.comxiaoyuankousuan.com ybccode.com yuanfudao.com yuansouti.com yuantiku.com yfcache.com -yfcalc.com yfcloud.com  yfdts.net  yfp2p.net -yfscdn.net yunfancdn.com  zhihu.com  zhimg.com zhihuishu.com -ziroom.comziroomapartment.com  ksyun.com ksyungslb.com ourdvsss.com abchina.com -boc.cn  whccb.com moji.com mojichina.com0123456789.com 0379home.com +xunlei.com 10086.cn 139.comchinamobile.comchinamobileltd.com migucloud.com migu.cn +cmvideo.cn miguvideo.com andfx.cn  andfx.net +cmicrwx.cncmpassport.comfetion-portal.com fetionpic.com mmarket.com mmarket6.com +ctexcel.ca ctexcel.comctexcel.com.hk +ctexcel.fr +ctexcel.us +189.cnchinatelecom-h.comchinatelecom.com.cnchinatelecomglobal.com +chntel.com  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cnguoxuedashi.com guoxuemi.com jikipedia.com haidilao.com0123456789.com 0379home.com 055110.com  05sun.com 0759job.com  100bt.com 100offer.com  11467.com -114chn.com 114piaowu.com 114shouji.com 115.com +114chn.com 114piaowu.com 114shouji.com 119you.com 123juzi.com 123juzi.net 123u.com 1637.com  16888.com 16rd.com  17173.com 178linux.com  17989.com  17cdn.com 17house.com  18183.com 188.com 1905.com  19yxw.com 1nongjing.com  1ting.com 1zhe.com 21cn.com 2265.com 2288.org 2345.com 258.com 263.net 289.com 2cto.com 3000.com 310win.com 315che.com 3234.com 32r.com 3322.org 3387.com 33lc.com 3454.com 3456.cc 35.com 3533.com 360aiyi.com 360doc.com  360jq.com 360zhyx.com 365azw.com -365dmp.com 36kr.com +365dmp.com 37.com 3733.com 3839.com -39.net 3conline.com 3d66.com 3dmgame.com -3elife.net 3h3.com 3yx.com  40407.com 4paradigm.com 500.com 500d.me +39.net 3conline.com 3d66.com +3elife.net 3h3.com 3yx.com  40407.com 500.com 500d.me 50bang.org 51.com 51.la 510you.com 51credit.com  51cto.com 51eshop.com 51gaifang.com 51hejia.com51jingying.com 51meishu.com @@ -5399,99 +8539,87 @@ ziroom.comziroomapartment.com  ksyun.com ksyungslb.com ourdv 52miji.com 52pk.com 52z.com 53kf.com 55.com 56.com 5577.com  55bbs.com  58pic.com  5bite.com 5fun.com 5gzm.net 5khouse.com 5you.com 66wz.com 68h5.com -6rooms.com 71.am 714.com 7230.com +6rooms.com 714.com 7230.com 72byte.com  7down.com 7k7k.com  7moor.com 7po.com 7x24cc.com -7xdown.com  818ps.com  84399.com  8686c.com 885.com  88cdn.com +7xdown.com  818ps.com  84399.com 885.com 900.la 917.com 91danji.com 91yunxiao.com 9553.com 962.net 9718.com  99166.com 998.com 999d.com 99danji.com 9ht.com 9xgame.com 9xu.com a9vg.com aardio.com adxvip.com -afzhan.com agrantsem.com  aicdn.com  aiemy.com aiketour.com  aiops.com  aipai.comairchangan.com airguilin.com aisee.tv aiskycn.com aiyunxiao.com -aizhan.com -ali213.netalittle-tea.com +afzhan.com agrantsem.com  aiemy.com aiketour.com  aiops.com  aipai.comairchangan.com airguilin.com aisee.tv aiskycn.com aiyunxiao.com +aizhan.comalittle-tea.com allyes.com anfensi.com anquan.org anruan.com -antutu.com aotrip.net  aoyou.com apk3.com apk8.com appchina.com -appinn.com  arpun.com babytree.combabytreeimg.com baidufree.combaifendian.com  baihe.com  baike.com baixing.com baixing.netbamenzhushou.combangongziyuan.com bankcomm.combankofchina.com baofeng.com baomitu.combaoxianshichang.com bcy.net bearychat.com beihaidc.combeijing-lipin.com bengbeng.com  benmi.com  berui.combestopview.com biancheng.net bianews.com bibaodao.com bidchance.com biddingx.com bihu.com -bio360.net  bio4p.com bio-equip.combiodiscover.com bishijie.com bitauto.combitautoimg.com bitecoin.com biyehome.net bjcathay.com bobo.com bojianger.com -bokecc.com  boosj.com bootcss.com btcfans.com btgtravel.com bthhotels.com  btime.comcabbagebox.com caijingwu.com -caixin.com -caiyun.com caiyunapp.com cang.comcankaoxiaoxi.comcardbaobao.com +appinn.com  arpun.com babytree.combabytreeimg.com baidufree.combaifendian.com  baihe.com baixing.com baixing.netbamenzhushou.combangongziyuan.com bankcomm.com baofeng.combaoxianshichang.com bcy.net bearychat.com beihaidc.combeijing-lipin.com bengbeng.com  benmi.com  berui.combestopview.com biancheng.net bianews.com bibaodao.com bidchance.com biddingx.com bihu.com +bio360.net  bio4p.com bio-equip.combiodiscover.com bishijie.com bitecoin.com biyehome.net bjcathay.com bobo.com bojianger.com +bokecc.com  boosj.com btcfans.com btgtravel.com bthhotels.com  btime.comcabbagebox.com caijingwu.com +caiyun.com cang.comcankaoxiaoxi.comcardbaobao.com carnoc.com ccb.com  cdn20.com  cecdc.com cecport.com centanet.com cerambath.org ch.com chachaba.com changba.com chashebao.comchazhengla.com -che168.comchina-chair.comchina-nengyuan.com  china.comchinacache.comchinacache.netchinachugui.comchinadongchu.com chinafph.comchinakaoyan.comchinalawedu.com chinanews.com chinapay.com chinapp.netchinapubmed.net chinasspp.comchinatranslation.net chinaunix.netchinaweiyu.comchinawutong.com -chinaz.com -chinaz.net chinazns.com chiphell.comchongdiantou.com +che168.comchina-chair.comchina-nengyuan.com  china.comchinacache.comchinacache.netchinachugui.comchinadongchu.com chinafph.comchinakaoyan.comchinalawedu.com chinapay.com chinapp.netchinapubmed.net chinasspp.comchinatranslation.net chinaunix.netchinaweiyu.comchinawutong.com chinazns.comchongdiantou.com chouti.com chuangxin.com chuansong.mechuansongme.com -chushou.tv chuyu.me  city8.com cjol.com clouddn.com cloudxns.com cmbchina.com cn.bing.com cnanzhi.com +chushou.tv chuyu.me  city8.com cjol.com clouddn.com cloudxns.com cnanzhi.com cnbeta.com cnbetacdn.com cnblogs.com cnepub.com  cnfol.com  cnlaw.net cnstock.com cnzz.com cocodiy.com code666.com cofeed.com -cofool.com coindog.comcontentchina.com  cpppf.org  cqvip.com  cr173.com  crsky.com  csbew.com +cofool.com coindog.comcontentchina.com  cpppf.org  cr173.com  crsky.com  csbew.com csmjzs.com csslcloud.net ctfile.com ctiforum.com ctoutiao.com  ctsbw.com cubead.com  cwxzx.com -cyagen.com  cybtc.com cyol.com cyts.com cztv.com cztvcloud.com dadajiasu.com dadighost.com daguzhe.com dajiabao.com  dajie.com dajieimg.com dalongyun.com dangbei.com dangdang.com danji100.com -danji6.com daocloud.io daovoice.iodayukaoshi.com dazijia.com  dbank.com +cyagen.com  cybtc.com cyol.com cyts.com cztv.com cztvcloud.com dadajiasu.com dadighost.com daguzhe.com dajiabao.com  dajie.com dajieimg.com dalongyun.com dangbei.com danji100.com +danji6.com daocloud.io daovoice.iodayukaoshi.com dazijia.com dcdkjx.com  dd373.com  ddooo.com dedecms.com develenv.com -dginfo.comdgphospital.com  dgtle.comdianchacha.com diandian.comdiandianqi.comdianwannan.comdidichuxing.comdingxiang-inc.com -diopic.net diyiyou.com dj99.com dmzj.com  docin.com dockerone.com +dginfo.comdgphospital.comdianchacha.com diandian.comdiandianqi.comdianwannan.comdingxiang-inc.com +diopic.net diyiyou.com dj99.com  docin.com dockerone.com dockone.io dogedoge.com donews.com dongao.comdongguantoday.com dopa.com -douban.com  douban.fm doubanio.com douxie.com downcc.com downxia.com downyi.com dpfile.comdreams-travel.comdrivergenius.com dui.ai duiopen.com duoduocdn.com duokanbox.com -duomai.com duoshuo.com  duote.com -duowan.com dxpmedia.com +duomai.com duoshuo.com  duote.com dxpmedia.com dxycdn.com  dyhjw.com dzsc.com dzw3.com  dzwww.com easesale.com  easiu.com eastday.com eastmoney.com eastsoo.com eayyou.com  ebico.com  ebrun.com ecitic.com ecjobhome.com edu.cn  eduei.com eeyy.com eflycloud.com elecfans.com emarbox.com emumax.com enterdesk.comeoeandroid.com excelhome.net expreview.comf.cx  faloo.com famulei.com  fanli.comfangxiaoer.com fanxian.com fastapi.net -feihuo.com feiniaomy.com feng.comfengkongcloud.com fengniao.comfengxian110.com  fenxi.com -fhldns.com  fimmu.com finchina.com fixdown.com  fqjob.net freebuf.com fugetech.com fuwj.com fxxz.com fyxz.com game234.com gameabc.com gamemei.com gamersky.com +feihuo.com feiniaomy.comfengkongcloud.com fengniao.comfengxian110.com  fenxi.com +fhldns.com  fimmu.com finchina.com fixdown.com  fqjob.net freebuf.com fugetech.com fuwj.com fxxz.com fyxz.com game234.com gameabc.com gamemei.com gaodun.comgaoshouyou.comgaoxiaojob.com -gdjdxy.comgdliontech.com gdrc.com geekpark.net geetest.com geilicdn.comgenelinkout.com  getui.com +gdjdxy.comgdliontech.com gdrc.com geilicdn.comgenelinkout.com  getui.com gezida.com gfan.com -giocdn.com  gitee.com globrand.com gm86.com gmallbio.com  gmz88.comgobasearcher.com gold678.com  golue.comgongxiangcj.com goosail.com  goufw.com gree.comgreenxiazai.com growingio.com  gtags.net  guabu.com guaiguai.comguanaitong.comguanhaobio.com gucheng.com  guigu.org  guokr.com guoxinmac.com  gupzs.com gushiwen.orgguzhangting.com +giocdn.com globrand.com gm86.com gmallbio.com  gmz88.comgobasearcher.com gold678.com  golue.comgongxiangcj.com goosail.com  goufw.com gree.comgreenxiazai.com growingio.com  gtags.net  guabu.com guaiguai.comguanaitong.comguanhaobio.com gucheng.com  guigu.org guoxinmac.com  gupzs.com gushiwen.orgguzhangting.com gwdang.comgxairlines.com gxb.io gzwanju.com h5uc.com hack520.com hackhome.com haishun.com hanboshi.com handanjob.comhangjiayun.com haolietou.com  haote.comhaoyouyinxiang.com hefei.cc -heisha.net  henha.com henkuai.com herostart.com  hexun.com -heytea.com  hiido.com hitv.com hiyd.com hktheone.com hn-cbec.com  hnair.com -hnrcsc.com hntv.tv hnyuyuhui.com hollycrm.com homeinns.com homekoo.comhongsanban.com hongxiu.com +heisha.net  henha.com henkuai.com herostart.com  hexun.com  hiido.com hitv.com hiyd.com hktheone.com hn-cbec.com +hnrcsc.com hntv.tv hnyuyuhui.com hollycrm.com homeinns.com homekoo.comhongsanban.com houdao.comhouyuantuan.com hteacher.net huanqiu.comhuashengdaili.com  huatu.com  huize.com  hujia.org hujiang.com hunantv.comhuochepiao.com huocheso.com  huxiu.com hxfy888.com hxsd.com iask.com -ibaotu.com ibuychem.com icaidao.com ichangtou.com  iciba.com idongdong.com idqqimg.com  ifeng.com ifengimg.com iflytek.com  igao7.com -iheima.com ijiandao.com ijinshan.com +ibaotu.com ibuychem.com icaidao.com ichangtou.com idongdong.com iflytek.com  igao7.com +iheima.com ijiandao.com ikafan.com im2maker.com  im-cc.com imedao.com imgo.tv  imooc.com indienova.com  infoq.cominfoqstatic.com -ip-cdn.com  ip138.com ipinyou.com ipip.net iranshao.com  irs01.com ishumei.com  it165.net  it168.com  it610.com  iteye.com +ip-cdn.com  ip138.com ipinyou.com iranshao.com  irs01.com ishumei.com  it165.net  it168.com  it610.com  iteye.com itjuzi.com  itmop.com  iyiou.com iyunxiao.com izuche.com -jandan.net jb51.com  jdair.net jia.com jiameng.com jianbihua.com jianshu.com -jianshu.io jianzhi8.com jiaodong.net jiaoyimao.com jiasuhui.com jiasule.com jiathis.com jiayuan.com jiazhao.com jiemeng8.comjikexueyuan.com jinianbi.comjinrongren.net  jinse.com  jinti.comjiqizhixin.com jisuanke.com jisuxia.com jiuzhilan.com jj20.com  jjwxc.net jkbl.com jmstatic.com job5588.com +jandan.net jb51.com  jdair.net jia.com jiameng.com jianbihua.com jianzhi8.com jiaodong.net jiaoyimao.com jiasuhui.com jiasule.com jiathis.com jiayuan.com jiazhao.com jiemeng8.comjikexueyuan.com jinianbi.comjinrongren.net  jinse.com  jinti.comjiqizhixin.com jisuanke.com jisuxia.com jiuzhilan.com jj20.com jkbl.com jmstatic.com job5588.com job910.com  jobjm.com jsbc.com jsrdgg.com jstv.com  jsyks.com juefeng.com julive.com  jumei.com  juwan.com  juxia.com  jyimg.com k366.com kaifubiao.com kaixin001.com kameng98.com -kanimg.com kankanews.com kantianqi.net kanzhun.com kaopu001.comkeboyunxiao.com  kejet.net kf5.com  kgimg.com +kanimg.com kankanews.com kantianqi.net kanzhun.com kaopu001.comkeboyunxiao.com  kejet.net kf5.com kimiss.com kingdee.com kkzj.com kongfz.com koolearn.com kouclo.com -koudai.com koudai8.com kq7.com  ksord.com ku6.com -ku6cdn.com -ku6img.com  kuaaa.com kuaidi100.com kuaihou.comkuaikanmanhua.com kuaizhan.com  kugou.com  kuqin.com -kuyiso.com lady8844.com laomaotao.net laomaotao.org  lascn.net  lawxp.com -le.com leanote.com ledu.comleetcode-cn.com leikeji.com leiphone.com leiting.com leju.com leturich.org letv.com letvcdn.com letvimg.com lianjia.com lianmishu.com +koudai.com koudai8.com kq7.com  ksord.com  kuaaa.com kuaidi100.com kuaihou.com kuaizhan.com  kuqin.com +kuyiso.com lady8844.com laomaotao.net laomaotao.org  lascn.net  lawxp.com leanote.com ledu.comleetcode-cn.com leikeji.com leiphone.com leiting.com leju.com leturich.org lianmishu.com liantu.com  liantu.me lianzhuli.comliaoxuefeng.com liba.com libaclub.comlieyunwang.com lightonus.com likuso.com lingkou.com linkvans.com  linsn.com linuxidc.com liulanqi.net liuxiaoer.com live800.com liweijia.com lixinger.com lkkbrand.com longhoo.net longre.comlongtugame.com longzhu.com  lotpc.com -loupan.com lrts.me +loupan.com lu.com luckyair.net  lufax.com lufaxcdn.com lunwengo.net luyouqi.com lvmama.comlvsexitong.com  lxdns.com  lxway.com magedu.com maisanqi.com @@ -5500,74 +8628,69 @@ mapbar.com mayi.com mayihr.com mcbang.com  mdpda.com mechina.org mediav.com meifang.com meika360.com meilishuo.commeimingteng.com -meiqia.commeishichina.com meishij.netmengtuoshi.wang mgtv.commiaobolive.com miaopai.com miaozhen.com +meiqia.commeishichina.com meishij.netmengtuoshi.wang mgtv.commiaobolive.com miaozhen.com miercn.com mikecrm.comminhangshi.com miusi.co mjia.cc -mmbang.com mmbang.info moegirl.org +mmbang.com mmbang.info mofang.com mofazhu.com mogu.com mogucdn.com mogujie.com mokahr.com moleecel.commoocollege.com mop.com msanjia.com mscbsc.com mukewang.com mumayi.com muomou.com muzhiwan.com -mydown.com mydrivers.com myshow360.net myyx618.com myzaker.com mzstatic.com naixuecha.com netbian.com +mydown.com mydrivers.com myshow360.net myyx618.com myzaker.com naixuecha.com netbian.com newasp.netnewbandeng.com  newyx.net nowcoder.com nowscore.com  nruan.com ntalker.com nvsheng.com  nzbdw.com oadz.com  oeeee.com  offcn.com officese.com oicq88.com  okooo.com ol-cdn.com ol-img.com oldboyedu.com oneapm.com onegreen.net oneyac.comonlinedown.netonlinesjtu.com onlylady.com -opdown.com oray.com oschina.net  ottcn.com +opdown.com oray.com  ottcn.com oupeng.com -p2peye.com p5w.net -paipai.compaipaibang.com paopaoche.net pc6.com +p2peye.com p5w.netpaipaibang.com paopaoche.net pc6.com pcbeta.com pchome.net  pcpop.com  peccn.com pgzs.compharmacodia.com piaoliang.com pingan.compingplusplus.com pingwest.com pingxx.com pintu360.com  pipaw.com  pipaw.net pptbest.com psbc.com -pubyun.com qbox.me  qc188.com qcc.com qcds.com qd8.com qd-metro.com qdmm.com qh24.com qiangbus.com qianjia.com qianlima.com qianzhan.comqiaobutang.com qichacha.com -qidian.com -qie.tv qifeiye.comqijiayoudao.net qingcloud.comqingdaochina.orgqingdaonews.com qingting.fmqingsongchou.com  qiniu.com qiniucdn.com qiniudn.com qiniudns.com qiumibao.com qizuang.com  qqddc.comqqgexingqianming.com qqrizhi.comqqshuoshuo.com +pubyun.com  qc188.com qcc.com qcds.com qd8.com qd-metro.com qh24.com qiangbus.com qianjia.com qianlima.com qianzhan.comqiaobutang.com qichacha.com +qie.tv qifeiye.comqijiayoudao.net qingcloud.comqingdaochina.orgqingdaonews.comqingsongchou.com qiumibao.com qizuang.com  qqddc.comqqgexingqianming.com qqrizhi.comqqshuoshuo.com qschou.com qtmojo.com qudong.com -qugame.com  qunar.com qunarzz.com qyer.com readnovel.com -renren.comrenren-inc.com rfchost.comrockyenglish.com rong360.com rtbasia.com  ruan8.comruby-china.org +qugame.com  qunar.com qunarzz.com qyer.com rfchost.comrockyenglish.com rong360.com rtbasia.com  ruan8.com runoob.com rzrc114.com  saibo.com sanguosha.com sanwen.net  scdng.com scoregg.com -sczsxx.com sdo.com sec-wiki.comsegmentfault.com +sczsxx.com sdo.com sec-wiki.com sencdn.com seniverse.comsenlinjimore.com sgamer.com shang360.com shangc.netshanghairc.com shangzhibo.tvshanshuihotel.com sharejs.com shebiaotm.comshelter-china.comshelterdome.netshengdaosoft.comshenmayouxi.com  sheui.com shijiexia.com shixiseng.com shmetro.comshoujihuifu.comshouyoubus.com shrbank.comshuidichou.comshuidihuzhu.com shumensy.comshuoshuokong.com shutcm.com -simei8.com simuwang.com sinesafe.com  sjwyx.com  skycn.com sllssrq.com  smzdm.com -snimay.com  sobot.com sofreight.com softwhy.com sohu.com -sohucs.com +simei8.com simuwang.com sinesafe.com  sjwyx.com  skycn.com sllssrq.com +snimay.com  sobot.com sofreight.com softwhy.com sojson.com -somode.com soso.com souqian.comsouthmoney.comsparkletour.comspringtour.com  sspai.com ssports.com starbaby.cc starbaby.comstaticfile.org stockstar.com sun0769.com +somode.com soso.com souqian.comsouthmoney.comsparkletour.comspringtour.com ssports.com starbaby.cc starbaby.com stockstar.com sun0769.com sunrtb.com supermap.comsupermapcloud.com sys321.com szfw.org szhk.com szzfgjj.com t1y5.com  taihe.comtaihuoniao.com tangeche.com tanx.com tao123.com -taoche.com te5.com tenxcloud.com  tgbus.comtianjimedia.comtianjin-air.comtianlailive.com +taoche.com te5.com tenxcloud.comtianjimedia.comtianjin-air.comtianlailive.com tianqi.com tietuku.com tiexue.net timedoo.com tingyun.com titanar.com tjjt360.com  tmcdn.net tobosu.com tom.com tongdun.net topthink.com touqikan.com travelsky.com trunktech.comtrustexporter.com trustutn.org  tudou.com tudouui.com tuer123.com tuicool.com -tuiwen.net  tujia.com  tuniu.com tutuapp.com  tuwan.com tuwanjun.com u.tools u17.com  ucbug.com -uggame.com uoko.com upaiyun.com  upyun.com urselect.comurumqi-air.com  useso.com uuu9.com uzzf.com  v5875.com value500.com vamaker.com  vancl.com vanclimg.com  vcimg.com vdolady.com veryhuo.com veryzhun.com -vgtime.com  vic18.com videojj.com  vijos.org vip.com  vobao.com +tuiwen.net  tujia.com  tuniu.com tutuapp.com  tuwan.com tuwanjun.com u.tools  ucbug.com +uggame.com uoko.com urselect.comurumqi-air.com  useso.com uuu9.com uzzf.com  v5875.com value500.com vamaker.com vdolady.com veryhuo.com veryzhun.com  vic18.com videojj.com  vijos.org vip.com  vobao.com vpgame.comwallstreetcn.comwangyangyang.vipwannianli8.com wanplus.com wanwushuo.com wanyiwang.com  wanyx.com -wdjimg.com wdzj.com  weand.com webterren.com weicaifu.com weidian.comweilaicaijing.comweilaiyunxiao.com weiphone.com weiphone.net weixing.com weiyangx.comwelltrend-edu.com wenjuan.comwhlovehome.com wicresoft.com +wdjimg.com wdzj.com  weand.com webterren.com weicaifu.com weidian.comweilaicaijing.comweilaiyunxiao.com weiphone.net weixing.com weiyangx.comwelltrend-edu.com wenjuan.comwhlovehome.com wicresoft.com win007.com win8.netwindows10zj.comwindows7en.com windowszj.com winwin7.com wishdown.com  wmzhe.com wnhuifu.com wodingche.com  womai.com wonnder.com wooyun.org worktile.comwoyaogexing.com  woyoo.com  wqiis.com wrating.com wscdns.com  wtown.com  wumii.com wuming.comwuximediaglobal.com  wywyx.com xafc.com  xbiao.com  xdwan.com xfdown.com -xhscdn.comxiachufang.comxiaobaixitong.comxiaoe-tech.com xiaogouh5.comxiaohongshu.com  xiaoka.tv xiaokaxiu.comxiaomingtaiji.comxiaoxiongxitong.comxiaoyuxitong.com  xiayx.com xiazaiba.com ximalaya.com xingjiesj.com xinhuanet.comxinrenxinshi.com xinshipu.comxingtan001.com xitong8.com xitu.com xiu8.com -xiucai.com xiziwang.net xmhouse.com  xnpic.com xoyo.com  xpgod.com -xsa239.comxuanchuanyi.com  xue51.com xuekanba.com xuexicha.com xundupdf.com xxsy.net  xycdn.com xywy.com +xhscdn.comxiachufang.comxiaobaixitong.comxiaoe-tech.com xiaogouh5.comxiaohongshu.com  xiaoka.tv xiaokaxiu.comxiaomingtaiji.comxiaoxiongxitong.comxiaoyuxitong.com  xiayx.com xiazaiba.com xingjiesj.com xinhuanet.comxinrenxinshi.com xinshipu.comxingtan001.com xitong8.com xitu.com xiu8.com +xiucai.com xiziwang.net xmhouse.com  xnpic.com  xpgod.com +xsa239.comxuanchuanyi.com  xue51.com xuekanba.com xuexicha.com xundupdf.com  xycdn.com xywy.com xzking.com yahui.cc -yaolan.com  yaoyl.com  yaozh.com  yccdn.com +yaolan.com  yaoyl.com  yaozh.com ycgame.com yeepay.com -yeshen.com  yesky.com yh31.com yhd.com  yicai.com  yigao.com yigoonet.com yihaodian.comyihaodianimg.com yihedoors.comyikaochacha.com yikexue.comyingjia360.comyinhang123.net yinxiang.com yinyuetai.comyinzhaowang.com +yeshen.com  yesky.com yh31.com  yicai.com  yigao.com yigoonet.com yihedoors.comyikaochacha.com yikexue.comyingjia360.comyinhang123.net yinxiang.com yinyuetai.comyinzhaowang.com yiqifa.com yiqifa.org yisu.com yitaifang.com  yiwan.com yixi.tv yizhibo.com  yjbys.com ynhr.com yocajr.com @@ -5575,13 +8698,11 @@ youboy.com youjiao.com youke.co youlian.fun youshang.com yslyhr.com  ysten.com yuewen.com  yunaq.com yunba.io yundaex.com yundasys.com yundun.com yunqishi.net yunshipei.com yunxiao.com yunzhijia.com  yupoo.com  yuzua.com  yxbao.com -yxdown.com -yy.com +yxdown.com yytcdn.com zampda.net zampdsp.com zastatic.com zbjimg.com zczj.com -zdfans.com -zdmimg.com zgjm.org +zdfans.com zgjm.org zgjsks.com  zglxw.com  zgzcw.com zhanbuba.comzhangyoubao.com  zhanqi.tv zhanzhang.net zhaodanji.com zhaopin.com zhcw.com zhenai.com  zhibo8.cc  zhidx.com zhifang.com zhipin.com zhiziyun.com zhongkao.comzhuangjiba.comzhuanyewanjia.comzhuayoukong.com zhubajie.com zhugeapi.net zhugeio.com  zimuzu.io zixiaomao.com zixuntop.com  zjstv.com zmengzhu.com zongheng.com @@ -5590,725 +8711,2236 @@ zrblog.net zsxq.com  zuche.com zuchecdn.com zuhaowan.com fm3838.comlarsonlimited.com runsheng.com vzuu.com zoom3g.com zoomyou.cn chaoxing.com chaoxing.cc -@ - DIGITALOCEANdigitalocean.comdigitaloceanspaces.com +( +IMGUR  imgur.com imgurinc.com + +KINGSOFT cmcm.com cmcmcdn.com  liebao.cn duba.com duba.net ijinshan.comseasungames.com xishanju.com xoyo.com testplus.cn +wps.cn  51dzt.com  iciba.com  docer.com kdocs.cn papocket.com  wpspdf.cn kimg.cn kingsoft.com ksmobile.com +ks-cdn.com  ksyun.com ksyungslb.com +6 +75TEAM 75.team +75team.com baomitu.com +# +CATEGORY-SCHOLAR-!CN apa.orgpsyccareers.com cambridge.org"cambridgeschoolshakespeare.comcambridgedigital.netcambridgemaths.orgnewisiknowledge.comisiknowledge.com clarivate.comwebofknowledge.comwebofscience.com doi.org doi.info els-cdn.comelsevier-ae.com elsevier.com elsevier.ioengineeringvillage.com  evise.com +scopus.comscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.sk ic.ac.ukimperial.ac.ukimperialbusiness.schoolimperial.insendi.com +knovel.commit mit.edu mit.netmitpressjournals.orgamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com +ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.comserialssolutions.com proquest.comsciencedirect.comsciencedirectassets.com +apress.com springer.comspringerlink.comspringernature.com wkap.nl tandf.co.uktandfonline.comtaylorandfrancis.comtaylorfrancis.com +aclweb.org acm.org altmetric.comanalytictech.comannualreviews.org  arxiv.org asha.org berkeley.edubiomedcentral.com biorxiv.org  brill.com cell.comcomputingreviews.com degruyter.comdentalhypotheses.comelifesciences.org europepmc.orgfrontiersin.org gale.com galegroup.com  ggsrv.com hindawi.com informs.orgisca-speech.orgjamanetwork.comjapanknowledge.comjbe-platform.com jmlr.org jneurosci.org  jstor.org kuke.comlawdata.com.twliteratumonline.com mdpi.com +nature.com nejm.org neurology.org ovid.com  peerj.comphysiology.org plos.org pnas.org princeton.eduresearchgate.netroutledgehandbooks.comroyalsocietypublishing.org sagepub.comscholarpedia.orgsciencemag.orgscientificamerican.com scitation.orgsilverchair-cdn.comspiedigitallibrary.orgstatsmakemecry.com thelancet.com uchicago.edu ucla.edu  umass.edu  wiley.com yale.edu + +CLOJURE clojure.org + +ISGD is.gdv.gd + + +CODECADEMYcodecademy.com +4 +CSIS csis.orgcsis-prod.s3.amazonaws.com +J +FLICKR +flickr +flickr.com +flickr.netstaticflickr.com +8 + KINGKONGLIVEkingkong.com.twkingkongapp.com + +WHOLEFOODSMARKETwholecitiesfoundation.orgwholefoodsmarket.comwholekidsfoundation.orgwholeplanetfoundation.org + + APPLE-UPDATEappldnld.apple.com gg.apple.comgnf-mdn.apple.comgnf-mr.apple.com gs.apple.com ig.apple.commesu.apple.comns.itunes.apple.comoscdn.apple.comosrecovery.apple.com skl.apple.comswcdn.apple.comswdist.apple.comswdownload.apple.comswpost.apple.comswscan.apple.comupdates-http.cdn-apple.comupdates.cdn-apple.com xp.apple.com +T + DLERCLOUD dlercloud.com dlercloud.org dlercloud.me dleris.best +, +DUYAOSS duyaoss.com duyaossr.com +" + GETCOMPOSERgetcomposer.org +2 + GROWINGIO-ADS!assets.growingio.com +ads +. + POCKETCASTS +pca.stpocketcasts.com + +COINBASE coinbase.com + +GAMERSKY gamersky.com + + +SF-EXPRESS  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.comsf-financial.com sf-saas.comsf-tech.com.cn sfcar.hk sffix.cn sfgy.org + +CNKI cnki.net +k +DOUYU  douyu.com douyu.tv douyucdn.cn douyucdn2.cn douyuscdn.com douyutv.com + +JAVBUS +javbus.com +s +SINOPECsinopec-usa.com sinopec.comsinopecgroup.comsinopecnews.com.cnsinopecsales.com +" + TYPENETWORKtypenetwork.com + +CODE code.org + + +QINGTINGFM qingting.fm +B +RBaerogard.com.auaerogard.com.cn +cnaerogardcn.com +airwick.at +airwick.be +airwick.ca +airwick.ch +airwick.cl airwick.co.in airwick.co.nz airwick.co.uk airwick.co.za airwick.comairwick.com.auairwick.com.brairwick.com.cn +cnairwick.com.mxairwick.com.tr +airwick.cz +airwick.de +airwick.dk +airwick.es +airwick.fi +airwick.fr +airwick.hr +airwick.hu +airwick.ie +airwick.it +airwick.jp airwick.net +airwick.nl +airwick.no +airwick.pl +airwick.pt +airwick.ro +airwick.ru +airwick.se +airwick.si +airwick.sk +airwick.tv +airwick.usairwickarabia.com vipoo.es  calgon.at  calgon.be  calgon.ch calgon.cn +cn calgon.co.uk +calgon.com calgon.com.tr  calgon.de  calgon.es  calgon.fr  calgon.ie  calgon.it  calgon.nl  calgon.pt  calgon.ru  calgon.tvcalgoncarbon-china.comcalgoncarbon.com calgonit.com clearasil.cn +cnclearasil.com.cn +cn clearasil.usdettol-prize.com  dettol.at  dettol.be  dettol.ch  dettol.cl dettol.co.id dettol.co.in dettol.co.ke dettol.co.nz dettol.co.uk +dettol.com dettol.com.au dettol.com.bd dettol.com.br dettol.com.cn +cn dettol.com.eg dettol.com.hk dettol.com.my dettol.com.ng dettol.com.sg  dettol.cz  dettol.fr  dettol.hu  dettol.ie +dettol.net  dettol.nl  dettol.pk  dettol.pl  dettol.pt  dettol.rudettolarabia.comdettolcleannaija.comdettolsitishield.co.indettolthailand.comespadoldettol.com.ardewitwithdurex.com dotherex.com durex-shop.chdurex-shopline.comdurex-slovenia.si durex.at durex.be durex.cl durex.co.id durex.co.il durex.co.nz durex.co.th durex.co.uk durex.co.za  durex.com durex.com.au durex.com.bd durex.com.cn +cn durex.com.co durex.com.hr durex.com.my durex.com.ng durex.com.pe durex.com.ph durex.com.pk durex.com.sg durex.com.tr durex.cz durex.de durex.dk durex.ee durex.es durex.fi durex.fr durex.hu durex.ie durex.it durex.jp durex.lv durex.mx durex.nl durex.no durex.pl durex.pt durex.ro durex.ru durex.se durex.us durexcam.comdurexcanada.comdurexchina.comdurexchina.com.cn +cndurexindia.comdurexloveclub.comdurexukraine.com durexusa.comlovesexdurex.cn +cnlovesexdurex.complaybydurex.com shopdurex.com trydurex.net trydurex.tvbebepremium3.com.bo +enfa.co.id enfa.com.vn enfaaplus.com enfababy.com enfabebe.comenfabebe.com.brenfabebe.com.coenfabebe.com.doenfabebe.com.ecenfabebe.com.mxenfabebe.com.peenfabebe.com.veenfabebe3.com.arenfagrow.co.inenfagrow.com.bnenfagrow.com.myenfagrow.com.phenfagrow.com.sg enfagrow4.comenfamama.com.arenfamama.com.ph +enfamil.ca enfamil.com +enfamil.es +enfamil.pl +enfamil.pt enfasmart.comenspireformula.comnutramigen.net nutramigen.pl$dishwashingexpert.com.cn +cn  finish.at  finish.bg finish.co.kr finish.co.nz finish.co.uk finish.co.za finish.com.cn +cn finish.com.hr finish.com.tr  finish.de  finish.es  finish.fr  finish.gr  finish.hu  finish.lv  finish.pl  finish.pt  finish.ro  finish.si  finish.skfinisharabia.comfinishbrasil.com.brfinishdishwashing.cafinishdishwashing.com finishinfo.be finishinfo.clfinishinfo.comfinishinfo.com.arfinishinfo.com.au finishinfo.cz finishinfo.fi finishinfo.it finishinfo.jp finishinfo.nl finishinfo.no finishinfo.ru finishinfo.sefinishkilpailu.fi finishwin.beyarininsuyu.com lizol.co.in lysol.ca lysol.cllysol.cn +cn lysol.co.cr  lysol.com lysol.com.cn +cn lysol.com.mx  lysol.netenfinitas.com.cn +cnmeadjohnson.commeadjohnson.com.cn +cnmeadjohnson.com.hkmeadjohnson.com.twmeadjohnson.net +mortein.cn +cn mortein.co.in mortein.co.nz mortein.co.za mortein.commortein.com.aumortein.com.brmortein.com.ngmortein.com.pkmorteincam.compifpafarabia.comkeepmovingwithmovefree.com move-free.net movefree.cn +cn movefrees.commovefreeoffers.commovefreerewards.comschiffvitamins.com +mucinex.ca +mucinex.cn mucinex.co.nz mucinex.commucinex.com.cn mucinex.net +mucinex.tvmucinexprofessional.com +nurofen.at +nurofen.bg +nurofen.cn +cn nurofen.co.il nurofen.co.nz nurofen.co.uk nurofen.co.za nurofen.comnurofen.com.aunurofen.com.cn +cnnurofen.com.sg +nurofen.cz +nurofen.de +nurofen.es +nurofen.fr +nurofen.hr +nurofen.hu +nurofen.ie +nurofen.it nurofen.net +nurofen.no +nurofen.pl +nurofen.pt +nurofen.ro +nurofen.sk +nurofen.runurofengel.com51nurofensk-prod-env.eu-west-1.elasticbeanstalk.com +cepacol.ca cepacol.com dobendan.degraneodin.com.mx +repsils.no strepsils.at strepsils.ch strepsils.cn +cnstrepsils.co.krstrepsils.co.nzstrepsils.co.zastrepsils.com.arstrepsils.com.brstrepsils.com.cn +cnstrepsils.com.costrepsils.com.austrepsils.com.hkstrepsils.com.phstrepsils.com.tw strepsils.es strepsils.fi strepsils.fr strepsils.hr strepsils.hu strepsils.ie strepsils.net strepsils.pl strepsils.pt strepsils.ro strepsils.ru strepsils.si strepsils.usstrepsilsarabia.como2action.co.krpowerofresolve.capowerofresolve.comspraynwash.com  vanish.at  vanish.be  vanish.ch  vanish.cl vanish.cn +cn vanish.co.id vanish.co.il vanish.co.in vanish.co.nz vanish.co.uk vanish.co.za vanish.com.ar vanish.com.br vanish.com.co vanish.com.hr vanish.com.mx vanish.com.my vanish.com.pe vanish.com.sg vanish.com.tr  vanish.de  vanish.dk  vanish.es  vanish.fi  vanish.fr  vanish.hu  vanish.ie  vanish.it  vanish.nl  vanish.no  vanish.pl  vanish.pt  vanish.ro  vanish.ru  vanish.se  vanish.si  vanish.skvanisharabia.comvanishbancaseulook.com.brvanishcentroamerica.com vanishinfo.czvanishstains.comvanishstains.com.au veet.at veet.be veet.ca veet.ch veet.clveet.cn +cn +veet.co.id +veet.co.in +veet.co.kr +veet.co.nz +veet.co.uk +veet.co.za veet.com veet.com.ar veet.com.au veet.com.bd veet.com.br veet.com.cn +cn veet.com.co veet.com.hk veet.com.mx veet.com.my veet.com.ph veet.com.pk veet.com.sg veet.com.tr veet.de veet.dk veet.es veet.fi veet.fr veet.hu veet.jp veet.nl veet.no veet.pt veet.ro veet.ru veet.se veet.tv veet.usveetarabia.comveetbangladesh.comveetcentroamerica.com veetclub.it +woolite.ca +woolite.cn +cn woolite.comwoolite.com.cn +cn +woolite.pl +woolite.uswoolitecarpet.comdigital-rb.com rb-crisis.com +rb.com +rb.netrbbusinessshop.comrbdigitalab.comrbdigitallab.comrbeuroinfo.com rbgrads.comrbgraduates.comrbmavericks.comrbnainternational.com  rbplc.comrbrandlibrary.com rbspeakup.com reckitt.netreckittbenckiser.cn +cnreckittbenckiser.com#reckittbenckiser.com.cn +cnreckittbenckiser.netreckittbenckiser.tvreckittprofessional.com +2 +YNET ynet.cn ynet.com ynet.com.cn +" + FOUNDERTYPEfoundertype.com +' +HACPAI +hacpai.com  ld246.com + +LOGITECH logi.comlogicool.co.jp logicoolg.com logitech.biz logitech.com logitech.fr logitechg.com logitechg.frworldsfastestgamer.net + + SPANKBANG spankbang.com +E +WIX wix.com  wixmp.com wixsite.com wixstatic.com +] +BUYPASSbuypass-ssl.com buypass.com +buypass.no +buypass.se minid.no + +GNU gnu.org +$ +SCMP scmp.com +i-scmp.com + + SWISSSIGN digital-id.ch digitalid.chmanaged-pki.chmanaged-pki.de pki-post.ch pki-posta.ch pki-poste.chroot-signing.chrootsigning.comssl-certificate.ch +swissid.ch swissign.com swissign.liswisssign-group.chswisssign-group.comswisssign-group.li swisssign.ch swisssign.com swisssign.li swisssign.net swisssign.orgswisssigner.chswisssigner.comswisssigngroup.chswisssigngroup.comswissstick.com swisstsa.ch swisstsa.li trustdoc.ch trustsign.ch zert.ch +! +WANFANGwanfangdata.com.cn + +WARROOM warroom.org ++ +XIMALAYA ximalaya.com  xmcdn.com +' +HEYZO heydoga.com  heyzo.com + +JD-ADSads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads +> +UBUNTU +ubuntu.com +ubuntu.netubuntuforums.org + +WHATSAPP wa.mewhatsapp-plus.infowhatsapp-plus.mewhatsapp-plus.net whatsapp.cc whatsapp.com whatsapp.info whatsapp.net whatsapp.org whatsapp.tvwhatsappbrand.com +1 +ZIROOM +ziroom.comziroomapartment.com + +ARCHIVE archive.org + +WINDY  windy.com +" + ACCUWEATHERaccuweather.com + +DETTOLdettol-prize.com  dettol.at  dettol.be  dettol.ch  dettol.cl dettol.co.id dettol.co.in dettol.co.ke dettol.co.nz dettol.co.uk +dettol.com dettol.com.au dettol.com.bd dettol.com.br dettol.com.cn +cn dettol.com.eg dettol.com.hk dettol.com.my dettol.com.ng dettol.com.sg  dettol.cz  dettol.fr  dettol.hu  dettol.ie +dettol.net  dettol.nl  dettol.pk  dettol.pl  dettol.pt  dettol.rudettolarabia.comdettolcleannaija.comdettolsitishield.co.indettolthailand.comespadoldettol.com.ar +" + MASTERCLASSmasterclass.com +$ +TAOMEE +61.com +taomee.com + +TINYURL tinyurl.com +* +WIWIDE wamawama.com +wiwide.com +& + BAICAONETWORKbaicaonetwork.com +D + +LIVEJASMINlivejasmin.com dditsadn.com dditscdn.com +% +MIHOYO +mihoyo.com bh3.com + +OPENVPN openvpn.net +6 +AGORA agora.io +agoraio.cn agoralab.co + +JIGUANG +42r.cn +5566ua.com aurorapush.cn +e0n.cn japps.cn jchat.io +jiguang.cn jmlk.co jpush.cn jpush.io jpushoa.com +jsurvey.cn  jvoice.cn +kc9.cn +n0q.cn pushcfg.com +s0n.cn + +RFI +rfi.fr + +SCOOP scoop.sh + +SKYsky sky.com skyassets.comskyoceanrescue.comskyoceanrescue.deskyoceanrescue.it skysports.com skysports.fr skysports.ieskysportsonline.comskysportsracing.com +m +SUNING cnsuning.com +suning.comsuningcloud.comsuningestate.comsuningholdings.com + +ZEE +bgr.inbollywoodlife.comcareerfundas.comcricketcountry.com dnai.in dnaindia.com earngeek.com ekhindi.com +ind.sh  india.comindiancolleges.com itripto.com  oncars.in prepsure.comthehealthsite.com wionews.com yo1health.com zee.com +zeebiz.comzeeentertainment.com zeenews.com"zeenews-fonts.s3.amazonaws.com +j +BAHAMUT gamer.com.twbahamut.com.twgamer-cds.cdn.hinet.netgamer2-cds.cdn.hinet.net + +DUREXdewitwithdurex.com dotherex.com durex-shop.chdurex-shopline.comdurex-slovenia.si durex.at durex.be durex.cl durex.co.id durex.co.il durex.co.nz durex.co.th durex.co.uk durex.co.za  durex.com durex.com.au durex.com.bd durex.com.cn +cn durex.com.co durex.com.hr durex.com.my durex.com.ng durex.com.pe durex.com.ph durex.com.pk durex.com.sg durex.com.tr durex.cz durex.de durex.dk durex.ee durex.es durex.fi durex.fr durex.hu durex.ie durex.it durex.jp durex.lv durex.mx durex.nl durex.no durex.pl durex.pt durex.ro durex.ru durex.se durex.us durexcam.comdurexcanada.comdurexchina.comdurexchina.com.cn +cndurexindia.comdurexloveclub.comdurexukraine.com durexusa.comlovesexdurex.cn +cnlovesexdurex.complaybydurex.com shopdurex.com trydurex.net trydurex.tv + +FIREFOX firefox.com + +GARENA"avatargarenanow-a.akamaihd.netcdngarenanow-a.akamaihd.net!dlmobilegarena-a.akamaihd.net garena.co.id garena.co.th +garena.com garena.live  garena.my  garena.ph  garena.sg  garena.tv  garena.tw  garena.vn garenanow.com seagroup.com + +MOCHA mochajs.org ++ +AFDIAN +afdian.net afdiancdn.com + +CHANGE +change.org + +IINA iina.io + + OPENSTREETMAP openmaps.orgopenstreetmap.comopenstreetmap.netopenstreetmap.orgopenstreetmaps.org osm.orgosmfoundation.orgstateofthemap.comstateofthemap.org + + BLINKLOADblinkload.zone +, +CYLINK +cylink.procylink0122.icu + +MIRAHEZE miraheze.org + +OPENSUSE opensuse.org +{ +OREILLY oreil.ly oreilly.comoreilly.com.cn +cnoreilly.revieworeillystatic.com +orl.ly + +YAHOO +flickr +flickr.com +flickr.netstaticflickr.com ads.yahoo.com +adsgemini.yahoo.com +ads ysm.yahoo.com +ads yahoo yahoo.ae yahoo.am yahoo.as yahoo.at yahoo.az yahoo.ba yahoo.be yahoo.bg yahoo.bi yahoo.bs yahoo.bt yahoo.by yahoo.ca  yahoo.cat yahoo.cd yahoo.cg yahoo.ch yahoo.cl yahoo.cmyahoo.cn +cn yahoo.co.ao yahoo.co.bw yahoo.co.ck yahoo.co.cr yahoo.co.id yahoo.co.il yahoo.co.in yahoo.co.jp yahoo.co.kr yahoo.co.mz yahoo.co.nz yahoo.co.th yahoo.co.tz yahoo.co.uk yahoo.co.uz yahoo.co.ve yahoo.co.vi yahoo.co.za  yahoo.com yahoo.com.af yahoo.com.ag yahoo.com.ai yahoo.com.ar yahoo.com.au yahoo.com.bd yahoo.com.bo yahoo.com.br yahoo.com.bz yahoo.com.cn +cn yahoo.com.co yahoo.com.do yahoo.com.ec yahoo.com.eg yahoo.com.es yahoo.com.fj yahoo.com.gi yahoo.com.gt yahoo.com.hk yahoo.com.kw yahoo.com.lb yahoo.com.ly yahoo.com.mt yahoo.com.mx yahoo.com.my yahoo.com.na yahoo.com.nf yahoo.com.om yahoo.com.pa yahoo.com.pe yahoo.com.ph yahoo.com.pk yahoo.com.pr yahoo.com.py yahoo.com.sa yahoo.com.sb yahoo.com.sg yahoo.com.sv yahoo.com.tj yahoo.com.tr yahoo.com.tw yahoo.com.ua yahoo.com.uy yahoo.com.vc yahoo.com.vn yahoo.cz yahoo.de yahoo.dj yahoo.dk yahoo.dm yahoo.ee yahoo.es yahoo.fi yahoo.fm yahoo.fr yahoo.ge yahoo.gg yahoo.gl yahoo.gm yahoo.gp yahoo.gr yahoo.gy yahoo.hk yahoo.hr yahoo.hu yahoo.ie yahoo.im yahoo.in yahoo.is yahoo.it yahoo.je yahoo.jo yahoo.la yahoo.lt yahoo.lu yahoo.lv yahoo.md yahoo.me yahoo.mk yahoo.mw yahoo.mx  yahoo.net yahoo.nl yahoo.no yahoo.nu yahoo.ph yahoo.pl yahoo.pn yahoo.ps yahoo.pt yahoo.ro yahoo.ru yahoo.rw yahoo.se yahoo.sg yahoo.sh yahoo.si yahoo.sk yahoo.sm yahoo.sn yahoo.so yahoo.sr yahoo.st yahoo.tg yahoo.tk yahoo.tl yahoo.tm yahoo.tn yahoo.vg yahoo.ws maktoob.com +myguide.hkyahoo-news.com.hk yahooapis.com yahoodns.netyahoofinance.comyahoohealth.comyahoomusic.comyahoosportsbook.com yho.com yimg.com  ymail.com + +AP +ap.org +apnews.com +A + PINDUODUO +pddpic.com pinduoduo.com yangkeduo.com +\ +TAIKANG taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.com ++ +BAIDU a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +ads zuoyebang.cc zuoyebang.com +zybang.com baidu +91.com +aipage.com apollo.auto baidu.cn  baidu.com baidu.com.cn baidubce.combaiducontent.com baidupcs.combaidustatic.com +baifae.com baifubao.com +bcebos.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn +bdydns.com +bdydns.net chuanke.com  dlnel.com  dlnel.org +duapps.com +dwz.cn +hao123.com hao123img.com +hao222.com +haokan.com jomocdn.net jomodns.com +mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com + +ERLANG +erlang.org +$ + LOCALPRESSHKlocalpresshk.com + +ATYPI  atypi.org + + +CRAIGSLISTcraigslist.org +F + +DEVIANTARTdeviantart.comdeviantart.net da-files.com + + MEADJOHNSONenfinitas.com.cn +cnmeadjohnson.commeadjohnson.com.cn +cnmeadjohnson.com.hkmeadjohnson.com.twmeadjohnson.net + +PIGAV  pigav.com +) + REBRANDLY rb.gy rebrandly.com +* +TELEKOM telekom.com +telekom.de + + 58TONGCHENG +58.com  58.com.cn 5858.com  58che.com 58xueche.com +anjuke.comanjukestatic.com chinahr.com +daojia.com diandao.org fang.com  sofun.com soufunimg.com  jxedt.com zhuancorp.comzhuanspirit.comzhuanzhuan.com  -BTCBOX btcbox.co.jp - - DAILYMAIL  anm.co.uk  dailym.aidailymail.co.uk dailymail.comdailymail.com.au dailymail.dkdailymailonline.comdmgmediaprivacy.co.ukmailhealth.commailonline.co.ukmailonline.commailonsunday.co.ukmailonsunday.ie metro.co.uk -mol.imthisismoney.co.uk -thismon.ee - -JENKINS -jenkins.io +FREEBSD freebsd.org  -JITSI  jitsi.org - - ZOOMINGIN zoomingin.tv -h -51JOB  51job.com 51jobcdn.comyingjiesheng.comyingjiesheng.netzhiding.com.cn - -91PORN -91porn.com -. - ACFUN-ADS!apilog-web.acfun.cn -@ads - - MCDONALDSmcd  mcdonalds4008-517-517.cnaboutmcdonalds.comhappymeal.co.nzhappymeal.com.au mcd.commcdelivery.co.idmcdelivery.co.krmcdelivery.com.aumcdelivery.com.mymcdelivery.com.sgmcdelivery.com.twmcdindonesia.com mcdonalds.camcdonalds.co.uk mcdonalds.commcdonalds.com.hk mcdonalds.hk mcdonalds.it mcdonalds.no mcdonalds.semcdonaldsarabia.commcdonaldsparties.co.nzmcdonaldsparties.com.au!xn--qhrx81fxh2a.xn--55qx5d.hk +GUOKR  guokr.com +k +IKEAikea.cn +cn ikea.com ikea.net  ingka.com  ingka.devingkacentres.com +9 + SQUIRRELVPNsquirrelvpn.comsquirrelgroup.net +7 + BUYMEACOFFEE buymeacoff.eebuymeacoffee.com + +FIGMA  figma.com + +JUEJIN  juejin.imb-gold-cdn.xitu.iomirror-gold-cdn.xitu.iop1-juejin.byteimg.comp2-juejin.byteimg.comp3-juejin.byteimg.comp4-juejin.byteimg.comp5-juejin.byteimg.comp6-juejin.byteimg.comp7-juejin.byteimg.comp8-juejin.byteimg.comp9-juejin.byteimg.com + +RSF rsf.org + +VOLVO volvodynafleetonline.comescandinavia-arg.comindependentoperatorcn.com road-crew.com udfs.com vfsco.at vfsco.be vfsco.bg vfsco.ca vfsco.ch vfsco.cl vfsco.co.uk vfsco.co.za  vfsco.com vfsco.com.au vfsco.com.br vfsco.com.cn +cn vfsco.com.tr vfsco.cz vfsco.de vfsco.dk vfsco.ee vfsco.es vfsco.fi vfsco.fr vfsco.hu vfsco.ie vfsco.in vfsco.it vfsco.jp vfsco.kr vfsco.lt vfsco.lv vfsco.mx vfsco.nl vfsco.no vfsco.pe vfsco.pl vfsco.ro vfsco.ru vfsco.se vfsco.sk vfsco.us vgcareers.netvolvo-truck.nl volvo.cavolvo.cn +cn  volvo.com volvo.com.cn +cn volvo.sevolvobrandshop.com volvobuses.at volvobuses.be volvobuses.ca volvobuses.ch volvobuses.covolvobuses.co.nzvolvobuses.co.ukvolvobuses.co.zavolvobuses.comvolvobuses.com.arvolvobuses.com.auvolvobuses.com.brvolvobuses.com.kwvolvobuses.com.ptvolvobuses.com.tw volvobuses.de volvobuses.dk volvobuses.es volvobuses.fi volvobuses.fr volvobuses.hk volvobuses.hu volvobuses.in volvobuses.it volvobuses.jo volvobuses.kr volvobuses.ma volvobuses.mx volvobuses.my volvobuses.no volvobuses.om volvobuses.ph volvobuses.pk volvobuses.pl volvobuses.ru volvobuses.se volvobuses.sg volvobuses.tn volvobuses.us volvoce.comvolvodefense.com volvogroup.be volvogroup.cn +cnvolvogroup.comvolvogroup.com.brvolvogroup.com.cn +cn volvogroup.de volvogroup.fr volvogroup.jp volvogroup.kr volvogroup.mx volvogroup.nl volvogroup.pe volvogroup.pl volvogroup.ru volvogroup.sevolvogrouptruckcenter.nlvolvomerchandise.comvolvopenta.comvolvopenta.com.br volvopenta.de volvopenta.es volvopenta.fr volvopenta.it volvopenta.nl volvopenta.se volvopenta.usvolvosaatio.fivolvospares.comvolvotrucks.aevolvotrucks.alvolvotrucks.amvolvotrucks.atvolvotrucks.azvolvotrucks.bavolvotrucks.bevolvotrucks.bgvolvotrucks.byvolvotrucks.chvolvotrucks.clvolvotrucks.co.aovolvotrucks.co.bwvolvotrucks.co.ilvolvotrucks.co.mzvolvotrucks.co.navolvotrucks.co.ukvolvotrucks.co.nzvolvotrucks.co.zavolvotrucks.co.zmvolvotrucks.co.zwvolvotrucks.comvolvotrucks.com.arvolvotrucks.com.auvolvotrucks.com.bnvolvotrucks.com.brvolvotrucks.com.cn +cnvolvotrucks.com.covolvotrucks.com.kwvolvotrucks.com.ptvolvotrucks.com.trvolvotrucks.com.twvolvotrucks.com.uavolvotrucks.czvolvotrucks.devolvotrucks.dkvolvotrucks.eevolvotrucks.esvolvotrucks.fivolvotrucks.frvolvotrucks.gevolvotrucks.grvolvotrucks.hkvolvotrucks.hrvolvotrucks.huvolvotrucks.idvolvotrucks.involvotrucks.itvolvotrucks.jpvolvotrucks.kgvolvotrucks.krvolvotrucks.kzvolvotrucks.ltvolvotrucks.lvvolvotrucks.mavolvotrucks.mdvolvotrucks.mkvolvotrucks.mnvolvotrucks.myvolvotrucks.netvolvotrucks.nlvolvotrucks.novolvotrucks.pevolvotrucks.phvolvotrucks.pkvolvotrucks.plvolvotrucks.psvolvotrucks.qavolvotrucks.rovolvotrucks.rsvolvotrucks.ruvolvotrucks.sevolvotrucks.sgvolvotrucks.sivolvotrucks.skvolvotrucks.tmvolvotrucks.tnvolvotrucks.uyvolvotruckcenter.bevolvotruckcenter.dkvolvotruckcenter.esvolvotruckcenter.fivolvotruckcenter.itvolvotruckcenter.krvolvotruckcenter.kzvolvotruckcenter.nlvolvotruckcenter.novolvotruckcenter.sevolvotruckrental.beudtrucksmeena.com +> + CATEGORY-DEValpinelinux.org anaconda.com anaconda.org conda.io android.comandroidify.com +apache.orgappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cncalendarserver.orgapple-cloudkit.com cups.orgdeveloper.apple.comdevimages-cdn.apple.comdevstreaming-cdn.apple.comfoundationdb.orgmacosforge.org macruby.com macruby.net macruby.orgapple-mapkit.complaygrounds-cdn.apple.com carekit.orgresearchandcare.orgresearchkit.cn +cnresearchkit.com.cn +cnresearchkit.hkresearchkit.netresearchkit.orgresearchkit.tvservicetalk.io +webkit.org webkitgtk.org wpewebkit.orgwebobjects.com-)appleworldwidedeveloper.hb-api.omtrdc.net)%appleworldwidedeveloper.sc.omtrdc.net#p-events-delivery.akamaized.net archlinux.orgarchlinuxarm.org atom.io +badgen.netbootstrapcdn.comgetbootstrap.combraventures.com braveux.com +compass.isfightforux.comforthebadge.comstockagainstphotography.com launchpad.netlaunchpadlibrarian.comlaunchpadlibrarian.netlaunchpadlibrarian.org snapcraft.io snapstore.io +ubuntu.com +ubuntu.netubuntuforums.org canonical.com  cdnjs.com +centos.orgchocolatey.org clojure.org +cnpmjs.org +cygwin.com +cython.org dart.dev dartlang.org dartpad.dev +debian.org +dotdeb.org  deno.landcompose-spec.io +docker.com  docker.ioelixir-lang.org +elrepo.org embed.ly embedly.com playerjs.io +erlang.orgaccountkit.comatscaleconference.com botorch.org +buck.build buckbuild.comcomponentkit.org draftjs.org +f8.comfacebookappcenter.infofacebookappcenter.netfacebookappcenter.orgfacebookconnect.comfacebookdevelopergarage.comfaciometrics.com fasttext.cc fbf8.com fbinfer.com fblitho.com fbredex.com +fbrell.com flow.dev flow.org flowtype.org frescolib.org hacklang.org hhvm.commakeitopen.com mcrouter.net mcrouter.orgmessengerdevelopers.com +ogp.meopengraphprotocol.comopengraphprotocol.org  parse.com pyrobot.org  react.com reactjs.com reactjs.org recoiljs.org rocksdb.com rocksdb.net rocksdb.orgyogalayout.comdevelopers.facebook.com fastlane.cifastlane.tools getfedora.orgfedoraforum.orgfedoraproject.orgfedoramagazine.org +ffmpeg.org flathub.org flatpak.org flutter.devflutterapp.comfontawesome.comfortawesome.com freebsd.org  fury.blog fury.co fury.dev  fury.help fury.io gemfury.com +gentoo.orggetcomposer.org git-scm.com gitbook.com +gitbook.iogitbook.zendesk.com  npmjs.com npm.communitydependabot.com +git.io github.blog +github.comgithub.community  github.io githubapp.comgithubassets.comgithubhackathon.comgithubstatus.comgithubusercontent.com/+github-avatars.oss-cn-hongkong.aliyuncs.comFBgithub-production-release-asset-[0-9a-za-z]{6}\.s3\.amazonaws\.com +gitlab.com  gitlab.io +gitlab.netgitlab-static.net.*gitlab-assets.oss-cn-hongkong.aliyuncs.com gnu.org go-lang.com go-lang.net go-lang.org +go.dev  godoc.org +golang.com +golang.net +golang.org  consul.io hashicorp.comnomadproject.io  packer.io terraform.io vagrantup.comvaultproject.io haskell.orghaskellstack.org stackage.org brew.shhomebrew.bintray.com +01.org hyperscan.iointellinuxgraphics.comintellinuxgraphics.net +oneapi.comopenvinotoolkit.orgsnap-telemetry.io +acpica.com clearlinux.cn +cnclearlinux.org +ospray.net +ospray.org +ius.iojava java.com java.net +jenkins.io jetbrains.com jetbrains.net datalore.iokotlinlang.org  jfrog.com  jfrog.org bintray.com!d29vzk4ow07wi7.cloudfront.net +js.org jsdelivr.net jsdelivr.comcdn.jsdelivr.net +cn jupyter.org kali.org kubernetes.io +k8s.iolinuxfromscratch.org linuxmint.com lua.org macports.org mariadb.orgadaptivecards.ioapi-extractor.com +apisof.net appcenter.ms +blazor.netbotframework.comcodethemicrobit.comdevopsassessment.net dot.netgamesstack.comgraphengine.ioinsiderdevtour.com +jwt.ms microbit.orgmicrosoftadc.commicrosoftgamestack.commicrosoftiotinsiderlabs.commicrosoftreactor.cn +cn#microsoftreactor.com.cn +cnmicrosoftreactor.infomicrosoftreactor.netmicrosoftreactor.orgmicrosoftsilverlight.commicrosoftsilverlight.orgmicrosoftsilverlight.netmicrosoftsqlserver.com  mmdnn.commono-project.com msdn.commsinnovationchallenge.commspairlift.commsropendata.com  nuget.org nugettest.orgopentranslatorstothings.orgposhtestgallery.compwabuilder.comreactorms.com.cn +cn +sankie.netsqlserveronlinux.comtimelinestoryteller.comuwpcommunitytoolkit.comvisualstudio-staging.comvisualstudio.comvisualstudio.covisualstudio.co.ukvisualstudio.euvisualstudio.net vfsforgit.com vfsforgit.org vsassets.io xamarin.comdeveloper.microsoft.comdtlgalleryint.cloudapp.net poshtestgallery.cloudapp.net"psg-int-centralus.cloudapp.netpsg-int-eastus.cloudapp.net  mingw.org mongodb.com mongodb.org  mysql.com  nginx.com  nginx.org  nixos.orgnodesource.comnotepad-plus-plus.org +openai.com openresty.org openssl.org opensuse.org openwrt.lan +private openwrt.orglede-project.org packagist.org pcre.org perl.org cpan.org metacpan.org phantomjs.org php.netpolymer-project.orgpolymerproject.orgpostgresql.org +python.orgpythonhosted.org pypa.io pypi.org qt.ioqt-project.org r-project.orgraspberrypi.org raspbian.orgreadthedocs-hosted.comreadthedocs.comreadthedocs.ioreadthedocs.org redis.io redislabs.com remirepo.net rpmfusion.org ruby-lang.org rubygems.orgscala-lang.org scala-sbt.orgscientificlinux.org scoop.sh +shields.io +sqlite.org askubuntu.comblogoverflow.commathoverflow.netserverfault.com sstatic.net stackapps.com stackauth.comstackexchange.com stackmod.blogstackoverflow.blogstackoverflow.comstackoverflow.emailstackoverflowbusiness.comstacksnippets.net superuser.com tex-talk.netthesffblog.commystrikingly.comstrikingly.comstrikinglycdn.comsublimetext.com +kernel.org  linux.org amp.devampproject.comampproject.netampproject.orgcdn.ampproject.org +cnamp.akamaized.netelectronjs.org +jquery.comjquerymobile.com jqueryui.com mochajs.org +nodejs.org openjsf.orglfai.foundationlinuxfoundation.org  unity.com unity3d.com!unityads.unity3d.com +ads#unityads.unitychina.cn +ads  unpkg.com +v8.dev v8project.org videojs.com videolan.org vim.org wireshark.org x.orgxda-developers.com xda-cdn.com xposed.info yarnpkg.com zsh.org +# + EMOGI-ADS emogi.com +ads +@ + GLOBALVOICESglobalvoices.orgglobalvoicesonline.org + +HEGRE  hegre.com + +ORIGIN dawngate.com eastore.comlordofultima.com +origin.com  origin.tv#cloudsync-prod.s3.amazonaws.comorigin-a.akamaihd.netrtm.tnt-ea.comssl-lvlt.cdn.ea.com + +QUALCOMMairgonetworks.comberkanawireless.comdragoniscoming.comgobianywhere.comhellosmartbook.com imod.comipleadership.org +iskoot.commeetsmartbook.compatenttruth.org pixtronix.comqctconnect.com +qprize.comqualcomm-email.com qualcomm.cnqualcomm.co.idqualcomm.co.inqualcomm.co.jpqualcomm.co.krqualcomm.co.uk qualcomm.comqualcomm.com.brqualcomm.com.tw qualcomm.de qualcomm.frqualcommhalo.comqualcommlabs.comqualcommmea.comqualcommretail.comqualcommventures.cnqualcommventures.com qualphone.com quicinc.com snapdragon.cnsnapdragonbooth.com +uplinq.com wipower.comwirelessreach.com +brewmp.comqualcomm.sc.omtrdc.net  -OPENSSL openssl.org - - SITEPOINT sitepoint.com -! -ZOOM zoom.com zoom.us -H -COOLAPK coolapk.comcoolapkmarket.comcoolapkmarket.net -8 - -CYBERTRUSTcybertrust.co.jpcybertrust.ne.jp -, -JAVAjava java.com java.net -g -OOKLA-SPEEDTEST-ADSPB^speed\.(coe|open)\.ad\.[a-z]{2,6}\.prod\.hosts\.ooklaserver\.net$ -@ads -( -REDIS redis.io redislabs.com - - TONGCHENG 40017.cn -17u.cn 17u.net 17usoft.com 17usoft.net  elong.comelongstatic.com -ly.com -; -WJX -sojump.com -wjx.cn wjx.com wjx.top +WEBFLOW webflow.com + +BITTREX bittrex.com +- +MYRADIO +myradio.hkmyradio.com.hk + +HUOBI +hbabit.com +hbfile.net  huobi.com huobi.me  huobi.pro huobi.sc huobiasia.viphuobigroup.comhuobitoken.com + +PAXFUL +paxful.com +$ +INTEL +01.org hyperscan.iointellinuxgraphics.comintellinuxgraphics.net +oneapi.comopenvinotoolkit.orgsnap-telemetry.io +acpica.com clearlinux.cn +cnclearlinux.org +ospray.net +ospray.org intel intel.ac intel.ae intel.af intel.ag intel.ai intel.ar intel.at intel.az intel.ba intel.bg intel.bh intel.bi intel.bo intel.bs intel.by intel.ca intel.cc intel.cg intel.ch intel.cl intel.cmintel.cn +cn intel.co.ae intel.co.cr intel.co.id intel.co.il intel.co.jp intel.co.kr intel.co.uk intel.co.za  intel.com intel.com.ar intel.com.au intel.com.bo intel.com.br intel.com.cn +cn intel.com.co intel.com.ec intel.com.hk intel.com.jm intel.com.mx intel.com.my intel.com.pe intel.com.ph intel.com.pr intel.com.py intel.com.tr intel.com.tw intel.com.uy intel.com.ve intel.cr intel.cu intel.cz intel.de intel.dk intel.dz intel.ec intel.ee intel.eg intel.es intel.eu intel.fi intel.fr intel.ga intel.gd intel.ge intel.gl intel.gm intel.gr intel.gs intel.gt intel.gy intel.hk intel.hn intel.ht intel.hu intel.ie intel.in intel.io intel.it intel.je intel.jo intel.jp intel.ke intel.la intel.lc intel.lk intel.lt intel.lu intel.ly intel.ma intel.md intel.me intel.mg intel.mk intel.mn intel.mp intel.mt intel.mu intel.mw intel.mx intel.my intel.ng intel.nl intel.nu intel.nz intel.pa intel.pe intel.ph intel.pl intel.pn intel.re intel.ro intel.ru intel.rw intel.sa intel.sc intel.se intel.sg intel.si intel.sk intel.sn intel.sr intel.st intel.sv intel.sx intel.sy intel.tf intel.tj intel.tl intel.tm intel.tn intel.tt intel.tv intel.tw intel.ua intel.uk intel.us intel.uy intel.uz intel.vg intel.vn intel.vu intel.wf intel.yt +altera.comalteraforum.comalteraforums.comalteraforums.netalterauserforum.comalterauserforum.netalterauserforums.comalterauserforums.net buyaltera.com celeron.com celeron.net centrino.com centrino.net  chips.com cilk.com cilk.netcloudinsights.comclusterconnection.com coreduo.comcoreextreme.comcrosswalk-project.comcrosswalk-project.netdoceapower.com  easic.com enpirion.comexascale-tech.comexploreintel.comgordonmoore.cominsidefilms.com intc.comintel-research.net&"intel-university-collaboration.netintelamericasstore.comintelapacstore.com intelatom.netintelcapital.comintelcapital.netintelcloudbuilders.comintelcloudfinder.comintelemeastore.cominteleventexpress.comintelforchange.comintelfreepress.com intelgo.netintelinsight.cominteliotmarketplace.com +intell.comintellearningseries.comintellinuxwireless.netintelnervana.comintelnet.component intelplay.comintelquark.comintelrealsense.cn +cnintelrealsense.com intelrxt.comintelsalestraining.comintelsecurity.comintelserveredge.comintelsoftwarenetwork.comintelstore.cominteltechnologyprovider.com intelvmwarecybersecurity.com  itnel.comlatencytop.comlookinside.commakebettercode.commakesenseofdata.com movidius.com movidius.netnervanasys.com  nevex.comnextgenerationcenter.com +niosii.com +niosii.netomekinteractive.com +omnitek.tv openamt.comopendroneid.orgoptanedifference.com +pc.com pentium.com pentium.net pintool.compoweredbyintel.comreconinstruments.com reconjet.comresearchintel.comsaffrontech.comsensorynetworks.com +siport.comsmart-edge.comtheintelstore.comthunderbolttechnology.nettrustedanalytics.comtrustedanalytics.net +vokevr.com vpro.com vpro.net xeon.comxn--ztsq84g.cn +xscale.combarefootnetworks.com + +MRAY  mray.club + +WALMART walmart wal-mart.com +wal.cowalmart-content.com walmart.comwalmart.pharmacywalmartimages.com +wmt.co C ADDTHIS addthis.comaddthiscdn.comaddthisedge.com +* +BETTEREXPLAINEDbetterexplained.com +9 +EMBEDLY embed.ly embedly.com playerjs.io + +QUANTIL quantil.com +. +ANDROID android.comandroidify.com +c +COMODO +comodo.com comodoca.com comodoca2.com comodoca3.com comodoca4.com + + +EVERBRIGHT cebbank.com ceblease.com +eb-ind.com ebasset.com ebchina.comebchinaintl.com +ebf.com.cn  ebfcn.com ebfortune.com ebtrust.com ebscn-am.com  ebscn.comeverbright.com  secec.comsunlife-everbright.com + + +JD3.cn  300hu.com +360buy.com 360buyimg.com +360top.com +7fresh.com baitiao.comblackdragon.com  caiyu.comchinabank.com.cn +dao123.comjcloud-cdn.comjcloud-live.comjcloud-oss.com +jcloud.comjcloudcache.com jcloudcs.com jclouddn.com jcloudec.com jcloudlb.comjcloudlive.com jcloudlv.com jcloudoss.com jcloudss.comjcloudstatic.comjcloudvideo.com  jclps.com +jd-app.com  jd-ex.com jd.cn jd.co.th +jd.com jd.hk jd.id jd.ru jdcache.com jdcloud.com jdcloudcs.comjdcloud-api.comjddapeigou.com jddebug.com jddglobal.com jdjinrong.com  jdpay.com jdpaydns.com jdx.com jdwl.comjingdongjinrong.com +jingxi.com +jkcsjd.com +joybuy.com  joybuy.eslinglonglife.com mayshijia.com minitiao.com  ocwms.com paidaojia.cn +paipai.comprestodb-china.com qianxun.comqingzhouip.com toplife.com +vg.com wangyin.com  wdfok.com yhd.com yihaodian.comyihaodianimg.com yiyaojd.com yizhitou.comads.union.jd.com +ads c-nfa.jd.com +adscps.360buy.com +ads +jzt.jd.com +ads stat.m.jd.com +ads img-x.jd.com +ads + +JS-ORG +js.org +! + +MASTERCARD mastercard.ae mastercard.at mastercard.az mastercard.ba mastercard.be mastercard.bg mastercard.by mastercard.ca mastercard.ch mastercard.cl mastercard.cn +cnmastercard.co.idmastercard.co.ilmastercard.co.inmastercard.co.jpmastercard.co.kemastercard.co.krmastercard.co.nzmastercard.co.thmastercard.co.ukmastercard.co.vemastercard.co.zamastercard.commastercard.com.armastercard.com.aumastercard.com.bhmastercard.com.brmastercard.com.bzmastercard.com.cn +cnmastercard.com.comastercard.com.cymastercard.com.egmastercard.com.gemastercard.com.gtmastercard.com.hkmastercard.com.kwmastercard.com.lbmastercard.com.mxmastercard.com.mymastercard.com.ngmastercard.com.pemastercard.com.phmastercard.com.samastercard.com.sgmastercard.com.trmastercard.com.twmastercard.com.vemastercard.com.vn mastercard.cz mastercard.de mastercard.dk mastercard.es mastercard.eu mastercard.fi mastercard.fr mastercard.gr mastercard.hr mastercard.hu mastercard.iemastercard.inc mastercard.it mastercard.jo mastercard.ke mastercard.kz mastercard.lu mastercard.md mastercard.my mastercard.nl mastercard.no mastercard.om mastercard.pl mastercard.pt mastercard.qa mastercard.ro mastercard.rs mastercard.ru mastercard.se mastercard.si mastercard.sk mastercard.ua mastercard.usareyoucreditwise.comborderlessprepaid.combranchportal.com idservice.incinclusivegrowthscore.com findacard.com mastercad.commastercard-email.commastercardacademy.commastercardadvisors.commastercardcenter.commastercardcenter.org*&mastercardcenterforinclusivegrowth.orgmastercardconnect.commastercardezsavings.commastercardidtheftalerts.commastercardrestaurant.commastercardservices.commastercardworldwide.commasterpassteststore.commasterintelligence.commcpeaceofmind.commyaccountglobalcash.commycardbenefits.comonedinesfree.com paypass.netpieceofplastic.compredictivetechnologies.com priceless.com pricelessmarketingengine.comsbitravelcard.comshoppercentre.com!smartcommunitiescoalition.com!smartcommunitiescoalition.org startpath.comtaptotokyo.comtasteofpremium.jptravelcontroller.comwwwpaypass.combecomeindex.comcashpassport.cacashpassport.co.zacashpassport.comcashpassport.com.brcashpassport.netcorporatecashpassport.comicashpassport.com.mxintercamcashpassport.com.mx!multicurrencycashpassport.comshinhangmc.commastercardbiz.camastercardbiz.com!mastercardbusinessnetwork.com +nab.com.aunabtravellercard.com.au 53world.com53worldsweeps.comlovethiscity.commastercardmoments.compahabicilemezsurprizler.com priceless.compriceless.com.cn +cn priceless.orgpricelessafrica.compricelessarabia.compricelessaruba.compricelessbeijing.cn +cnpricelessbeijing.com#pricelessbeijing.com.cn +cnpricelesshongkong.compricelesshonolulu.compricelesspick.compricelesssantiago.compricelesssydney.compricelesssurprises.compricelesstoronto.capricelesstv.com simplify.comsimplifycommerce.comcashpassportglobe.comgwktravelex.nl travelex.be travelex.bh travelex.catravelex.co.intravelex.co.jptravelex.co.nztravelex.co.uk travelex.comtravelex.com.autravelex.com.cn +cntravelex.com.hktravelex.com.mytravelex.com.omtravelex.com.tr travelex.de travelex.fr travelex.it travelex.qatravelexae.comtravelexch.comtravelexmoneycard.combidvestbank.co.zaworldcurrencycard.co.zanab.demdex.net&"nationalaustraliaban.tt.omtrdc.net  -ELREPO -elrepo.org +PORNHD +pornhd.com +4 +SCInewisiknowledge.comisiknowledge.com + +AVSFORUM avsforum.com + + +CHOCOLATEYchocolatey.org +% + FONTEXPLORERfontexplorerx.com + +IUS +ius.io  -HEGRE  hegre.com +JAVHD  javhd.com +Y +JFROG  jfrog.com  jfrog.org bintray.com!d29vzk4ow07wi7.cloudfront.net + +ONEDRIVE 1drv.com 1drv.mslivefilestore.com onedrive.coonedrive.co.uk onedrive.com onedrive.eu onedrive.net onedrive.orgonedrive.live.comstorage.live.com +# +V8 +v8.dev v8project.org +, + BYTEDANCE-ADSmcs.snssdk.com +ads +( +UCLOUD  ucloud.cn ufileos.com  -RFA rfa.org -> -UBUNTU -ubuntu.com -ubuntu.netubuntuforums.org +WHO who.int +N +CNBC cnbc.com +cnbcfm.com +nbcuni.comnbcudigitaladops.com +* +JIANSHU jianshu.com +jianshu.io + +MANORAMAmalayalamanorama.com manorama.commanoramanews.commanoramaonline.commanoramayearbook.inonmanorama.com radiomango.fm  theman.in +theweek.invanitaonline.com +vanitha.invanithaveedu.com + +OUPamamanualofstyle.com anb.org blackstonespoliceservice.com epigeum.com oed.com  omscr.com oup.com +ouplaw.com ox.ac.ukoxfordaasc.comoxfordartonline.comoxfordbibliographies.comoxfordclinicalpsych.com oxforddnb.comoxfordfirstsource.comoxfordhandbooks.comoxfordlawtrove.comoxfordmedicine.comoxfordmusiconline.comoxfordpoliticstrove.com oxfordre.comoxfordreference.comoxfordscholarlyeditions.comoxfordscholarship.comoxfordwesternmusic.comsipriyearbook.org ukwhoswho.com"universitypressscholarship.comveryshortintroductions.com + +SUPERSONIC-ADSsupersonic.com +adssupersonicads.com +ads +ssacdn.com +ads)supersonicads-a.akamaihd.net +ads +e +METART +metart.commetartnetwork.com metcams.comnaiadsystems.com  nsimg.net + + NETEASE-ADSanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads +k + PANASONIC  panasonic panasonic.cn +cn panasonic.com panasonic.jp technics.com + +SLASHDOT slashdot.org + +TIDELIFT tidelift.com + +GIT git-scm.com + + +HONGKONGFPhongkongfp.com +6 + RUBYCHINAruby-china.orgrubyconfchina.org + + +SKILLSHAREskillshare.com + + ZEROHEDGE zerohedge.com + +BRAVEUXbraventures.com braveux.com +compass.isfightforux.comforthebadge.comstockagainstphotography.com + +IBMibmweatherchannel weather bluemix.com bluemix.net ibm.com +ibm.eu ibm.net +ibm.us s-bluemix.net s81c.com + +IPFS ipfs.io +" + LETSENCRYPTletsencrypt.org +: +POLYMERpolymer-project.orgpolymerproject.org +" + SUBLIMETEXTsublimetext.com + +TMTPOST tmtpost.com chaindd.com +72whys.com checkzeit.com +tivitv.com tigeek.net.cntmtsmartlife.comtmtsmartrun.com +& +XNXX xnxx.com xnxx-cdn.com +@ +JQUERY +jquery.comjquerymobile.com jqueryui.com +4 + KHANACADEMYkhanacademy.org kastatic.org + +NETFLAV netflav.com +* +SCIENTIFICLINUXscientificlinux.org + + ZHIHUISHU zhihuishu.com +g + ATLASSIAN atlassian.com bitbucket.org statuspage.io +trello.com trellocdn.com + + CHINAUNICOM  10010.com 10010.com.cnchinaunicom.comchinaunicom.com.cnchinaunicom.com.hkchinaunicomglobal.commychinaunicom.com  wo.com.cn + +DISNEYabc-studios.com abc.com edgedatg.com espn.com espncdn.com watchespn.comespn.hb.omtrdc.netespndotcom.tt.omtrdc.net +marvel.commarvel10thanniversary.commarveldimensionofheroes.commarvelparty.netmarvelpinball.commarvelsdoubleagent.commarvelspotlightplays.com marvelsuperheroseptember.commarvelsuperwar.comthemarvelexperiencetour.comnatgeomaps.comnationalgeographic.com"nationalgeographicpartners.com ngeo.comadventuresbydisney.com +babble.com babyzone.com +dilcdn.comdisney-asia.comdisney-discount.comdisney-plus.netdisney-studio.comdisney-studio.net  disney.be  disney.bg  disney.ca disney.co.il disney.co.th disney.co.uk disney.co.za +disney.com disney.com.au disney.com.br  disney.cz  disney.de  disney.dk  disney.es  disney.fi  disney.fr  disney.gr  disney.hu  disney.id  disney.in  disney.io  disney.it  disney.my  disney.nl  disney.no  disney.ph  disney.pl  disney.pt  disney.ro  disney.se  disney.sgdisneyadsales.comdisneyarena.comdisneyaulani.comdisneybaby.comdisneycareers.comdisneychannelonstage.comdisneychannelroadtrip.comdisneycruisebrasil.comdisneyenconcert.comdisneyiejobs.comdisneyinflight.comdisneyjunior.comdisneyjuniortreataday.comdisneylatino.comdisneymagicmoments.co.ildisneymagicmoments.co.ukdisneymagicmoments.co.zadisneymagicmoments.dedisneymagicmoments.esdisneymagicmoments.frdisneymagicmoments.gen.trdisneymagicmoments.grdisneymagicmoments.itdisneymagicmoments.pl disneyme.comdisneymeetingsandevents.comdisneymovieinsiders.comdisneymusicpromotion.comdisneynewseries.com disneynow.comdisneypeoplesurveys.comdisneyplus.comdisneyredirects.comdisneysrivieraresort.comdisneystore.comdisneysubscription.comdisneyturkiye.com.trdisneytvajobs.comdisneyworld-go.com +dssott.comgo-disneyworldgo.com +go.com  mickey.tvmoviesanywhere.complaymation.comshopdisney.comshops-disney.comsorcerersarena.comspaindisney.com starwars.com#starwarsgalacticstarcruiser.comstreamingdisney.netthestationbymaker.comthisispolaris.comwatchdisneyfe.com + +FANDOM cursecdn.com +fandom.com  wikia.com  wikia.org dndbeyond.com futhead.com gamepedia.com muthead.comwikia.nocookie.netfandom.zendesk.com +$ +GFW  gfw.press +gfw.report ++ +WIKIDOT wdfiles.com wikidot.com + + +AKAMAI ak1.net +aka-ai.com +aka-ai.net akacrypto.net akadeem.net +akadns.com akadns6.net +akaeai.com +akafms.net akahost.net +akaint.net akam.net +akamaa.com +akamah.com +akamak.com +akamam.comakamai-access.comakamai-access.netakamai-cdn.com akamai-platform-internal.netakamai-platform-staging.comakamai-platform.netakamai-regression.netakamai-staging.netakamai-sucks.netakamai-thailand.comakamai-thailand.netakamai-trials.com akamai.co.kr +akamai.com +akamai.netakamaientrypoint.netakamaietpcnctest.com#akamaietpcompromisedcnctest.com'#akamaietpcompromisedmalwaretest.comakamaietpmalwaretest.comakamaietpphishingtest.comakamaihd-staging.net akamaihd.com akamaihd.netakamaimagicmath.netakamainewzealand.comakamaiphillipines.comakamaiphillipines.netakamaitech.comakamaitech.netakamaitechnologies.comakamaitechnologies.netakamaisingapore.netakamaized-staging.net akamaized.netakamaizercentral.com +akamci.com  akami.com  akami.net +akamii.com +akamqi.com akastream.com akastream.net +akatns.net iamakamai.com iamakamai.netsoasta-dswb.com +srtcdn.net ++ +FORBES +forbes.com forbesimg.com + +MONOTYPEfontexplorerx.com  fonts.com  fonts.net fontbook.com fontshop.comfstopimages.com40fontshop-prod-responsive-images.s3.amazonaws.com linotype.com myfonts.com myfonts.net monotype.commonotypeimaging.com bitstream.com itcfonts.com + +CANON canon c-ij.com canon-cee.comcanon-cmos-sensors.com canon-cna.comcanon-ebm.com.hkcanon-emea.comcanon-emirates.aecanon-europa.comcanon-europe.com canon-me.com canon-ois.qacanon-se.com.tw canon.am canon.at canon.az canon.ba canon.be canon.bg canon.ca canon.chcanon.cn +cn canon.co.il canon.co.uk canon.co.za  canon.com canon.com.al canon.com.au canon.com.by canon.com.cn +cn canon.com.cy canon.com.hk canon.com.mk canon.com.mt canon.com.my canon.com.tr canon.com.tw canon.cz canon.de canon.dk canon.ee canon.es canon.fi canon.fr canon.ge canon.gr canon.hr canon.hu canon.ie canon.it canon.kz canon.lt canon.lu canon.lv canon.me  canon.net canon.nl canon.no canon.pl canon.pt canon.ro canon.rs canon.ru canon.se canon.si canon.sk canon.tj canon.ua canon.uzcanonfoundation.orgcanonproprinters.com +@ +REUTERS reuters.com +reuters.tvreutersmedia.net +, +ACPLAY +acplay.netdandanplay.com +9 + +ARTSTATIONartstation.comartstationmedia.com +_ +CATEGORY-WIKI-CNhuijistatic.com huijiwiki.com moegirl.orgmoegirl.org.cn + +IEEE ieee.org ieee.tvtryengineering.org ieee-ccnc.org ieee-ecce.org ieeemce.orgstandardsuniversity.orgieee-region6.org ieee.ca ieeer10.org +ieeer5.org +ieeer8.org ieeeusa.orgieeefoundation.orgieee-into-focus.org ieee-vics.org ieeeday.orgdatasheets360.comglobalspec.com ieee-isto.orgtechstreet.com computer.org +comsoc.org embs.org emcs.org grss-ieee.org ieee-aess.org ieee-cas.org ieee-ceda.orgieee-edusociety.org ieee-ies.org ieee-ims.org ieee-npss.org ieee-pels.org ieee-pes.org ieee-ras.orgieee-sensors.org ieee-tems.org ieee-uffc.org ieeeaps.org ieeecsc.org ieeecss.org ieeedeis.orgieeemagnetics.org ieeenano.org ieeeoes.org ieeesmc.orgieeesystemscouncil.org  itsoc.org mtt.orgphotonicssociety.orgsignalprocessingsociety.orgtechnologyandsociety.org vtsociety.org + +MINISOloveminiso.com.br miniso-au.com miniso-bh.com miniso-np.com miniso-nz.com  miniso.by  miniso.ca miniso.cn +cn  miniso.co miniso.co.id miniso.co.tz +miniso.com miniso.com.es miniso.com.gr miniso.com.mx miniso.com.pl miniso.com.py miniso.com.tr  miniso.ge  miniso.ie  miniso.jp  miniso.ma  miniso.my  miniso.pe  miniso.pk  miniso.ua  miniso.uz minisohome.cn +cnminisoindia.comminisojordan.comminisokorea.comminisolife.co.zaminisothailand.comminisovietam.vn minsio.cn +cn myminiso.com +6 +PROQUESTserialssolutions.com proquest.com +, +RENREN +renren.comrenren-inc.com +9 +SHADOWSOCKSCOMshadowsocks.comshadowsocks.nl + +AMAZON amazon-adsystem.com +adswholecitiesfoundation.orgwholefoodsmarket.comwholekidsfoundation.orgwholeplanetfoundation.orgaws +amazonimdb +kindle xn--cckwcxetdxn--jlq480n2rg yamaxun +zapposaboutamazon.cn +cnaboutamazon.co.ukaboutamazon.comaboutamazon.com.auaboutamazon.deaboutamazon.esaboutamazon.euaboutamazon.fraboutamazon.inaboutamazon.itaboutamazon.jpaboutamazon.pl alexafund.cn +cnalexafund.com.cn +cn amaaozn.comamazon-fashions.comamazon-jp-recruiting.comamazon-lantern.comamazon-launchpad.com  amazon.ae  amazon.ca amazon.cn +cn amazon.co.jp amazon.co.uk +amazon.com amazon.com.au amazon.com.br amazon.com.mx amazon.com.tr  amazon.de  amazon.es  amazon.fr  amazon.in  amazon.it amazon.jobs  amazon.jp  amazon.nl +amazon.red  amazon.sgamazonalexavoxcon.comamazonauthorinsights.comamazonbusiness.cn +cn!amazonbusiness.com.cn +cnamazonbusiness.orgamazonbusinessblog.comamazonchoice.cn +cnamazonchoice.com.cn +cnamazonchoices.cn +cn amazonchoices.com.cn +cnamazondevicesupport.comamazonfctours.comamazonianblog.comamazonimages.comamazoninspire.cn +cn amazoninspire.com.cn +cnamazonlaunchpad.cn +cnamazonlaunchpad.com"amazonlaunchpad.com.cn +cn amazonlending.com.cn +cn!amazonliterarypartnership.comamazonlumberyard.wang amazonnow.cn +cnamazonnow.com.cn +cn amazonsdi.comamazonstudiosguilds.comamazontrust.comamazonvideodirect.com amzn.com amzn.to  amznl.comassoc-amazon.cn +cnassociates-amazon.comgameon-masters.comgdansk-amazon.commedia-amazon.com primeday.cn +cnprimeday.com.cn +cn primeday.infosiege-amazon.comssl-images-amazon.comueberamazon.de +yamaxun.cn +cn yamaxun.comz.cn +cn audible.comacmvalidations.comacmvalidationsaws.comaesworkshops.comamazonaws-china.com amazonaws.com amazonaws.tvamazonworkdocs.cn +cnamazonworkdocs.com!amazonworkdocs.com.cn +cnamplifyapp.comamplifyframework.comaws-iot-hackathon.comawsautopilot.comawsautoscaling.com awsbraket.comawscommandlineinterface.comawsedstart.comawseducate.comawseducate.netawseducate.orgawsloft-johannesburg.comawsloft-stockholm.comawssecworkshops.com awsstatic.comawsthinkbox.com awstrust.comcdkworkshop.comcloudfront.netcontainersonaws.comelasticbeanstalk.comthinkboxsoftware.com".+\.awsdns-[0-9][0-9]\.co\.uk$.+\.awsdns-[0-9][0-9]\.com$.+\.awsdns-[0-9][0-9]\.net$.+\.awsdns-[0-9][0-9]\.org$".+\.awsdns-cn-[0-9][0-9]\.biz$!.+\.awsdns-cn-[0-9][0-9]\.cn$".+\.awsdns-cn-[0-9][0-9]\.com$".+\.awsdns-cn-[0-9][0-9]\.net$ kindle.cn +cn kindle.co.jp kindle.co.uk +kindle.com  kindle.de  kindle.es  kindle.fr  kindle.in  kindle.it  kindle.jpkindleoasis.cn +cnkindleoasis.comkindleoasis.com.cn +cnkindleoasis.infokindleoasis.jpkindleoasis.orgkindleoasis.uskindleoasisnews.comkindleproject.comamazonprimevideo.cn +cn#amazonprimevideo.com.cn +cnamazonprimevideos.comamazonvideo.ccamazonvideo.comprime-video.com primevideo.ccprimevideo.comprimevideo.infoprimevideo.org primevideo.tv+images-cn.ssl-images-amazon.com +cn-!images-cn-8.ssl-images-amazon.com +cn +3 +QUORA  quora.com quoracdn.net qr.ae + +BEATS100beatscheap.com1monsterbeatsbydreus.com2013beatsbydrdreonline.com2013beatsbydrdreshop.com2013beatsbydreshop.com2013beatshdcybermonday.com2013cheapestbeats.com2013newbeatsworld.com2013pascherbeatsbydre.com2014cheapbeatsbydre.com 2beatsdre.com2buybeatsbydre.com2drdrebeats.com40shopping.com4beatsbydre.com5beatsbydre.comaaagradeheadphones.com +aanaan.comabcheadphones.comabeatsbydrdre.com aeasyshop.com +airmay.com +ajtalk.com albeats.com annstores.netaokwholesale.netaucheapbeats.comaudiobeatsau.comaudiobeatsbydre.comaudiomonsterbeatsonline.comauricularemonsterbeats.com#auricularesbeatsbaratosshop.comauricularesbeatsmarkt.comausbeatsbydrdre.combag-glasses1.com bandgirlz.com baxsound.com bbestmall.com +beatbd.combeatbydre2013.combeatbydremonster.com!beatbydreheadphonesonsale.combeatbydrekopen.combeatbydreuk2014.combeatdrdres.combeatfactoryoutlets.combeatmonstersaustralia.netbeats-by-dre-australia.combeats-bydrdre.netbeats-bydre-mall.combeats-bydrecheapsale.combeats-bydreoutletonline.combeats-bydreoutletsale.combeats-bydreoutletsale.netbeats-bydreoutletssale.netbeats-bydrestore.combeats-bydreuk.combeats-deal.combeats-dre-us.com"beats-headphones-buy-cheap.combeats-headphones.usbeats-sale.combeats-seller.combeats-soaho.com  beats1.cc beats1.cn +cn  beats1.tv beats1.com.cn +cn beats123.com beats2.com.cn +cn beats4.cn +cn +beats4.netbeats4outlets.combeats4salecheap.combeatsallsale.combeatsaudifonos.combeatsaudiobydre.combeatsaudiobydre.netbeatsaudios.netbeatsbeatsmonster.combeatsbestdeals.combeatsblackfridaydeals.netbeatsblackfridayretails.combeatsboxingdayuksale.combeatsbydrdre-headphones.combeatsbydrdre-officials5.combeatsbydrdre-online.combeatsbydrdre-onsale.combeatsbydrdre-store.combeatsbydrdre-store.usbeatsbydrdre4sale.combeatsbydrdrebiz.combeatsbydrdrecustom.combeatsbydrdredanmark.combeatsbydrdremall.combeatsbydrdreoutlet.combeatsbydrdres.combeatsbydrdresale.netbeatsbydrdrestore.combeatsbydrdreus.com!beatsbydre-beatsheadphone.combeatsbydre-chen.combeatsbydre-club.combeatsbydre-headphones.com!beatsbydre-headphonesshop.combeatsbydre-mall.combeatsbydre-outlet.combeatsbydre-outletsale.netbeatsbydre-outletstore.combeatsbydre-sell.combeatsbydre-store.combeatsbydre-studio.combeatsbydre-us.com beatsbydre.jpbeatsbydre2081.combeatsbydre411.combeatsbydre4usales.combeatsbydreauofficial.combeatsbydreausale.net beatsbydreaustralia-sale.com!beatsbydreaustraliaonline.com"beatsbydreaustraliaonlines.com beatsbydreaustraliasales.combeatsbydrebeatsby.com!beatsbydreblackfriday2013.com beatsbydreblackfridaypro.combeatsbydreboxingdayca.combeatsbydrecasquesfr.com#beatsbydrecheap-outletstore.combeatsbydrecheaper.com"beatsbydrecheaponlinesales.combeatsbydrecolors.com beatsbydrecustomwireless.com&"beatsbydrecybermondaydeals2013.com&"beatsbydrecybermondaydeals2013.netbeatsbydredanmarks.com"beatsbydredealsblackfriday.com"beatsbydredealscybermonday.combeatsbydrediscount.com beatsbydrediscountonline.netbeatsbydredr.combeatsbydreexecutivesale.com beatsbydreformall2013-nl.com beatsbydreforsalesonline.com beatsbydreforshop2013-nl.combeatsbydreforstore.combeatsbydreforyououtlet.combeatsbydrefr.com!beatsbydrefrcasquepascher.combeatsbydrefriday.combeatsbydregot.combeatsbydrehd.combeatsbydrehd.netbeatsbydreheadphones-nz.combeatsbydreheadphonesolo.combeatsbydrehut.combeatsbydreinexpensive.combeatsbydreireland-sales.com beatsbydreirelandonlines.combeatsbydreirelandsale.com beatsbydreirelandsonline.combeatsbydremall2013.com"beatsbydremonsteraustralia.combeatsbydrenls.combeatsbydrenorge1.net!beatsbydreofficialdanmark.combeatsbydreoksale.combeatsbydreol.combeatsbydreonlie2013-nl.com!beatsbydreonlines-ireland.combeatsbydreonlines-uk.combeatsbydreonlinesale-nz.combeatsbydreoordopjes.combeatsbydreoslo.combeatsbydreoutletsale.combeatsbydreoutletscheap.combeatsbydrerealstore.combeatsbydres-shop.combeatsbydresale-uk.combeatsbydresalemall2013.combeatsbydresales.us'#beatsbydresalesonline-australia.com beatsbydresaleonlines-nz.combeatsbydresdanmark.netbeatsbydreshop-uk.combeatsbydreshops.netbeatsbydresingapores.combeatsbydresingaporesale.combeatsbydrespeakers.combeatsbydresold.com%!beatsbydresolohdonline-canada.combeatsbydresonline-nz.combeatsbydrestorevip.combeatsbydressale.combeatsbydressolo.combeatsbydresstudio.com"beatsbydrestudio-australia.combeatsbydrestudio.combeatsbydretoutlet.combeatsbydreuk.combeatsbydreuk.netbeatsbydreus.combeatsbydrevipde.combeatsbydrew.combeatsbydrsmonsterinusa.combeatsbymusic.netbeatsbysdrbre.combeatsbysdrdres.combeatscasque-france.combeatscheap-nz.combeatscheap-uk.combeatscheapforsale.combeatscollection2014.combeatscustomblackfriday.combeatsdanmark2013.combeatsdrdre-headphones.combeatsdrdre-it.combeatsdrdre-solo.combeatsdrdre2014.combeatsdrdrecuffie.netbeatsdrdrekaufenschweiz.netbeatsdrdreneon.combeatsdre-monster.com beatsdre.netbeatsdre4cheap.combeatsdrecheap.combeatsdredreheadphones.combeatsdreforsale.combeatsdreinau.combeatsdremonster-uk.com!beatsdrenewcolorful4usale.combeatsdreoutletsale.combeatsdresale2013.combeatsdresalestore.combeatsdresolo2013.combeatsdreus.combeatsearbudsheadphoness.combeatsfacstore.combeatsfactoroutlets.combeatsfactorycollection.combeatsfactoryoutles.combeatsforcheap-usa.combeatsforme.combeatsfranceofficiel.combeatselectronic.netbeatselectronics.com +beatsep.cn +cn beatsep.com beatsep.net beatsheadphones-discount.combeatsheadphones1.combeatsheadphones2u.combeatsheadphonesale.combeatsheadphonesdealer.combeatsheadphonesforcheap.netbeatsheadphonesonline.combeatsheadphoness.combeatsheadphonestudio.combeatsheadphonesusamall.combestshoesale2014.netbeatshopuk.combeatsincanada.combeatsinsingapore.combeatsireland.net beatsjoy.combeatsmonstersales.combeatsmusic.combeatsmusic.wang beatsneon.combeatsnzsale.com beatsodre.combeatsofdre-usa.combeatsonblackfriday2013.com beatsone.netbeatsoutlet.netbeatsoutletanytime.combeatsoutletonlines.combeatspascher-bydre.combeatspascher-fr.netbeatspascher.netbeatspaschers.netbeatspillnewcolor.combeatspills.combeatspromonsterjp.combeatspromotions.combeatssales.combeatssaleus.combeatssaustraliabuy.combeatssbyaustralia.combeatssbydredanmark.combeatsshop-uk.combeatsshop-usa.combeatsshopstore.combeatssingapores.combeatssingaporeshop.com beatsstudiohodetelefoner.combeatsstudiosite.combeatstoreusa.com beatsua.combeatswholesale.usbeatswirelesscheap.combeatswirelesscuffie.combegin-trade.combestbeats4u.com +biitii.comblackfridaydrebeatsnew.comblackfridaydrebeatsshop.combloommicroventures.com bookonsky.net +bossae.combrandeasygo.combrandelectronic.combrandproducts1688.com brands098.combusinesswebwise.combuy-from-shanghai.combuybeatsbydre-uk.combuybeatsheadphonesbydre.combuycheapbeatsbus.combuycheapbeatsbydre.combuycheapbeatsbydreshop.combuycheapbeatsdreuk.combuydrdrebeatbox.combuyminibeatbox.combuyonlineheadphones.combuyshoponly.combuzzardflapper.combybeatsdre.combydrebeats.comcanada-beatsbydre.com casque-fr.com casquebeatsbydrdresolohd.comcasquebeatsdocteurdre.comcasquebeatsdre2013.comcasquebeatsenligne.comcasquebeatsfracheter.comcasquebeatsmer.netcasquebeatsofficiel-fr.comcasquebeatspascher2013.comcasquebeatssolo.netcasquedrdrebeatssfr.comcasquemonsterbeats.com#casquemonsterbeatsbydre2013.comcasquesbeatsaudio.comcheap-beats-by-dre.netcheap-beatsbydre.comcheapbagshoes.com cheapbeats.uscheapbeats365.comcheapbeats4sale.netcheapbeatsaustraliasale.comcheapbeatsbus.comcheapbeatsbydr.comcheapbeatsbydrdrepro.comcheapbeatsbydre-au.comcheapbeatsbydre99.comcheapbeatsbydrefau.comcheapbeatsbydremall.comcheapbeatsbydremonster.comcheapbeatsbydrenz.netcheapbeatsbydreonsale.com cheapbeatsbydreoutlet-nz.comcheapbeatsbydreoutlet.com"cheapbeatsbydreoutlets2013.comcheapbeatsbydresale.comcheapbeatsbydreshop.comcheapbeatsdrdresolo.com$ cheapbeatsbydrestudioedition.com"cheapbeatsbydrestudioutlet.comcheapbeatsdrestudios.comcheapbeatsheadphone2014.comcheapbeatsheadphones.uscheapbeatsie.comcheapbeatsla.comcheapbeatssale4u.comcheapbeatsshopbydre.comcheapcustombeatsbydre.comcheapdrdrebeats8.comcheapdrdrebeatsca.comcheapdrebeats8.netcheaperbeatsbydresale.comcheapestbeatsdrdre.comcheapheadphonesland.comcheapheadphonessale.comcheapheadsetmall.comcheapheadsetshop.com cheapmonsterbeatsbydrdre.com!cheapmonsterbeatsheadsets.com cheapmonstersbeatsonsale.comcheapmonsterbeatssale.comcheapmonsterbeatsusa.uscheapnewbeatsbydre.comcheapsalemonster.comcheapshoesvip.comcheapwireless04.comcheapwirelessbeats.comcheerwholesale.uschihair-straightener.comchinaclothesstore.comciattackers.com +cmhalq.com cnshopin.comcoolmonster.netcozydrdrebeats.com cqcorea.comcuffiesaldi.comcustombeatsbydrebuy.comcustombeatsdeals.comcustombeatsforcheap.comcustombeatsny.comcustombeatssbydreus.comcustomdrdrebeats.comcustomizedbeatbydre.comcustomizedbeatsbydre.comcustomizedbeatsdre.comcybermondaybeats4sale.comdanemarket.comdanmarkbeatsbydrdre.comdctbeatsbydre.comdealsbeatsblackfriday.comdetaliczny.comdiscountbeatsbydre-us.comdiscountbeatsstore.comdkbeatsbydre.comdrbeatsukmart.comdrdre-beats.comdrdrebeats-chen.comdrdrebeats-headphone.comdrdrebeats-usa.comdrdrebeatsale.comdrdrebeatsbillig.comdrdrebeatsdesale.comdrdrebeatsdiscount.comdrdrebeatsforu.comdrdrebeatsretail2013.comdrdrebeatssale7.comdrdrebeatsuk.comdrdreheadphonebeats.comdrdreheadphonekey.comdrdreheadphonesusstore.comdrdremonster-beats.comdrdremonsterdre.comdrdreprobeatssale.com drdrefnac.comdrebeats-australia.comdrebeats-france.comdrebeats-monster.com!drebeats-monsteraustralia.comdrebeats-monsterusa.comdrebeats-singapore.comdrebeats-singapore.netdrebeats-singaporecheap.comdrebeats-singaporecheap.netdrebeats-solo.comdrebeats-studio.comdrebeatsaustralia-cheap.comdrebeatsaustralia-cheap.netdrebeatsbuy.comdrebeatsbydreoutlet.comdrebeatscanada.comdrebeatsdeutschland.netdrebeatsforsaleus.comdrebeatsheadphones-nz.comdrebeatshome.comdrebeatsoutletstore.comdrebeatsoldes.comdrebeatspill.comdrebeatssite.com#drebeatssolocybermondaysale.comdrebeatsstudio2013.comdrebeatstudio.com drebyby.comdremonsterbeatsoutlets.comdreprobeats.com dreprofy.com +dtsell.comearphonescheapest.comebuyheadphones.comesbeatsbydrebuy.cometheadphones.comfamosascalvas.comfindmybeats.comfr-beatsbydrestore.comfrancecasquebeatssolde.comfrcasquesbeats.com free-aa.com free-sns.com frishoes.comgamebeforethegame.comgetdrebeatssale.comgmnetworks.net gobeatsye.comgobuyonlinestore.net goodsdunk.netheadphonepubs.comheadphones-cool.comheadphones-dre.com headphones-outlet-online.comheadphonesbeatsaudio.comheadphonesbeatsbydre.comheadphoneses.comheadphoneshome.comheadphoneshotsales.comheadphonesol.comheadphonesretailer.comheadphonessupply.comheadphonezip.comheadset987.comhellokittybeats.com highbolt.net highdefinitionbeatsbydre.com hipaa6020.com hipzoom.nethonawalaan.comhotbeatsonsale.comhotmonsterbeats.comhottestheadphonesonline.com  hrsaz.com ibeats-uk.comibeatsbydre.ccibeatsbydre.comigoshopping.net illianacomputerrecycling.comimonsterbeats.comincentivetravelgifts.comioffergift.com islamiccenterofnewlondon.comitaliabeatsbydrdre.com jkbeats.comkickshatchannel.comkobbeatssbydredk.comkopfhorergunstigshop.comleecountytimes.com lexuemei.comlovebeatsdr.com lovemarca.comluckyissue.com +lyzsxx.com mairbeats.com +makeeu.commallheadphone.commbeats-tech.commbheadphone.com +micstl.commmonsterheadphones.netmonbeats2013.commonster-beats-by-dr-dre.com monster-beats-headphones.commonsterbeats-cheap.commonsterbeats-headphone.commonsterbeats-onsale.commonsterbeats-solo.commonsterbeats-solo.netmonsterbeats365buy.commonsterbeats8beatsbydre.commonsterbeatsale.commonsterbeatsalestore.commonsterbeatssalg.commonsterbeatsau.commonsterbeatsbydrdre-nz.commonsterbeatsbydrdre-usa.com!monsterbeatsbydrdrecanada.com!monsterbeatsbydrdrestudio.commonsterbeatsbydre-nz.commonsterbeatsbydre-usa.commonsterbeatsbydre2015.com'#monsterbeatsbydreaustraliacheap.com!monsterbeatsbydrebilligde.com monsterbeatsbydrefactory.commonsterbeatsbydrenew.commonsterbeatsbydres.commonsterbeatsbydreshop.commonsterbeatscasques.commonsterbeatscommunity.commonsterbeatsdrdrecheap.commonsterbeatsfactory.netmonsterbeatsfinland.commonsterbeatsforsale.commonsterbeatsheadphone.commonsterbeatsheadphones.netmonsterbeatshere.commonsterbeatsitaly.commonsterbeatsmall.commonsterbeatsnegozi.netmonsterbeatsok.com!monsterbeatsonlinestoreuk.commonsterbeatsoutlet.usmonsterbeatspascher.netmonsterbeatsru.commonsterbeatssales.commonsterbeatsshops.netmonsterbeatsstore.com#monsterbeatssydneyaustralia.commonsterbeatstang.commonsterbeatstienda.commonsterbeatstudio.commonsterbydrebeat.com!monstercasquebeatspascher.netmonstercheapbeatss.commonsterdrebeats-canada.netmonsterdrebeats-usa.commonsterdrebeats-usa.netmonsterheadphone.netmonsterproduct.netmonstersbeatbydres.commonstersdebea.commonstershopcheapbeats.netmoreheadphones.com +ms4dre.commybeatsbydrestudio.commybeatsbydreuk.commybeatscheapbydre.commyferrariheadphones.comnamemybeats.com neborder.comnegozimonsterbeats.comnegoziomonsterbeats.comnewbeatsblackfriday.com newbemany.comnewdrediscount.comnewestbeatsbydre.comnewlysprung.netnewmonst1erbeatsto1re.com!newmonsterbeatsheadphones.comnewschristmasshopping.comnflhotsalejerseys.com nicesshop.netofferairjordanlebron.comofficialbeatsbydreshop.comofficialbeatsbydrestore.comofficialdrdre.comofficialheadphone.com ogameblog.comonbeatsbydresale.com onlinemonsterbeatsonsale.com onsalekey.comonsaletrend.comoutletbeatsshop.compascherbeatsmonster.compaulsimon-music.comperfectkickz.netpersoneelsland.compicknicekicks.netpickshoesclothes.com pillbeatsblackfridaysale.compocketbiketrader.compowerbeats2wireless.compowerbeatsbydrdre.compowerbeatsbydre.compromonsterbeatsbydre.comprostudiobeatscybersale.com  rbsgr.comrepsneakermall.com repswing.com!salebeatslasteststyle4you.comsaleblackfridaydrebeats.comsalecheaphandbags.com samebags.com sanvaras.com +scnshop.cc +shoers.com shoestop2.comshop-headphones.netshopbeatsdre.com shopbydre.comshopcustomizedbeats.comshopdrebeats.comshopmonsterbeats.comshopping-days.netshoppinguheadphones.comsneaker666.comsneakerpage.netsneakerskick.comsolostudioksale.com soso7778.comspecialtyheadphones.comspiritclubs.comstraightouttasomewhere.comstudiobeatsbydrdre.comsulwerphoto.comsunglassessale2014.comsuperearsenjoy.comsupplybestjerseys.comsustainthesound.comsverigebeatsbydrdre.com szcheapmonsterheadphones.comszwinnertechnology.com takegoto.comthe-monster-beats.comthebeatsbydre.comthebeatsbydre.netthebeatsheadphonesale.com +theuab.nettopbeatsbydrdreoutlet.comtopbeatsdealer.comtopbeatsforsale.com tradevip1.com tteshop.com ubnw.net +unstyle.us&"usa-beatsbydreheadphonesonsale.net  v-has.com vip-beats.comvipbeatsbydre.comvipheadphones.com vipshoes2.com  wasdj.comwholesale-exporter1.comwholesalediscountpurses.comwholesalefine.comwholesaleonlinemart.comworldcoinpay.comyourmonsterbeats.com%!beatselectronicsllc.tt.omtrdc.net +" + HUBBLEPHONEhubblephone.com + +WOOLITE +woolite.ca +woolite.cn +cn woolite.comwoolite.com.cn +cn +woolite.pl +woolite.uswoolitecarpet.com  -UPROXY -uproxy.org +CAIXIN +caixin.com +# +DCARD dcard.io dcard.tw +x +FASTLY +fastly.com +fastly.netfastlylabs.com fastlylb.netfastly-terrarium.com +zencdn.net + + +JINRISHICIjinrishici.com + +WEVERSE +weverse.io +z +CERNcern ams02.space cern.ch cixp.netdotcernpilot.info  ippog.orglinearcollider.org + +SOFTBANK softbank sb-mobile.jpsb-telecom.netsoftbank-ipo.comsoftbank-jp.comsoftbank-robotics.comsoftbank-telecom.comsoftbank-telecom.net softbank.jp softbank.tvsoftbankbb.comsoftbankbb.netsoftbankci.comsoftbankhawksstore.jpsoftbankmobile.netsoftbankrobotics.comsoftbanktelecom.comsoftbankusa.netsoftbankventuresasia.comsoftbankworld.com + +THELINUXFOUNDATION +kernel.org  linux.org amp.devampproject.comampproject.netampproject.orgcdn.ampproject.org +cnamp.akamaized.netelectronjs.org +jquery.comjquerymobile.com jqueryui.com mochajs.org +nodejs.org openjsf.orglfai.foundationlinuxfoundation.org + + WORDPRESSvideopress.com w.org wordpress.com wordpress.org wordpress.tv wp-themes.com +wp.com  wpvip.com + +BTCBOX btcbox.co.jp  -CHANGE -change.org -A -MEIZU flyme.cn meizu.cn  meizu.com  mzres.com +ELREPO +elrepo.org +. +JIEMIAN jiemian.comjiemian.com.cn + +MDNdeveloper.mozilla.org($interactive-examples.mdn.mozilla.netmdn.mozillademos.orgmedia.prod.mdn.mozit.cloud + +PSIPHON psiphon3.com +. + +AMAZON-ADS amazon-adsystem.com +ads + +BESTBUY bby.combbycastatic.ca bbycloud.combbycontent.combbycontent.net bbyintl.com bbystatic.com  bbyurl.us bestbhy.combestbuy-audio.com"bestbuy-communityrelations.combestbuy-giftcard.infobestbuy-int.combestbuy-jobs.com +bestbuy.ca +bestbuy.cn +cn bestbuy.combestbuy.com.cn +cnbestbuy.com.mx bestbuy.infobestbuy24x7solutions.combestbuybusiness.com'#bestbuybusinessadvantageaccount.combestbuycanada.cabestbuycanada.combestbuycanadaltd.cabestbuycharityclassic.combestbuycoffeemakers.combestbuyethics.combestbuyforbusiness.cabestbuygsm.combestbuyideax.com!bestbuyphotoworkshoptours.combestbuyrewards.combestbuyrewardzone.ca bestbuys.combestbuysgeeksquad.combestbuysolutions.netbestbuystores.combestbuytradein.com bestbuyus.com besztbuy.com bextbuy.combienvenuechezbestbuy.ca cowboom.com futureshop.cainitproducts.commagnoliaav.com.cn +cn mybestbuy.commybestbuyclaims.commyrewardzone.com myrz.compacifickitchenandhome.comtiendabestbuy.comunbrandedproducts.comwelcometobestbuy.cawolfatbestbuy.comwolfatbestbuy.netwww-bestbuystores.comgeek-squad-support.comgeek-squad.netgeek-squad.orggeek-squads.net geeksquad.ca geeksquad.cc geeksquad.com geeksquad.net geeksquad.tvgeeksquadcares.comgeeksquadcentral.comgeeksquadforums.comgeeksquadonline.comgeeksquadprotectionplan.orggeeksquadservices.orggeeksquadwebroot.org gscanada.info +gsccdn.com  gslink.usonlinegeeksquad.comrocketfishproducts.com dealtree.orgtechliquidators.com + +DW +dw.com + +NVIDIA +geforce.cn +cn geforce.co.kr geforce.co.uk geforce.comgeforce.com.twgputechconf.cn +cngputechconf.co.krgputechconf.comgputechconf.com.augputechconf.com.twgputechconf.eugputechconf.ingputechconf.jp nvidia.asia  nvidia.be  nvidia.ch nvidia.cn +cn nvidia.co.jp nvidia.co.kr +nvidia.com nvidia.com.au nvidia.com.br nvidia.com.tr nvidia.com.tw  nvidia.cz  nvidia.de  nvidia.dk  nvidia.es  nvidia.eu  nvidia.fi  nvidia.fr  nvidia.it  nvidia.lu  nvidia.nl  nvidia.no  nvidia.pl  nvidia.ro  nvidia.ru  nvidia.seshotwithgeforce.comnvidia.tt.omtrdc.net +Q +WANGSU  8686c.comchinanetcenter.com +wangsu.com ourdvsss.com +9 + YCOMBINATORstartupschool.orgycombinator.com +@ + ZUOYEBANG zuoyebang.cc zuoyebang.com +zybang.com +Ǒ +CATEGORY-ENTERTAINMENT abema.io abema.tv ameba.jp ao3.orgarchiveofourown.orgarchiveofourown.comarchiveofourown.net +att.tv atttvnow.comattwatchtv.com directv.com  dtvce.comnettyinternet.com gamer.com.twbahamut.com.twgamer-cds.cdn.hinet.netgamer2-cds.cdn.hinet.net bandcamp.com +bcbits.com blizzard.cn +cn blizzard.comblizzardgearstore.comblz-contentstack.com blzstatic.cn +cn +battle.netbattlenet.com.cn +cn bnet.163.com +cnblizzard.nefficient.co.krblzddist1-a.akamaihd.netblzddistkr1-a.akamaihd.netbnetcmsus-a.akamaihd.netbnetproduct-a.akamaihd.netbnetshopus.akamaized.net diablo3.comdiabloimmortal.comdi.res.netease.com +cn!diablo3.nosdn.127.net +cnfiresidegatherings.complayhearthstone.com%hearthstone.nosdn.127.net +cnheroesofthestorm.com%hearthstone.nosdn.127.net +cn"heroes.nos.netease.com +cnplayoverwatch.com#overwatch.nosdn.127.net +cn starcraft.comstarcraft2.comsc2.nosdn.127.net +cnplaywarcraft3.comworldofwarcraft.com wowchina.com +cnwow.nosdn.127.net +cnblizzcon-a.akamaihd.netblz.nosdn.127.net +cnblzmedia-a.akamaihd.netblznav.akamaized.net blubrry.com  castro.fmdeviantart.comdeviantart.net da-files.comabc-studios.com abc.com edgedatg.com espn.com espncdn.com watchespn.comespn.hb.omtrdc.netespndotcom.tt.omtrdc.net +marvel.commarvel10thanniversary.commarveldimensionofheroes.commarvelparty.netmarvelpinball.commarvelsdoubleagent.commarvelspotlightplays.com marvelsuperheroseptember.commarvelsuperwar.comthemarvelexperiencetour.comnatgeomaps.comnationalgeographic.com"nationalgeographicpartners.com ngeo.comadventuresbydisney.com +babble.com babyzone.com +dilcdn.comdisney-asia.comdisney-discount.comdisney-plus.netdisney-studio.comdisney-studio.net  disney.be  disney.bg  disney.ca disney.co.il disney.co.th disney.co.uk disney.co.za +disney.com disney.com.au disney.com.br  disney.cz  disney.de  disney.dk  disney.es  disney.fi  disney.fr  disney.gr  disney.hu  disney.id  disney.in  disney.io  disney.it  disney.my  disney.nl  disney.no  disney.ph  disney.pl  disney.pt  disney.ro  disney.se  disney.sgdisneyadsales.comdisneyarena.comdisneyaulani.comdisneybaby.comdisneycareers.comdisneychannelonstage.comdisneychannelroadtrip.comdisneycruisebrasil.comdisneyenconcert.comdisneyiejobs.comdisneyinflight.comdisneyjunior.comdisneyjuniortreataday.comdisneylatino.comdisneymagicmoments.co.ildisneymagicmoments.co.ukdisneymagicmoments.co.zadisneymagicmoments.dedisneymagicmoments.esdisneymagicmoments.frdisneymagicmoments.gen.trdisneymagicmoments.grdisneymagicmoments.itdisneymagicmoments.pl disneyme.comdisneymeetingsandevents.comdisneymovieinsiders.comdisneymusicpromotion.comdisneynewseries.com disneynow.comdisneypeoplesurveys.comdisneyplus.comdisneyredirects.comdisneysrivieraresort.comdisneystore.comdisneysubscription.comdisneyturkiye.com.trdisneytvajobs.comdisneyworld-go.com +dssott.comgo-disneyworldgo.com +go.com  mickey.tvmoviesanywhere.complaymation.comshopdisney.comshops-disney.comsorcerersarena.comspaindisney.com starwars.com#starwarsgalacticstarcruiser.comstreamingdisney.netthestationbymaker.comthisispolaris.comwatchdisneyfe.com dawngate.com eastore.comlordofultima.com +origin.com  origin.tv#cloudsync-prod.s3.amazonaws.comorigin-a.akamaihd.netrtm.tnt-ea.comssl-lvlt.cdn.ea.comawayoutgame.combattlefieldbadcompany2.combattlefront2.combattlefrontii.combejewled-stars.combejeweledstars.comcapitalgames.com chillingo.comcommandandconquer.comconquerwithcharacter.com  crysis.jp dawngate.comdawngatechronicles.com +dicela.com +dicela.netea-anz-press.com +ea.com eaaccess.comeacashcard.com eacodigos.com eakorea.co.kr eamobile.com eanordic.com +eaplay.com easports.com easports.jpeasportsactive.comeasportsactiveonline.comeasportsfootball.comeasportsfootballclub.comeasportsmma.comeasportsworld.comelectronicarts.comelectronicarts.fr futpromos.com futunited.comghostgames.comheroesofdragonage.com hutpromos.commaddenchampionship.commaddenrewards.commaddenseason.infomaddenseason.netmaddenseason.org  maxis.commysimsracing.com play4free.com playapex.com pogo.com pogobeta.com +popcap.comprojectapex.com pvzheroes.com spearhead.krspeedhunters.com  spore.com ssx3.comstarwarsbattlefront.comstarwarsbattlefront2.comtiberiumalliances.com tiburon.com +tnt-ea.comultimaforever.com unravel2.comunraveltwo.comvisceralgames.com +yogify.comanthemgame.comanthemthegame.comapexlegends.comprojectapex.combattlefield.combattlefield1943.combattlefield3.combattlefield4.combattlefield5.combattlefieldheroes.combattlefieldv.com battlelog.com bioware.combiowarestore.com eamythic.com eamythic.net cncrivals.comcommandandconquer.comtiberiumalliances.comcamelot-europe.comcamelotherald.comcamelotherald.net daoc.netdarkageofcamelot.comdarkness-risen.comdeadspacegame.com dice.se dragonage.comdragonagekeep.comdragonagemovie.comthedreadwolfrises.comdungeonkeeper.cndungeonkeeper.comdungeonkeeper.com.cneafootballworld.comfifastreet.comfifastreet3.com frostbite.comindustrialtoys.commasseffect.commasseffectarchives.comeamirrorsedge.commirrorsedge.commirrorsedge.jpmirrorsedge.netmirrorsedge2.commirrorsedge2d.comblackboxgames.comeablackbox.comneedforspeed.comneedforspeedboost.comneedforspeeddriftkings.comneedforspeedeliminator.comneedforspeedlightning.comneedforspeedoverdrive.comneedforspeedproven.comneedforspeedredline.comneedforspeedshowdown.comneedforspeedstreetkings.comneedforspeedtakedown.comneedforspeedtherun.comneedforspeedtimeattack.com#needforspeedundergroundeast.com nfsworld.comteamneedforspeed.complantsvszombies2.com +pvzgw2.com pvzheroes.comseaofsolitude.comsimcity-buildit.com simcity.com +skate2.com spearhead.krstarwarsfallenorder.comstarwarsjedifallenorder.comstarwarstheoldrepublic.comswjedifallenorder.com  swjfo.com  swtor.com  swtor.net +mysims.com thesims.com thesims3.com thesims4.comthesimssocial.com titanfall.commythicentertainment.commythicentertainment.netmythicgames.comultimaonline.com +uo.com uoherald.com xdsummit.comea.tt.omtrdc.neteaassets-a.akamaihd.netbattlebreakers.com epicgames.com fortnite.com paragon.complayparagon.comroborecall.comshadowcomplex.com spyjinx.comunrealengine.comunrealtournament.com6*^cdn\d-epicgames-\d+\.file\.myqcloud\.com$ +cn*&^epicgames-download\d\.akamaized\.net$;/^epicgames-download\d-\d+\.file\.myqcloud\.com$ +cn fireside.fm"avatargarenanow-a.akamaihd.netcdngarenanow-a.akamaihd.net!dlmobilegarena-a.akamaihd.net garena.co.id garena.co.th +garena.com garena.live  garena.my  garena.ph  garena.sg  garena.tv  garena.tw  garena.vn garenanow.com seagroup.com gog.comgog-statics.comgog.qtlglb.com +cn$gogalaxy.gog-statics.com +cn'menu-static.gog-statics.com +cn'productcard.gog-statics.com +cn(static-login.gog-statics.com +cn'www4-static.gog-statics.com +cn, ^images(-\d)?\.gog-statics\.com$ +cn cinemax.comforthethrone.com hbo.com hboasia.com  hbogo.com hbogoasia.com hbogoasia.hk +hbomax.com +hbonow.com  maxgo.com +112263.com callhulu.comfindyourlimits.com freehulu.com  hooloo.tv  hoolu.com hoolu.tv hu1u.com huloo.cc huloo.tv hulu.com hulu.tv hulu.ushuluaction.com +huluad.com huluapp.com huluasks.com hulucall.com hulufree.com hulugans.comhulugermany.com +hulugo.com +huluim.comhuluinstantmessenger.com huluitaly.com hulunet.comhulunetwork.com huluplus.comhulupremium.comhulupurchase.com +huluqa.comhulurussia.com huluspain.comhulusports.comhulustream.com huluteam.com +hulutv.com huluusa.comjoinmaidez.com mushymush.tv +myhulu.comoriginalhulu.com payhulu.comregisterhulu.comthehulubraintrust.comwwwhuluplus.com imdb.com imdb.tomedia-imdb.cominternationalsaimoe.comkingkong.com.twkingkongapp.com litv.tv megaphone.fm moov.hk fast.com +netflix.ca netflix.com netflix.netnetflixinvestor.comnetflixtechblog.com nflxext.com nflximg.com nflximg.netnflxsearch.net +nflxso.net nflxvideo.netnico +nicodic.jp nicomanga.jp niconico.com nicoseiga.jp nicovideo.jp nimg.jp simg.jp100classicbooks.com +amiibo.comayudanintendo.combowsersinsidestory.comexcitebots.comflipnotestudio.comgloryofheracles.comhackyourconsole.comkirbysuperstarultra.comkirbysepicyarn.comlegendofzelda.cn +cn legendofzelda.com.cn +cn miitomo.commiitomo.com.cn +cn miiverse.com nentindo.netnintendo-europe-sales.comnintendo-europe.com nintendo.at nintendo.be nintendo.chnintendo.co.jpnintendo.co.krnintendo.co.uknintendo.co.za nintendo.comnintendo.com.hknintendo.com.pt nintendo.de nintendo.dk nintendo.es nintendo.eu nintendo.fi nintendo.fr nintendo.it nintendo.net nintendo.nl nintendo.no nintendo.pt nintendo.ru nintendo.se nintendo.twnintendo3ds.comnintendodsi.comnintendoeurope.comnintendolabo.cn +cnnintendonetwork.netnintendonyc.comnintendostore.comnintendoswitch.comnintendoswitch.netnintendoswitchtogether.compersonaltrainermath.complaynintendo.comsupersmashbros.cn +cn!supersmashbros.com.cn +cnthelegendarystarfy.comthewonderful101.comwariolandshakeit.comwariowarediy.comyoshisnewisland.comac-pocketcamp.comdiddykongracing.com dkr.com donkeykongcountryreturns.comfire-emblem-heroes.comfireemblemawakening.com +dialga.com giratina.com +kyurem.com pokedex3d.compokemon-moon.compokemon-sun.compokemon-sunmoon.com pokemon.compokemonbank.compokemonblackwhite.com pokemonbw.compokemonchampionships.compokemongoldsilver.compokemonhome.compokemonletsgoeevee.compokemonletsgopikachu.compokemonmysterydungeon.compokemonpicross.compokemonplatinum.compokemonrubysapphire.compokemonsunmoon.compokemonswordshield.compokemonultrasunmoon.compokemonvgc.compokemonwifi.net xn--mts47c3w9b1qr.cn +cnxn--mts47c3w9b1qr.netsplatoon2tournament.com starfox.comdrmario-world.commarioandluigidreamteam.commariobroswii.com mariokart.cn +cnmariokart.com.cn +cnmariokart7.commariokart8.commariosupersluggers.comnewsupermariobrosu.comsupermario.comsupermario3dworld.com!supermariobros.com.cn +cnsupermariogalaxy.comsupermariorun.comsuperpapermario.comnintendowii.com  wii-u.com +wiifit.com wiifitu.com wiipartyu.com wiisports.comwiisportsresort.comwiiugamepad.com  wiivc.net xenoblade.com op.ggopgg-static.akamaized.net overcast.fm  pixiv.net  pixiv.org pixiv.co.jp  pximg.net playstationplaystation.complaystation.net sonyentertainmentnetwork.com +pca.stpocketcasts.com"api-priconne-redive.cygames.jpomotenashi.cygames.jp%!prd-priconne-redive.akamaized.nethistoryofdota.comhistoryofdota.nethistoryofdota.orginstituteofwar.orgmolesports.com rgpub.ioriot-games.com riot.com riot.net riotcdn.netriotgames.co.kr riotgames.comriotgames.info riotgames.jp riotgames.net riotgames.tv riotpin.comriotpoints.com rstatic.net supremacy.com supremacy.net championshipseriesleague.com lcsmerch.comleaguehighschool.comleagueoflegends.caleagueoflegends.cn +cnleagueoflegends.co.krleagueoflegends.comleagueoflegends.infoleagueoflegends.krleagueoflegends.netleagueoflegends.orgleagueoflegendsscripts.comleaguesharp.infoleaguoflegends.comlearnwithleague.comlol-europe.com lolclub.org lolespor.comlolesports.com lolfanart.net +lolpcs.com lolshop.co.kr lolstatic.comlolusercontent.com +lpl.com.cn +cn pvp.net +pvp.tv ulol.comlolstatic-a.akamaihd.netrockstargames.com +rsg.sc1-gamedownloads-rockstargames-com.akamaized.net)%media-rockstargames-com.akamaized.net*&videos-rockstargames-com.akamaized.net fandango.com mgo.commgo-images.com ravm.tv roku.com rokutime.com dishworld.comslinginternational.com  sling.commovenetworks.com +movetv.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com +wwtbam.comyourfantasybeginsnow.comsoundcloud.com +sndcdn.com byspotify.com pscdn.co scdn.co spoti.fispotify-everywhere.com spotify.comspotify.designspotifycdn.comspotifycharts.comspotifycodes.comspotifyforbrands.comspotifyjobs.com fanatical.comhumblebundle.complayartifact.com +s.teamsteam-chat.comsteamcommunity.comsteamcontent.comsteamgames.comsteampowered.comsteamstatic.comsteamusercontent.comunderlords.comvalvesoftware.com wmsjsteam.com +cn csgo.wmsj.cn +cndl.steam.ksyna.com +cn dota2.wmsj.cn +cn st.dl.bscstorage.net +cnst.dl.eccdnx.com +cn!st.dl.pinyuncloud.com +cn&steampowered.com.8686c.com +cn%steamstatic.com.8686c.com +cn steambroadcast.akamaized.netsteamcdn-a.akamaihd.net!steamcommunity-a.akamaihd.netsteamstore-a.akamaihd.net#steamusercontent-a.akamaihd.net"steamuserimages-a.akamaihd.netsteamunlocked.net syosetu.com +muscdn.com +musical.ly +tiktok.com tiktokcdn.com tiktokv.com#p16-tiktokcdn-com.akamaized.net ext-twitch.tv  jtvnw.net  ttvnw.net  twitch.tv twitchcdn.net twitchsvc.net ubi.com ubisoft.com  uplay.com,(ubisoft-uplay-savegames.s3.amazonaws.com,(ubisoft-orbit-savegames.s3.amazonaws.com)uplaypc-s-ubisoft.cdn.ubi.com +cn +vhx.tv +vhxqa1.com +vhxqa2.com +vhxqa3.com +vhxqa4.com +vhxqa6.comvimeo-staging.comvimeo-staging2.com  vimeo.com vimeo.frvimeobusiness.com vimeocdn.comvimeogoods.comvimeoondemand.comvimeostatus.comlivestream.com abow.jp angelbeats.jp +anigema.jpcharlotte-anime.jpclannad-movie.jpheaven-burns-red.comkamisama-day.jpkamisama-maeda-lab.com koubaibu.jplitbus-anime.com product.co.jprewrite-anime.tvvisualarts.gr.jpvisual-arts.jp +viu.tvapi.viu.now.com^ewcdn[0-9]{2}\.nowe\.com$ viu.com dfp6rglgjqszk.cloudfront.net!d1k2us671qcoau.cloudfront.net!d2anahhhmp1ffz.cloudfront.net +weverse.io wwe.com wwe9.com +beth.games bethesda.netbethesdagamestudios.com bethsoft.com doom.comelderscrolls.comcallersbane.com minecraft.netminecraftshop.com +mojang.comforzamotorsport.netforzaracingchampionship.com forzarc.comorithegame.comrenovacionxboxlive.comtellmewhygame.com xbox.co xbox.com xbox.eu xbox.org +xbox360.co xbox360.com +xbox360.eu xbox360.org +xboxab.comxboxgamepass.comxboxgamestudios.com xboxlive.cn +cn xboxlive.com +xboxone.co xboxone.com +xboxone.euxboxplayanywhere.comxboxstudios.com +xbx.lv yande.re cvnad.com +ads +iyoowi.com +ads +got001.com +got002.com jstucdn.com playcvn.com rrys.tv rrys2019.com rrys2020.com rrysapp.com  yyets.com +zimuzu.com  zimuzu.tv zmz2019.com +zmzapi.com +z5.app +z5.com zee5.com zee5.in zee5.tvzeebioskop.com zeetv.co.uk  zeetv.com  zeeuk.com +) +DRIBBBLE drbl.in dribbble.com + +HUAWEI  dbank.com dbankcdn.com harmonyos.com hicloud.com hihonor.com honor.cn +huawei.comhuaweicloud.com  vmall.com vmallres.com +V + JETBRAINS jetbrains.com jetbrains.net datalore.iokotlinlang.org + +AOMEDIA aomedia.org + +GOG gog.comgog-statics.comgog.qtlglb.com +cn$gogalaxy.gog-statics.com +cn'menu-static.gog-statics.com +cn'productcard.gog-statics.com +cn(static-login.gog-statics.com +cn'www4-static.gog-statics.com +cn, ^images(-\d)?\.gog-statics\.com$ +cn + +ZSH zsh.org + +BITSTAMP bitstamp.net -NODESOURCEnodesource.com -# - DATFOUNDATIONdat.foundation - -DMM-ADS bluekai.com -@adsfout.jp -@ads gmossp-sp.jp -@adsi-mobile.co.jp -@ads im-apps.net -@ads impact-ad.jp -@ads ladsp.com -@ads microad.co.jp -@ads -microad.jp -@ads socdm.com -@ads - - LINUXMINT linuxmint.com -. - POCKETCASTS -pca.stpocketcasts.com +FONTSINUSEfontsinuse.com +% +KUGOU  kgimg.com  kugou.com + + TENCENT-ADS ad.qq.com +ads ad.qun.qq.com +ads!adfilter.imtt.qq.com +ads adping.qq.com +adsadpm.app.qq.com +adsadsclick.qq.com +adsadsfile.qq.com +adsadshmmsg.qq.com +adsadslvfile.qq.com +adsadslvseed.qq.com +ads%adsmind.apdcdn.tc.qq.com +adsadsqqclick.qq.com +adsadstestview.qq.com +adsadsview.qq.com +adsadsview2.qq.com +adsadv.app.qq.com +ads adver.qq.com +ads btrace.qq.com +adse.qq.com +adslog.tbs.qq.com +ads mpush.qq.com +ads mtrace.qq.com +ads push.qq.com +ads pgdt.gtimg.cn +ads + + THEGUARDIAN theguardiandev-guardianapis.comdev-theguardian.com +gu-web.netguardianapis.comguardianapps.co.uk +guim.co.uktheguardian.comtheguardiandns.com + + +XUEYUANJUNxueyuanjun.com + + CATEGORY-CASbuypass-ssl.com buypass.com +buypass.no +buypass.se minid.no +comodo.com comodoca.com comodoca2.com comodoca3.com comodoca4.comcybertrust.co.jpcybertrust.ne.jp digicert.com freessl.com geotrust.com rapidssl.com +thawte.com  thawte.de  thawte.fr entrust.netentrustdatacard.comglobalsign-media.com globalsign.be globalsign.chglobalsign.co.ukglobalsign.comglobalsign.com.auglobalsign.com.hkglobalsign.com.sg globalsign.es globalsign.eu globalsign.frglobalsign.net globalsign.nl!secure.globalsign.com +cnocsp.globalsign.com +cn ocsp2.globalsign.com +cn identrust.comidentrust.co.uk identrust.netletsencrypt.org secom.co.jpsecomtrust.net sectigo.comenterprisessl.comhackerguardian.cominstantssl.comoptimumssl.compositivessl.com digital-id.ch digitalid.chmanaged-pki.chmanaged-pki.de pki-post.ch pki-posta.ch pki-poste.chroot-signing.chrootsigning.comssl-certificate.ch +swissid.ch swissign.com swissign.liswisssign-group.chswisssign-group.comswisssign-group.li swisssign.ch swisssign.com swisssign.li swisssign.net swisssign.orgswisssigner.chswisssigner.comswisssigngroup.chswisssigngroup.comswissstick.com swisstsa.ch swisstsa.li trustdoc.ch trustsign.ch zert.ch telekom.com +telekom.de trustwave.com verisign.asia verisign.biz verisign.chverisign.co.inverisign.co.uk verisign.comverisign.com.auverisign.com.brverisign.com.cnverisign.com.esverisign.com.hkverisign.com.sgverisign.com.twverisign.com.vn verisign.de verisign.dk verisign.es verisign.fr verisign.hk verisign.in verisign.info verisign.jobs verisign.mobi verisign.name verisign.net verisign.org verisign.pro verisign.se verisign.sg verisign.tw verisign.us verisign.vnverisigninc.com  - WIRESHARK wireshark.org + CORDCLOUD cordcloud.org + +PRIVATElan localdomain example invalid  localhosttest local  home.arpa ^[^.]+$localhost.sec.qq.comlocalhost.ptlogin2.qq.com +< +ANACONDA anaconda.com anaconda.org conda.io + +APPLEiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +adscalendarserver.orgapple-cloudkit.com cups.orgdeveloper.apple.comdevimages-cdn.apple.comdevstreaming-cdn.apple.comfoundationdb.orgmacosforge.org macruby.com macruby.net macruby.orgapple-mapkit.complaygrounds-cdn.apple.com carekit.orgresearchandcare.orgresearchkit.cn +cnresearchkit.com.cn +cnresearchkit.hkresearchkit.netresearchkit.orgresearchkit.tvservicetalk.io +webkit.org webkitgtk.org wpewebkit.orgwebobjects.com-)appleworldwidedeveloper.hb-api.omtrdc.net)%appleworldwidedeveloper.sc.omtrdc.net#p-events-delivery.akamaized.net100beatscheap.com1monsterbeatsbydreus.com2013beatsbydrdreonline.com2013beatsbydrdreshop.com2013beatsbydreshop.com2013beatshdcybermonday.com2013cheapestbeats.com2013newbeatsworld.com2013pascherbeatsbydre.com2014cheapbeatsbydre.com 2beatsdre.com2buybeatsbydre.com2drdrebeats.com40shopping.com4beatsbydre.com5beatsbydre.comaaagradeheadphones.com +aanaan.comabcheadphones.comabeatsbydrdre.com aeasyshop.com +airmay.com +ajtalk.com albeats.com annstores.netaokwholesale.netaucheapbeats.comaudiobeatsau.comaudiobeatsbydre.comaudiomonsterbeatsonline.comauricularemonsterbeats.com#auricularesbeatsbaratosshop.comauricularesbeatsmarkt.comausbeatsbydrdre.combag-glasses1.com bandgirlz.com baxsound.com bbestmall.com +beatbd.combeatbydre2013.combeatbydremonster.com!beatbydreheadphonesonsale.combeatbydrekopen.combeatbydreuk2014.combeatdrdres.combeatfactoryoutlets.combeatmonstersaustralia.netbeats-by-dre-australia.combeats-bydrdre.netbeats-bydre-mall.combeats-bydrecheapsale.combeats-bydreoutletonline.combeats-bydreoutletsale.combeats-bydreoutletsale.netbeats-bydreoutletssale.netbeats-bydrestore.combeats-bydreuk.combeats-deal.combeats-dre-us.com"beats-headphones-buy-cheap.combeats-headphones.usbeats-sale.combeats-seller.combeats-soaho.com  beats1.cc beats1.cn +cn  beats1.tv beats1.com.cn +cn beats123.com beats2.com.cn +cn beats4.cn +cn +beats4.netbeats4outlets.combeats4salecheap.combeatsallsale.combeatsaudifonos.combeatsaudiobydre.combeatsaudiobydre.netbeatsaudios.netbeatsbeatsmonster.combeatsbestdeals.combeatsblackfridaydeals.netbeatsblackfridayretails.combeatsboxingdayuksale.combeatsbydrdre-headphones.combeatsbydrdre-officials5.combeatsbydrdre-online.combeatsbydrdre-onsale.combeatsbydrdre-store.combeatsbydrdre-store.usbeatsbydrdre4sale.combeatsbydrdrebiz.combeatsbydrdrecustom.combeatsbydrdredanmark.combeatsbydrdremall.combeatsbydrdreoutlet.combeatsbydrdres.combeatsbydrdresale.netbeatsbydrdrestore.combeatsbydrdreus.com!beatsbydre-beatsheadphone.combeatsbydre-chen.combeatsbydre-club.combeatsbydre-headphones.com!beatsbydre-headphonesshop.combeatsbydre-mall.combeatsbydre-outlet.combeatsbydre-outletsale.netbeatsbydre-outletstore.combeatsbydre-sell.combeatsbydre-store.combeatsbydre-studio.combeatsbydre-us.com beatsbydre.jpbeatsbydre2081.combeatsbydre411.combeatsbydre4usales.combeatsbydreauofficial.combeatsbydreausale.net beatsbydreaustralia-sale.com!beatsbydreaustraliaonline.com"beatsbydreaustraliaonlines.com beatsbydreaustraliasales.combeatsbydrebeatsby.com!beatsbydreblackfriday2013.com beatsbydreblackfridaypro.combeatsbydreboxingdayca.combeatsbydrecasquesfr.com#beatsbydrecheap-outletstore.combeatsbydrecheaper.com"beatsbydrecheaponlinesales.combeatsbydrecolors.com beatsbydrecustomwireless.com&"beatsbydrecybermondaydeals2013.com&"beatsbydrecybermondaydeals2013.netbeatsbydredanmarks.com"beatsbydredealsblackfriday.com"beatsbydredealscybermonday.combeatsbydrediscount.com beatsbydrediscountonline.netbeatsbydredr.combeatsbydreexecutivesale.com beatsbydreformall2013-nl.com beatsbydreforsalesonline.com beatsbydreforshop2013-nl.combeatsbydreforstore.combeatsbydreforyououtlet.combeatsbydrefr.com!beatsbydrefrcasquepascher.combeatsbydrefriday.combeatsbydregot.combeatsbydrehd.combeatsbydrehd.netbeatsbydreheadphones-nz.combeatsbydreheadphonesolo.combeatsbydrehut.combeatsbydreinexpensive.combeatsbydreireland-sales.com beatsbydreirelandonlines.combeatsbydreirelandsale.com beatsbydreirelandsonline.combeatsbydremall2013.com"beatsbydremonsteraustralia.combeatsbydrenls.combeatsbydrenorge1.net!beatsbydreofficialdanmark.combeatsbydreoksale.combeatsbydreol.combeatsbydreonlie2013-nl.com!beatsbydreonlines-ireland.combeatsbydreonlines-uk.combeatsbydreonlinesale-nz.combeatsbydreoordopjes.combeatsbydreoslo.combeatsbydreoutletsale.combeatsbydreoutletscheap.combeatsbydrerealstore.combeatsbydres-shop.combeatsbydresale-uk.combeatsbydresalemall2013.combeatsbydresales.us'#beatsbydresalesonline-australia.com beatsbydresaleonlines-nz.combeatsbydresdanmark.netbeatsbydreshop-uk.combeatsbydreshops.netbeatsbydresingapores.combeatsbydresingaporesale.combeatsbydrespeakers.combeatsbydresold.com%!beatsbydresolohdonline-canada.combeatsbydresonline-nz.combeatsbydrestorevip.combeatsbydressale.combeatsbydressolo.combeatsbydresstudio.com"beatsbydrestudio-australia.combeatsbydrestudio.combeatsbydretoutlet.combeatsbydreuk.combeatsbydreuk.netbeatsbydreus.combeatsbydrevipde.combeatsbydrew.combeatsbydrsmonsterinusa.combeatsbymusic.netbeatsbysdrbre.combeatsbysdrdres.combeatscasque-france.combeatscheap-nz.combeatscheap-uk.combeatscheapforsale.combeatscollection2014.combeatscustomblackfriday.combeatsdanmark2013.combeatsdrdre-headphones.combeatsdrdre-it.combeatsdrdre-solo.combeatsdrdre2014.combeatsdrdrecuffie.netbeatsdrdrekaufenschweiz.netbeatsdrdreneon.combeatsdre-monster.com beatsdre.netbeatsdre4cheap.combeatsdrecheap.combeatsdredreheadphones.combeatsdreforsale.combeatsdreinau.combeatsdremonster-uk.com!beatsdrenewcolorful4usale.combeatsdreoutletsale.combeatsdresale2013.combeatsdresalestore.combeatsdresolo2013.combeatsdreus.combeatsearbudsheadphoness.combeatsfacstore.combeatsfactoroutlets.combeatsfactorycollection.combeatsfactoryoutles.combeatsforcheap-usa.combeatsforme.combeatsfranceofficiel.combeatselectronic.netbeatselectronics.com +beatsep.cn +cn beatsep.com beatsep.net beatsheadphones-discount.combeatsheadphones1.combeatsheadphones2u.combeatsheadphonesale.combeatsheadphonesdealer.combeatsheadphonesforcheap.netbeatsheadphonesonline.combeatsheadphoness.combeatsheadphonestudio.combeatsheadphonesusamall.combestshoesale2014.netbeatshopuk.combeatsincanada.combeatsinsingapore.combeatsireland.net beatsjoy.combeatsmonstersales.combeatsmusic.combeatsmusic.wang beatsneon.combeatsnzsale.com beatsodre.combeatsofdre-usa.combeatsonblackfriday2013.com beatsone.netbeatsoutlet.netbeatsoutletanytime.combeatsoutletonlines.combeatspascher-bydre.combeatspascher-fr.netbeatspascher.netbeatspaschers.netbeatspillnewcolor.combeatspills.combeatspromonsterjp.combeatspromotions.combeatssales.combeatssaleus.combeatssaustraliabuy.combeatssbyaustralia.combeatssbydredanmark.combeatsshop-uk.combeatsshop-usa.combeatsshopstore.combeatssingapores.combeatssingaporeshop.com beatsstudiohodetelefoner.combeatsstudiosite.combeatstoreusa.com beatsua.combeatswholesale.usbeatswirelesscheap.combeatswirelesscuffie.combegin-trade.combestbeats4u.com +biitii.comblackfridaydrebeatsnew.comblackfridaydrebeatsshop.combloommicroventures.com bookonsky.net +bossae.combrandeasygo.combrandelectronic.combrandproducts1688.com brands098.combusinesswebwise.combuy-from-shanghai.combuybeatsbydre-uk.combuybeatsheadphonesbydre.combuycheapbeatsbus.combuycheapbeatsbydre.combuycheapbeatsbydreshop.combuycheapbeatsdreuk.combuydrdrebeatbox.combuyminibeatbox.combuyonlineheadphones.combuyshoponly.combuzzardflapper.combybeatsdre.combydrebeats.comcanada-beatsbydre.com casque-fr.com casquebeatsbydrdresolohd.comcasquebeatsdocteurdre.comcasquebeatsdre2013.comcasquebeatsenligne.comcasquebeatsfracheter.comcasquebeatsmer.netcasquebeatsofficiel-fr.comcasquebeatspascher2013.comcasquebeatssolo.netcasquedrdrebeatssfr.comcasquemonsterbeats.com#casquemonsterbeatsbydre2013.comcasquesbeatsaudio.comcheap-beats-by-dre.netcheap-beatsbydre.comcheapbagshoes.com cheapbeats.uscheapbeats365.comcheapbeats4sale.netcheapbeatsaustraliasale.comcheapbeatsbus.comcheapbeatsbydr.comcheapbeatsbydrdrepro.comcheapbeatsbydre-au.comcheapbeatsbydre99.comcheapbeatsbydrefau.comcheapbeatsbydremall.comcheapbeatsbydremonster.comcheapbeatsbydrenz.netcheapbeatsbydreonsale.com cheapbeatsbydreoutlet-nz.comcheapbeatsbydreoutlet.com"cheapbeatsbydreoutlets2013.comcheapbeatsbydresale.comcheapbeatsbydreshop.comcheapbeatsdrdresolo.com$ cheapbeatsbydrestudioedition.com"cheapbeatsbydrestudioutlet.comcheapbeatsdrestudios.comcheapbeatsheadphone2014.comcheapbeatsheadphones.uscheapbeatsie.comcheapbeatsla.comcheapbeatssale4u.comcheapbeatsshopbydre.comcheapcustombeatsbydre.comcheapdrdrebeats8.comcheapdrdrebeatsca.comcheapdrebeats8.netcheaperbeatsbydresale.comcheapestbeatsdrdre.comcheapheadphonesland.comcheapheadphonessale.comcheapheadsetmall.comcheapheadsetshop.com cheapmonsterbeatsbydrdre.com!cheapmonsterbeatsheadsets.com cheapmonstersbeatsonsale.comcheapmonsterbeatssale.comcheapmonsterbeatsusa.uscheapnewbeatsbydre.comcheapsalemonster.comcheapshoesvip.comcheapwireless04.comcheapwirelessbeats.comcheerwholesale.uschihair-straightener.comchinaclothesstore.comciattackers.com +cmhalq.com cnshopin.comcoolmonster.netcozydrdrebeats.com cqcorea.comcuffiesaldi.comcustombeatsbydrebuy.comcustombeatsdeals.comcustombeatsforcheap.comcustombeatsny.comcustombeatssbydreus.comcustomdrdrebeats.comcustomizedbeatbydre.comcustomizedbeatsbydre.comcustomizedbeatsdre.comcybermondaybeats4sale.comdanemarket.comdanmarkbeatsbydrdre.comdctbeatsbydre.comdealsbeatsblackfriday.comdetaliczny.comdiscountbeatsbydre-us.comdiscountbeatsstore.comdkbeatsbydre.comdrbeatsukmart.comdrdre-beats.comdrdrebeats-chen.comdrdrebeats-headphone.comdrdrebeats-usa.comdrdrebeatsale.comdrdrebeatsbillig.comdrdrebeatsdesale.comdrdrebeatsdiscount.comdrdrebeatsforu.comdrdrebeatsretail2013.comdrdrebeatssale7.comdrdrebeatsuk.comdrdreheadphonebeats.comdrdreheadphonekey.comdrdreheadphonesusstore.comdrdremonster-beats.comdrdremonsterdre.comdrdreprobeatssale.com drdrefnac.comdrebeats-australia.comdrebeats-france.comdrebeats-monster.com!drebeats-monsteraustralia.comdrebeats-monsterusa.comdrebeats-singapore.comdrebeats-singapore.netdrebeats-singaporecheap.comdrebeats-singaporecheap.netdrebeats-solo.comdrebeats-studio.comdrebeatsaustralia-cheap.comdrebeatsaustralia-cheap.netdrebeatsbuy.comdrebeatsbydreoutlet.comdrebeatscanada.comdrebeatsdeutschland.netdrebeatsforsaleus.comdrebeatsheadphones-nz.comdrebeatshome.comdrebeatsoutletstore.comdrebeatsoldes.comdrebeatspill.comdrebeatssite.com#drebeatssolocybermondaysale.comdrebeatsstudio2013.comdrebeatstudio.com drebyby.comdremonsterbeatsoutlets.comdreprobeats.com dreprofy.com +dtsell.comearphonescheapest.comebuyheadphones.comesbeatsbydrebuy.cometheadphones.comfamosascalvas.comfindmybeats.comfr-beatsbydrestore.comfrancecasquebeatssolde.comfrcasquesbeats.com free-aa.com free-sns.com frishoes.comgamebeforethegame.comgetdrebeatssale.comgmnetworks.net gobeatsye.comgobuyonlinestore.net goodsdunk.netheadphonepubs.comheadphones-cool.comheadphones-dre.com headphones-outlet-online.comheadphonesbeatsaudio.comheadphonesbeatsbydre.comheadphoneses.comheadphoneshome.comheadphoneshotsales.comheadphonesol.comheadphonesretailer.comheadphonessupply.comheadphonezip.comheadset987.comhellokittybeats.com highbolt.net highdefinitionbeatsbydre.com hipaa6020.com hipzoom.nethonawalaan.comhotbeatsonsale.comhotmonsterbeats.comhottestheadphonesonline.com  hrsaz.com ibeats-uk.comibeatsbydre.ccibeatsbydre.comigoshopping.net illianacomputerrecycling.comimonsterbeats.comincentivetravelgifts.comioffergift.com islamiccenterofnewlondon.comitaliabeatsbydrdre.com jkbeats.comkickshatchannel.comkobbeatssbydredk.comkopfhorergunstigshop.comleecountytimes.com lexuemei.comlovebeatsdr.com lovemarca.comluckyissue.com +lyzsxx.com mairbeats.com +makeeu.commallheadphone.commbeats-tech.commbheadphone.com +micstl.commmonsterheadphones.netmonbeats2013.commonster-beats-by-dr-dre.com monster-beats-headphones.commonsterbeats-cheap.commonsterbeats-headphone.commonsterbeats-onsale.commonsterbeats-solo.commonsterbeats-solo.netmonsterbeats365buy.commonsterbeats8beatsbydre.commonsterbeatsale.commonsterbeatsalestore.commonsterbeatssalg.commonsterbeatsau.commonsterbeatsbydrdre-nz.commonsterbeatsbydrdre-usa.com!monsterbeatsbydrdrecanada.com!monsterbeatsbydrdrestudio.commonsterbeatsbydre-nz.commonsterbeatsbydre-usa.commonsterbeatsbydre2015.com'#monsterbeatsbydreaustraliacheap.com!monsterbeatsbydrebilligde.com monsterbeatsbydrefactory.commonsterbeatsbydrenew.commonsterbeatsbydres.commonsterbeatsbydreshop.commonsterbeatscasques.commonsterbeatscommunity.commonsterbeatsdrdrecheap.commonsterbeatsfactory.netmonsterbeatsfinland.commonsterbeatsforsale.commonsterbeatsheadphone.commonsterbeatsheadphones.netmonsterbeatshere.commonsterbeatsitaly.commonsterbeatsmall.commonsterbeatsnegozi.netmonsterbeatsok.com!monsterbeatsonlinestoreuk.commonsterbeatsoutlet.usmonsterbeatspascher.netmonsterbeatsru.commonsterbeatssales.commonsterbeatsshops.netmonsterbeatsstore.com#monsterbeatssydneyaustralia.commonsterbeatstang.commonsterbeatstienda.commonsterbeatstudio.commonsterbydrebeat.com!monstercasquebeatspascher.netmonstercheapbeatss.commonsterdrebeats-canada.netmonsterdrebeats-usa.commonsterdrebeats-usa.netmonsterheadphone.netmonsterproduct.netmonstersbeatbydres.commonstersdebea.commonstershopcheapbeats.netmoreheadphones.com +ms4dre.commybeatsbydrestudio.commybeatsbydreuk.commybeatscheapbydre.commyferrariheadphones.comnamemybeats.com neborder.comnegozimonsterbeats.comnegoziomonsterbeats.comnewbeatsblackfriday.com newbemany.comnewdrediscount.comnewestbeatsbydre.comnewlysprung.netnewmonst1erbeatsto1re.com!newmonsterbeatsheadphones.comnewschristmasshopping.comnflhotsalejerseys.com nicesshop.netofferairjordanlebron.comofficialbeatsbydreshop.comofficialbeatsbydrestore.comofficialdrdre.comofficialheadphone.com ogameblog.comonbeatsbydresale.com onlinemonsterbeatsonsale.com onsalekey.comonsaletrend.comoutletbeatsshop.compascherbeatsmonster.compaulsimon-music.comperfectkickz.netpersoneelsland.compicknicekicks.netpickshoesclothes.com pillbeatsblackfridaysale.compocketbiketrader.compowerbeats2wireless.compowerbeatsbydrdre.compowerbeatsbydre.compromonsterbeatsbydre.comprostudiobeatscybersale.com  rbsgr.comrepsneakermall.com repswing.com!salebeatslasteststyle4you.comsaleblackfridaydrebeats.comsalecheaphandbags.com samebags.com sanvaras.com +scnshop.cc +shoers.com shoestop2.comshop-headphones.netshopbeatsdre.com shopbydre.comshopcustomizedbeats.comshopdrebeats.comshopmonsterbeats.comshopping-days.netshoppinguheadphones.comsneaker666.comsneakerpage.netsneakerskick.comsolostudioksale.com soso7778.comspecialtyheadphones.comspiritclubs.comstraightouttasomewhere.comstudiobeatsbydrdre.comsulwerphoto.comsunglassessale2014.comsuperearsenjoy.comsupplybestjerseys.comsustainthesound.comsverigebeatsbydrdre.com szcheapmonsterheadphones.comszwinnertechnology.com takegoto.comthe-monster-beats.comthebeatsbydre.comthebeatsbydre.netthebeatsheadphonesale.com +theuab.nettopbeatsbydrdreoutlet.comtopbeatsdealer.comtopbeatsforsale.com tradevip1.com tteshop.com ubnw.net +unstyle.us&"usa-beatsbydreheadphonesonsale.net  v-has.com vip-beats.comvipbeatsbydre.comvipheadphones.com vipshoes2.com  wasdj.comwholesale-exporter1.comwholesalediscountpurses.comwholesalefine.comwholesaleonlinemart.comworldcoinpay.comyourmonsterbeats.com%!beatselectronicsllc.tt.omtrdc.netapple-icloud.cn +cnappleicloud.cn +cnapplemx-icloud.comicloud-apple.cn +cnicloud-content.comicloud-isupport.com  icloud.ch +icloud.com icloud.com.cn +cn  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.jp  icloud.lv icloud.net.cn +cn  icloud.om +icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloudads.neticloudapple.cn +cn icloudbox.neticloudbrowser.net icloude.comicloudhome.comicloudmail.neticloudmusic.net icloudnet.net icloudpay.net icloudo.com +icloudo.de icloudo.net icloudos.de icloudos.neticloudsecure.neticloudsetup.comios-icloud.com +me.com myicloud.net mylcloud.net wwwicloud.com!www-cdn.icloud.com.akadns.net!12diasdepresentesdeitunes.com12diasderegalosdeitunes.cl12diasderegalosdeitunes.co!12diasderegalosdeitunes.co.cr!12diasderegalosdeitunes.co.ni!12diasderegalosdeitunes.co.ve12diasderegalosdeitunes.com"12diasderegalosdeitunes.com.co"12diasderegalosdeitunes.com.hn"12diasderegalosdeitunes.com.ni"12diasderegalosdeitunes.com.ve12diasderegalosdeitunes.cr12diasderegalosdeitunes.gt12diasderegalosdeitunes.hn12diasderegalosdeitunes.pe 12joursdecadeauxdeitunes.comapple-itunes.cn +cn itun.es itunbes.com ituneas.comitunes-apple.cn +cnitunes-radio.net  itunes.ca  itunes.co itunes.co.th +itunes.com  itunes.hk  itunes.mx +itunes.org +itunes.rio  itunes.usitunes12days.comitunesapple.cn +cnitunesessentials.comitunesfestivals.comitunesiradio.comituneslatino.comituneslogin.netitunesmatch.comitunesparty.comitunesradio.cn +cnitunesradio.comitunesradio.com.cn +cnitunesradio.rioitunesradio.tvitunesradio.twitunesstore.co itunesu.com itunesu.net iutunes.com wwwitunes.comitunes-apple.com.akadns.netappleswift.com  swift.org +swiftui.cn +cnswiftui.com.cn +cn apple apple.ae apple.at apple.be apple.bg apple.bs apple.ca apple.ch apple.cl apple.cmapple.cn +cn apple.co apple.co.cr apple.co.hu apple.co.jp apple.co.kr apple.co.mz apple.co.nz apple.co.th apple.co.uk  apple.com apple.com.af apple.com.au apple.com.bo apple.com.br apple.com.cn +cn apple.com.co apple.com.de apple.com.do apple.com.gr apple.com.gy apple.com.jm apple.com.lk apple.com.mg apple.com.mx apple.com.my apple.com.pa apple.com.pe apple.com.pl apple.com.pr apple.com.pt apple.com.py apple.com.sg apple.com.sv apple.com.tr apple.com.tw apple.com.uy apple.cz apple.de apple.dk apple.ee apple.es apple.eu apple.fi apple.fr apple.hamburg apple.hn apple.hr apple.hu apple.ie apple.in apple.is apple.it apple.jo apple.jp apple.kr apple.lk apple.lt apple.lv apple.me apple.my  apple.net apple.net.gr apple.nl apple.no apple.pk apple.pl apple.pt apple.ro apple.rs apple.ru apple.sa apple.se apple.sg apple.si apple.sk apple.so apple.tt apple.tw apple.uk apple.usapple.xn--czr694bapple.xn--fiqs8s  apple.xyz aplestore.comapple-store.cn +cnapple-store.netapple-store.wang applestor.com applestore.bg applestore.cc applestore.ch applestore.cm applestore.cn +cnapplestore.co.huapplestore.co.jpapplestore.co.ugapplestore.co.ukapplestore.comapplestore.com.auapplestore.com.bnapplestore.com.cn +cnapplestore.com.eeapplestore.com.egapplestore.com.grapplestore.com.hkapplestore.com.hrapplestore.com.joapplestore.com.myapplestore.com.phapplestore.com.plapplestore.com.ptapplestore.com.roapplestore.com.ruapplestore.com.snapplestore.com.tw applestore.de applestore.hk applestore.kr applestore.meapplestore.netapplestore.net.gr applestore.ph applestore.qa applestore.sgapplestore.wangapplestoreonline.comapplestorepro.euonlineapplestore.comapp-store.wangappe-store.comapple-appstore.cn +cnappleappstore.cn +cnappleappstore.netappleappstore.tv  appsto.reappstore.co.id appstore.hk appstore.my appstore.phappstoreapple.cn +cn asto.retvappstore.netapple-imac.com appleimac.comimac-apple.comimac-applecomputer.com imac.co +imac.co.nz imac.com imac.eu imac.gr imac.one imac.rs imacapple.comimacapplecomputer.comebookforipad.com euroipad.comfindmyipad.com indiaipad.com +ipad.co.kr ipad.de  ipad.host  ipad.wang  ipad3.com +ipadair.cl +ipadair.cmipadair.com.bripadair.com.es +ipadair.fr +ipadair.hk +ipadair.ie +ipadair.jp +ipadair.twipadaustralia.com ipadmini.cmipadmini.com.lk ipadmini.lk ipadpro.buzz +ukipad.comappleiphone.huappleiphone.netappleiphonecell.combestiphonestuff.comcooliphonecasesstore.comcustom-iphonecase.comdesigneriphonescases.com dl-iphone.comfundaiphone5s.com hebiphone.com hf-iphone.com +iphine.comiphone-8.com.cn +cn iphone-cd.com iphone-cn.com iphone-sh.comiphone-vip1.comiphone-vip2.comiphone-vip3.comiphone-vip4.comiphone-vip5.com iphone-x.tv iphone-yh.com iphone-zh.com  iphone.cm +iphone.com iphone.com.au iphone.com.gr  iphone.es iphone.host iphone.net.gr  iphone.pt  iphone.rs  iphone.ru iphone.wang iphone4.comiphone4.com.br iphone4s.com iphone5.comiphone5casescovers.comiphone5s5case.comiphoneacessorios.com.briphonecase2013.comiphonecase5.comiphonecases100.comiphonecases5.comiphoneclaro.com.briphonecollcase.com iphonefc.comiphonegermany.comiphonehangzhou.comiphoneimessage.comiphoneplus.wang iphonerip.net iphonese.tviphoneunlockimei.com iphonexs.tvonlyiphone5case.comaplleipods.comappleclassicipod.comdownloadsforipod.com ipod.ca ipod.ch ipod.cm ipod.co +ipod.co.nz +ipod.co.uk +ipod.co.za ipod.com ipod.com.au ipod.com.cn +cn ipod.com.fr ipod.com.hk ipod.com.sg ipod.com.tw ipod.de ipod.es ipod.eu ipod.fr ipod.gr ipod.hk ipod.is ipod.net ipod.no ipod.pk ipod.rs ipod.ru ipod.tw ipodcentre.nlipodcleaner.comipoditouch.com ipodnano.com ipodnano.netipodprices.com +ipodrip.caipodrocks.com.au  ipods.comipodshop.com.au ipodtouch.co ipodtouch.com +myipod.netoffrezdesipods.comsimplyipod.comwwwipodlounge.comimacsources.comlaunchpad.wang mac.wang +macbook.co +macbook.hk +macbook.tw macbook.wang macbookair.cn +cnmacbookair.co.krmacbookair.co.ukmacbookair.commacbookair.com.aumacbookair.com.cn +cnmacbookair.com.es macbookair.es macbookair.hk macbookair.kr macbookair.jpmacbookair.net macbookpro.comacbookpro.commacbookpro.com.aumacbookpro.net macbookpro.usmacbookpros.commacbooksale.comwwwmacbookair.comapple-watch.com.ru applewatch.hk applewatch.tv applewatch.twapplewatch.wangapplewatchedition.comapplewatchseries3.netapplewatchsport.comapplemusic.berlinapplemusic.comapplemusic.com.auapplemusic.hamburgapplemusic.wangapplemusicconnect.comapplemusicfestival.com musickit.netwwwapplemusic.comapple.comscoreresearch.com +apple.newsappleenews.comapplenews.berlinapplenews.hamburg applenews.tvapplenewsformat.com apple-pay.com apple-pay.rsapple-pay.wangapplepay.berlinapplepay.co.rsapplepay.com.twapplepay.hamburg applepay.hk applepay.info applepay.jp applepay.rs applepay.tvapplepaycash.cn +cnapplepaycash.com.cn +cnapplepaycash.netapplepaycash.tv!applepaymerchantsupplies.infoapplepaysupplies.berlinapplepaysupplies.cn +cnapplepaysupplies.com#applepaysupplies.com.cn +cnapplepaysupplies.infoapplepaysupplies.netapplepaysupplies.tvapplewallet.comapplewallet.tv +i-book.com +i-book.net ibook.co.nz  ibook.com ibook.eu  ibook.netibookpartner.comibooksauthor.com  iphoto.eu  iphoto.no  iphoto.se iphoto.wang  imovie.euimoviegallery.comimoviestage.comapplecare.berlin applecare.cc applecare.euapplecare.hamburgapplecare.wangappledarwin.comappledarwin.netdarwinsource.comdarwinsource.orgdarwinsourcecode.comappleaccount.netappleid-applemx.comappleid-applemx.usappleid-iclou.com appleid-uk.usappleid.berlin appleid.comappleid.hamburg +appleid.hk ids-apple.com myappleid.com appletv.com +appletv.fr appletv.wang appletv4.cn +cnappletv4.com.cn +cnappletvapp.appleappleone.audio appleone.blog appleone.chatappleone.cloud appleone.clubappleone.community appleone.filmappleone.guide appleone.hostappleone.space appleone.techappleone.website +shazam.com1to1computing.com.au1to1conference.com.au 5lml.com +a0pple.net aapl.twairport.brussels airport.com +airport.euairsupportapp.com airtunes.com airtunes.info airtunes.netalchemysynth.com  ap0le.com aple.com  apole.com +app0le.com +appl-e.com appl.com +appl4e.com  appla.comapple-darwin.comapple-darwin.netapple-darwin.org apple-dns.cn +cn apple-dns.comapple-dns.com.cn +cn apple-dns.netapple-enews.comapple-expo.com apple-expo.eu apple-hk.comapple-ibooks.cn +cn apple-inc.netapple-livephotoskit.com apple-maps.cn +cnapple-online.com apple-usa.netappleafrica.comappleantilles.comappleaustralia.comappleaustralia.com.auappleaustralia.net.au applebk.netapplecarbon.com applecard.tvapplecentar.co.rsapplecentar.rsapplecenter.cn +cnapplecenter.com.cn +cnapplecentre.com.auapplecentre.infoappleclub.com.hk applecom.comapplecomputer-imac.comapplecomputer.cn +cnapplecomputer.co.inapplecomputer.co.nzapplecomputer.com applecomputer.com.cn +cnapplecomputer.com.hkapplecomputer.com.twapplecomputer.huapplecomputer.krapplecomputerimac.comapplecomputerinc.infoapplecomputers.co.nzapplecoronavirus.com appledns.cn +cnappledns.com.cn +cn appleexpo.euappleexpo.infoapplefilmaker.comapplefilmmaker.comapplefinalcutproworld.comapplefinalcutproworld.netapplefinalcutproworld.orgapplehongkong.comapplehongkong.com.hkappleinclegal.comappleipodsettlement.comappleiservices.com applelink.comapplemagickeyboard.comapplemalaysia.com.myapplemasters.infoappleonline.comappleonline.net appleoriginalproductions.com +appleos.tvapplepencil.netapplepodcasts.comapplepremiumreseller.com.au applepremiumresellers.com.auapplereach.comapplereach.net apples-msk.ruapplescreensavers.comapplescript.infoappleshare.infoappleshop.co.uk applesiri.cn +cnapplesurveys.comappletaiwan.com appletips.net appleweb.net applexpo.net applezh.com  applf.com +applfe.com +applle.com  applw.comappmediagroup.com +appule.com  appye.com  apyle.com  beddit.tvbraeburncapital.com burstly.netburstlyrewards.com buyaapl.com buyaapl.net buyaple.com camelphat.comcamelspaceeffect.com +carbon.com catalina.hk cdn-apple.com  chomp.com +coreml.netdashwood360.comdesktopmovie.comdesktopmovie.netdesktopmovie.orgdesktopmovies.netdesktopmovies.orgdeveloper-advisor.comdevice-manager.usdigitalhub.comdiscussionsapple.com +dot-mac.de  dotmac.dedvdstudiopro.bizdvdstudiopro.comdvdstudiopro.infodvdstudiopro.netdvdstudiopro.orgdvdstudiopro.us +earpod.net ecgapp.com.cn +cn +ecgapp.netedu-research.org +emac.co.in emac.in  emagic.de +eworld.com faceid99.com faceid99.netfaceidglobal.com faceshift.cn +cn facetime.netfinalcutpro.comfind-apple.com firewire.cl firewire.eu geoport.com +homepod.cn +cn +hopstop.tv ichat.co.in idvd.eu  ikids.comilecture.co.nz ilife.eu ilife.gr +ilife.wang imessage.tv insidear.cn +cninsidemacintosh.comiosinthecar.comipa-iphone.net  ipple.com ischool.com itools.info  iwork.com iwork.se +iwork.wangjetfuelapp.comjetfuelapps.comlatticedata.com livephotos.cn +cnlivephotos.com.cn +cn livephotos.tvlojaiphone.com.br mac-mini.com mac.com +mac.com.au +mac.eu +mac.rs macappsto.re macboxset.com mach-os.com mach-os.net +machos.net macintosh.eumacintoshsoftware.com macmini.com macos.com.aumacossierra.com macosx.infomacosxlion.com macpazar.com macreach.com macreach.net mobileme.dkmr-apple.com.tw mzstatic.com +newton.com next.com overapple.com powerbook.eupullstring.netquatrowireless.com quicktime.cc quicktime.comquicktime.com.au quicktime.eu quicktime.net quicktime.tvreform-apple.comservices-apple.net siri.com spektral.cc texture.comthinkdifferent.us +touchid.tv touchid.wangtracking-location.comtruedepth3d.com tryrating.comwebobjects.co.uk webobjects.de webobjects.euwebobjects.net wuxiapple.com wwapple.netwww-sms-apple.com wwwapple.com wwwapple.net wwwlapple.comxn--czrs0t4phtr3a.cnxn--fiqs8sxootzz.cn xn--fiqs8sxootzz.xn--hxt814e!xn--gtvq61aiijy0b.xn--hxt814exn--gtvz22d.wangxn--gtvz22d.xn--hxt814exn--hxtr4rozx.xn--czr694b xn--kput3imi374g.xn--hxt814e#xn--ohq11k7pl25iyo8a.cn +cn xn--ruq8a011kt6y.xn--hxt814e, adcdownload.apple.com.akadns.net +cn!adcdownload.apple.com +cn."amp-api-search-edge.apps.apple.com +cn"amp-api.apps.apple.com +cn aod.itunes.apple.com +cn#api-edge.apps.apple.com +cnappldnld.apple.com +cn"appldnld.g.aaplimg.com +cnapps.apple.com +cnapps.mzstatic.com +cn(apptrailers.itunes.apple.com +cn bag.itunes.apple.com +cn'bookkeeper.itunes.apple.com +cnbooks.apple.com +cn!cds-cdn.v.aaplimg.com +cn$cds.apple.com.akadns.net +cn cds.apple.com +cncl2-cn.apple.com +cn<0cl2.apple.com.edgekey.net.globalredir.akadns.net +cncl4-cn.apple.com +cn'client-api.itunes.apple.com +cn+clientflow.apple.com.akadns.net +cn clientflow.apple.com +cn cma.itunes.apple.com +cn."configuration.apple.com.akadns.net +cn#configuration.apple.com +cn!communities.apple.com +cncstat.apple.com +cn."dd-cdn.origin-apple.com.akadns.net +cn(discussionschinese.apple.com +cn(download.developer.apple.com +cnfides-pol.apple.com +cngs-loc-cn.apple.com +cngs-loc.apple.com +cn%gsp10-ssl-cn.ls.apple.com +cn!gsp11-cn.ls.apple.com +cn!gsp12-cn.ls.apple.com +cn!gsp13-cn.ls.apple.com +cnC7gsp4-cn.ls.apple.com.edgekey.net.globalredir.akadns.net +cn, gsp4-cn.ls.apple.com.edgekey.net +cn gsp4-cn.ls.apple.com +cn gsp5-cn.ls.apple.com +cn(gspe11-2-cn-ssl.ls.apple.com +cn&gspe12-cn-ssl.ls.apple.com +cn&gspe19-cn-ssl.ls.apple.com +cn-!gspe19-cn.ls-apple.com.akadns.net +cn"gspe19-cn.ls.apple.com +cn#gspe21-ssl.ls.apple.com +cngspe21.ls.apple.com +cn#gspe35-ssl.ls.apple.com +cn&gspe85-cn-ssl.ls.apple.com +cniadsdk.apple.com +cn, icloud-cdn.icloud.com.akadns.net +cn icloud.cdn-apple.com +cn'images.apple.com.akadns.net +cn?3images.apple.com.edgekey.net.globalredir.akadns.net +cnimages.apple.com +cn3'init-p01md-lb.push-apple.com.akadns.net +cn init-p01md.apple.com +cn3'init-p01st-lb.push-apple.com.akadns.net +cn%init-p01st.push.apple.com +cn3'init-s01st-lb.push-apple.com.akadns.net +cn%init-s01st.push.apple.com +cn!init.itunes.apple.com +cn$iosapps.itunes.apple.com +cn(iosapps.itunes.g.aaplimg.com +cniphone-ld.apple.com +cn'itunes-apple.com.akadns.net +cnitunes.apple.com +cn#itunesconnect.apple.com +cn"js-cdn.music.apple.com +cn km.support.apple.com +cnmaps.apple.com +cn)mesu-cdn.apple.com.akadns.net +cn+mesu-china.apple.com.akadns.net +cnmesu.apple.com +cnmusic.apple.com +cn(ocsp-lb.apple.com.akadns.net +cnocsp.apple.com +cnoscdn.apple.com +cn-!oscdn.origin-apple.com.akadns.net +cn$osxapps.itunes.apple.com +cnpancake.apple.com +cn, pancake.cdn-apple.com.akadns.net +cnpd.itunes.apple.com +cnphobos.apple.com +cn!play.itunes.apple.com +cn1%prod-support.apple-support.akadns.net +cn$se-edge.itunes.apple.com +cn se2.itunes.apple.com +cn#search.itunes.apple.com +cn1%sf-api-token-service.itunes.apple.com +cnsp.itunes.apple.com +cn4(stocks-sparkline-lb.apple.com.akadns.net +cn&stocks-sparkline.apple.com +cn>2store.apple.com.edgekey.net.globalredir.akadns.net +cn'store.apple.com.edgekey.net +cnstore.apple.com +cn2&store.storeimages.apple.com.akadns.net +cn+store.storeimages.cdn-apple.com +cn+streamingaudio.itunes.apple.com +cnsu.itunes.apple.com +cn2&support-china.apple-support.akadns.net +cnsupport.apple.com +cn."swcatalog-cdn.apple.com.akadns.net +cnswcatalog.apple.com +cnswcdn.apple.com +cnswcdn.g.aaplimg.com +cn'swdist.apple.com.akadns.net +cnswdist.apple.com +cn+swscan-cdn.apple.com.akadns.net +cnswscan.apple.com +cn!sync.itunes.apple.com +cn1%updates-http.cdn-apple.com.akadns.net +cn&updates-http.cdn-apple.com +cn upp.itunes.apple.com +cnvalid.apple.com +cn-!valid.origin-apple.com.akadns.net +cn"weather-data.apple.com +cn<0www.apple.com.edgekey.net.globalredir.akadns.net +cn%www.apple.com.edgekey.net +cn www.apple.com +cn#^a[1-5]\.mzstatic\.com$ +cn0$^cdn(-cn)?[1-4]?\.apple-mapkit\.com$ +cn9-^cl[1-5]-cdn\.origin-apple\.com\.akadns\.net$ +cn!^cl[1-5]\.apple\.com$ +cn+^is[1-5](-ssl)?\.mzstatic\.com$ +cn$^s[1-5]?\.mzstatic\.com$ +cnapple.com.akadns.net%!courier-push-apple.com.akadns.netpush-apple.com.akadns.net + +BINANCEbinance.charity binance.cloud binance.combinance.vision binancezh.com bnbstatic.com yshyqxx.com + +BITQUICK bitquick.co + +FEEDLY +feedly.com + +GOOGLE android.comandroidify.com blogspot.ae blogspot.al blogspot.am blogspot.ba blogspot.be blogspot.bg blogspot.bj blogspot.ca blogspot.cf blogspot.ch blogspot.clblogspot.co.atblogspot.co.idblogspot.co.ilblogspot.co.keblogspot.co.nzblogspot.co.ukblogspot.co.za blogspot.comblogspot.com.arblogspot.com.aublogspot.com.brblogspot.com.byblogspot.com.coblogspot.com.cyblogspot.com.eeblogspot.com.egblogspot.com.esblogspot.com.mtblogspot.com.ngblogspot.com.trblogspot.com.uy blogspot.cv blogspot.cz blogspot.de blogspot.dk blogspot.fi blogspot.fr blogspot.gr blogspot.hk blogspot.hr blogspot.hu blogspot.ie blogspot.in blogspot.is blogspot.it blogspot.jp blogspot.kr blogspot.li blogspot.lt blogspot.lu blogspot.md blogspot.mk blogspot.mx blogspot.my blogspot.nl blogspot.no blogspot.pe blogspot.pt blogspot.qa blogspot.re blogspot.ro blogspot.rs blogspot.ru blogspot.se blogspot.sg blogspot.si blogspot.sk blogspot.sn blogspot.td blogspot.tw blogspot.ug blogspot.vn dart.dev dartlang.org dartpad.dev fastlane.cifastlane.tools flutter.devflutterapp.com go-lang.com go-lang.net go-lang.org +go.dev  godoc.org +golang.com +golang.net +golang.org2mdn.net +ads admob.com +ads adsense.com +ads'adsensecustomsearchads.com +ads%adsenseformobileapps.com +ads$advertisercommunity.com +ads%advertiserscommunity.com +ads"adwords-community.com +ads adwords.com +adsadwordsexpress.com +ads app-measurement.com +ads&clickserver.googleads.com +adsdoubleclick.com +adsdoubleclick.net +ads!google-analytics.com +adsgoogleadapis.com +ads!googleadservices.com +ads googleanalytics.com +adsgoogleoptimize.com +ads"googlesyndication.com +ads!googletagmanager.com +ads"googletagservices.com +ads'googletraveladservices.com +ads +urchin.com +ads>1^adservice\.google\.([a-z]{2}|com?)(\.[a-z]{2})?$ +adscharlestonroadregistry.comregistry.google get.app get.dev get.how get.page iam.soyxn--p8j9a0d9c9a.xn--q9jyb4cscholar.google.aescholar.google.atscholar.google.bescholar.google.bgscholar.google.cascholar.google.catscholar.google.chscholar.google.clscholar.google.cnscholar.google.co.crscholar.google.co.idscholar.google.co.ilscholar.google.co.inscholar.google.co.jpscholar.google.co.krscholar.google.co.nzscholar.google.co.thscholar.google.co.ukscholar.google.co.vescholar.google.co.zascholar.google.comscholar.google.com.arscholar.google.com.auscholar.google.com.boscholar.google.com.brscholar.google.com.coscholar.google.com.cuscholar.google.com.doscholar.google.com.ecscholar.google.com.egscholar.google.com.gtscholar.google.com.hkscholar.google.com.lyscholar.google.com.mxscholar.google.com.myscholar.google.com.nischolar.google.com.pascholar.google.com.pescholar.google.com.phscholar.google.com.pkscholar.google.com.prscholar.google.com.pyscholar.google.com.sgscholar.google.com.svscholar.google.com.trscholar.google.com.twscholar.google.com.uascholar.google.com.uyscholar.google.com.vnscholar.google.czscholar.google.descholar.google.dkscholar.google.esscholar.google.fischolar.google.frscholar.google.grscholar.google.hnscholar.google.hrscholar.google.huscholar.google.isscholar.google.itscholar.google.lischolar.google.ltscholar.google.luscholar.google.lvscholar.google.nlscholar.google.noscholar.google.plscholar.google.ptscholar.google.roscholar.google.ruscholar.google.sescholar.google.sischolar.google.skpolymer-project.orgpolymerproject.org +v8.dev v8project.org youtubeggpht.cn +cn  ggpht.comgooglevideo.comwithyoutube.com youtu.beyoutube-nocookie.com +youtube.ae +youtube.al +youtube.am +youtube.at +youtube.az +youtube.ba +youtube.be +youtube.bg +youtube.bh +youtube.bo +youtube.by +youtube.ca youtube.cat +youtube.ch +youtube.cl +youtube.co youtube.co.ae youtube.co.at youtube.co.cr youtube.co.hu youtube.co.id youtube.co.il youtube.co.in youtube.co.jp youtube.co.ke youtube.co.kr youtube.co.ma youtube.co.nz youtube.co.th youtube.co.tz youtube.co.ug youtube.co.uk youtube.co.ve youtube.co.za youtube.co.zw youtube.comyoutube.com.aryoutube.com.auyoutube.com.azyoutube.com.bdyoutube.com.bhyoutube.com.boyoutube.com.bryoutube.com.byyoutube.com.coyoutube.com.doyoutube.com.ecyoutube.com.eeyoutube.com.egyoutube.com.esyoutube.com.ghyoutube.com.gryoutube.com.gtyoutube.com.hkyoutube.com.hnyoutube.com.hryoutube.com.jmyoutube.com.joyoutube.com.kwyoutube.com.lbyoutube.com.lvyoutube.com.lyyoutube.com.mkyoutube.com.mtyoutube.com.mxyoutube.com.myyoutube.com.ngyoutube.com.niyoutube.com.omyoutube.com.payoutube.com.peyoutube.com.phyoutube.com.pkyoutube.com.ptyoutube.com.pyyoutube.com.qayoutube.com.royoutube.com.sayoutube.com.sgyoutube.com.svyoutube.com.tnyoutube.com.tryoutube.com.twyoutube.com.uayoutube.com.uyyoutube.com.ve +youtube.cr +youtube.cz +youtube.de +youtube.dk +youtube.ee +youtube.es +youtube.fi +youtube.fr +youtube.ge +youtube.gr +youtube.gt +youtube.hk +youtube.hr +youtube.hu +youtube.ie +youtube.in +youtube.iq +youtube.is +youtube.it +youtube.jo +youtube.jp +youtube.kr +youtube.kz +youtube.la +youtube.lk +youtube.lt +youtube.lu +youtube.lv +youtube.ly +youtube.ma +youtube.md +youtube.me +youtube.mk +youtube.mn +youtube.mx +youtube.my +youtube.ng +youtube.ni +youtube.nl +youtube.no +youtube.pa +youtube.pe +youtube.ph +youtube.pk +youtube.pl +youtube.pr +youtube.pt +youtube.qa +youtube.ro +youtube.rs +youtube.ru +youtube.sa +youtube.se +youtube.sg +youtube.si +youtube.sk +youtube.sn youtube.soy +youtube.sv +youtube.tn +youtube.tv +youtube.ua +youtube.ug +youtube.uy +youtube.vnyoutubeeducation.comyoutubefanfest.comyoutubegaming.comyoutubego.co.idyoutubego.co.in youtubego.comyoutubego.com.br youtubego.id youtubego.inyoutubei.googleapis.comyoutubekids.comyoutubemobilesupport.com yt.be  ytimg.comand +chromedclkgbizgle gmailgoogoog +googleguge hangout nexus xn--qcka1pmc  google.ad  google.ae  google.al  google.am  google.as  google.at  google.az  google.ba  google.be  google.bf  google.bg  google.bi  google.bj  google.bs  google.bt  google.by  google.ca +google.cat  google.cd  google.cf  google.cg  google.ch  google.ci  google.cl  google.cm google.cn +cn google.co.ao google.co.bw google.co.ck google.co.cr google.co.id google.co.il google.co.in google.co.jp google.co.ke google.co.kr google.co.ls google.co.ma google.co.mz google.co.nz google.co.th google.co.tz google.co.ug google.co.uk google.co.uz google.co.ve google.co.vi google.co.za google.co.zm google.co.zw +google.com google.com.af google.com.ag google.com.ai google.com.ar google.com.au google.com.bd google.com.bh google.com.bn google.com.bo google.com.br google.com.bz google.com.co google.com.cu google.com.cy google.com.do google.com.ec google.com.eg google.com.et google.com.fj google.com.gh google.com.gi google.com.gt google.com.hk google.com.jm google.com.kh google.com.kw google.com.lb google.com.ly google.com.mm google.com.mt google.com.mx google.com.my google.com.na google.com.ng google.com.ni google.com.np google.com.om google.com.pa google.com.pe google.com.pg google.com.ph google.com.pk google.com.pr google.com.py google.com.qa google.com.sa google.com.sb google.com.sg google.com.sl google.com.sv google.com.tj google.com.tr google.com.tw google.com.ua google.com.uy google.com.vc google.com.vn  google.cv  google.cz  google.de  google.dj  google.dk  google.dm  google.dz  google.ee  google.es  google.fi  google.fm  google.fr  google.ga  google.ge  google.gg  google.gl  google.gm  google.gr  google.gy  google.hn  google.hr  google.ht  google.hu  google.ie  google.im  google.iq  google.is  google.it  google.je  google.jo  google.kg  google.ki  google.kz  google.la  google.li  google.lk  google.lt  google.lu  google.lv  google.md  google.me  google.mg  google.mk  google.ml  google.mn  google.ms  google.mu  google.mv  google.mw  google.ne  google.nl  google.no  google.nr  google.nu  google.pl  google.pn  google.ps  google.pt  google.ro  google.rs  google.ru  google.rw  google.sc  google.se  google.sh  google.si  google.sk  google.sm  google.sn  google.so  google.sr  google.st  google.td  google.tg  google.tl  google.tm  google.tn  google.to  google.tt  google.vg  google.vu  google.ws 0emm.com  1e100.net  1ucrs.com +466453.com abc.xyz adgoogle.net +admeld.comangulardart.org +api.ai +apigee.com appbridge.ca appbridge.io appbridge.it appspot.com +apture.com area120.com +asp-cc.com autodraw.com bandpage.combaselinestudy.combaselinestudy.org bazel.build bdn.devbeatthatquote.com  blink.org blogblog.com blogger.combrocaproject.com +brotli.org bumpshare.com +bumptop.ca bumptop.com bumptop.net bumptop.org bumptunes.comcampuslondon.com certificate-transparency.org +chrome.comchromebook.comchromecast.com chromeos.dev chromium.orgchronicle.securitychroniclesec.comcloudburstresearch.comcloudfunctions.netcloudrobotics.comcobrasearch.com codespot.com conscrypt.com conscrypt.orgcookiechoices.org  coova.com  coova.net  coova.orgcrossmediapanel.com crr.com  cs4hs.comdartsearch.netdataliberation.org  debug.comdebugproject.com deepmind.comdevsitetest.howdialogflow.comdigitalassetlinks.org episodic.comfeedburner.com +fflick.comfinanceleadsonline.comfirebaseapp.comfirebaseio.com +foofle.com froogle.com fuchsia.dev  g-tun.comg.cn +cng.co g.dev +g.page gateway.devgerritcodereview.comgetbumptop.com ggoogle.com gipscorp.com gkecnapps.cn +cn globaledu.org  gmail.com gmodules.com  gogle.com +gogole.comgonglchuangl.net +goo.gl +googel.com +googil.com  googl.comgoogle-syndication.com google.berlin +google.dev +google.net +google.orggoogle.ventures"googleacquisitionmigration.com googleapis.cn +cngoogleapis.comgoogleapps.comgooglearth.comgoogleblog.com googlebot.comgooglecapital.comgooglecert.netgooglecnapps.cn +cngooglecode.comgooglecommerce.comgooglecompare.co.ukgoogledanmark.comgoogledomains.comgoogledrive.com googlee.comgoogleearth.comgooglefiber.netgooglefinland.comgooglemail.comgooglemaps.comgooglepagecreator.comgooglephotos.comgoogleplay.comgoogleplus.comgooglesource.comgooglestore.comgooglesverige.comgoogleusercontent.comgoogleventures.com +googlr.com +goolge.com gooogle.com gridaware.app gsrc.io +gstatic.cn +cn gstatic.comgstaticcnapps.cn +cn +gsuite.com +gv.com gvt0.com gvt1.com gvt2.com gvt3.com gvt5.com gvt6.com gvt7.com gvt9.comhdrplusdata.org hindiweb.comhowtogetmo.co.ukhtml5rocks.com hwgo.comiamremarkable.org igoogle.com impermium.com +j2objc.orgjibemobile.com keyhole.comkeytransparency.comkeytransparency.fookeytransparency.org lanternal.com like.commadewithcode.com material.io mdialog.com meet.newmfg-inspector.commobileview.pagemoodstocks.com near.by nest.com nomulus.foo +oauthz.com on.here on2.comonefifteen.netonefifteen.orgoneworldmanystories.com openthread.io openweave.io orbitera.com  page.linkpagespeedmobilizer.com pageview.mobi panoramio.compartylikeits1986.orgpaxlicense.org +picasa.com picasaweb.com picasaweb.net picasaweb.org +picnik.com pittpatt.com +pixate.com postini.comprojectara.comprojectbaseline.compublishproxy.comquestvisual.comquickoffice.com quiksee.com +revolv.comridepenguin.com run.appsavethedate.foo +saynow.com schemer.comscreenwisetrends.comscreenwisetrendspanel.com snapseed.com solveforx.com +stadia.devstcroixmosquito.comstcroixmosquitoproject.comstudywatchbyverily.comstudywatchbyverily.orgstxmosquito.comstxmosquitoproject.comstxmosquitoproject.netstxmosquitoproject.org synergyse.comtensorflow.org  tfhub.devthecleversense.comthegooglestore.comthinkquarterly.co.ukthinkquarterly.comthinkwithgoogle.com tiltbrush.com txcloud.net  txvia.comunfiltered.news useplannr.comusvimosquito.comusvimosquitoproject.comvelostrata.com +verily.comverilylifesciences.comverilystudyhub.comverilystudywatch.comverilystudywatch.org +wallet.com  waymo.com waze.com web.app web.devwebappfieldguide.comwebmproject.orgwebpkgcache.com +webrtc.orgweltweitwachsen.dewhatbrowser.org widevine.comwithgoogle.com womenwill.comwomenwill.com.br womenwill.id womenwill.in womenwill.mx  x.company +x.team xn--9kr7l.comxn--9trs65b.comxn--flw351e.comxn--ggle-55da.comxn--gogl-0nd52e.comxn--gogl-1nd42e.com xplr.cozukunftswerkstatt.de265.com +cn2mdn.net +cn adservice.google.com +cnapp-measurement.com +cn beacons.gcp.gvt2.com +cnbeacons.gvt2.com +cnbeacons3.gvt2.com +cn c.admob.com +cn(c.android.clients.google.com +cn!cache.pack.google.com +cncheckin.gstatic.com +cn%clickserve.dartsearch.net +cn)clientservices.googleapis.com +cn)connectivitycheck.gstatic.com +cncorp.google.com +cn crl.pki.goog +cn"csi-china.l.google.com +cncsi.gstatic.com +cn dl.google.com +cndl.l.google.com +cndoubleclick.net +cn-!firebase-settings.crashlytics.com +cn fonts.googleapis.com +cnfonts.gstatic.com +cn google-analytics.com +cn googleadservices.com +cngoogleanalytics.com +cn!googlesyndication.com +cn googletagmanager.com +cn!googletagservices.com +cngtm.oasisfeng.com +cn!imasdk.googleapis.com +cn kh.google.com +cn ocsp.pki.goog +cn, pagead-googlehosted.l.google.com +cn!pki-goog.l.google.com +cn recaptcha.net +cnredirector.gvt1.com +cn)safebrowsing-cache.google.com +cn'safebrowsing.googleapis.com +cn$settings.crashlytics.com +cn-!ssl-google-analytics.l.google.com +cnssl.gstatic.com +cn%toolbarqueries.google.com +cntools.google.com +cntools.l.google.com +cn$translate.googleapis.com +cn!update.googleapis.com +cn-!www-googletagmanager.l.google.com +cnwww.gstatic.com +cnwww.recaptcha.net +cn0$^khm([0-3]|db)?\.google(apis)?\.com$ +cn + +NAVER +lin.ee line.me line.naver.jp line-apps.com line-cdn.net line-scdn.net +nhncorp.jp grafolio.com  naver.com naver.jp  naver.net navercorp.com  plug.game pstatic.net +( +OPENCOLLECTIVEopencollective.com  -1PONDO  1pondo.tv -' -APA apa.orgpsyccareers.com -* -BOXUN  boxun.combowenpress.com - -OPENSUSE opensuse.org - -BILIBILI -acg.tv acgvideo.com -b23.tv biliapi.com biliapi.net bilibili.combilibiligame.net biligame.com biligame.net bilivideo.com  hdslb.com im9.com -mincdn.com$ upos-hz-mirrorakam.akamaized.net -0 - COWTRANSFER c-t.workcowtransfer.com - -LUA lua.org -B -DISQUS -disqus.com disquscdn.comdisqusservice.com -$ - HUANGHUAGANGhuanghuagang.org +SVP svp-team.com  -QMAP qmap.pub - -ARCHIVE archive.org -i -ARCHIVEOFOUROWN ao3.orgarchiveofourown.orgarchiveofourown.comarchiveofourown.net - -DENO  deno.land -. -JIEMIAN jiemian.comjiemian.com.cn +XDTY xdty.org +1 +ABEMA abema.io abema.tv ameba.jp < -NGA -nga.cn 178.com -ngabbs.com ngacn.cc -Z -PICSEE pics.ee  picsee.co -picsee.pro pise.pw pros.ee -pse.is - -SINA-ADS 2016.sina.cn -@adsad.sina.com.cn -@adsadbox.sina.com.cn -@ads"adimages.sina.com.hk -@ads"adimg.mobile.sina.cn -@ads!adimg.uve.weibo.com -@ads"adm.leju.sina.com.cn -@ads ads.sina.com -@adsalitui.weibo.com -@adsapi.apps.sina.cn -@ads!appgift.sinaapp.com -@ads$appsupdate.sinaapp.com -@ads atm.sina.com -@ads beacon.sina.com.cn -@ads biz.weibo.com -@adsc.biz.weibo.com -@ads"c.wcpt.biz.weibo.com -@ads&click.uve.mobile.sina.cn -@ads!click.uve.weibo.com -@adscm.dmp.sina.cn -@ads1#contentrecommend-out.mobile.sina.cn -@ads%count.video.sina.com.cn -@ads!counter.sina.com.cn -@adscre.dp.sina.cn -@adscre-dp.sina.cn -@adsd00.sina.com.cn -@adsdcads.sina.com.cn -@adsdl.kjava.sina.cn -@ads dmp.sina.cn -@adsdp.im.weibo.cn -@ads game.weibo.cn -@adsgame.weibo.com -@ads#gw5.push.mcp.weibo.cn -@ads#gw6.push.mcp.weibo.cn -@ads#img.adbox.sina.com.cn -@ads$img.amp.ad.sina.com.cn -@ads#int.dpool.sina.com.cn -@ads&interest.mix.sina.com.cn -@ads*log.interest.mix.sina.com.cn -@ads!log.mix.sina.com.cn -@ads log.sina.cn -@ads"m.beacon.sina.com.cn -@adsm.game.weibo.cn -@ads"mg.games.sina.com.cn -@ads"motu.p4p.sina.com.cn -@ads newspush.sinajs.cn -@ads!oascentral.sina.com -@ads$oascentral.sina.com.hk -@adsp4p.sina.com.cn -@adspalmnews.sina.cn -@ads pay.mobile.sina.cn -@adspfp.sina.com.cn -@adspfpip.sina.com -@ads"promote.biz.weibo.cn -@ads r.dmp.sina.cn -@adsrm.sina.com.cn -@ads rs.sinajs.cn -@ads s.alitui.weibo.com -@ads#s.img.mix.sina.com.cn -@ads sapi.sina.cn -@ads sax.sina.cn -@adssax.sina.com.cn -@adssaxn.sina.com.cn -@adssaxs.sina.com.cn -@ads!sbeacon.sina.com.cn -@ads#sdkapp.mobile.sina.cn -@ads"sdkapp.uve.weibo.com -@ads%sdkclick.mobile.sina.cn -@ads slog.sina.cn -@adsslog.sina.com.cn -@ads(staticadm.leju.sina.com.cn -@adstjs.sjs.sinajs.cn -@ads#trends.mobile.sina.cn -@ads#u1.img.mobile.sina.cn -@ads'wapwbclick.mobile.sina.cn -@ads"wbapp.mobile.sina.cn -@ads!wbapp.uve.weibo.com -@ads$wbclick.mobile.sina.cn -@ads%wbpctips.mobile.sina.cn -@adswidget.weibo.com -@ads!woocall.sina.com.cn -@adszc.biz.weibo.com -@ads zymo.mps.weibo.com -@ads -: -ZAOBAO -zaobao.com zaobao.com.sg  zaobao.sg + BITSQUARE bisq.io bisq.network bitsquare.io + +ELIXIRelixir-lang.org +1 +JINSHUJU jinshuju.netjinshujucdn.com + +GEEKPARK geekpark.net +` +GEMFURY  fury.blog fury.co fury.dev  fury.help fury.io gemfury.com + + INMEDIAHK inmediahk.net +d + JUSTMYSOCKSjustmysocks.netjustmysocks1.netjustmysocks2.netjustmysocks4.net +C +MAOCLOUD +maoyun.commaoyuncloud.cnmaoyuncloud.com , -DUYAOSS duyaoss.com duyaossr.com - -HUFFPOSThuffingtonpost.cahuffingtonpost.co.ukhuffingtonpost.co.zahuffingtonpost.comhuffingtonpost.com.auhuffingtonpost.com.mxhuffingtonpost.dehuffingtonpost.eshuffingtonpost.frhuffingtonpost.grhuffingtonpost.inhuffingtonpost.ithuffingtonpost.jphuffingtonpost.kr huffpost.comhuffpostarabi.comhuffpostbrasil.comhuffpostmaghreb.com - -ICLOUDicloud-content.com  icloud.ch -icloud.com  icloud.de  icloud.ee  icloud.fi  icloud.fr  icloud.hu  icloud.ie  icloud.is  icloud.lv  icloud.om -icloud.org  icloud.pt  icloud.ro  icloud.se  icloud.si  icloud.sk  icloud.vn icloude.com icloudo.com -icloudo.de icloudos.de -% -ZHIHU  zhihu.com  zhimg.com - -NETEASE 126.com 126.link 126.net 127.net 163.com163industry.com 163mail.com 163qiyukf.com -163yun.com 166.net -haowu.linkicourse163.org  kaola.com -lofter.com  nease.netnetease-inc.com netease.com -netease.im -qiyukf.com ydstatic.com yeah.net -youdao.com g.163.com -@ads -I -PYTHON -python.orgpythonhosted.org pypa.io pypi.org - -AZURE azure-dns.comazure-dns.info azure-dns.net azure-dns.orgazure-mobile.netazure-test.net  azure.com  azure.netazurecomcdn.netazurecontainer.ioazuredns-prd.infoazuredns-prd.orgazureedge-test.net azureedge.netazurewebsites.net +MEDIUM +medium.commedium.systems +/ + SNAPCRAFT snapcraft.io snapstore.io + +CEX +cex.io + +DELL +cfblob.comcloudchoose.comcloudvolumes.com +cmpaas.com +cpedge.comcrit-staging.comexperience-vmware.com gemfire.netgeodesummit.com getboxer.com gitstar.com gitstar.net gopivotal.net greenplum.net hwslabs.com immidio.comitfromtheinside.comlatamvmwareforum.compivotalinitiative.comsnapvolumes.com ssdevrd.com vcanedge.com vcloudair.net vfabric.netvidmpreview.com +virsto.com +virsto.net vmglobal.net +vmmark.comvmtestdrive.com vmw.comvmware-cloudmanagement.comvmware-techcenter.comvmware20mosaic.comvmwareausnews.com!vmwarecertificationvideos.comvmwarecloud.comvmwaredemandcenter.comvmwareemeablog.comvmwaregrid.comvmwarehorizon.comvmwareidentity.comvmwarelearning.comvmwarelearningplatform.comvmwarestuff.comvmwareusergroupstore.comvmwareviewpoint.com vmwarevmc.com vmwdemo.com vmwgcomms.comvmwhorizonair.comvmwidm-ads.com +vmwidm.comvmwlabconnect.comvmwlearningplatform.com vmworld.comvmworld2010.comvmworld2013.comvmwsalesrewards.comvmwservices.com +vnware.netwhychoosehorizon.comwhychooseview.comwhychoosevmwareeuc.comwindowsuem.comworkspaceair.com xlstudio.comavinetworks.com +badaas.com bitnami.combitnamiapp.combitnamistudio.comdockerizer.comcloudcredibility.comcloudhealthtech.com cloudlive.comkubeacademy.com kubeapps.com +nyansa.com velocloud.com gopivotal.com heptio.cn +cn +heptio.com aliveipc.com aliveitsm.comaliveprofiler.com alivercm.comaliverewind.com alivertsm.com alivevm.com alivevmax.com alivevue.com vsphere.com vsphere.net air-watch.comairwatchexpress.comairwatchqa.com +getws1.com getwsone.comwhatisairwatch.comwhatisworkspaceone.comworkspaceone.comvmware.tt.omtrdc.netdelldell-brand.com dell.com dellcdn.com +& + VAGINACONTESTvaginacontest.com  -FIRESIDE fireside.fm -5 -IMDB imdb.com imdb.tomedia-imdb.com - -BITMEX -bitmex.com -8 -DMM dmm.com  dmm.co.jpdmm-extension.com +VUVUZELA vuvuzela.io + +BBGWATCH bbgwatch.com +H +BLENDERbigbuckbunny.org blender.orgelephantsdream.org +. +CABLETVcabletv.com.hk i-cable.com + +DIDI didi-food.comdidiaustralia.blogdidichuxing.comdidiglobal.comdidimobility.co.jpdidistatic.comxiaojukeji.com +a +LE +le.com lecloud.com +lemall.com letv.com letvcdn.com letvimg.com +) +LIANJIA lianjia.com  ljcdn.com + +LITV litv.tv  - NEWYORKER newyorker.com -q -UNITY  unity.com unity3d.com"unityads.unity3d.com -@ads$unityads.unitychina.cn -@ads - - CATEGORY-PORN  1pondo.tv -91porn.com  avgle.com avn.com beeg.com bongacams.com -bcicdn.com bcrncdn.com -btt804.com -btt904.com -bttzyw.com -bttzyw.net t66y.comchaturbate.com e-hentai.org ehgt.org ehtracker.org -ehwiki.org exhentai.orghentaiverse.org eporner.comfanhaodian.com  hegre.com heydoga.com  heyzo.com hqporner.com -javbus.com javfinder.sh findercdn.me o0-2.com  javhd.comjavlibrary.com -javwide.tv javwide.com kindgirls.comlivejasmin.com dditsadn.com dditscdn.com -metart.commetartnetwork.com metcams.comnaiadsystems.com  nsimg.net netflav.com  pigav.com -pornhd.com -phncdn.com phprcdn.com pornhub.compornhubpremium.com  press.vin redtube.com spankbang.comtheporndude.com  tube8.comvaginacontest.com  x-art.com xhamster.com xnxx.com xnxx-cdn.com xvideos.comxvideos-cdn.com youporn.com -, -SECOM secom.co.jpsecomtrust.net -( - UBERADS-ADS uberads.com -@ads -" - SINOINSIDERsinoinsider.com - - WIKIMEDIA mediawiki.org wikibooks.org wikidata.orgwikimediafoundation.org wikimedia.org wikinews.org wikipedia.org wikiquote.orgwikisource.orgwikiversity.orgwikivoyage.orgwiktionary.orgwmfusercontent.org -w.wiki toolforge.orgwikimediacloud.org wmcloud.org wmflabs.org - -XINGRZ  xingrz.me -" - ALPINELINUXalpinelinux.org -' -HEYZO heydoga.com  heyzo.com -3 -HKEDCITY hkedcity.nethkreadingcity.net - -SWIFT  swift.org - - IQIYI-ADSa.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@ads -L -LANZOU baidupan.com -lanzou.com lanzous.com woozooo.com + OPENRESTY openresty.org + +WESTERNDIGITALg-technology.com +sandisk.ae +sandisk.it +sandisk.cn +cn sandisk.co.jp sandisk.co.kr sandisk.co.uk sandisk.comsandisk.com.ausandisk.com.brsandisk.com.trsandisk.com.tw +sandisk.de +sandisk.es +sandisk.fr +sandisk.hk +sandisk.id +sandisk.in +sandisk.nl +sandisk.sg +wd.com wdc.comwesterndigital.com + +115 115.com + +9TO59to5google.com 9to5mac.com9to5terminal.com 9to5toys.com dronedj.com electrek.cospaceexplored.com +? +BOOTCSS bootcss.com +bootcdn.cnphpcomposer.com + +KALI kali.org + + WIKIMEDIA mediawiki.org wikibooks.org wikidata.orgwikimediafoundation.org wikimedia.org wikinews.org wikipedia.org wikiquote.orgwikisource.orgwikiversity.orgwikivoyage.orgwiktionary.orgwmfusercontent.org +w.wiki toolforge.orgwikimediacloud.org wmcloud.org wmflabs.org +^ + APPLE-ADSiadsdk.apple.com +ads iad.apple.com +ads qwapi.com +ads + +CONAIR  conair.me ++ +GUARDIANPROJECTguardianproject.info + + LINUXMINT linuxmint.com - LEANPLUM-ADS leanplum.com + +POSTGRESQLpostgresql.org + +XART  x-art.com +, +BANDCAMP bandcamp.com +bcbits.com +3 + +CONTENTFULcontentful.com ctfassets.net + +D100 d100.net + +HEYTEA +heytea.com + + MCDONALDSmcd  mcdonalds4008-517-517.cn +cnaboutmcdonalds.comhappymeal.co.nzhappymeal.com.au mcd.commcdelivery.co.idmcdelivery.co.krmcdelivery.com.aumcdelivery.com.mymcdelivery.com.sgmcdelivery.com.twmcdindonesia.com mcdonalds.camcdonalds.co.uk mcdonalds.commcdonalds.com.hk mcdonalds.hk mcdonalds.it mcdonalds.no mcdonalds.semcdonaldsarabia.commcdonaldsparties.co.nzmcdonaldsparties.com.au!xn--qhrx81fxh2a.xn--55qx5d.hk + +MIAOPAI miaopai.com ~ GITLAB gitlab.com  gitlab.io gitlab.netgitlab-static.net.*gitlab-assets.oss-cn-hongkong.aliyuncs.com -P -REDDIT -reddit.comredditstatic.comredditmedia.com redd.it - - WIKILEAKS wikileaks.org - -ADIDAS  adidas.at  adidas.be  adidas.ch adidas.co.in adidas.co.uk -adidas.com adidas.com.sa adidas.com.tw  adidas.cz  adidas.de  adidas.dk  adidas.hu  adidas.ie  adidas.it  adidas.nl  adidas.pl  adidas.ru  adidas.se - -EFF eff.org + +JIYUKOBOjiyu-kobo.co.jp  -FIGMA  figma.com +MINGW  mingw.org +N +THETYPE thetype.cloud +cn thetype.comtypeisbeautiful.com  -QUANTIL quantil.com -k -SLING dishworld.comslinginternational.com  sling.commovenetworks.com -movetv.com - -CAOLIU t66y.com +TUNSAFE tunsafe.com +' + UBERADS-ADS uberads.com +ads +c +YOUKU +kumiao.com  youku.com  ykimg.com +mmstat.com soku.com +cibntv.net +% +36KR 36kr.com 36krcdn.com +$ +AFP afp.com afpforum.com +% + BAIDU-ADS a.baidu.com +ads ad.duapps.com +ads ad.player.baidu.com +ads adm.baidu.com +adsadscdn.baidu.com +adsadx.xiaodutv.com +adsae.bdstatic.com +ads afd.baidu.com +ads als.baidu.com +ads&api.mobula.sdk.duapps.com +ads"api.tuisong.baidu.com +adsappc.baidu.com +adsb.bdstatic.com +adsbaichuan.baidu.com +adsbaidustatic.com +adsbaidutv.baidu.com +adsbanlv.baidu.com +ads bar.baidu.com +ads"bdimg.share.baidu.com +adsbdplus.baidu.com +ads bj.bcebos.com +adsbtlaunch.baidu.com +ads c.baidu.com +ads cb.baidu.com +adscbjs.baidu.com +adscjhq.baidu.com +adscleaner.baidu.com +ads click.bes.baidu.com +adsclick.hm.baidu.com +adsclick.qianqian.com +ads"cm.baichuan.baidu.com +ads cm.baidu.com +adscm.pos.baidu.com +ads cpro.baidu.cn +adscpro.baidu.com +ads!cpro.baidustatic.com +ads!cpro.tieba.baidu.com +ads"cpro.zhidao.baidu.com +adscpro2.baidu.com +ads"cpro2.baidustatic.com +ads crs.baidu.com +adsdatax.baidu.com +ads dd713.bj.bcebos.com +ads dl.client.baidu.com +adsdl.ops.baidu.com +adsdl1sw.baidu.com +adsdl2.bav.baidu.com +adsdlsw.baidu.com +adsdlsw.br.baidu.com +ads!dl-vip.bav.baidu.com +ads(dl-vip.pcfaster.baidu.co.th +ads#download.bav.baidu.com +ads"download.sd.baidu.com +adsdrmcmm.baidu.com +ads dup.baidustatic.com +ads dxp.baidu.com +ads dzl.baidu.com +ads e.baidu.com +adseclick.baidu.com +adsecma.bdimg.com +adsecmb.bdimg.com +adsecmc.bdimg.com +ads eiv.baidu.com +ads em.baidu.com +adsentry.baidu.com +ads ers.baidu.com +ads f10.baidu.com +ads#fc-feed.cdn.bcebos.com +adsfclick.baidu.com +adsfeed.baidu.com +adsfexclick.baidu.com +ads g.baidu.com +adsgimg.baidu.com +adsguanjia.baidu.com +ads hc.baidu.com +ads hm.baidu.com +adshmma.baidu.com +ads hpd.baidu.com +adsidm.bce.baidu.com +adsidm-su.baidu.com +adsiebar.baidu.com +adsikcode.baidu.com +adsimg.taotaosou.cn +adsimg01.taotaosou.cn +adsj.br.baidu.com +adskstj.baidu.com +ads log.music.baidu.com +ads m1.baidu.com +ads ma.baidu.com +adsmobads.baidu.com +ads"mobads-logs.baidu.com +adsmpro.baidu.com +adsmsite.baidu.com +adsneirong.baidu.com +adsnsclick.baidu.com +ads#nsclickvideo.baidu.com +adsopenrcv.baidu.com +ads$pc.videoclick.baidu.com +ads pos.baidu.com +adspups.bdimg.com +ads%push.zhanzhang.baidu.com +ads qianclick.baidu.com +adsrelease.baidu.com +adsres.mi.baidu.com +ads"rigel.baidustatic.com +ads#river.zhidao.baidu.com +ads rj.baidu.com +adsrplog.baidu.com +ads s.baidu.com +adss.cpro.baidu.com +ads!sa.tuisong.baidu.com +adssclick.baidu.com +adssestat.baidu.com +adsshadu.baidu.com +adsshare.baidu.com +ads"snippet.pos.baidu.com +adssobar.baidu.com +adssobartop.baidu.com +adsspcode.baidu.com +adsstat.v.baidu.com +ads su.bdimg.com +adssu.bdstatic.com +ads t10.baidu.com +ads t11.baidu.com +ads t12.baidu.com +ads tk.baidu.com +adstkweb.baidu.com +ads"tob-cms.bj.bcebos.com +adstongji.baidu.com +adstoolbar.baidu.com +adstracker.baidu.com +adstuijian.baidu.com +ads*uat1.bfsspadserver.8le8le.com +ads#ubmcmm.baidustatic.com +adsucstat.baidu.com +adsulic.baidu.com +ads ulog.imap.baidu.com +adsunion.baidu.com +ads!unionimage.baidu.com +adsutility.baidu.com +ads utk.baidu.com +ads videopush.baidu.com +adsvv84.bj.bcebos.com +adsw.gdown.baidu.com +ads w.x.baidu.com +adswangmeng.baidu.com +adsweishi.baidu.com +ads$wenku-cms.bj.bcebos.com +ads%wisepush.video.baidu.com +ads wm.baidu.com +adswn.pos.baidu.com +adsznsv.baidu.com +adszz.bdstatic.com +adszzy1.quyaoya.com +ads -DOI doi.org doi.info + +TYPOGRAPHYtypography.com +7 +DART dart.dev dartlang.org dartpad.dev +) +LINGUEE linguee.com  deepl.com +W +MOJANGcallersbane.com minecraft.netminecraftshop.com +mojang.com += +SIGNAL +signal.art +signal.orgsignalusers.org + +UNWIRE  unwire.hk + +CYGWIN +cygwin.com + + JFENGTIME jfengtime.com + +SPOTIFY byspotify.com pscdn.co scdn.co spoti.fispotify-everywhere.com spotify.comspotify.designspotifycdn.comspotifycharts.comspotifycodes.comspotifyforbrands.comspotifyjobs.com  -FIREFOX firefox.com -\ -PRIVATE local  localhostlocalhost.sec.qq.comlocalhost.ptlogin2.qq.com - -RASPBIAN raspbian.org - -SONY playstationplaystation.complaystation.net sonyentertainmentnetwork.comimageworks.commotionpictureser.com playshow.ioplayshowtv.comsonyclassics.comsonypictures.comsonypicturesanimation.comsonypicturesmuseum.comsonypicturesstudios.comsonypicturestelevision.com#sonypicturestelevisiongames.com wheelpop.com -wwtbam.comyourfantasybeginsnow.comsonyginzasonypark.jpsony-africa.com sony-asia.comsony-europe.comsony-hes.co.jpsony-latin.com sony-mea.comsony-olympus-medical.comsony-promotion.eusony-semicon.co.jp sony.at sony.ba sony.be sony.bg sony.ca sony.ch sony.cl -sony.co.cr -sony.co.id -sony.co.in -sony.co.jp -sony.co.kr -sony.co.nz -sony.co.th -sony.co.uk sony.com sony.com.ar sony.com.au sony.com.bo sony.com.br sony.com.co sony.com.do sony.com.ec sony.com.gt sony.com.hk sony.com.hn sony.com.mk sony.com.mx sony.com.my sony.com.ni sony.com.pa sony.com.pe sony.com.ph sony.com.sg sony.com.sv sony.com.tr sony.com.tw sony.com.vn sony.cz sony.de sony.dk sony.ee sony.es sony.eu sony.fi sony.fr sony.gr sony.hr sony.hu sony.ie sony.it sony.kz sony.lt sony.lu sony.lv sony.net sony.nl sony.no sony.pl sony.pt sony.ro sony.rs sony.ru sony.se sony.si sony.sk sony.ua sonybo.co.jp sonybsc.comsonybuilding.jpsonydesign.com sonydna.comsonyglobalsolutions.jp sonykigyo.jpsonylatvija.com -sonypcl.jpsonyprotechnosupport.co.jpsonystoragemedia.co.jp sonytc.co.jp  sovec.net +TABOOLA taboola.com + +VERISIGN verisign.asia verisign.biz verisign.chverisign.co.inverisign.co.uk verisign.comverisign.com.auverisign.com.brverisign.com.cnverisign.com.esverisign.com.hkverisign.com.sgverisign.com.twverisign.com.vn verisign.de verisign.dk verisign.es verisign.fr verisign.hk verisign.in verisign.info verisign.jobs verisign.mobi verisign.name verisign.net verisign.org verisign.pro verisign.se verisign.sg verisign.tw verisign.us verisign.vnverisigninc.com +R +ARPHIC +arphic.com arphic.com.cn arphic.com.twifontcloud.com +H +COOLAPK coolapk.comcoolapkmarket.comcoolapkmarket.net + +MOVEFREEkeepmovingwithmovefree.com move-free.net movefree.cn +cn movefrees.commovefreeoffers.commovefreerewards.comschiffvitamins.com +1 + LIBERAPAY liberapay.com liberapay.org +) +MEITU  meitu.com meitudata.com  SQLITE sqlite.org - -DIGICERT digicert.com freessl.com geotrust.com rapidssl.com -thawte.com  thawte.de  thawte.fr -T - DLERCLOUD dlercloud.com dlercloud.org dlercloud.me dleris.best - -JS-ORG -js.org - -HK01 hk01.com - +; +WJX +sojump.com +wjx.cn wjx.com wjx.top +U + CLEARASIL clearasil.cn +cnclearasil.com.cn +cn clearasil.us + IQIYI 71.am  iqiyi.com iqiyipic.com pps.tv ppsimg.com qiyi.com qiyipic.com qy.net -71edge.coma.ckm.iqiyi.com -@adsad.m.iqiyi.com -@ads afp.iqiyi.com -@adsc.uaa.iqiyi.com -@ads!cloudpush.iqiyi.com -@ads#cm.passport.iqiyi.com -@adscupid.iqiyi.com -@ads$emoticon.sns.iqiyi.com -@ads"gamecenter.iqiyi.com -@ads"hotchat-im.iqiyi.com -@ads ifacelog.iqiyi.com -@adsmbdlog.iqiyi.com -@ads msg.71.am -@ads msg.video.qiyi.com -@ads!msg2.video.qiyi.com -@ads$policy.video.iqiyi.com -@adsyuedu.iqiyi.com -@ads - -LETV-ADS$api.game.letvstore.com -@ads ark.letv.com -@ads dc.letv.com -@adsdev.dc.letv.com -@ads fz.letv.com -@ads g3.letv.com -@adsletv.allyes.com -@adsminisite.letv.com -@adsmsg.m.letv.com -@adsn.mark.letv.com -@adsplog.dc.letv.com -@adspro.hoye.letv.com -@ads pro.letv.com -@ads stat.letv.com -@ads#static.app.m.letv.com -@ads -H - NEXITALLY nexitally.comnexitallysafe.com nexitcore.com -0 -OPENWRT openwrt.orglede-project.org - -BMWbmwbmw-abudhabi.com bmw-asia.com bmw-dubai.com bmw-ghana.combmw-golfsport.com bmw-int1.combmw-kuwait.combmw-lebanon.com -bmw-me.combmw-motorsport.combmw-nigeria.com bmw-oman.combmw-pakistan.combmw-pma.com.sg bmw-qatar.combmw-saudiarabia.combmw-special-sales.combmw-yachtsport.com -bmw.am -bmw.bb -bmw.bg -bmw.bm -bmw.bs -bmw.by -bmw.ca -bmw.cc -bmw.ch -bmw.cl  bmw.co.ao  bmw.co.cr  bmw.co.id  bmw.co.jp  bmw.co.nz bmw.com -bmw.com.ar -bmw.com.au -bmw.com.bn -bmw.com.cn -bmw.com.kh -bmw.com.mt -bmw.com.my -bmw.com.ph -bmw.dk -bmw.ee -bmw.fi -bmw.gr -bmw.hn -bmw.ht -bmw.hu -bmw.ie -bmw.in -bmw.lc -bmw.lk -bmw.lt -bmw.lv -bmw.ma -bmw.mu -bmw.no -bmw.pl -bmw.pt -bmw.ro -bmw.se -bmw.si -bmw.sk -bmw.sn -bmw.tt -bmw.uz -bmw.vn  bmwbkk.de bmwgroup.com  bmwhk.combmwjamaica.com -bmwlat.combmwmyanmar.com mini.com - -CLOUDN  cloudn.me +71edge.coma.ckm.iqiyi.com +adsad.m.iqiyi.com +ads afp.iqiyi.com +adsc.uaa.iqiyi.com +ads cloudpush.iqiyi.com +ads"cm.passport.iqiyi.com +adscupid.iqiyi.com +ads#emoticon.sns.iqiyi.com +ads!gamecenter.iqiyi.com +ads!hotchat-im.iqiyi.com +adsifacelog.iqiyi.com +adsmbdlog.iqiyi.com +ads msg.71.am +adsmsg.video.qiyi.com +ads msg2.video.qiyi.com +ads#policy.video.iqiyi.com +adsyuedu.iqiyi.com +ads + +JENKINS +jenkins.io +# +MEGA +mega.co.nz mega.nz +; + SCORELAND scoreland.comcdn77.scoreuniverse.com " - GETCOMPOSERgetcomposer.org - + SINOINSIDERsinoinsider.com + +SPACEX +spacex.com +3 -SKILLSHAREskillshare.com -0 +STREAMABLE embed-cdn.comstreamable.com +5 +YOUJIZZ youjizz.comyjcontentdelivery.com + +ADBLOCKgetadblock.com + +ADIDAS  adidas.at  adidas.be  adidas.ch adidas.co.in adidas.co.uk +adidas.com adidas.com.cn +cn adidas.com.sa adidas.com.tw  adidas.cz  adidas.de  adidas.dk  adidas.hu  adidas.ie  adidas.it  adidas.nl  adidas.pl  adidas.ru  adidas.se +, -SOUNDCLOUDsoundcloud.com -sndcdn.com -\ -TAIKANG taikang.comtaikanglife.comtaikangzhijia.comtkhealthcare.com -2 -UBI ubi.com ubisoft.com  uplay.com - -VISA visa.be visa.ca visa.cl -visa.co.ao -visa.co.cr -visa.co.id -visa.co.il -visa.co.in -visa.co.jp -visa.co.ke -visa.co.ni -visa.co.nz -visa.co.th -visa.co.uk -visa.co.ve -visa.co.za visa.com visa.com.ag visa.com.ai visa.com.ar visa.com.au visa.com.az visa.com.bo visa.com.br visa.com.bs visa.com.bz visa.com.cn visa.com.co visa.com.cy visa.com.dm visa.com.do visa.com.ec visa.com.ge visa.com.gt visa.com.gy visa.com.hk visa.com.hn visa.com.hr visa.com.jm visa.com.kh visa.com.kn visa.com.kz visa.com.lc visa.com.lk visa.com.ms visa.com.mx visa.com.my visa.com.ng visa.com.pa visa.com.pe visa.com.ph visa.com.pr visa.com.py visa.com.ru visa.com.sg visa.com.sv visa.com.tr visa.com.tt visa.com.tw visa.com.ua visa.com.uy visa.com.vc visa.com.vi visa.com.vn visa.cz visa.de visa.dk visa.es visa.fi visa.fr visa.gd visa.gp visa.gr visa.hu visa.ie visa.is visa.ky visa.lt visa.lv visa.mn visa.mq visa.nl visa.no visa.pl visa.pt visa.ro visa.se visa.sk visa.sx visa.tc -visabg.com visaeurope.at visaeurope.ch visaeurope.lu visaeurope.sivisaitalia.com visakorea.comvisamiddleeast.comvisasoutheasteurope.com +HOTJAR-ADSstatic.hotjar.com +ads +" + SHADOWSOCKSshadowsocks.org +- +BITFLYER bitflyer.com bitflyer.jp + +DEDAO biji.com +ddmogo.com +igetget.cn igetget.com luojilab.com  mogoo.com +sao.cn saolife.com +( +REDIS redis.io redislabs.com + +WWE wwe.com wwe9.com +6 +CATEGORY-COLLABORATE-CN shimo.im  yuque.com A - PINDUODUO -pddpic.com pinduoduo.com yangkeduo.com - -RENZHE renzhe.cloud - - -SF-EXPRESS  feng1.comrongechain.comsf-airlines.comsf-cityrush.comsf-express.com sf-saas.comsf-tech.com.cn sffix.cn sfgy.org +MEIZU flyme.cn meizu.cn  meizu.com  mzres.com + +NETEASE 126.com 126.link 126.net 127.com 127.net 163.com163industry.com 163mail.com 163qiyukf.com +163yun.com 166.net +haowu.linkicourse163.org  kaola.com +lofter.com  nease.netnetease-inc.com netease.com +netease.im +qiyukf.com ydstatic.com yeah.net +youdao.comanalytics.163.com +ads crash.163.com +ads crashlytics.163.com +ads g.163.com +ads  - WIREGUARD wireguard.com - -AVGLE  avgle.com -- -BAIDU baidu -91.com -aipage.com apollo.auto baidu.cn  baidu.com baidu.com.cn baidubce.combaiducontent.com baidupcs.combaidustatic.com -baifae.com baifubao.com  bdimg.com bdstatic.com bdtjrcv.com  bdydns.cn -bdydns.net chuanke.com  dlnel.com  dlnel.org -duapps.com -dwz.cn -hao123.com hao123img.com -hao222.com -haokan.com jomocdn.net jomodns.com -mipcdn.com  nuomi.com quyaoya.com smartapps.cn  tieba.com tiebaimg.com xianfae.com xiaodutv.com a.baidu.com -@ads ad.duapps.com -@ads!ad.player.baidu.com -@ads adm.baidu.com -@adsadscdn.baidu.com -@adsadx.xiaodutv.com -@adsae.bdstatic.com -@ads afd.baidu.com -@ads als.baidu.com -@adsanquan.baidu.com -@ads!antivirus.baidu.com -@adsapi.cpu.baidu.com -@ads'api.mobula.sdk.duapps.com -@ads#api.tuisong.baidu.com -@adsappc.baidu.com -@adsb.bdstatic.com -@ads baichuan.baidu.com -@adsbaidustatic.com -@adsbaidutv.baidu.com -@adsbanlv.baidu.com -@ads bar.baidu.com -@ads bce.baidu.com -@ads#bdimg.share.baidu.com -@adsbdplus.baidu.com -@ads bj.bcebos.com -@ads btlaunch.baidu.com -@ads c.baidu.com -@ads cb.baidu.com -@adscbjs.baidu.com -@adscjhq.baidu.com -@adscleaner.baidu.com -@ads!click.bes.baidu.com -@ads click.hm.baidu.com -@ads click.qianqian.com -@ads#cm.baichuan.baidu.com -@ads cm.baidu.com -@adscm.pos.baidu.com -@ads cpro.baidu.cn -@adscpro.baidu.com -@ads"cpro.baidustatic.com -@ads"cpro.tieba.baidu.com -@ads#cpro.zhidao.baidu.com -@adscpro2.baidu.com -@ads#cpro2.baidustatic.com -@ads cpu.baidu.com -@ads!cpu-admin.baidu.com -@ads crs.baidu.com -@adsdatax.baidu.com -@ads!dd713.bj.bcebos.com -@ads!dl.client.baidu.com -@adsdl.ops.baidu.com -@adsdl1sw.baidu.com -@adsdl2.bav.baidu.com -@adsdlsw.baidu.com -@adsdlsw.br.baidu.com -@ads"dl-vip.bav.baidu.com -@ads)dl-vip.pcfaster.baidu.co.th -@ads$download.bav.baidu.com -@ads#download.sd.baidu.com -@adsdrmcmm.baidu.com -@ads!dup.baidustatic.com -@ads dxp.baidu.com -@ads dzl.baidu.com -@ads e.baidu.com -@adseclick.baidu.com -@adsecma.bdimg.com -@adsecmb.bdimg.com -@adsecmc.bdimg.com -@ads eiv.baidu.com -@ads em.baidu.com -@adsentry.baidu.com -@ads ers.baidu.com -@ads f10.baidu.com -@ads$fc-feed.cdn.bcebos.com -@adsfclick.baidu.com -@adsfeed.baidu.com -@ads fexclick.baidu.com -@ads g.baidu.com -@adsgimg.baidu.com -@adsguanjia.baidu.com -@ads hc.baidu.com -@ads hm.baidu.com -@adshmma.baidu.com -@ads hpd.baidu.com -@adsidm.bce.baidu.com -@adsidm-su.baidu.com -@adsiebar.baidu.com -@adsikcode.baidu.com -@adsimg.taotaosou.cn -@ads img01.taotaosou.cn -@adsj.br.baidu.com -@adskstj.baidu.com -@ads!log.music.baidu.com -@ads m1.baidu.com -@ads ma.baidu.com -@ads#mipcache.bdstatic.com -@adsmobads.baidu.com -@ads#mobads-logs.baidu.com -@adsmpro.baidu.com -@adsmsite.baidu.com -@adsneirong.baidu.com -@adsnsclick.baidu.com -@ads$nsclickvideo.baidu.com -@adsopenrcv.baidu.com -@ads%pc.videoclick.baidu.com -@ads pos.baidu.com -@adspups.bdimg.com -@ads&push.zhanzhang.baidu.com -@ads!qianclick.baidu.com -@adsrelease.baidu.com -@adsres.mi.baidu.com -@ads#rigel.baidustatic.com -@ads$river.zhidao.baidu.com -@ads rj.baidu.com -@adsrplog.baidu.com -@ads s.baidu.com -@adss.cpro.baidu.com -@ads"sa.tuisong.baidu.com -@adssclick.baidu.com -@adssestat.baidu.com -@adsshadu.baidu.com -@adsshare.baidu.com -@ads#snippet.pos.baidu.com -@adssobar.baidu.com -@ads sobartop.baidu.com -@adsspcode.baidu.com -@adsstat.v.baidu.com -@ads su.bdimg.com -@adssu.bdstatic.com -@ads t10.baidu.com -@ads t11.baidu.com -@ads t12.baidu.com -@ads tk.baidu.com -@adstkweb.baidu.com -@ads#tob-cms.bj.bcebos.com -@adstongji.baidu.com -@adstoolbar.baidu.com -@adstracker.baidu.com -@adstuijian.baidu.com -@ads+uat1.bfsspadserver.8le8le.com -@ads$ubmcmm.baidustatic.com -@adsucstat.baidu.com -@adsulic.baidu.com -@ads!ulog.imap.baidu.com -@adsunion.baidu.com -@ads"unionimage.baidu.com -@adsutility.baidu.com -@ads utk.baidu.com -@ads!videopush.baidu.com -@ads vv84.bj.bcebos.com -@adsw.gdown.baidu.com -@ads w.x.baidu.com -@ads wangmeng.baidu.com -@adsweishi.baidu.com -@ads%wenku-cms.bj.bcebos.com -@ads&wisepush.video.baidu.com -@ads wm.baidu.com -@adswn.pos.baidu.com -@adsznsv.baidu.com -@adszz.bdstatic.com -@adszzy1.quyaoya.com -@ads zuoyebang.cc zuoyebang.com -zybang.com -% -DEMOCRACYEARTHdemocracy.earth -" - EPICBROWSERepicbrowser.com -! -NTD ntd.com  ntdtv.com -I -ACFUN acfun.cn aixifan.com!apilog-web.acfun.cn -@ads -* - ADCOLONY-ADS adcolony.com -@ads - - -APPLEDAILYappledaily.comappledaily.com.hkappledaily.com.tw appledaily.hkapplefruity.comapplehealth.com.hk -atnext.combestmallawards.com deluxe.com.hk eracom.com.tw next.hknextdigital.com.hknextdigital.com.twnextfilm.com.hknextmag.com.tw nextmedia.comnextmedia.com.tw nextmgz.comnextplus.com.hk nexttv.com.twnextwork.com.hknextwork.com.tw nextwork.hk nextwork.tw nxtdig.com.hk nxtdig.com.tw omoplanet.com privilege.hk privilege.tw sharpdaily.tw tomonews.nettwnextdigital.com - -SAMSUNG samsung -xn--cg4bkigalaxyappstore.comgalaxymobile.jpgame-platform.net knoxemm.com samsung.comsamsungapps.comsamsungcloud.com samsungdm.comsamsunggalaxyfriends.comsamsungknox.comsamsungqbe.com - -XIAOMI -mi.com -mi-img.com  mifile.cn miui.com -miwifi.com  xiaomi.cn -xiaomi.com -xiaomi.netxiaomiyoupin.com - -BEEG beeg.com - -CCTV cctv.cn cctv.com cctvpic.com chinalive.com cntv.cn cntv.com.cn  cntvwb.cn  ipanda.cn -ipanda.com ipanda.com.cn -ipanda.net livechina.cn livechina.comolympicchannelchina.cn + GREATFIRE greatfire.org  -GRAVATAR gravatar.com \ No newline at end of file +LINOTYPE linotype.com +E +PIXIV  pixiv.net  pixiv.org pixiv.co.jp  pximg.net + + STREPSILS +cepacol.ca cepacol.com dobendan.degraneodin.com.mx +repsils.no strepsils.at strepsils.ch strepsils.cn +cnstrepsils.co.krstrepsils.co.nzstrepsils.co.zastrepsils.com.arstrepsils.com.brstrepsils.com.cn +cnstrepsils.com.costrepsils.com.austrepsils.com.hkstrepsils.com.phstrepsils.com.tw strepsils.es strepsils.fi strepsils.fr strepsils.hr strepsils.hu strepsils.ie strepsils.net strepsils.pl strepsils.pt strepsils.ro strepsils.ru strepsils.si strepsils.usstrepsilsarabia.com +' +ZEPLIN +zeplin.dev  zeplin.io +* +HKOPENTV hkopentv.com fantv.hk + +INSIDERbusinessinsider.co.zabusinessinsider.combusinessinsider.com.aubusinessinsider.com.plbusinessinsider.debusinessinsider.esbusinessinsider.frbusinessinsider.inbusinessinsider.jpbusinessinsider.mxbusinessinsider.mybusinessinsider.nlbusinessinsider.sginsider-intelligence.com insider.cominsiderintelligence.com + +FIRESIDE fireside.fm + + SHARETHIS sharethis.com \ No newline at end of file diff --git a/release/config/systemd/system/v2ray.service b/release/config/systemd/system/v2ray.service new file mode 100644 index 0000000000..a299209cd7 --- /dev/null +++ b/release/config/systemd/system/v2ray.service @@ -0,0 +1,16 @@ +[Unit] +Description=V2Ray Service +Documentation=https://www.v2fly.org/ +After=network.target nss-lookup.target + +[Service] +User=nobody +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +NoNewPrivileges=true +ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json +Restart=on-failure +RestartPreventExitStatus=23 + +[Install] +WantedBy=multi-user.target diff --git a/release/config/systemd/system/v2ray@.service b/release/config/systemd/system/v2ray@.service new file mode 100644 index 0000000000..514a86aa37 --- /dev/null +++ b/release/config/systemd/system/v2ray@.service @@ -0,0 +1,16 @@ +[Unit] +Description=V2Ray Service +Documentation=https://www.v2fly.org/ +After=network.target nss-lookup.target + +[Service] +User=nobody +CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE +NoNewPrivileges=true +ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json +Restart=on-failure +RestartPreventExitStatus=23 + +[Install] +WantedBy=multi-user.target diff --git a/release/config/systemd/v2ray.service b/release/config/systemd/v2ray.service deleted file mode 100644 index cc9c394b11..0000000000 --- a/release/config/systemd/v2ray.service +++ /dev/null @@ -1,22 +0,0 @@ -[Unit] -Description=V2Ray Service -Documentation=https://www.v2ray.com/ https://www.v2fly.org/ -After=network.target nss-lookup.target - -[Service] -# If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple -#Type=exec -Type=simple -# This service runs as root. You may consider to run it as another user for security concerns. -# By uncommenting User=nobody and commenting out User=root, the service will run as user nobody. -# More discussion at https://github.com/v2ray/v2ray-core/issues/1011 -User=root -#User=nobody -CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE -AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE -NoNewPrivileges=true -ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/release/config/systemd/v2ray@.service b/release/config/systemd/v2ray@.service deleted file mode 100644 index 557bb095aa..0000000000 --- a/release/config/systemd/v2ray@.service +++ /dev/null @@ -1,22 +0,0 @@ -[Unit] -Description=V2Ray Service -Documentation=https://www.v2ray.com/ https://www.v2fly.org/ -After=network.target nss-lookup.target - -[Service] -# If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple -#Type=exec -Type=simple -# This service runs as root. You may consider to run it as another user for security concerns. -# By uncommenting User=nobody and commenting out User=root, the service will run as user nobody. -# More discussion at https://github.com/v2ray/v2ray-core/issues/1011 -User=root -#User=nobody -CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE -AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE -NoNewPrivileges=true -ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/%i.json -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/release/config/systemv/v2ray b/release/config/systemv/v2ray deleted file mode 100755 index 839730f0b5..0000000000 --- a/release/config/systemv/v2ray +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: v2ray -# Required-Start: $network $local_fs $remote_fs -# Required-Stop: $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: V2Ray proxy services -# Description: V2Ray proxy services -### END INIT INFO - -# Acknowledgements: Isulew Li - -DESC=v2ray -NAME=v2ray -DAEMON=/usr/bin/v2ray/v2ray -PIDFILE=/var/run/$NAME.pid -SCRIPTNAME=/etc/init.d/$NAME - -DAEMON_OPTS="-config /etc/v2ray/config.json" - -# Exit if the package is not installed -[ -x $DAEMON ] || exit 0 - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# -# Function that starts the daemon/service -# -do_start() -{ - mkdir -p /var/log/v2ray - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - # 3 if configuration file not ready for daemon - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --background -m -- $DAEMON_OPTS \ - || return 2 - # Add code here, if necessary, that waits for the process to be ready - # to handle requests from services started subsequently which depend - # on this one. As a last resort, sleep for some time. -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE - RETVAL="$?" - [ "$RETVAL" = 2 ] && return 2 - # Wait for children to finish too if this is a daemon that forks - # and if the daemon is only ever run from this initscript. - # If the above conditions are not satisfied then add some other code - # that waits for the process to drop all resources that could be - # needed by services started subsequently. A last resort is to - # sleep for some time. - start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON - [ "$?" = 2 ] && return 2 - # Many daemons don't delete their pidfiles when they exit. - rm -f $PIDFILE - return "$RETVAL" -} - -# -# Function that sends a SIGHUP to the daemon/service -# -do_reload() { - # - # If the daemon can reload its configuration without - # restarting (for example, when it is sent a SIGHUP), - # then implement that here. - # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - status) - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? - ;; - reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - log_daemon_msg "Reloading $DESC" "$NAME" - do_reload - log_end_msg $? - ;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|status|reload|restart|force-reload}" >&2 - exit 3 - ;; -esac diff --git a/release/doc/readme.md b/release/doc/readme.md deleted file mode 100644 index fbe481fe49..0000000000 --- a/release/doc/readme.md +++ /dev/null @@ -1,37 +0,0 @@ -# V2Ray 内核 - -V2Ray 内核可以单独使用,也可以配置其它程序一起使用。 - -官网:https://www.v2ray.com/ - -## 使用方式 - -### Windows 或 macOS - -压缩包内的 config.json 是默认的配置文件,无需修改即可使用。配置文件的详细信息可以在官网找到。 - -* Windows 中的可执行文件为 v2ray.exe 和 wv2ray.exe。双击即可运行。 - * v2ray.exe 是一个命令行程序,启动后可以看到命令行界面。 - * wv2ray.exe 是一个后台程序,没有界面,会在后台自动运行。 -* macOS 中的可执行文件为 v2ray。右键单击,然后选择使用 Terminal 打开即可。 - -### Linux - -压缩包中包含多个配置文件,按需使用。 - -可执行程序为 v2ray,启动命令: - -```bash -v2ray --config= -``` - -## 验证文件 - -压缩包中的 .sig 文件为 GPG 签名文件,用来验证对应程序文件的真实性。签名公钥可以在下面的链接找到: - -https://github.com/v2ray/v2ray-core/blob/master/release/verify/official_release.asc - -## 问题反馈 - -* Github: https://github.com/v2ray/v2ray-core -* Telegram: https://t.me/v2fly_chat diff --git a/release/install-release.sh b/release/install-release.sh index 272b0a00e6..4b2bde4a00 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is accessible as https://install.direct/go.sh # Original source is located at github.com/v2fly/v2ray-core/release/install-release.sh @@ -9,484 +9,14 @@ # 2: Application error # 3: Network error -# CLI arguments -PROXY='' -HELP='' -FORCE='' -CHECK='' -REMOVE='' -VERSION='' -VSRC_ROOT='/tmp/v2ray' -EXTRACT_ONLY='' -LOCAL='' -LOCAL_INSTALL='' -DIST_SRC='github' -ERROR_IF_UPTODATE='' - -CUR_VER="" -NEW_VER="" -VDIS='' -ZIPFILE="/tmp/v2ray/v2ray.zip" -V2RAY_RUNNING=0 - -CMD_INSTALL="" -CMD_UPDATE="" -SOFTWARE_UPDATED=0 - -SYSTEMCTL_CMD=$(command -v systemctl 2>/dev/null) -SERVICE_CMD=$(command -v service 2>/dev/null) - #######color code######## RED="31m" # Error message -GREEN="32m" # Success message YELLOW="33m" # Warning message -BLUE="36m" # Info message - - -######################### -while [[ $# > 0 ]]; do - case "$1" in - -p|--proxy) - PROXY="-x ${2}" - shift # past argument - ;; - -h|--help) - HELP="1" - ;; - -f|--force) - FORCE="1" - ;; - -c|--check) - CHECK="1" - ;; - --remove) - REMOVE="1" - ;; - --version) - VERSION="$2" - shift - ;; - --extract) - VSRC_ROOT="$2" - shift - ;; - --extractonly) - EXTRACT_ONLY="1" - ;; - -l|--local) - LOCAL="$2" - LOCAL_INSTALL="1" - shift - ;; - --source) - DIST_SRC="$2" - shift - ;; - --errifuptodate) - ERROR_IF_UPTODATE="1" - ;; - *) - # unknown option - ;; - esac - shift # past argument or value -done - -############################### colorEcho(){ echo -e "\033[${1}${@:2}\033[0m" 1>& 2 } -archAffix(){ - case "${1:-"$(uname -m)"}" in - i686|i386) - echo '32' - ;; - x86_64|amd64) - echo '64' - ;; - *armv7*|armv6l) - echo 'arm' - ;; - *armv8*|aarch64) - echo 'arm64' - ;; - *mips64le*) - echo 'mips64le' - ;; - *mips64*) - echo 'mips64' - ;; - *mipsle*) - echo 'mipsle' - ;; - *mips*) - echo 'mips' - ;; - *s390x*) - echo 's390x' - ;; - ppc64le) - echo 'ppc64le' - ;; - ppc64) - echo 'ppc64' - ;; - *) - return 1 - ;; - esac - - return 0 -} - -zipRoot() { - unzip -lqq "$1" | awk -e ' - NR == 1 { - prefix = $4; - } - NR != 1 { - prefix_len = length(prefix); - cur_len = length($4); - - for (len = prefix_len < cur_len ? prefix_len : cur_len; len >= 1; len -= 1) { - sub_prefix = substr(prefix, 1, len); - sub_cur = substr($4, 1, len); - - if (sub_prefix == sub_cur) { - prefix = sub_prefix; - break; - } - } - - if (len == 0) { - prefix = ""; - nextfile; - } - } - END { - print prefix; - } - ' -} - -downloadV2Ray(){ - rm -rf /tmp/v2ray - mkdir -p /tmp/v2ray - if [[ "${DIST_SRC}" == "jsdelivr" ]]; then - DOWNLOAD_LINK="https://cdn.jsdelivr.net/gh/v2ray/dist/v2ray-linux-${VDIS}.zip" - else - DOWNLOAD_LINK="https://github.com/v2fly/v2ray-core/releases/download/${NEW_VER}/v2ray-linux-${VDIS}.zip" - fi - colorEcho ${BLUE} "Downloading V2Ray: ${DOWNLOAD_LINK}" - curl ${PROXY} -L -H "Cache-Control: no-cache" -o ${ZIPFILE} ${DOWNLOAD_LINK} - if [ $? != 0 ];then - colorEcho ${RED} "Failed to download! Please check your network or try again." - return 3 - fi - return 0 -} - -installSoftware(){ - COMPONENT=$1 - if [[ -n `command -v $COMPONENT` ]]; then - return 0 - fi - - getPMT - if [[ $? -eq 1 ]]; then - colorEcho ${RED} "The system package manager tool isn't APT or YUM, please install ${COMPONENT} manually." - return 1 - fi - if [[ $SOFTWARE_UPDATED -eq 0 ]]; then - colorEcho ${BLUE} "Updating software repo" - $CMD_UPDATE - SOFTWARE_UPDATED=1 - fi - - colorEcho ${BLUE} "Installing ${COMPONENT}" - $CMD_INSTALL $COMPONENT - if [[ $? -ne 0 ]]; then - colorEcho ${RED} "Failed to install ${COMPONENT}. Please install it manually." - return 1 - fi - return 0 -} - -# return 1: not apt, yum, or zypper -getPMT(){ - if [[ -n `command -v apt-get` ]];then - CMD_INSTALL="apt-get -y -qq install" - CMD_UPDATE="apt-get -qq update" - elif [[ -n `command -v yum` ]]; then - CMD_INSTALL="yum -y -q install" - CMD_UPDATE="yum -q makecache" - elif [[ -n `command -v zypper` ]]; then - CMD_INSTALL="zypper -y install" - CMD_UPDATE="zypper ref" - else - return 1 - fi - return 0 -} - -normalizeVersion() { - if [ -n "$1" ]; then - case "$1" in - v*) - echo "$1" - ;; - *) - echo "v$1" - ;; - esac - else - echo "" - fi -} - -# 1: new V2Ray. 0: no. 2: not installed. 3: check failed. 4: don't check. -getVersion(){ - if [[ -n "$VERSION" ]]; then - NEW_VER="$(normalizeVersion "$VERSION")" - return 4 - else - VER="$(/usr/bin/v2ray/v2ray -version 2>/dev/null)" - RETVAL=$? - CUR_VER="$(normalizeVersion "$(echo "$VER" | head -n 1 | cut -d " " -f2)")" - TAG_URL="https://api.github.com/repos/v2fly/v2ray-core/releases/latest" - NEW_VER="$(normalizeVersion "$(curl ${PROXY} -H "Accept: application/json" -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" -s "${TAG_URL}" --connect-timeout 10| grep 'tag_name' | cut -d\" -f4)")" - - if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then - colorEcho ${RED} "Failed to fetch release information. Please check your network or try again." - return 3 - elif [[ $RETVAL -ne 0 ]];then - return 2 - elif [[ $NEW_VER != $CUR_VER ]];then - return 1 - fi - return 0 - fi -} - -stopV2ray(){ - colorEcho ${BLUE} "Shutting down V2Ray service." - if [[ -n "${SYSTEMCTL_CMD}" ]] || [[ -f "/lib/systemd/system/v2ray.service" ]] || [[ -f "/etc/systemd/system/v2ray.service" ]]; then - ${SYSTEMCTL_CMD} stop v2ray - elif [[ -n "${SERVICE_CMD}" ]] || [[ -f "/etc/init.d/v2ray" ]]; then - ${SERVICE_CMD} v2ray stop - fi - if [[ $? -ne 0 ]]; then - colorEcho ${YELLOW} "Failed to shutdown V2Ray service." - return 2 - fi - return 0 -} - -startV2ray(){ - if [ -n "${SYSTEMCTL_CMD}" ] && [[ -f "/lib/systemd/system/v2ray.service" || -f "/etc/systemd/system/v2ray.service" ]]; then - ${SYSTEMCTL_CMD} start v2ray - elif [ -n "${SERVICE_CMD}" ] && [ -f "/etc/init.d/v2ray" ]; then - ${SERVICE_CMD} v2ray start - fi - if [[ $? -ne 0 ]]; then - colorEcho ${YELLOW} "Failed to start V2Ray service." - return 2 - fi - return 0 -} - -installV2Ray(){ - # Install V2Ray binary to /usr/bin/v2ray - mkdir -p '/etc/v2ray' '/var/log/v2ray' && \ - unzip -oj "$1" "$2v2ray" "$2v2ctl" "$2geoip.dat" "$2geosite.dat" -d '/usr/bin/v2ray' && \ - chmod +x '/usr/bin/v2ray/v2ray' '/usr/bin/v2ray/v2ctl' || { - colorEcho ${RED} "Failed to copy V2Ray binary and resources." - return 1 - } - - # Install V2Ray server config to /etc/v2ray - if [ ! -f '/etc/v2ray/config.json' ]; then - local PORT="$(($RANDOM + 10000))" - local UUID="$(cat '/proc/sys/kernel/random/uuid')" - - unzip -pq "$1" "$2vpoint_vmess_freedom.json" | \ - sed -e "s/10086/${PORT}/g; s/23ad6b10-8d1a-40f7-8ad0-e3e35cd38297/${UUID}/g;" - > \ - '/etc/v2ray/config.json' || { - colorEcho ${YELLOW} "Failed to create V2Ray configuration file. Please create it manually." - return 1 - } - - colorEcho ${BLUE} "PORT:${PORT}" - colorEcho ${BLUE} "UUID:${UUID}" - fi -} - - -installInitScript(){ - if [[ -n "${SYSTEMCTL_CMD}" ]]; then - if [[ ! -f "/etc/systemd/system/v2ray.service" && ! -f "/lib/systemd/system/v2ray.service" ]]; then - unzip -oj "$1" "$2systemd/v2ray.service" -d '/etc/systemd/system' && \ - systemctl enable v2ray.service - fi - elif [[ -n "${SERVICE_CMD}" ]] && [[ ! -f "/etc/init.d/v2ray" ]]; then - installSoftware 'daemon' && \ - unzip -oj "$1" "$2systemv/v2ray" -d '/etc/init.d' && \ - chmod +x '/etc/init.d/v2ray' && \ - update-rc.d v2ray defaults - fi -} - -Help(){ - cat - 1>& 2 << EOF -./install-release.sh [-h] [-c] [--remove] [-p proxy] [-f] [--version vx.y.z] [-l file] - -h, --help Show help - -p, --proxy To download through a proxy server, use -p socks5://127.0.0.1:1080 or -p http://127.0.0.1:3128 etc - -f, --force Force install - --version Install a particular version, use --version v3.15 - -l, --local Install from a local file - --remove Remove installed V2Ray - -c, --check Check for update -EOF -} - -remove(){ - if [[ -n "${SYSTEMCTL_CMD}" ]] && [[ -f "/etc/systemd/system/v2ray.service" ]];then - if pgrep "v2ray" > /dev/null ; then - stopV2ray - fi - systemctl disable v2ray.service - rm -rf "/usr/bin/v2ray" "/etc/systemd/system/v2ray.service" - if [[ $? -ne 0 ]]; then - colorEcho ${RED} "Failed to remove V2Ray." - return 0 - else - colorEcho ${GREEN} "Removed V2Ray successfully." - colorEcho ${BLUE} "If necessary, please remove configuration file and log file manually." - return 0 - fi - elif [[ -n "${SYSTEMCTL_CMD}" ]] && [[ -f "/lib/systemd/system/v2ray.service" ]];then - if pgrep "v2ray" > /dev/null ; then - stopV2ray - fi - systemctl disable v2ray.service - rm -rf "/usr/bin/v2ray" "/lib/systemd/system/v2ray.service" - if [[ $? -ne 0 ]]; then - colorEcho ${RED} "Failed to remove V2Ray." - return 0 - else - colorEcho ${GREEN} "Removed V2Ray successfully." - colorEcho ${BLUE} "If necessary, please remove configuration file and log file manually." - return 0 - fi - elif [[ -n "${SERVICE_CMD}" ]] && [[ -f "/etc/init.d/v2ray" ]]; then - if pgrep "v2ray" > /dev/null ; then - stopV2ray - fi - rm -rf "/usr/bin/v2ray" "/etc/init.d/v2ray" - if [[ $? -ne 0 ]]; then - colorEcho ${RED} "Failed to remove V2Ray." - return 0 - else - colorEcho ${GREEN} "Removed V2Ray successfully." - colorEcho ${BLUE} "If necessary, please remove configuration file and log file manually." - return 0 - fi - else - colorEcho ${YELLOW} "V2Ray not found." - return 0 - fi -} - -checkUpdate(){ - echo "Checking for update." - VERSION="" - getVersion - RETVAL="$?" - if [[ $RETVAL -eq 1 ]]; then - colorEcho ${BLUE} "Found new version ${NEW_VER} for V2Ray.(Current version:$CUR_VER)" - elif [[ $RETVAL -eq 0 ]]; then - colorEcho ${BLUE} "No new version. Current version is ${NEW_VER}." - elif [[ $RETVAL -eq 2 ]]; then - colorEcho ${YELLOW} "No V2Ray installed." - colorEcho ${BLUE} "The newest version for V2Ray is ${NEW_VER}." - fi - return 0 -} - -main(){ - #helping information - [[ "$HELP" == "1" ]] && Help && return - [[ "$CHECK" == "1" ]] && checkUpdate && return - [[ "$REMOVE" == "1" ]] && remove && return - - local ARCH=$(uname -m) - VDIS="$(archAffix)" - - # extract local file - if [[ $LOCAL_INSTALL -eq 1 ]]; then - colorEcho ${YELLOW} "Installing V2Ray via local file. Please make sure the file is a valid V2Ray package, as we are not able to determine that." - NEW_VER=local - rm -rf /tmp/v2ray - ZIPFILE="$LOCAL" - #FILEVDIS=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f4` - #SYSTEM=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f3` - #if [[ ${SYSTEM} != "linux" ]]; then - # colorEcho ${RED} "The local V2Ray can not be installed in linux." - # return 1 - #elif [[ ${FILEVDIS} != ${VDIS} ]]; then - # colorEcho ${RED} "The local V2Ray can not be installed in ${ARCH} system." - # return 1 - #else - # NEW_VER=`ls /tmp/v2ray |grep v2ray-v |cut -d "-" -f2` - #fi - else - # download via network and extract - installSoftware "curl" || return $? - getVersion - RETVAL="$?" - if [[ $RETVAL == 0 ]] && [[ "$FORCE" != "1" ]]; then - colorEcho ${BLUE} "Latest version ${CUR_VER} is already installed." - if [ -n "${ERROR_IF_UPTODATE}" ]; then - return 10 - fi - return - elif [[ $RETVAL == 3 ]]; then - return 3 - else - colorEcho ${BLUE} "Installing V2Ray ${NEW_VER} on ${ARCH}" - downloadV2Ray || return $? - fi - fi - - local ZIPROOT="$(zipRoot "${ZIPFILE}")" - installSoftware unzip || return $? - - if [ -n "${EXTRACT_ONLY}" ]; then - colorEcho ${BLUE} "Extracting V2Ray package to ${VSRC_ROOT}." - - if unzip -o "${ZIPFILE}" -d ${VSRC_ROOT}; then - colorEcho ${GREEN} "V2Ray extracted to ${VSRC_ROOT%/}${ZIPROOT:+/${ZIPROOT%/}}, and exiting..." - return 0 - else - colorEcho ${RED} "Failed to extract V2Ray." - return 2 - fi - fi - - if pgrep "v2ray" > /dev/null ; then - V2RAY_RUNNING=1 - stopV2ray - fi - installV2Ray "${ZIPFILE}" "${ZIPROOT}" || return $? - installInitScript "${ZIPFILE}" "${ZIPROOT}" || return $? - if [[ ${V2RAY_RUNNING} -eq 1 ]];then - colorEcho ${BLUE} "Restarting V2Ray service." - startV2ray - fi - colorEcho ${GREEN} "V2Ray ${NEW_VER} is installed." - rm -rf /tmp/v2ray - return 0 -} - -main +colorEcho ${RED} "ERROR: This script has been DISCARDED, please switch to fhs-install-v2ray project." +colorEcho ${YELLOW} "HOW TO USE: https://github.com/v2fly/fhs-install-v2ray" +colorEcho ${YELLOW} "TO MIGRATE: https://github.com/v2fly/fhs-install-v2ray/wiki/Migrate-from-the-old-script-to-this" +exit 255 diff --git a/release/mapping.bzl b/release/mapping.bzl index eae4518a42..97a76c7b8f 100644 --- a/release/mapping.bzl +++ b/release/mapping.bzl @@ -1,7 +1,6 @@ -def gen_mappings(os, arch): +def gen_mappings(os, arch, ver): return { - "v2ray_core/release/doc": "doc", "v2ray_core/release/config": "", - "v2ray_core/main/" + os + "/" + arch: "", - "v2ray_core/infra/control/main/" + os + "/" + arch: "", + "v2ray_core/main/" + os + "/" + arch + "/" + ver: "", + "v2ray_core/infra/control/main/" + os + "/" + arch + "/" + ver : "", } diff --git a/release/mutilate/removeVSign.sh b/release/mutilate/removeVSign.sh old mode 100644 new mode 100755 index 525b48e8a4..aec2cbe233 --- a/release/mutilate/removeVSign.sh +++ b/release/mutilate/removeVSign.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash -export VROOT=$( dirname "${BASH_SOURCE[0]}" )/../../ +export VROOT=$(dirname "${BASH_SOURCE[0]}")/../../ rm $VROOT/infra/control/verify.go -sed -i '/VSign/d' $VROOT/go.mod \ No newline at end of file +sed -i '/VSign/d' $VROOT/go.mod diff --git a/release/requestsign.sh b/release/requestsign.sh index feb65f26d0..195a2412ad 100755 --- a/release/requestsign.sh +++ b/release/requestsign.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash RELEASE_DATA=$(curl --data "version=${SIGN_VERSION}" --data "password=${SIGN_SERVICE_PASSWORD}" -X POST "${SIGN_SERIVCE_URL}" ) echo $RELEASE_DATA @@ -25,4 +25,4 @@ function upload() { } curl "https://raw.githubusercontent.com/v2fly/Release/master/v2fly/${SIGN_VERSION}.Release" > Release -upload Release \ No newline at end of file +upload Release diff --git a/release/requestsign_github.sh b/release/requestsign_github.sh index 3a3dd6b42f..f30a40dc49 100755 --- a/release/requestsign_github.sh +++ b/release/requestsign_github.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash export SIGN_VERSION=$(cat $GITHUB_EVENT_PATH| jq -r ".release.tag_name") echo $SIGN_VERSION -$GITHUB_WORKSPACE/release/requestsign.sh \ No newline at end of file +$GITHUB_WORKSPACE/release/requestsign.sh diff --git a/release/tagrelease.sh b/release/tagrelease.sh index b43df5c600..dde6b97930 100755 --- a/release/tagrelease.sh +++ b/release/tagrelease.sh @@ -1,11 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash CONST_refs="refs" TRIGGER_REASON_A=${TRIGGER_REASON:0:${#CONST_refs}} -if [ $TRIGGER_REASON_A != $CONST_refs ] -then +if [ $TRIGGER_REASON_A != $CONST_refs ]; then echo "not a tag: $TRIGGER_REASON_A" exit fi @@ -14,21 +13,18 @@ CONST_refsB="refs/tags/" TRIGGER_REASON_B=${TRIGGER_REASON:0:${#CONST_refsB}} -if [ $TRIGGER_REASON_B != $CONST_refsB ] -then +if [ $TRIGGER_REASON_B != $CONST_refsB ]; then echo "not a tag (B)" exit fi - GITHUB_RELEASE_TAG=${TRIGGER_REASON:${#CONST_refsB}:25} echo ${GITHUB_RELEASE_TAG} - RELEASE_DATA=$(curl -H "Authorization: token ${GITHUB_TOKEN}" -X GET https://api.github.com/repos/v2fly/v2ray-core/releases/tags/${GITHUB_RELEASE_TAG}) echo $RELEASE_DATA -RELEASE_ID=$(echo $RELEASE_DATA| jq ".id") +RELEASE_ID=$(echo $RELEASE_DATA | jq ".id") echo $RELEASE_ID @@ -44,35 +40,37 @@ function uploadfile() { function upload() { FILE=$1 DGST=$1.dgst - openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >> $DGST - openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >> $DGST - openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >> $DGST - openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >> $DGST + openssl dgst -md5 $FILE | sed 's/([^)]*)//g' >>$DGST + openssl dgst -sha1 $FILE | sed 's/([^)]*)//g' >>$DGST + openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST + openssl dgst -sha512 $FILE | sed 's/([^)]*)//g' >>$DGST uploadfile $FILE uploadfile $DGST } -ART_ROOT=$GOPATH/src/v2ray.com/core/bazel-bin/release - +ART_ROOT=${WORKDIR}/bazel-bin/release pushd ${ART_ROOT} { go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen version "${GITHUB_RELEASE_TAG}" go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen project "v2fly" - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-macos.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-macos-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-32.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-arm.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-windows-arm32-v7a.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-32.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm64.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm64-v8a.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v7a.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v6.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-arm32-v5.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips64le.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips.zip - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mipsle.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-mips32le.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-ppc64le.zip + go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-riscv64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-linux-s390x.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-64.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-freebsd-32.zip @@ -80,24 +78,27 @@ pushd ${ART_ROOT} go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-openbsd-32.zip go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen file v2ray-dragonfly-64.zip } >Release.unsigned.unsorted - go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen sort < Release.unsigned.unsorted > Release.unsigned +go run github.com/xiaokangwang/V2BuildAssist/v2buildutil gen sort Release.unsigned popd -upload ${ART_ROOT}/v2ray-macos.zip +upload ${ART_ROOT}/v2ray-macos-64.zip upload ${ART_ROOT}/v2ray-windows-64.zip upload ${ART_ROOT}/v2ray-windows-32.zip -upload ${ART_ROOT}/v2ray-windows-arm.zip +upload ${ART_ROOT}/v2ray-windows-arm32-v7a.zip upload ${ART_ROOT}/v2ray-linux-64.zip upload ${ART_ROOT}/v2ray-linux-32.zip -upload ${ART_ROOT}/v2ray-linux-arm.zip -upload ${ART_ROOT}/v2ray-linux-arm64.zip +upload ${ART_ROOT}/v2ray-linux-arm64-v8a.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v7a.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v6.zip +upload ${ART_ROOT}/v2ray-linux-arm32-v5.zip upload ${ART_ROOT}/v2ray-linux-mips64.zip upload ${ART_ROOT}/v2ray-linux-mips64le.zip -upload ${ART_ROOT}/v2ray-linux-mips.zip -upload ${ART_ROOT}/v2ray-linux-mipsle.zip +upload ${ART_ROOT}/v2ray-linux-mips32.zip +upload ${ART_ROOT}/v2ray-linux-mips32le.zip upload ${ART_ROOT}/v2ray-linux-ppc64.zip upload ${ART_ROOT}/v2ray-linux-ppc64le.zip +upload ${ART_ROOT}/v2ray-linux-riscv64.zip upload ${ART_ROOT}/v2ray-linux-s390x.zip upload ${ART_ROOT}/v2ray-freebsd-64.zip upload ${ART_ROOT}/v2ray-freebsd-32.zip diff --git a/release/updatedat.sh b/release/updatedat.sh deleted file mode 100755 index e6a499751b..0000000000 --- a/release/updatedat.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -pushd "$GOPATH/src/v2ray.com/core/" || return - -# Update geoip.dat -curl -L -o release/config/geoip.dat "https://github.com/v2ray/geoip/raw/release/geoip.dat" -sleep 1 - -# Update geosite.dat -curl -L -o release/config/geosite.dat "https://github.com/v2ray/domain-list-community/raw/release/dlc.dat" -sleep 1 - -popd || return diff --git a/release/user-package.sh b/release/user-package.sh index d0bef1c4a9..938a8b5a1a 100755 --- a/release/user-package.sh +++ b/release/user-package.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# Bash3 Boilerplate. Copyright (c) 2014, kvz.io set -o errexit set -o pipefail @@ -8,85 +7,86 @@ set -o nounset trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; trap ERR; exit 1' ERR -# Set magic variables for current file & dir -__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -__file="${__dir}/$(basename "${BASH_SOURCE[0]}")" -__base="$(basename "${__file}" .sh)" -__root="$(cd "$(dirname "${__dir}")" && pwd)" # <-- change this as it depends on your app - - NOW=$(date '+%Y%m%d-%H%M%S') TMP=$(mktemp -d) SRCDIR=$(pwd) CODENAME="user" BUILDNAME=$NOW -VERSIONTAG=$(git describe --tags) -GOPATH=$(go env GOPATH) -cleanup () { rm -rf "$TMP"; } +cleanup() { rm -rf "$TMP"; } trap cleanup INT TERM ERR get_source() { - echo ">>> Getting v2ray sources ..." - go get -insecure -v -t v2ray.com/core/... - SRCDIR="$GOPATH/src/v2ray.com/core" + echo ">>> Clone v2fly/v2ray-core repo..." + git clone https://github.com/v2fly/v2ray-core.git + cd v2ray-core + go mod download } build_v2() { - pushd "$SRCDIR" - LDFLAGS="-s -w -X v2ray.com/core.codename=${CODENAME} -X v2ray.com/core.build=${BUILDNAME} -X v2ray.com/core.version=${VERSIONTAG}" + if [[ $nosource != 1 ]]; then + cd ${SRCDIR}/v2ray-core + local VERSIONTAG=$(git describe --abbrev=0 --tags) + else + echo ">>> Use current directory as WORKDIR" + local VERSIONTAG=$(git describe --abbrev=0 --tags) + fi + + LDFLAGS="-s -w -buildid= -X v2ray.codename=${CODENAME} -X v2ray.build=${BUILDNAME} -X v2ray.version=${VERSIONTAG}" echo ">>> Compile v2ray ..." env CGO_ENABLED=0 go build -o "$TMP"/v2ray"${EXESUFFIX}" -ldflags "$LDFLAGS" ./main - if [[ $GOOS == "windows" ]];then - env CGO_ENABLED=0 go build -o "$TMP"/wv2ray"${EXESUFFIX}" -ldflags "-H windowsgui $LDFLAGS" ./main + if [[ $GOOS == "windows" ]]; then + env CGO_ENABLED=0 go build -o "$TMP"/wv2ray"${EXESUFFIX}" -ldflags "-H windowsgui $LDFLAGS" ./main fi echo ">>> Compile v2ctl ..." env CGO_ENABLED=0 go build -o "$TMP"/v2ctl"${EXESUFFIX}" -tags confonly -ldflags "$LDFLAGS" ./infra/control/main - popd } build_dat() { - echo ">>> Downloading newest geoip ..." - curl -s -L -o "$TMP"/geoip.dat "https://github.com/v2ray/geoip/raw/release/geoip.dat" + echo ">>> Download latest geoip..." + curl -s -L -o "$TMP"/geoip.dat "https://github.com/v2fly/geoip/raw/release/geoip.dat" - echo ">>> Downloading newest geosite ..." - curl -s -L -o "$TMP"/geosite.dat "https://github.com/v2ray/domain-list-community/raw/release/dlc.dat" + echo ">>> Download latest geosite..." + curl -s -L -o "$TMP"/geosite.dat "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat" } copyconf() { echo ">>> Copying config..." - pushd "$SRCDIR"/release/config - tar c --exclude "*.dat" . | tar x -C "$TMP" + cd ./release/config + if [[ $GOOS == "linux" ]]; then + tar c --exclude "*.dat" . | tar x -C "$TMP" + else + tar c --exclude "*.dat" --exclude "systemd/**" . | tar x -C "$TMP" + fi } packzip() { echo ">>> Generating zip package" - pushd "$TMP" - local PKG=${__dir}/v2ray-custom-${GOARCH}-${GOOS}-${PKGSUFFIX}${NOW}.zip + cd "$TMP" + local PKG=${SRCDIR}/v2ray-custom-${GOARCH}-${GOOS}-${PKGSUFFIX}${NOW}.zip zip -r "$PKG" . - echo ">>> Generated: $(basename "$PKG")" + echo ">>> Generated: $(basename "$PKG") at $(dirname "$PKG")" } packtgz() { echo ">>> Generating tgz package" - pushd "$TMP" - local PKG=${__dir}/v2ray-custom-${GOARCH}-${GOOS}-${PKGSUFFIX}${NOW}.tar.gz + cd "$TMP" + local PKG=${SRCDIR}/v2ray-custom-${GOARCH}-${GOOS}-${PKGSUFFIX}${NOW}.tar.gz tar cvfz "$PKG" . - echo ">>> Generated: $(basename "$PKG")" + echo ">>> Generated: $(basename "$PKG") at $(dirname "$PKG")" } packtgzAbPath() { local ABPATH="$1" echo ">>> Generating tgz package at $ABPATH" - pushd "$TMP" + cd "$TMP" tar cvfz "$ABPATH" . echo ">>> Generated: $ABPATH" } - pkg=zip nosource=0 nodat=0 @@ -97,21 +97,15 @@ EXESUFFIX= PKGSUFFIX= for arg in "$@"; do -case $arg in - arm*) + case $arg in + 386 | arm* | mips* | ppc64* | riscv64 | s390x) GOARCH=$arg ;; - mips*) - GOARCH=$arg - ;; - 386) - GOARCH=386 - ;; windows) - GOOS=windows + GOOS=$arg EXESUFFIX=.exe ;; - darwin) + darwin | dragonfly | freebsd | openbsd) GOOS=$arg ;; nodat) @@ -136,11 +130,11 @@ case $arg in buildname=*) BUILDNAME=${arg##buildname=} ;; -esac + esac done if [[ $nosource != 1 ]]; then - get_source + get_source fi export GOOS GOARCH @@ -149,21 +143,19 @@ echo "PKG ARGS: pkg=${pkg}" build_v2 if [[ $nodat != 1 ]]; then - build_dat + build_dat fi if [[ $noconf != 1 ]]; then - copyconf + copyconf fi if [[ $pkg == "zip" ]]; then - packzip + packzip elif [[ $pkg == "tgz" ]]; then - packtgz + packtgz else packtgzAbPath "$pkg" fi - cleanup - diff --git a/release/verify/official_release.pub b/release/verify/official_release.pub deleted file mode 100644 index f2df721932..0000000000 --- a/release/verify/official_release.pub +++ /dev/null @@ -1,2 +0,0 @@ -untrusted comment: V2Fly Signing Key -RWTe6SReSmJUeqoA8cq1MxX7ycL06DAMAJcAgQ8dCN3kFtnWBHYDpTnx diff --git a/testing/scenarios/shadowsocks_test.go b/testing/scenarios/shadowsocks_test.go index 21fd94cf3f..368a67d472 100644 --- a/testing/scenarios/shadowsocks_test.go +++ b/testing/scenarios/shadowsocks_test.go @@ -35,7 +35,6 @@ func TestShadowsocksAES256TCP(t *testing.T) { account := serial.ToTypedMessage(&shadowsocks.Account{ Password: "shadowsocks-password", CipherType: shadowsocks.CipherType_AES_256_CFB, - Ota: shadowsocks.Account_Enabled, }) serverPort := tcp.PickPort() @@ -134,7 +133,6 @@ func TestShadowsocksAES128UDP(t *testing.T) { account := serial.ToTypedMessage(&shadowsocks.Account{ Password: "shadowsocks-password", CipherType: shadowsocks.CipherType_AES_128_CFB, - Ota: shadowsocks.Account_Enabled, }) serverPort := tcp.PickPort() @@ -261,7 +259,6 @@ func TestShadowsocksChacha20TCP(t *testing.T) { account := serial.ToTypedMessage(&shadowsocks.Account{ Password: "shadowsocks-password", CipherType: shadowsocks.CipherType_CHACHA20_IETF, - Ota: shadowsocks.Account_Enabled, }) serverPort := tcp.PickPort() @@ -749,7 +746,6 @@ func TestShadowsocksNone(t *testing.T) { account := serial.ToTypedMessage(&shadowsocks.Account{ Password: "shadowsocks-password", CipherType: shadowsocks.CipherType_NONE, - Ota: shadowsocks.Account_Enabled, }) serverPort := tcp.PickPort() diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index 8131213935..5f90cca7b1 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -928,8 +928,8 @@ func TestVMessKCPLarge(t *testing.T) { t.Error(err) } - defer func(){ - <-time.After(5*time.Second) + defer func() { + <-time.After(5 * time.Second) CloseAllServers(servers) }() } @@ -1178,8 +1178,8 @@ func TestVMessGCMMuxUDP(t *testing.T) { time.Sleep(time.Second) } - defer func(){ - <-time.After(5*time.Second) + defer func() { + <-time.After(5 * time.Second) CloseAllServers(servers) }() } diff --git a/transport/config.pb.go b/transport/config.pb.go index 5aa8551630..e75a907094 100644 --- a/transport/config.pb.go +++ b/transport/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/config.proto + package transport import ( @@ -20,8 +26,8 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -// Global transport settings. This affects all type of connections that go through V2Ray. -// Deprecated. Use each settings in StreamConfig. +// Global transport settings. This affects all type of connections that go +// through V2Ray. Deprecated. Use each settings in StreamConfig. type Config struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -33,7 +39,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_config_proto_msgTypes[0] + mi := &file_transport_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +52,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_config_proto_msgTypes[0] + mi := &file_transport_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -59,7 +65,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_config_proto_rawDescGZIP(), []int{0} + return file_transport_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetTransportSettings() []*internet.TransportConfig { @@ -69,47 +75,46 @@ func (x *Config) GetTransportSettings() []*internet.TransportConfig { return nil } -var File_v2ray_com_core_transport_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_config_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x1a, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x67, 0x0a, - 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5d, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x42, 0x3e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x50, 0x01, 0x5a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0xaa, - 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_transport_config_proto protoreflect.FileDescriptor + +var file_transport_config_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, + 0x67, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5d, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x42, 0x4d, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x50, 0x01, 0x5a, 0x18, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0xaa, 0x02, 0x14, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_v2ray_com_core_transport_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_config_proto_rawDescData = file_v2ray_com_core_transport_config_proto_rawDesc + file_transport_config_proto_rawDescOnce sync.Once + file_transport_config_proto_rawDescData = file_transport_config_proto_rawDesc ) -func file_v2ray_com_core_transport_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_config_proto_rawDescData) +func file_transport_config_proto_rawDescGZIP() []byte { + file_transport_config_proto_rawDescOnce.Do(func() { + file_transport_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_config_proto_rawDescData) }) - return file_v2ray_com_core_transport_config_proto_rawDescData + return file_transport_config_proto_rawDescData } -var file_v2ray_com_core_transport_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_config_proto_goTypes = []interface{}{ +var file_transport_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.Config (*internet.TransportConfig)(nil), // 1: v2ray.core.transport.internet.TransportConfig } -var file_v2ray_com_core_transport_config_proto_depIdxs = []int32{ +var file_transport_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.transport.Config.transport_settings:type_name -> v2ray.core.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 @@ -118,13 +123,13 @@ var file_v2ray_com_core_transport_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_config_proto_init() } -func file_v2ray_com_core_transport_config_proto_init() { - if File_v2ray_com_core_transport_config_proto != nil { +func init() { file_transport_config_proto_init() } +func file_transport_config_proto_init() { + if File_transport_config_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_v2ray_com_core_transport_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_transport_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -141,18 +146,18 @@ func file_v2ray_com_core_transport_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_config_proto_rawDesc, + RawDescriptor: file_transport_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_config_proto_msgTypes, + GoTypes: file_transport_config_proto_goTypes, + DependencyIndexes: file_transport_config_proto_depIdxs, + MessageInfos: file_transport_config_proto_msgTypes, }.Build() - File_v2ray_com_core_transport_config_proto = out.File - file_v2ray_com_core_transport_config_proto_rawDesc = nil - file_v2ray_com_core_transport_config_proto_goTypes = nil - file_v2ray_com_core_transport_config_proto_depIdxs = nil + File_transport_config_proto = out.File + file_transport_config_proto_rawDesc = nil + file_transport_config_proto_goTypes = nil + file_transport_config_proto_depIdxs = nil } diff --git a/transport/config.proto b/transport/config.proto index 8510ff32aa..e0c059a921 100644 --- a/transport/config.proto +++ b/transport/config.proto @@ -2,14 +2,14 @@ syntax = "proto3"; package v2ray.core.transport; option csharp_namespace = "V2Ray.Core.Transport"; -option go_package = "transport"; +option go_package = "v2ray.com/core/transport"; option java_package = "com.v2ray.core.transport"; option java_multiple_files = true; -import "v2ray.com/core/transport/internet/config.proto"; +import "transport/internet/config.proto"; -// Global transport settings. This affects all type of connections that go through V2Ray. -// Deprecated. Use each settings in StreamConfig. +// Global transport settings. This affects all type of connections that go +// through V2Ray. Deprecated. Use each settings in StreamConfig. message Config { repeated v2ray.core.transport.internet.TransportConfig transport_settings = 1; } diff --git a/transport/internet/config.pb.go b/transport/internet/config.pb.go index da67de3b6f..362a7364e8 100644 --- a/transport/internet/config.pb.go +++ b/transport/internet/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/config.proto + package internet import ( @@ -62,11 +68,11 @@ func (x TransportProtocol) String() string { } func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_transport_internet_config_proto_enumTypes[0].Descriptor() + return file_transport_internet_config_proto_enumTypes[0].Descriptor() } func (TransportProtocol) Type() protoreflect.EnumType { - return &file_v2ray_com_core_transport_internet_config_proto_enumTypes[0] + return &file_transport_internet_config_proto_enumTypes[0] } func (x TransportProtocol) Number() protoreflect.EnumNumber { @@ -75,7 +81,7 @@ func (x TransportProtocol) Number() protoreflect.EnumNumber { // Deprecated: Use TransportProtocol.Descriptor instead. func (TransportProtocol) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_config_proto_rawDescGZIP(), []int{0} } type SocketConfig_TCPFastOpenState int32 @@ -114,11 +120,11 @@ func (x SocketConfig_TCPFastOpenState) String() string { } func (SocketConfig_TCPFastOpenState) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_transport_internet_config_proto_enumTypes[1].Descriptor() + return file_transport_internet_config_proto_enumTypes[1].Descriptor() } func (SocketConfig_TCPFastOpenState) Type() protoreflect.EnumType { - return &file_v2ray_com_core_transport_internet_config_proto_enumTypes[1] + return &file_transport_internet_config_proto_enumTypes[1] } func (x SocketConfig_TCPFastOpenState) Number() protoreflect.EnumNumber { @@ -127,7 +133,7 @@ func (x SocketConfig_TCPFastOpenState) Number() protoreflect.EnumNumber { // Deprecated: Use SocketConfig_TCPFastOpenState.Descriptor instead. func (SocketConfig_TCPFastOpenState) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{3, 0} + return file_transport_internet_config_proto_rawDescGZIP(), []int{3, 0} } type SocketConfig_TProxyMode int32 @@ -166,11 +172,11 @@ func (x SocketConfig_TProxyMode) String() string { } func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_transport_internet_config_proto_enumTypes[2].Descriptor() + return file_transport_internet_config_proto_enumTypes[2].Descriptor() } func (SocketConfig_TProxyMode) Type() protoreflect.EnumType { - return &file_v2ray_com_core_transport_internet_config_proto_enumTypes[2] + return &file_transport_internet_config_proto_enumTypes[2] } func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber { @@ -179,7 +185,7 @@ func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber { // Deprecated: Use SocketConfig_TProxyMode.Descriptor instead. func (SocketConfig_TProxyMode) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{3, 1} + return file_transport_internet_config_proto_rawDescGZIP(), []int{3, 1} } type TransportConfig struct { @@ -199,7 +205,7 @@ type TransportConfig struct { func (x *TransportConfig) Reset() { *x = TransportConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[0] + mi := &file_transport_internet_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -212,7 +218,7 @@ func (x *TransportConfig) String() string { func (*TransportConfig) ProtoMessage() {} func (x *TransportConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[0] + mi := &file_transport_internet_config_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -225,7 +231,7 @@ func (x *TransportConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use TransportConfig.ProtoReflect.Descriptor instead. func (*TransportConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_config_proto_rawDescGZIP(), []int{0} } func (x *TransportConfig) GetProtocol() TransportProtocol { @@ -271,7 +277,7 @@ type StreamConfig struct { func (x *StreamConfig) Reset() { *x = StreamConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[1] + mi := &file_transport_internet_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -284,7 +290,7 @@ func (x *StreamConfig) String() string { func (*StreamConfig) ProtoMessage() {} func (x *StreamConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[1] + mi := &file_transport_internet_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -297,7 +303,7 @@ func (x *StreamConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamConfig.ProtoReflect.Descriptor instead. func (*StreamConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_config_proto_rawDescGZIP(), []int{1} } // Deprecated: Do not use. @@ -354,7 +360,7 @@ type ProxyConfig struct { func (x *ProxyConfig) Reset() { *x = ProxyConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[2] + mi := &file_transport_internet_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -367,7 +373,7 @@ func (x *ProxyConfig) String() string { func (*ProxyConfig) ProtoMessage() {} func (x *ProxyConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[2] + mi := &file_transport_internet_config_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -380,7 +386,7 @@ func (x *ProxyConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ProxyConfig.ProtoReflect.Descriptor instead. func (*ProxyConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{2} + return file_transport_internet_config_proto_rawDescGZIP(), []int{2} } func (x *ProxyConfig) GetTag() string { @@ -402,8 +408,8 @@ type SocketConfig struct { Tfo SocketConfig_TCPFastOpenState `protobuf:"varint,2,opt,name=tfo,proto3,enum=v2ray.core.transport.internet.SocketConfig_TCPFastOpenState" json:"tfo,omitempty"` // TProxy is for enabling TProxy socket option. Tproxy SocketConfig_TProxyMode `protobuf:"varint,3,opt,name=tproxy,proto3,enum=v2ray.core.transport.internet.SocketConfig_TProxyMode" json:"tproxy,omitempty"` - // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket option. - // This option is for UDP only. + // 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"` @@ -412,7 +418,7 @@ type SocketConfig struct { func (x *SocketConfig) Reset() { *x = SocketConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[3] + mi := &file_transport_internet_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -425,7 +431,7 @@ func (x *SocketConfig) String() string { func (*SocketConfig) ProtoMessage() {} func (x *SocketConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_config_proto_msgTypes[3] + mi := &file_transport_internet_config_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -438,7 +444,7 @@ func (x *SocketConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use SocketConfig.ProtoReflect.Descriptor instead. func (*SocketConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP(), []int{3} + return file_transport_internet_config_proto_rawDescGZIP(), []int{3} } func (x *SocketConfig) GetMark() int32 { @@ -483,115 +489,115 @@ func (x *SocketConfig) GetBindPort() uint32 { return 0 } -var File_v2ray_com_core_transport_internet_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_config_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 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, 0x1d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x1a, - 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 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, 0xc8, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x42, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xb4, 0x03, 0x0a, - 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x50, 0x0a, - 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5d, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, +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, 0x1d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x54, 0x0a, - 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x1f, 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, 0x22, 0xad, 0x03, 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, 0x4e, 0x0a, 0x03, 0x74, 0x66, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x03, 0x74, 0x66, 0x6f, 0x12, 0x4e, 0x0a, 0x06, 0x74, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x76, 0x32, 0x72, 0x61, + 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, 0xc8, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x22, 0x35, 0x0a, 0x10, - 0x54, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x10, 0x02, 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, 0x5a, 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, - 0x42, 0x4f, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0xaa, 0x02, 0x1d, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, + 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, 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, 0x42, 0x0a, 0x08, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xb4, + 0x03, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, + 0x50, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x30, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5d, 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, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x53, 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, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, + 0x54, 0x0a, 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x1f, 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, 0x22, 0xad, 0x03, 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, 0x4e, 0x0a, 0x03, 0x74, + 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, + 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x03, 0x74, 0x66, 0x6f, 0x12, 0x4e, 0x0a, 0x06, 0x74, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x22, 0x35, + 0x0a, 0x10, 0x54, 0x43, 0x50, 0x46, 0x61, 0x73, 0x74, 0x4f, 0x70, 0x65, 0x6e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x10, 0x02, 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, 0x5a, 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, 0x42, 0x68, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x1d, 0x56, + 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_config_proto_rawDescData = file_v2ray_com_core_transport_internet_config_proto_rawDesc + file_transport_internet_config_proto_rawDescOnce sync.Once + file_transport_internet_config_proto_rawDescData = file_transport_internet_config_proto_rawDesc ) -func file_v2ray_com_core_transport_internet_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_config_proto_rawDescData + return file_transport_internet_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_config_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_v2ray_com_core_transport_internet_config_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_v2ray_com_core_transport_internet_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.TransportProtocol (SocketConfig_TCPFastOpenState)(0), // 1: v2ray.core.transport.internet.SocketConfig.TCPFastOpenState (SocketConfig_TProxyMode)(0), // 2: v2ray.core.transport.internet.SocketConfig.TProxyMode @@ -601,7 +607,7 @@ var file_v2ray_com_core_transport_internet_config_proto_goTypes = []interface{}{ (*SocketConfig)(nil), // 6: v2ray.core.transport.internet.SocketConfig (*serial.TypedMessage)(nil), // 7: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_transport_internet_config_proto_depIdxs = []int32{ +var file_transport_internet_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.transport.internet.TransportConfig.protocol:type_name -> v2ray.core.transport.internet.TransportProtocol 7, // 1: v2ray.core.transport.internet.TransportConfig.settings:type_name -> v2ray.core.common.serial.TypedMessage 0, // 2: v2ray.core.transport.internet.StreamConfig.protocol:type_name -> v2ray.core.transport.internet.TransportProtocol @@ -617,13 +623,13 @@ var file_v2ray_com_core_transport_internet_config_proto_depIdxs = []int32{ 0, // [0:8] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_config_proto_init() } -func file_v2ray_com_core_transport_internet_config_proto_init() { - if File_v2ray_com_core_transport_internet_config_proto != nil { +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_v2ray_com_core_transport_internet_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TransportConfig); i { case 0: return &v.state @@ -635,7 +641,7 @@ func file_v2ray_com_core_transport_internet_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StreamConfig); i { case 0: return &v.state @@ -647,7 +653,7 @@ func file_v2ray_com_core_transport_internet_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProxyConfig); i { case 0: return &v.state @@ -659,7 +665,7 @@ func file_v2ray_com_core_transport_internet_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SocketConfig); i { case 0: return &v.state @@ -676,19 +682,19 @@ func file_v2ray_com_core_transport_internet_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_config_proto_rawDesc, + RawDescriptor: file_transport_internet_config_proto_rawDesc, NumEnums: 3, NumMessages: 4, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_transport_internet_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_transport_internet_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_config_proto = out.File - file_v2ray_com_core_transport_internet_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_config_proto_depIdxs = nil + 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/transport/internet/config.proto b/transport/internet/config.proto index d650c35a02..f3b96a94e8 100644 --- a/transport/internet/config.proto +++ b/transport/internet/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.transport.internet; option csharp_namespace = "V2Ray.Core.Transport.Internet"; -option go_package = "internet"; +option go_package = "v2ray.com/core/transport/internet"; option java_package = "com.v2ray.core.transport.internet"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; enum TransportProtocol { TCP = 0; @@ -40,7 +40,7 @@ message StreamConfig { // Type of security. Must be a message name of the settings proto. string security_type = 3; - + // Settings for transport security. For now the only choice is TLS. repeated v2ray.core.common.serial.TypedMessage security_settings = 4; @@ -80,8 +80,8 @@ message SocketConfig { // TProxy is for enabling TProxy socket option. TProxyMode tproxy = 3; - // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket option. - // This option is for UDP only. + // ReceiveOriginalDestAddress is for enabling IP_RECVORIGDSTADDR socket + // option. This option is for UDP only. bool receive_original_dest_address = 4; bytes bind_address = 5; diff --git a/transport/internet/domainsocket/config.go b/transport/internet/domainsocket/config.go index 09cfabb260..652162126b 100644 --- a/transport/internet/domainsocket/config.go +++ b/transport/internet/domainsocket/config.go @@ -9,14 +9,23 @@ import ( ) const protocolName = "domainsocket" +const sizeofSunPath = 108 func (c *Config) GetUnixAddr() (*net.UnixAddr, error) { path := c.Path if path == "" { return nil, newError("empty domain socket path") } - if c.Abstract && path[0] != '\x00' { - path = "\x00" + path + if c.Abstract && path[0] != '@' { + path = "@" + path + } + if c.Abstract && c.Padding { + raw := []byte(path) + addr := make([]byte, sizeofSunPath) + for i, c := range raw { + addr[i] = c + } + path = string(addr) } return &net.UnixAddr{ Name: path, diff --git a/transport/internet/domainsocket/config.pb.go b/transport/internet/domainsocket/config.pb.go index bf4dde13c0..76c61b15cb 100644 --- a/transport/internet/domainsocket/config.pb.go +++ b/transport/internet/domainsocket/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/domainsocket/config.proto + package domainsocket import ( @@ -24,17 +30,23 @@ type Config struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Path of the domain socket. This overrides the IP/Port parameter from upstream caller. + // 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. + // 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"` + AcceptProxyProtocol bool `protobuf:"varint,4,opt,name=acceptProxyProtocol,proto3" json:"acceptProxyProtocol,omitempty"` } func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_domainsocket_config_proto_msgTypes[0] + mi := &file_transport_internet_domainsocket_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +59,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_domainsocket_config_proto_msgTypes[0] + 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 { @@ -60,7 +72,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_domainsocket_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetPath() string { @@ -77,46 +89,66 @@ func (x *Config) GetAbstract() bool { return false } -var File_v2ray_com_core_transport_internet_domainsocket_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDesc = []byte{ - 0x0a, 0x3b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x38, 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, 0x42, 0x6d, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x0c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x72, 0x65, 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, +func (x *Config) GetPadding() bool { + if x != nil { + return x.Padding + } + return false +} + +func (x *Config) GetAcceptProxyProtocol() bool { + if x != nil { + return x.AcceptProxyProtocol + } + 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, 0x2a, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x84, 0x01, 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, 0x12, + 0x30, 0x0a, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 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, 0x42, 0x8f, 0x01, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 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, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescData = file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDescData + return file_transport_internet_domainsocket_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_domainsocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_domainsocket_config_proto_goTypes = []interface{}{ +var file_transport_internet_domainsocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_internet_domainsocket_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.internet.domainsocket.Config } -var file_v2ray_com_core_transport_internet_domainsocket_config_proto_depIdxs = []int32{ +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 @@ -124,13 +156,13 @@ var file_v2ray_com_core_transport_internet_domainsocket_config_proto_depIdxs = [ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_domainsocket_config_proto_init() } -func file_v2ray_com_core_transport_internet_domainsocket_config_proto_init() { - if File_v2ray_com_core_transport_internet_domainsocket_config_proto != nil { +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_v2ray_com_core_transport_internet_domainsocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -147,18 +179,18 @@ func file_v2ray_com_core_transport_internet_domainsocket_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDesc, + RawDescriptor: file_transport_internet_domainsocket_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_domainsocket_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_domainsocket_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_domainsocket_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_domainsocket_config_proto = out.File - file_v2ray_com_core_transport_internet_domainsocket_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_domainsocket_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_domainsocket_config_proto_depIdxs = nil + 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/transport/internet/domainsocket/config.proto b/transport/internet/domainsocket/config.proto index 161550ec08..5c1086d0dd 100644 --- a/transport/internet/domainsocket/config.proto +++ b/transport/internet/domainsocket/config.proto @@ -2,14 +2,20 @@ syntax = "proto3"; package v2ray.core.transport.internet.domainsocket; option csharp_namespace = "V2Ray.Core.Transport.Internet.DomainSocket"; -option go_package = "domainsocket"; +option go_package = "v2ray.com/core/transport/internet/domainsocket"; option java_package = "com.v2ray.core.transport.internet.domainsocket"; option java_multiple_files = true; message Config { - // Path of the domain socket. This overrides the IP/Port parameter from upstream caller. - string path = 1; - // 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. - bool abstract = 2; + // Path of the domain socket. This overrides the IP/Port parameter from + // upstream caller. + string path = 1; + // 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. + bool abstract = 2; + // Some apps, eg. haproxy, use the full length of sockaddr_un.sun_path to + // connect(2) or bind(2) when using abstract UDS. + bool padding = 3; + bool acceptProxyProtocol = 4; } diff --git a/transport/internet/domainsocket/dial.go b/transport/internet/domainsocket/dial.go index bd6591de3b..d3a43f48ac 100644 --- a/transport/internet/domainsocket/dial.go +++ b/transport/internet/domainsocket/dial.go @@ -11,6 +11,7 @@ import ( "v2ray.com/core/common/net" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" ) func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) { @@ -27,6 +28,8 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { return tls.Client(conn, config.GetTLSConfig(tls.WithDestination(dest))), nil + } else if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + return xtls.Client(conn, config.GetXTLSConfig(xtls.WithDestination(dest))), nil } return conn, nil diff --git a/transport/internet/domainsocket/errgen.go b/transport/internet/domainsocket/errgen.go index d4501e8301..124b932bfe 100644 --- a/transport/internet/domainsocket/errgen.go +++ b/transport/internet/domainsocket/errgen.go @@ -1,3 +1,3 @@ package domainsocket -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/domainsocket/listener.go b/transport/internet/domainsocket/listener.go index 587fecd9ed..607dbbd09c 100644 --- a/transport/internet/domainsocket/listener.go +++ b/transport/internet/domainsocket/listener.go @@ -10,21 +10,26 @@ import ( "os" "strings" + "github.com/pires/go-proxyproto" + goxtls "github.com/xtls/go" "golang.org/x/sys/unix" - + "v2ray.com/core/common" "v2ray.com/core/common/net" + "v2ray.com/core/common/session" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" ) type Listener struct { - addr *net.UnixAddr - ln net.Listener - tlsConfig *gotls.Config - config *Config - addConn internet.ConnHandler - locker *fileLocker + addr *net.UnixAddr + ln net.Listener + tlsConfig *gotls.Config + xtlsConfig *goxtls.Config + config *Config + addConn internet.ConnHandler + locker *fileLocker } func Listen(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error) { @@ -39,11 +44,23 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti return nil, newError("failed to listen domain socket").Base(err).AtWarning() } - ln := &Listener{ - addr: addr, - ln: unixListener, - config: settings, - addConn: handler, + var ln *Listener + if settings.AcceptProxyProtocol { + policyFunc := func(upstream net.Addr) (proxyproto.Policy, error) { return proxyproto.REQUIRE, nil } + ln = &Listener{ + addr: addr, + ln: &proxyproto.Listener{Listener: unixListener, Policy: policyFunc}, + config: settings, + addConn: handler, + } + newError("accepting PROXY protocol").AtWarning().WriteToLog(session.ExportIDToError(ctx)) + } else { + ln = &Listener{ + addr: addr, + ln: unixListener, + config: settings, + addConn: handler, + } } if !settings.Abstract { @@ -59,6 +76,9 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { ln.tlsConfig = config.GetTLSConfig() } + if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + ln.xtlsConfig = config.GetXTLSConfig() + } go ln.run() @@ -89,6 +109,8 @@ func (ln *Listener) run() { if ln.tlsConfig != nil { conn = tls.Server(conn, ln.tlsConfig) + } else if ln.xtlsConfig != nil { + conn = xtls.Server(conn, ln.xtlsConfig) } ln.addConn(internet.Connection(conn)) diff --git a/transport/internet/headers/http/config.pb.go b/transport/internet/headers/http/config.pb.go index 5891b89436..ec998d0132 100644 --- a/transport/internet/headers/http/config.pb.go +++ b/transport/internet/headers/http/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/http/config.proto + package http import ( @@ -26,14 +32,15 @@ type Header struct { // "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. + // 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_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -46,7 +53,7 @@ func (x *Header) String() string { func (*Header) ProtoMessage() {} func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[0] + 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 { @@ -59,7 +66,7 @@ func (x *Header) ProtoReflect() protoreflect.Message { // Deprecated: Use Header.ProtoReflect.Descriptor instead. func (*Header) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{0} } func (x *Header) GetName() string { @@ -88,7 +95,7 @@ type Version struct { func (x *Version) Reset() { *x = Version{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[1] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -101,7 +108,7 @@ func (x *Version) String() string { func (*Version) ProtoMessage() {} func (x *Version) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[1] + 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 { @@ -114,7 +121,7 @@ func (x *Version) ProtoReflect() protoreflect.Message { // Deprecated: Use Version.ProtoReflect.Descriptor instead. func (*Version) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{1} } func (x *Version) GetValue() string { @@ -136,7 +143,7 @@ type Method struct { func (x *Method) Reset() { *x = Method{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[2] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -149,7 +156,7 @@ func (x *Method) String() string { func (*Method) ProtoMessage() {} func (x *Method) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[2] + 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 { @@ -162,7 +169,7 @@ func (x *Method) ProtoReflect() protoreflect.Message { // Deprecated: Use Method.ProtoReflect.Descriptor instead. func (*Method) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{2} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{2} } func (x *Method) GetValue() string { @@ -189,7 +196,7 @@ type RequestConfig struct { func (x *RequestConfig) Reset() { *x = RequestConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[3] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -202,7 +209,7 @@ func (x *RequestConfig) String() string { func (*RequestConfig) ProtoMessage() {} func (x *RequestConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[3] + 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 { @@ -215,7 +222,7 @@ func (x *RequestConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestConfig.ProtoReflect.Descriptor instead. func (*RequestConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{3} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{3} } func (x *RequestConfig) GetVersion() *Version { @@ -260,7 +267,7 @@ type Status struct { func (x *Status) Reset() { *x = Status{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[4] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -273,7 +280,7 @@ func (x *Status) String() string { func (*Status) ProtoMessage() {} func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[4] + 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 { @@ -286,7 +293,7 @@ func (x *Status) ProtoReflect() protoreflect.Message { // Deprecated: Use Status.ProtoReflect.Descriptor instead. func (*Status) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{4} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{4} } func (x *Status) GetCode() string { @@ -316,7 +323,7 @@ type ResponseConfig struct { func (x *ResponseConfig) Reset() { *x = ResponseConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[5] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -329,7 +336,7 @@ func (x *ResponseConfig) String() string { func (*ResponseConfig) ProtoMessage() {} func (x *ResponseConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[5] + 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 { @@ -342,7 +349,7 @@ func (x *ResponseConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ResponseConfig.ProtoReflect.Descriptor instead. func (*ResponseConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{5} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{5} } func (x *ResponseConfig) GetVersion() *Version { @@ -371,16 +378,18 @@ type Config struct { 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. + // 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. + // 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_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[6] + mi := &file_transport_internet_headers_http_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -393,7 +402,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[6] + 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 { @@ -406,7 +415,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{6} + return file_transport_internet_headers_http_config_proto_rawDescGZIP(), []int{6} } func (x *Config) GetRequest() *RequestConfig { @@ -423,93 +432,95 @@ func (x *Config) GetResponse() *ResponseConfig { return nil } -var File_v2ray_com_core_transport_internet_headers_http_config_proto protoreflect.FileDescriptor +var File_transport_internet_headers_http_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDesc = []byte{ - 0x0a, 0x3b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x88, - 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x4d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x4a, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, +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, 0x2a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0xf7, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x4a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, - 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xb5, 0x01, 0x0a, 0x06, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x53, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x56, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x65, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 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, + 0x88, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xf7, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x4a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, + 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0xb5, 0x01, 0x0a, 0x06, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x53, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x04, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x2a, 0x56, 0x32, - 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, + 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, 0x56, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x8f, 0x01, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 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, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_http_config_proto_rawDescData + return file_transport_internet_headers_http_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_v2ray_com_core_transport_internet_headers_http_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.http.Header (*Version)(nil), // 1: v2ray.core.transport.internet.headers.http.Version (*Method)(nil), // 2: v2ray.core.transport.internet.headers.http.Method @@ -518,7 +529,7 @@ var file_v2ray_com_core_transport_internet_headers_http_config_proto_goTypes = [ (*ResponseConfig)(nil), // 5: v2ray.core.transport.internet.headers.http.ResponseConfig (*Config)(nil), // 6: v2ray.core.transport.internet.headers.http.Config } -var file_v2ray_com_core_transport_internet_headers_http_config_proto_depIdxs = []int32{ +var file_transport_internet_headers_http_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.transport.internet.headers.http.RequestConfig.version:type_name -> v2ray.core.transport.internet.headers.http.Version 2, // 1: v2ray.core.transport.internet.headers.http.RequestConfig.method:type_name -> v2ray.core.transport.internet.headers.http.Method 0, // 2: v2ray.core.transport.internet.headers.http.RequestConfig.header:type_name -> v2ray.core.transport.internet.headers.http.Header @@ -534,13 +545,13 @@ var file_v2ray_com_core_transport_internet_headers_http_config_proto_depIdxs = [ 0, // [0:8] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_http_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_http_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -552,7 +563,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -564,7 +575,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -576,7 +587,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -588,7 +599,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -600,7 +611,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -612,7 +623,7 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -629,18 +640,18 @@ func file_v2ray_com_core_transport_internet_headers_http_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_http_config_proto_rawDesc, NumEnums: 0, NumMessages: 7, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_http_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_http_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_http_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_http_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_http_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_http_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_http_config_proto_depIdxs = nil + 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/transport/internet/headers/http/config.proto b/transport/internet/headers/http/config.proto index df033b141f..f9e881e66d 100644 --- a/transport/internet/headers/http/config.proto +++ b/transport/internet/headers/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.http; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Http"; -option go_package = "http"; +option go_package = "v2ray.com/core/transport/internet/headers/http"; option java_package = "com.v2ray.core.transport.internet.headers.http"; option java_multiple_files = true; @@ -10,7 +10,8 @@ message Header { // "Accept", "Cookie", etc string name = 1; - // Each entry must be valid in one piece. Random entry will be chosen if multiple entries present. + // Each entry must be valid in one piece. Random entry will be chosen if + // multiple entries present. repeated string value = 2; } @@ -54,9 +55,11 @@ message ResponseConfig { } message Config { - // Settings for authenticating requests. If not set, client side will not send authenication header, and server side will bypass authentication. + // Settings for authenticating requests. If not set, client side will not send + // authenication header, and server side will bypass authentication. RequestConfig request = 1; - // Settings for authenticating responses. If not set, client side will bypass authentication, and server side will not send authentication header. + // Settings for authenticating responses. If not set, client side will bypass + // authentication, and server side will not send authentication header. ResponseConfig response = 2; -} \ No newline at end of file +} diff --git a/transport/internet/headers/http/http.go b/transport/internet/headers/http/http.go index 6f65e97533..c12d5b0359 100644 --- a/transport/internet/headers/http/http.go +++ b/transport/internet/headers/http/http.go @@ -1,6 +1,6 @@ package http -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen import ( "bufio" @@ -126,7 +126,7 @@ func (h *HeaderReader) Read(reader io.Reader) (*buf.Buffer, error) { } } - if hasThisUri == false { + if !hasThisUri { return nil, ErrHeaderMisMatch } diff --git a/transport/internet/headers/http/http_test.go b/transport/internet/headers/http/http_test.go index 28f2d9ae46..54fcaf6643 100644 --- a/transport/internet/headers/http/http_test.go +++ b/transport/internet/headers/http/http_test.go @@ -34,7 +34,6 @@ func TestReaderWriter(t *testing.T) { t.Error("unknown error ", err) } _ = buffer - return /* if buffer.String() != "efg" { t.Error("buffer: ", buffer.String()) @@ -256,7 +255,6 @@ func TestConnectionInvPath(t *testing.T) { break } } - return } func TestConnectionInvReq(t *testing.T) { @@ -315,5 +313,4 @@ func TestConnectionInvReq(t *testing.T) { if !strings.HasPrefix(string(l), "HTTP/1.1 400 Bad Request") { t.Error("Resp to non http conn", string(l)) } - return } diff --git a/transport/internet/headers/noop/config.pb.go b/transport/internet/headers/noop/config.pb.go index 4efb4f2366..419f1a4e4d 100644 --- a/transport/internet/headers/noop/config.pb.go +++ b/transport/internet/headers/noop/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/noop/config.proto + package noop import ( @@ -28,7 +34,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_noop_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[0] + 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 { @@ -54,7 +60,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{0} } type ConnectionConfig struct { @@ -66,7 +72,7 @@ type ConnectionConfig struct { func (x *ConnectionConfig) Reset() { *x = ConnectionConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[1] + mi := &file_transport_internet_headers_noop_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -79,7 +85,7 @@ func (x *ConnectionConfig) String() string { func (*ConnectionConfig) ProtoMessage() {} func (x *ConnectionConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[1] + 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 { @@ -92,48 +98,50 @@ func (x *ConnectionConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use ConnectionConfig.ProtoReflect.Descriptor instead. func (*ConnectionConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_headers_noop_config_proto_rawDescGZIP(), []int{1} } -var File_v2ray_com_core_transport_internet_headers_noop_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDesc = []byte{ - 0x0a, 0x3b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x65, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x04, 0x6e, 0x6f, 0x6f, - 0x70, 0xaa, 0x02, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x2a, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x8f, 0x01, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2a, + 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDescData + return file_transport_internet_headers_noop_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_transport_internet_headers_noop_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.noop.Config (*ConnectionConfig)(nil), // 1: v2ray.core.transport.internet.headers.noop.ConnectionConfig } -var file_v2ray_com_core_transport_internet_headers_noop_config_proto_depIdxs = []int32{ +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 @@ -141,13 +149,13 @@ var file_v2ray_com_core_transport_internet_headers_noop_config_proto_depIdxs = [ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_noop_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_noop_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_noop_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -159,7 +167,7 @@ func file_v2ray_com_core_transport_internet_headers_noop_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -176,18 +184,18 @@ func file_v2ray_com_core_transport_internet_headers_noop_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_noop_config_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_noop_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_noop_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_noop_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_noop_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_noop_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_noop_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_noop_config_proto_depIdxs = nil + 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/transport/internet/headers/noop/config.proto b/transport/internet/headers/noop/config.proto index aec672a9dd..a5db08dda7 100644 --- a/transport/internet/headers/noop/config.proto +++ b/transport/internet/headers/noop/config.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.noop; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Noop"; -option go_package = "noop"; +option go_package = "v2ray.com/core/transport/internet/headers/noop"; option java_package = "com.v2ray.core.transport.internet.headers.noop"; option java_multiple_files = true; message Config {} -message ConnectionConfig{} \ No newline at end of file +message ConnectionConfig {} diff --git a/transport/internet/headers/srtp/config.pb.go b/transport/internet/headers/srtp/config.pb.go index 3556644596..2c0fd09a89 100644 --- a/transport/internet/headers/srtp/config.pb.go +++ b/transport/internet/headers/srtp/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/srtp/config.proto + package srtp import ( @@ -35,7 +41,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_srtp_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_srtp_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -48,7 +54,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_srtp_config_proto_msgTypes[0] + 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 { @@ -61,7 +67,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_srtp_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetVersion() uint32 { @@ -106,53 +112,55 @@ func (x *Config) GetPayloadType() uint32 { return 0 } -var File_v2ray_com_core_transport_internet_headers_srtp_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDesc = []byte{ - 0x0a, 0x3b, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, - 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x2a, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x65, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x72, 0x65, 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, 0x04, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x2a, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x2a, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x8f, 0x01, 0x0a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 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, 0x2a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDescData + return file_transport_internet_headers_srtp_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_srtp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_headers_srtp_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.srtp.Config } -var file_v2ray_com_core_transport_internet_headers_srtp_config_proto_depIdxs = []int32{ +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 @@ -160,13 +168,13 @@ var file_v2ray_com_core_transport_internet_headers_srtp_config_proto_depIdxs = [ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_srtp_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_srtp_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_srtp_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_srtp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -183,18 +191,18 @@ func file_v2ray_com_core_transport_internet_headers_srtp_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_srtp_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_srtp_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_srtp_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_srtp_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_srtp_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_srtp_config_proto_depIdxs = nil + 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/transport/internet/headers/srtp/config.proto b/transport/internet/headers/srtp/config.proto index d1d9e501fa..3888cf6146 100644 --- a/transport/internet/headers/srtp/config.proto +++ b/transport/internet/headers/srtp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.srtp; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Srtp"; -option go_package = "srtp"; +option go_package = "v2ray.com/core/transport/internet/headers/srtp"; option java_package = "com.v2ray.core.transport.internet.headers.srtp"; option java_multiple_files = true; @@ -13,4 +13,4 @@ message Config { uint32 csrc_count = 4; bool marker = 5; uint32 payload_type = 6; -} \ No newline at end of file +} diff --git a/transport/internet/headers/tls/config.pb.go b/transport/internet/headers/tls/config.pb.go index 6167986918..24615cfac5 100644 --- a/transport/internet/headers/tls/config.pb.go +++ b/transport/internet/headers/tls/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/tls/config.proto + package tls import ( @@ -28,7 +34,7 @@ type PacketConfig struct { func (x *PacketConfig) Reset() { *x = PacketConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_tls_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_tls_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *PacketConfig) String() string { func (*PacketConfig) ProtoMessage() {} func (x *PacketConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_tls_config_proto_msgTypes[0] + 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 { @@ -54,46 +60,47 @@ func (x *PacketConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use PacketConfig.ProtoReflect.Descriptor instead. func (*PacketConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_tls_config_proto_rawDescGZIP(), []int{0} } -var File_v2ray_com_core_transport_internet_headers_tls_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x62, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, +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, 0x29, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x03, 0x74, 0x6c, 0x73, 0xaa, - 0x02, 0x29, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, + 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, 0x8c, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2d, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x29, 0x56, 0x32, + 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDescData + return file_transport_internet_headers_tls_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_tls_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_headers_tls_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.tls.PacketConfig } -var file_v2ray_com_core_transport_internet_headers_tls_config_proto_depIdxs = []int32{ +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 @@ -101,13 +108,13 @@ var file_v2ray_com_core_transport_internet_headers_tls_config_proto_depIdxs = [] 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_tls_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_tls_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_tls_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_tls_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -124,18 +131,18 @@ func file_v2ray_com_core_transport_internet_headers_tls_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_tls_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_tls_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_tls_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_tls_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_tls_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_tls_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_tls_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_tls_config_proto_depIdxs = nil + 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/transport/internet/headers/tls/config.proto b/transport/internet/headers/tls/config.proto index 7bd8b5e8e7..415527e883 100644 --- a/transport/internet/headers/tls/config.proto +++ b/transport/internet/headers/tls/config.proto @@ -2,9 +2,8 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.tls; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Tls"; -option go_package = "tls"; +option go_package = "v2ray.com/core/transport/internet/headers/tls"; option java_package = "com.v2ray.core.transport.internet.headers.tls"; option java_multiple_files = true; -message PacketConfig { -} +message PacketConfig {} diff --git a/transport/internet/headers/utp/config.pb.go b/transport/internet/headers/utp/config.pb.go index 7235e39771..5966024d8d 100644 --- a/transport/internet/headers/utp/config.pb.go +++ b/transport/internet/headers/utp/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/utp/config.proto + package utp import ( @@ -30,7 +36,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_utp_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_utp_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -43,7 +49,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_utp_config_proto_msgTypes[0] + 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 { @@ -56,7 +62,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_utp_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetVersion() uint32 { @@ -66,44 +72,46 @@ func (x *Config) GetVersion() uint32 { return 0 } -var File_v2ray_com_core_transport_internet_headers_utp_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDesc = []byte{ - 0x0a, 0x3a, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, +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, 0x29, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x8c, 0x01, 0x0a, + 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x62, 0x0a, 0x2d, 0x63, - 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x03, - 0x75, 0x74, 0x70, 0xaa, 0x02, 0x29, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, - 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, + 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, 0x70, 0xaa, + 0x02, 0x29, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDescData + return file_transport_internet_headers_utp_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_utp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_headers_utp_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.utp.Config } -var file_v2ray_com_core_transport_internet_headers_utp_config_proto_depIdxs = []int32{ +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 @@ -111,13 +119,13 @@ var file_v2ray_com_core_transport_internet_headers_utp_config_proto_depIdxs = [] 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_utp_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_utp_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_utp_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_utp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -134,18 +142,18 @@ func file_v2ray_com_core_transport_internet_headers_utp_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_utp_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_utp_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_utp_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_utp_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_utp_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_utp_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_utp_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_utp_config_proto_depIdxs = nil + 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/transport/internet/headers/utp/config.proto b/transport/internet/headers/utp/config.proto index f55e4dcf44..f874fcc283 100644 --- a/transport/internet/headers/utp/config.proto +++ b/transport/internet/headers/utp/config.proto @@ -2,10 +2,10 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.utp; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Utp"; -option go_package = "utp"; +option go_package = "v2ray.com/core/transport/internet/headers/utp"; option java_package = "com.v2ray.core.transport.internet.headers.utp"; option java_multiple_files = true; message Config { uint32 version = 1; -} \ No newline at end of file +} diff --git a/transport/internet/headers/wechat/config.pb.go b/transport/internet/headers/wechat/config.pb.go index 871a25a52d..1940ac71d9 100644 --- a/transport/internet/headers/wechat/config.pb.go +++ b/transport/internet/headers/wechat/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/wechat/config.proto + package wechat import ( @@ -28,7 +34,7 @@ type VideoConfig struct { func (x *VideoConfig) Reset() { *x = VideoConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_wechat_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_wechat_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *VideoConfig) String() string { func (*VideoConfig) ProtoMessage() {} func (x *VideoConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_wechat_config_proto_msgTypes[0] + 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 { @@ -54,47 +60,48 @@ func (x *VideoConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use VideoConfig.ProtoReflect.Descriptor instead. func (*VideoConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_wechat_config_proto_rawDescGZIP(), []int{0} } -var File_v2ray_com_core_transport_internet_headers_wechat_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDesc = []byte{ - 0x0a, 0x3d, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x2c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x6b, 0x0a, 0x30, - 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x06, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x2c, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x2c, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x95, 0x01, + 0x0a, 0x30, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 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, 0x2c, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDescData + return file_transport_internet_headers_wechat_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_wechat_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_headers_wechat_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.wechat.VideoConfig } -var file_v2ray_com_core_transport_internet_headers_wechat_config_proto_depIdxs = []int32{ +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 @@ -102,13 +109,13 @@ var file_v2ray_com_core_transport_internet_headers_wechat_config_proto_depIdxs = 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_wechat_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_wechat_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_wechat_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_wechat_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -125,18 +132,18 @@ func file_v2ray_com_core_transport_internet_headers_wechat_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_wechat_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_wechat_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_wechat_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_wechat_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_wechat_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_wechat_config_proto_depIdxs = nil + 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/transport/internet/headers/wechat/config.proto b/transport/internet/headers/wechat/config.proto index f2b8529255..467057a032 100644 --- a/transport/internet/headers/wechat/config.proto +++ b/transport/internet/headers/wechat/config.proto @@ -2,9 +2,8 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.wechat; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Wechat"; -option go_package = "wechat"; +option go_package = "v2ray.com/core/transport/internet/headers/wechat"; option java_package = "com.v2ray.core.transport.internet.headers.wechat"; option java_multiple_files = true; -message VideoConfig { -} \ No newline at end of file +message VideoConfig {} diff --git a/transport/internet/headers/wireguard/config.pb.go b/transport/internet/headers/wireguard/config.pb.go index 894b9491dd..d021bb4c76 100644 --- a/transport/internet/headers/wireguard/config.pb.go +++ b/transport/internet/headers/wireguard/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/headers/wireguard/config.proto + package wireguard import ( @@ -28,7 +34,7 @@ type WireguardConfig struct { func (x *WireguardConfig) Reset() { *x = WireguardConfig{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_msgTypes[0] + mi := &file_transport_internet_headers_wireguard_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *WireguardConfig) String() string { func (*WireguardConfig) ProtoMessage() {} func (x *WireguardConfig) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_msgTypes[0] + 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 { @@ -54,48 +60,49 @@ func (x *WireguardConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use WireguardConfig.ProtoReflect.Descriptor instead. func (*WireguardConfig) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_headers_wireguard_config_proto_rawDescGZIP(), []int{0} } -var File_v2ray_com_core_transport_internet_headers_wireguard_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDesc = []byte{ - 0x0a, 0x40, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x74, 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, - 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, - 0x09, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x2f, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x9e, 0x01, 0x0a, 0x33, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x33, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, + 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescData = file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDescData + return file_transport_internet_headers_wireguard_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.headers.wireguard.WireguardConfig } -var file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_depIdxs = []int32{ +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 @@ -103,13 +110,13 @@ var file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_depIdx 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_init() } -func file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_init() { - if File_v2ray_com_core_transport_internet_headers_wireguard_config_proto != nil { +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_v2ray_com_core_transport_internet_headers_wireguard_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -126,18 +133,18 @@ func file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_init( out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDesc, + RawDescriptor: file_transport_internet_headers_wireguard_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_headers_wireguard_config_proto = out.File - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_headers_wireguard_config_proto_depIdxs = nil + 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/transport/internet/headers/wireguard/config.proto b/transport/internet/headers/wireguard/config.proto index 1917d6b7dd..05e8bfe461 100644 --- a/transport/internet/headers/wireguard/config.proto +++ b/transport/internet/headers/wireguard/config.proto @@ -2,9 +2,8 @@ syntax = "proto3"; package v2ray.core.transport.internet.headers.wireguard; option csharp_namespace = "V2Ray.Core.Transport.Internet.Headers.Wireguard"; -option go_package = "wireguard"; +option go_package = "v2ray.com/core/transport/internet/headers/wireguard"; option java_package = "com.v2ray.core.transport.internet.headers.wireguard"; option java_multiple_files = true; -message WireguardConfig { -} +message WireguardConfig {} diff --git a/transport/internet/http/config.pb.go b/transport/internet/http/config.pb.go index 44f3cf114f..36f1541252 100644 --- a/transport/internet/http/config.pb.go +++ b/transport/internet/http/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/http/config.proto + package http import ( @@ -31,7 +37,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_http_config_proto_msgTypes[0] + mi := &file_transport_internet_http_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +50,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_http_config_proto_msgTypes[0] + 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 { @@ -57,7 +63,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_http_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_http_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetHost() []string { @@ -74,43 +80,44 @@ func (x *Config) GetPath() string { return "" } -var File_v2ray_com_core_transport_internet_http_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_http_config_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x22, 0x30, 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, 0x42, 0x55, 0x0a, 0x26, 0x63, - 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x04, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x22, - 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x22, 0x30, 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, 0x42, 0x77, 0x0a, 0x26, + 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x26, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 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, 0x22, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_http_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_http_config_proto_rawDescData = file_v2ray_com_core_transport_internet_http_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_http_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_http_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_http_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_http_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_http_config_proto_rawDescData + return file_transport_internet_http_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_http_config_proto_goTypes = []interface{}{ +var file_transport_internet_http_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_internet_http_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.internet.http.Config } -var file_v2ray_com_core_transport_internet_http_config_proto_depIdxs = []int32{ +var file_transport_internet_http_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 @@ -118,13 +125,13 @@ var file_v2ray_com_core_transport_internet_http_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_http_config_proto_init() } -func file_v2ray_com_core_transport_internet_http_config_proto_init() { - if File_v2ray_com_core_transport_internet_http_config_proto != nil { +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_v2ray_com_core_transport_internet_http_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -141,18 +148,18 @@ func file_v2ray_com_core_transport_internet_http_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_http_config_proto_rawDesc, + RawDescriptor: file_transport_internet_http_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_http_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_http_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_http_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_http_config_proto = out.File - file_v2ray_com_core_transport_internet_http_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_http_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_http_config_proto_depIdxs = nil + 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/transport/internet/http/config.proto b/transport/internet/http/config.proto index cb995c13d2..079fb2bcb8 100644 --- a/transport/internet/http/config.proto +++ b/transport/internet/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.transport.internet.http; option csharp_namespace = "V2Ray.Core.Transport.Internet.Http"; -option go_package = "http"; +option go_package = "v2ray.com/core/transport/internet/http"; option java_package = "com.v2ray.core.transport.internet.http"; option java_multiple_files = true; diff --git a/transport/internet/http/http.go b/transport/internet/http/http.go index cb8ad4e922..f2305b871a 100644 --- a/transport/internet/http/http.go +++ b/transport/internet/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/http/hub.go b/transport/internet/http/hub.go index 32fb309079..4b75a1a288 100644 --- a/transport/internet/http/hub.go +++ b/transport/internet/http/hub.go @@ -9,23 +9,24 @@ import ( "strings" "time" + "golang.org/x/net/http2" + "golang.org/x/net/http2/h2c" + "v2ray.com/core/common" "v2ray.com/core/common/net" + http_proto "v2ray.com/core/common/protocol/http" "v2ray.com/core/common/serial" "v2ray.com/core/common/session" "v2ray.com/core/common/signal/done" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" - - "golang.org/x/net/http2" - "golang.org/x/net/http2/h2c" ) type Listener struct { server *http.Server handler internet.ConnHandler local net.Addr - config Config + config *Config } func (l *Listener) Addr() net.Addr { @@ -82,6 +83,11 @@ func (l *Listener) ServeHTTP(writer http.ResponseWriter, request *http.Request) } } + forwardedAddrs := http_proto.ParseXForwardedFor(request.Header) + if len(forwardedAddrs) > 0 && forwardedAddrs[0].Family().IsIP() { + remoteAddr.(*net.TCPAddr).IP = forwardedAddrs[0].IP() + } + done := done.New() conn := net.NewConnection( net.ConnectionOutput(request.Body), @@ -102,7 +108,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti IP: address.IP(), Port: int(port), }, - config: *httpSettings, + config: httpSettings, } var server *http.Server diff --git a/transport/internet/internet.go b/transport/internet/internet.go index 77027eaad2..a2283fcf83 100644 --- a/transport/internet/internet.go +++ b/transport/internet/internet.go @@ -1,3 +1,3 @@ package internet -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/kcp/config.go b/transport/internet/kcp/config.go index 0abd12d54b..f601618588 100644 --- a/transport/internet/kcp/config.go +++ b/transport/internet/kcp/config.go @@ -4,8 +4,6 @@ package kcp import ( "crypto/cipher" - "fmt" - "v2ray.com/core/common" "v2ray.com/core/transport/internet" ) @@ -63,7 +61,6 @@ func (c *Config) GetReadBufferSize() uint32 { // GetSecurity returns the security settings. func (c *Config) GetSecurity() (cipher.AEAD, error) { if c.Seed != nil { - fmt.Println("=========NewAEADAESGCMBasedOnSeed Used============") return NewAEADAESGCMBasedOnSeed(c.Seed.Seed), nil } return NewSimpleAuthenticator(), nil diff --git a/transport/internet/kcp/config.pb.go b/transport/internet/kcp/config.pb.go index 84e9c87c7c..29f94fef2a 100644 --- a/transport/internet/kcp/config.pb.go +++ b/transport/internet/kcp/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/kcp/config.proto + package kcp import ( @@ -32,7 +38,7 @@ type MTU struct { func (x *MTU) Reset() { *x = MTU{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[0] + mi := &file_transport_internet_kcp_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +51,7 @@ func (x *MTU) String() string { func (*MTU) ProtoMessage() {} func (x *MTU) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[0] + 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 { @@ -58,7 +64,7 @@ func (x *MTU) ProtoReflect() protoreflect.Message { // Deprecated: Use MTU.ProtoReflect.Descriptor instead. func (*MTU) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{0} } func (x *MTU) GetValue() uint32 { @@ -80,7 +86,7 @@ type TTI struct { func (x *TTI) Reset() { *x = TTI{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[1] + mi := &file_transport_internet_kcp_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -93,7 +99,7 @@ func (x *TTI) String() string { func (*TTI) ProtoMessage() {} func (x *TTI) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[1] + 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 { @@ -106,7 +112,7 @@ func (x *TTI) ProtoReflect() protoreflect.Message { // Deprecated: Use TTI.ProtoReflect.Descriptor instead. func (*TTI) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{1} } func (x *TTI) GetValue() uint32 { @@ -128,7 +134,7 @@ type UplinkCapacity struct { func (x *UplinkCapacity) Reset() { *x = UplinkCapacity{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[2] + mi := &file_transport_internet_kcp_config_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -141,7 +147,7 @@ func (x *UplinkCapacity) String() string { func (*UplinkCapacity) ProtoMessage() {} func (x *UplinkCapacity) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[2] + 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 { @@ -154,7 +160,7 @@ func (x *UplinkCapacity) ProtoReflect() protoreflect.Message { // Deprecated: Use UplinkCapacity.ProtoReflect.Descriptor instead. func (*UplinkCapacity) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{2} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{2} } func (x *UplinkCapacity) GetValue() uint32 { @@ -176,7 +182,7 @@ type DownlinkCapacity struct { func (x *DownlinkCapacity) Reset() { *x = DownlinkCapacity{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[3] + mi := &file_transport_internet_kcp_config_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -189,7 +195,7 @@ func (x *DownlinkCapacity) String() string { func (*DownlinkCapacity) ProtoMessage() {} func (x *DownlinkCapacity) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[3] + 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 { @@ -202,7 +208,7 @@ func (x *DownlinkCapacity) ProtoReflect() protoreflect.Message { // Deprecated: Use DownlinkCapacity.ProtoReflect.Descriptor instead. func (*DownlinkCapacity) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{3} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{3} } func (x *DownlinkCapacity) GetValue() uint32 { @@ -224,7 +230,7 @@ type WriteBuffer struct { func (x *WriteBuffer) Reset() { *x = WriteBuffer{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[4] + mi := &file_transport_internet_kcp_config_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -237,7 +243,7 @@ func (x *WriteBuffer) String() string { func (*WriteBuffer) ProtoMessage() {} func (x *WriteBuffer) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[4] + 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 { @@ -250,7 +256,7 @@ func (x *WriteBuffer) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteBuffer.ProtoReflect.Descriptor instead. func (*WriteBuffer) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{4} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{4} } func (x *WriteBuffer) GetSize() uint32 { @@ -272,7 +278,7 @@ type ReadBuffer struct { func (x *ReadBuffer) Reset() { *x = ReadBuffer{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[5] + mi := &file_transport_internet_kcp_config_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -285,7 +291,7 @@ func (x *ReadBuffer) String() string { func (*ReadBuffer) ProtoMessage() {} func (x *ReadBuffer) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[5] + 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 { @@ -298,7 +304,7 @@ func (x *ReadBuffer) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadBuffer.ProtoReflect.Descriptor instead. func (*ReadBuffer) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{5} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{5} } func (x *ReadBuffer) GetSize() uint32 { @@ -319,7 +325,7 @@ type ConnectionReuse struct { func (x *ConnectionReuse) Reset() { *x = ConnectionReuse{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[6] + mi := &file_transport_internet_kcp_config_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -332,7 +338,7 @@ func (x *ConnectionReuse) String() string { func (*ConnectionReuse) ProtoMessage() {} func (x *ConnectionReuse) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[6] + 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 { @@ -345,7 +351,7 @@ func (x *ConnectionReuse) ProtoReflect() protoreflect.Message { // Deprecated: Use ConnectionReuse.ProtoReflect.Descriptor instead. func (*ConnectionReuse) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{6} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{6} } func (x *ConnectionReuse) GetEnable() bool { @@ -367,7 +373,7 @@ type EncryptionSeed struct { func (x *EncryptionSeed) Reset() { *x = EncryptionSeed{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[7] + mi := &file_transport_internet_kcp_config_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -380,7 +386,7 @@ func (x *EncryptionSeed) String() string { func (*EncryptionSeed) ProtoMessage() {} func (x *EncryptionSeed) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[7] + 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 { @@ -393,7 +399,7 @@ func (x *EncryptionSeed) ProtoReflect() protoreflect.Message { // Deprecated: Use EncryptionSeed.ProtoReflect.Descriptor instead. func (*EncryptionSeed) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{7} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{7} } func (x *EncryptionSeed) GetSeed() string { @@ -422,7 +428,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[8] + mi := &file_transport_internet_kcp_config_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -435,7 +441,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[8] + 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 { @@ -448,7 +454,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP(), []int{8} + return file_transport_internet_kcp_config_proto_rawDescGZIP(), []int{8} } func (x *Config) GetMtu() *MTU { @@ -514,100 +520,100 @@ func (x *Config) GetSeed() *EncryptionSeed { return nil } -var File_v2ray_com_core_transport_internet_kcp_config_proto protoreflect.FileDescriptor +var File_transport_internet_kcp_config_proto protoreflect.FileDescriptor -var file_v2ray_com_core_transport_internet_kcp_config_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, +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, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 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, + 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, 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, 0x97, 0x05, 0x0a, 0x06, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x03, 0x6d, 0x74, 0x75, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x38, 0x0a, 0x03, 0x74, 0x74, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5a, 0x0a, 0x0f, 0x75, 0x70, - 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, + 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, 0x97, 0x05, + 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x38, 0x0a, 0x03, 0x6d, 0x74, 0x75, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x38, 0x0a, 0x03, 0x74, 0x74, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x5a, 0x0a, 0x0f, + 0x75, 0x70, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x63, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0x60, 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, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x60, 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, 0x33, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x51, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4e, 0x0a, 0x0b, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 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, 0x51, 0x0a, 0x0c, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4b, 0x0a, 0x0d, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x45, 0x0a, 0x04, 0x73, 0x65, 0x65, 0x64, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x52, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x03, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x21, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, - 0x72, 0x65, 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, + 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, 0x4e, 0x0a, + 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4b, 0x0a, + 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x45, 0x0a, 0x04, 0x73, 0x65, + 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, + 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x74, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x25, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x21, 0x56, 0x32, 0x52, 0x61, + 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_kcp_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescData = file_v2ray_com_core_transport_internet_kcp_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_kcp_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_kcp_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_kcp_config_proto_rawDescData + return file_transport_internet_kcp_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_v2ray_com_core_transport_internet_kcp_config_proto_goTypes = []interface{}{ +var file_transport_internet_kcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_transport_internet_kcp_config_proto_goTypes = []interface{}{ (*MTU)(nil), // 0: v2ray.core.transport.internet.kcp.MTU (*TTI)(nil), // 1: v2ray.core.transport.internet.kcp.TTI (*UplinkCapacity)(nil), // 2: v2ray.core.transport.internet.kcp.UplinkCapacity @@ -619,7 +625,7 @@ var file_v2ray_com_core_transport_internet_kcp_config_proto_goTypes = []interfac (*Config)(nil), // 8: v2ray.core.transport.internet.kcp.Config (*serial.TypedMessage)(nil), // 9: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_transport_internet_kcp_config_proto_depIdxs = []int32{ +var file_transport_internet_kcp_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.transport.internet.kcp.Config.mtu:type_name -> v2ray.core.transport.internet.kcp.MTU 1, // 1: v2ray.core.transport.internet.kcp.Config.tti:type_name -> v2ray.core.transport.internet.kcp.TTI 2, // 2: v2ray.core.transport.internet.kcp.Config.uplink_capacity:type_name -> v2ray.core.transport.internet.kcp.UplinkCapacity @@ -635,13 +641,13 @@ var file_v2ray_com_core_transport_internet_kcp_config_proto_depIdxs = []int32{ 0, // [0:8] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_kcp_config_proto_init() } -func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { - if File_v2ray_com_core_transport_internet_kcp_config_proto != nil { +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_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -653,7 +659,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -665,7 +671,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -677,7 +683,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -689,7 +695,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -701,7 +707,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -713,7 +719,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -725,7 +731,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -737,7 +743,7 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -754,18 +760,18 @@ func file_v2ray_com_core_transport_internet_kcp_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_kcp_config_proto_rawDesc, + RawDescriptor: file_transport_internet_kcp_config_proto_rawDesc, NumEnums: 0, NumMessages: 9, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_kcp_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_kcp_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_kcp_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_kcp_config_proto = out.File - file_v2ray_com_core_transport_internet_kcp_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_kcp_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_kcp_config_proto_depIdxs = nil + 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/transport/internet/kcp/config.proto b/transport/internet/kcp/config.proto index a56e1536e8..8fc180ec78 100644 --- a/transport/internet/kcp/config.proto +++ b/transport/internet/kcp/config.proto @@ -2,11 +2,11 @@ syntax = "proto3"; package v2ray.core.transport.internet.kcp; option csharp_namespace = "V2Ray.Core.Transport.Internet.Kcp"; -option go_package = "kcp"; +option go_package = "v2ray.com/core/transport/internet/kcp"; option java_package = "com.v2ray.core.transport.internet.kcp"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; // Maximum Transmission Unit, in bytes. message MTU { @@ -58,4 +58,4 @@ message Config { v2ray.core.common.serial.TypedMessage header_config = 8; reserved 9; EncryptionSeed seed = 10; -} \ No newline at end of file +} diff --git a/transport/internet/kcp/dialer.go b/transport/internet/kcp/dialer.go index b0531b5009..bc481ae3d6 100644 --- a/transport/internet/kcp/dialer.go +++ b/transport/internet/kcp/dialer.go @@ -4,7 +4,6 @@ package kcp import ( "context" - "crypto/tls" "io" "sync/atomic" @@ -13,7 +12,8 @@ import ( "v2ray.com/core/common/dice" "v2ray.com/core/common/net" "v2ray.com/core/transport/internet" - v2tls "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" ) var ( @@ -88,9 +88,10 @@ func DialKCP(ctx context.Context, dest net.Destination, streamSettings *internet var iConn internet.Connection = session - if config := v2tls.ConfigFromStreamSettings(streamSettings); config != nil { - tlsConn := tls.Client(iConn, config.GetTLSConfig(v2tls.WithDestination(dest))) - iConn = tlsConn + if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { + iConn = tls.Client(iConn, config.GetTLSConfig(tls.WithDestination(dest))) + } else if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + iConn = xtls.Client(iConn, config.GetXTLSConfig(xtls.WithDestination(dest))) } return iConn, nil diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index 177b651706..5bef0b8964 100644 --- a/transport/internet/kcp/kcp.go +++ b/transport/internet/kcp/kcp.go @@ -5,4 +5,4 @@ // xtaci@github for translating to Golang package kcp -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/kcp/listener.go b/transport/internet/kcp/listener.go index 8e141c6b56..e47ff84a76 100644 --- a/transport/internet/kcp/listener.go +++ b/transport/internet/kcp/listener.go @@ -5,15 +5,18 @@ package kcp import ( "context" "crypto/cipher" - "crypto/tls" + gotls "crypto/tls" "sync" + goxtls "github.com/xtls/go" + "v2ray.com/core/common" "v2ray.com/core/common/buf" "v2ray.com/core/common/net" "v2ray.com/core/transport/internet" - v2tls "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/tls" "v2ray.com/core/transport/internet/udp" + "v2ray.com/core/transport/internet/xtls" ) type ConnectionID struct { @@ -25,14 +28,15 @@ type ConnectionID struct { // Listener defines a server listening for connections type Listener struct { sync.Mutex - sessions map[ConnectionID]*Connection - hub *udp.Hub - tlsConfig *tls.Config - config *Config - reader PacketReader - header internet.PacketHeader - security cipher.AEAD - addConn internet.ConnHandler + sessions map[ConnectionID]*Connection + hub *udp.Hub + tlsConfig *gotls.Config + xtlsConfig *goxtls.Config + config *Config + reader PacketReader + header internet.PacketHeader + security cipher.AEAD + addConn internet.ConnHandler } func NewListener(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, addConn internet.ConnHandler) (*Listener, error) { @@ -57,9 +61,12 @@ func NewListener(ctx context.Context, address net.Address, port net.Port, stream addConn: addConn, } - if config := v2tls.ConfigFromStreamSettings(streamSettings); config != nil { + if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { l.tlsConfig = config.GetTLSConfig() } + if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + l.xtlsConfig = config.GetXTLSConfig() + } hub, err := udp.ListenUDP(ctx, address, port, streamSettings, udp.HubCapacity(1024)) if err != nil { @@ -131,8 +138,9 @@ func (l *Listener) OnReceive(payload *buf.Buffer, src net.Destination) { }, writer, l.config) var netConn internet.Connection = conn if l.tlsConfig != nil { - tlsConn := tls.Server(conn, l.tlsConfig) - netConn = tlsConn + netConn = gotls.Server(conn, l.tlsConfig) + } else if l.xtlsConfig != nil { + netConn = goxtls.Server(conn, l.xtlsConfig) } l.addConn(netConn) diff --git a/transport/internet/kcp/sending.go b/transport/internet/kcp/sending.go index 38b1201132..c8852ef7ea 100644 --- a/transport/internet/kcp/sending.go +++ b/transport/internet/kcp/sending.go @@ -121,10 +121,7 @@ func (sw *SendingWindow) Flush(current uint32, rto uint32, maxInFlightSize uint3 segment.transmit++ sw.writer.Write(segment) inFlightSize++ - if inFlightSize >= maxInFlightSize { - return false - } - return true + return inFlightSize < maxInFlightSize }) if sw.onPacketLoss != nil && inFlightSize > 0 && sw.totalInFlightSize != 0 { diff --git a/transport/internet/quic/config.pb.go b/transport/internet/quic/config.pb.go index 4bd672c08f..89e642a72c 100644 --- a/transport/internet/quic/config.pb.go +++ b/transport/internet/quic/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/quic/config.proto + package quic import ( @@ -34,7 +40,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_quic_config_proto_msgTypes[0] + mi := &file_transport_internet_quic_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -47,7 +53,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_quic_config_proto_msgTypes[0] + 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 { @@ -60,7 +66,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_quic_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_quic_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetKey() string { @@ -84,58 +90,58 @@ func (x *Config) GetHeader() *serial.TypedMessage { return nil } -var File_v2ray_com_core_transport_internet_quic_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_quic_config_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, - 0x65, 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, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x2c, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0xa2, 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, 0x46, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, - 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, - 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x55, - 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x04, 0x71, 0x75, 0x69, 0x63, - 0xaa, 0x02, 0x22, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, 0xa2, 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, 0x46, 0x0a, 0x08, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3e, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x77, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x26, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x22, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x72, 0x65, 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_v2ray_com_core_transport_internet_quic_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_quic_config_proto_rawDescData = file_v2ray_com_core_transport_internet_quic_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_quic_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_quic_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_quic_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_quic_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_quic_config_proto_rawDescData + return file_transport_internet_quic_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_quic_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_quic_config_proto_goTypes = []interface{}{ +var file_transport_internet_quic_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_internet_quic_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.internet.quic.Config (*protocol.SecurityConfig)(nil), // 1: v2ray.core.common.protocol.SecurityConfig (*serial.TypedMessage)(nil), // 2: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_transport_internet_quic_config_proto_depIdxs = []int32{ +var file_transport_internet_quic_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.transport.internet.quic.Config.security:type_name -> v2ray.core.common.protocol.SecurityConfig 2, // 1: v2ray.core.transport.internet.quic.Config.header:type_name -> v2ray.core.common.serial.TypedMessage 2, // [2:2] is the sub-list for method output_type @@ -145,13 +151,13 @@ var file_v2ray_com_core_transport_internet_quic_config_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_quic_config_proto_init() } -func file_v2ray_com_core_transport_internet_quic_config_proto_init() { - if File_v2ray_com_core_transport_internet_quic_config_proto != nil { +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_v2ray_com_core_transport_internet_quic_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -168,18 +174,18 @@ func file_v2ray_com_core_transport_internet_quic_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_quic_config_proto_rawDesc, + RawDescriptor: file_transport_internet_quic_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_quic_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_quic_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_quic_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_quic_config_proto = out.File - file_v2ray_com_core_transport_internet_quic_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_quic_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_quic_config_proto_depIdxs = nil + 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/transport/internet/quic/config.proto b/transport/internet/quic/config.proto index bbc20cae36..23420e6d2e 100644 --- a/transport/internet/quic/config.proto +++ b/transport/internet/quic/config.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package v2ray.core.transport.internet.quic; option csharp_namespace = "V2Ray.Core.Transport.Internet.Quic"; -option go_package = "quic"; +option go_package = "v2ray.com/core/transport/internet/quic"; option java_package = "com.v2ray.core.transport.internet.quic"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; -import "v2ray.com/core/common/protocol/headers.proto"; +import "common/serial/typed_message.proto"; +import "common/protocol/headers.proto"; message Config { string key = 1; diff --git a/transport/internet/quic/conn.go b/transport/internet/quic/conn.go index 7f039fe163..c59b2a7b69 100644 --- a/transport/internet/quic/conn.go +++ b/transport/internet/quic/conn.go @@ -8,10 +8,10 @@ import ( "errors" "time" + "github.com/lucas-clemente/quic-go" "v2ray.com/core/common" "v2ray.com/core/common/buf" "v2ray.com/core/common/net" - quic "v2ray.com/core/external/github.com/lucas-clemente/quic-go" "v2ray.com/core/transport/internet" ) diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index 1a382eb115..daec007f5c 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -7,10 +7,10 @@ import ( "sync" "time" + "github.com/lucas-clemente/quic-go" "v2ray.com/core/common" "v2ray.com/core/common/net" "v2ray.com/core/common/task" - quic "v2ray.com/core/external/github.com/lucas-clemente/quic-go" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" ) @@ -63,7 +63,7 @@ func removeInactiveSessions(sessions []*sessionContext) []*sessionContext { activeSessions = append(activeSessions, s) continue } - if err := s.session.Close(); err != nil { + if err := s.session.CloseWithError(0, ""); err != nil { newError("failed to close session").Base(err).WriteToLog() } if err := s.rawConn.Close(); err != nil { @@ -151,7 +151,7 @@ func (s *clientSessions) openConnection(destAddr net.Addr, config *Config, tlsCo quicConfig := &quic.Config{ ConnectionIDLength: 12, HandshakeTimeout: time.Second * 8, - IdleTimeout: time.Second * 30, + MaxIdleTimeout: time.Second * 30, } conn, err := wrapSysConn(rawConn, config) diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index 11865f6923..372d96e8d4 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -6,11 +6,11 @@ import ( "context" "time" + "github.com/lucas-clemente/quic-go" "v2ray.com/core/common" "v2ray.com/core/common/net" "v2ray.com/core/common/protocol/tls/cert" "v2ray.com/core/common/signal/done" - quic "v2ray.com/core/external/github.com/lucas-clemente/quic-go" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" ) @@ -25,14 +25,16 @@ type Listener struct { func (l *Listener) acceptStreams(session quic.Session) { for { - stream, err := session.AcceptStream() + stream, err := session.AcceptStream(context.Background()) if err != nil { newError("failed to accept stream").Base(err).WriteToLog() select { case <-session.Context().Done(): return case <-l.done.Wait(): - session.Close() + if err := session.CloseWithError(0, ""); err != nil { + newError("failed to close session").Base(err).WriteToLog() + } return default: time.Sleep(time.Second) @@ -53,7 +55,7 @@ func (l *Listener) acceptStreams(session quic.Session) { func (l *Listener) keepAccepting() { for { - conn, err := l.listener.Accept() + conn, err := l.listener.Accept(context.Background()) if err != nil { newError("failed to accept QUIC sessions").Base(err).WriteToLog() if l.done.Done() { @@ -105,7 +107,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti quicConfig := &quic.Config{ ConnectionIDLength: 12, HandshakeTimeout: time.Second * 8, - IdleTimeout: time.Second * 45, + MaxIdleTimeout: time.Second * 45, MaxIncomingStreams: 32, MaxIncomingUniStreams: -1, } diff --git a/transport/internet/quic/quic.go b/transport/internet/quic/quic.go index 1ec3b3cfb8..16bb0ab7b1 100644 --- a/transport/internet/quic/quic.go +++ b/transport/internet/quic/quic.go @@ -7,7 +7,7 @@ import ( "v2ray.com/core/transport/internet" ) -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen // Here is some modification needs to be done before update quic vendor. // * use bytespool in buffer_pool.go diff --git a/transport/internet/quic/quic_test.go b/transport/internet/quic/quic_test.go index 3f42bd8cd8..73639e9e9d 100644 --- a/transport/internet/quic/quic_test.go +++ b/transport/internet/quic/quic_test.go @@ -29,7 +29,13 @@ func TestQuicConnection(t *testing.T) { ProtocolSettings: &quic.Config{}, SecurityType: "tls", SecuritySettings: &tls.Config{ - Certificate: []*tls.Certificate{tls.ParseCertificate(cert.MustGenerate(nil, cert.DNSNames("www.v2ray.com"), cert.CommonName("www.v2ray.com")))}, + Certificate: []*tls.Certificate{ + tls.ParseCertificate( + cert.MustGenerate(nil, + cert.DNSNames("www.v2fly.org"), + ), + ), + }, }, }, func(conn internet.Connection) { go func() { @@ -59,7 +65,7 @@ func TestQuicConnection(t *testing.T) { ProtocolSettings: &quic.Config{}, SecurityType: "tls", SecuritySettings: &tls.Config{ - ServerName: "www.v2ray.com", + ServerName: "www.v2fly.org", AllowInsecure: true, }, }) diff --git a/transport/internet/sockopt_darwin.go b/transport/internet/sockopt_darwin.go index ccac238d97..e6281923da 100644 --- a/transport/internet/sockopt_darwin.go +++ b/transport/internet/sockopt_darwin.go @@ -50,3 +50,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) func bindAddr(fd uintptr, address []byte, port uint32) error { return nil } + +func setReuseAddr(fd uintptr) error { + return nil +} + +func setReusePort(fd uintptr) error { + return nil +} diff --git a/transport/internet/sockopt_freebsd.go b/transport/internet/sockopt_freebsd.go index 46634cb68e..48c5eda69b 100644 --- a/transport/internet/sockopt_freebsd.go +++ b/transport/internet/sockopt_freebsd.go @@ -188,15 +188,8 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) } func bindAddr(fd uintptr, ip []byte, port uint32) error { - if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1); err != nil { - return newError("failed to set resuse_addr").Base(err).AtWarning() - } - - if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePortLB, 1); err != nil { - if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePort, 1); err != nil { - return newError("failed to set resuse_port").Base(err).AtWarning() - } - } + setReuseAddr(fd) + setReusePort(fd) var sockaddr syscall.Sockaddr @@ -219,3 +212,19 @@ func bindAddr(fd uintptr, ip []byte, port uint32) error { return syscall.Bind(int(fd), sockaddr) } + +func setReuseAddr(fd uintptr) error { + if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1); err != nil { + return newError("failed to set SO_REUSEADDR").Base(err).AtWarning() + } + return nil +} + +func setReusePort(fd uintptr) error { + if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePortLB, 1); err != nil { + if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, soReUsePort, 1); err != nil { + return newError("failed to set SO_REUSEPORT").Base(err).AtWarning() + } + } + return nil +} diff --git a/transport/internet/sockopt_linux.go b/transport/internet/sockopt_linux.go index 068879e808..9c1c8f3102 100644 --- a/transport/internet/sockopt_linux.go +++ b/transport/internet/sockopt_linux.go @@ -15,13 +15,8 @@ const ( ) func bindAddr(fd uintptr, ip []byte, port uint32) error { - if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1); err != nil { - return newError("failed to set resuse_addr").Base(err).AtWarning() - } - - if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil { - return newError("failed to set resuse_port").Base(err).AtWarning() - } + setReuseAddr(fd) + setReusePort(fd) var sockaddr syscall.Sockaddr @@ -107,9 +102,19 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) } } + return nil +} + +func setReuseAddr(fd uintptr) error { + if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1); err != nil { + return newError("failed to set SO_REUSEADDR").Base(err).AtWarning() + } + return nil +} + +func setReusePort(fd uintptr) error { if err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil { return newError("failed to set SO_REUSEPORT").Base(err).AtWarning() } - return nil } diff --git a/transport/internet/sockopt_other.go b/transport/internet/sockopt_other.go index 962c981d82..ac61296bf0 100644 --- a/transport/internet/sockopt_other.go +++ b/transport/internet/sockopt_other.go @@ -13,3 +13,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) func bindAddr(fd uintptr, ip []byte, port uint32) error { return nil } + +func setReuseAddr(fd uintptr) error { + return nil +} + +func setReusePort(fd uintptr) error { + return nil +} diff --git a/transport/internet/sockopt_windows.go b/transport/internet/sockopt_windows.go index f47aa07a7b..cb6292bcae 100644 --- a/transport/internet/sockopt_windows.go +++ b/transport/internet/sockopt_windows.go @@ -46,3 +46,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig) func bindAddr(fd uintptr, ip []byte, port uint32) error { return nil } + +func setReuseAddr(fd uintptr) error { + return nil +} + +func setReusePort(fd uintptr) error { + return nil +} diff --git a/transport/internet/system_listener.go b/transport/internet/system_listener.go index 4c85c9ae32..b17cbbba56 100644 --- a/transport/internet/system_listener.go +++ b/transport/internet/system_listener.go @@ -27,6 +27,8 @@ func getControlFunc(ctx context.Context, sockopt *SocketConfig, controllers []co } } + setReusePort(fd) + for _, controller := range controllers { if err := controller(network, address, fd); err != nil { newError("failed to apply external controller").Base(err).WriteToLog(session.ExportIDToError(ctx)) @@ -39,9 +41,7 @@ func getControlFunc(ctx context.Context, sockopt *SocketConfig, controllers []co func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.Listener, error) { var lc net.ListenConfig - if sockopt != nil || len(dl.controllers) > 0 { - lc.Control = getControlFunc(ctx, sockopt, dl.controllers) - } + lc.Control = getControlFunc(ctx, sockopt, dl.controllers) return lc.Listen(ctx, addr.Network(), addr.String()) } @@ -49,9 +49,7 @@ func (dl *DefaultListener) Listen(ctx context.Context, addr net.Addr, sockopt *S func (dl *DefaultListener) ListenPacket(ctx context.Context, addr net.Addr, sockopt *SocketConfig) (net.PacketConn, error) { var lc net.ListenConfig - if sockopt != nil || len(dl.controllers) > 0 { - lc.Control = getControlFunc(ctx, sockopt, dl.controllers) - } + lc.Control = getControlFunc(ctx, sockopt, dl.controllers) return lc.ListenPacket(ctx, addr.Network(), addr.String()) } diff --git a/transport/internet/tcp/config.pb.go b/transport/internet/tcp/config.pb.go index 364b135645..da5cd357c3 100644 --- a/transport/internet/tcp/config.pb.go +++ b/transport/internet/tcp/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/tcp/config.proto + package tcp import ( @@ -25,13 +31,14 @@ type Config struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - HeaderSettings *serial.TypedMessage `protobuf:"bytes,2,opt,name=header_settings,json=headerSettings,proto3" json:"header_settings,omitempty"` + 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_v2ray_com_core_transport_internet_tcp_config_proto_msgTypes[0] + mi := &file_transport_internet_tcp_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +51,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_tcp_config_proto_msgTypes[0] + 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 { @@ -57,7 +64,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_tcp_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_tcp_config_proto_rawDescGZIP(), []int{0} } func (x *Config) GetHeaderSettings() *serial.TypedMessage { @@ -67,50 +74,60 @@ func (x *Config) GetHeaderSettings() *serial.TypedMessage { return nil } -var File_v2ray_com_core_transport_internet_tcp_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_tcp_config_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x1a, 0x30, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 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, 0x5f, 0x0a, 0x06, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x4f, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x76, - 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x52, 0x0a, 0x25, 0x63, 0x6f, - 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x03, 0x74, 0x63, 0x70, 0xaa, 0x02, 0x21, 0x56, 0x32, 0x52, - 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, +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, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x93, 0x01, 0x0a, 0x06, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4f, 0x0a, 0x0f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x74, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 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, 0x25, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x21, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, + 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_v2ray_com_core_transport_internet_tcp_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_tcp_config_proto_rawDescData = file_v2ray_com_core_transport_internet_tcp_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_tcp_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_tcp_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_tcp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_tcp_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_tcp_config_proto_rawDescData + return file_transport_internet_tcp_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_tcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_tcp_config_proto_goTypes = []interface{}{ +var file_transport_internet_tcp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_internet_tcp_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.internet.tcp.Config (*serial.TypedMessage)(nil), // 1: v2ray.core.common.serial.TypedMessage } -var file_v2ray_com_core_transport_internet_tcp_config_proto_depIdxs = []int32{ +var file_transport_internet_tcp_config_proto_depIdxs = []int32{ 1, // 0: v2ray.core.transport.internet.tcp.Config.header_settings:type_name -> v2ray.core.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 @@ -119,13 +136,13 @@ var file_v2ray_com_core_transport_internet_tcp_config_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_tcp_config_proto_init() } -func file_v2ray_com_core_transport_internet_tcp_config_proto_init() { - if File_v2ray_com_core_transport_internet_tcp_config_proto != nil { +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_v2ray_com_core_transport_internet_tcp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -142,18 +159,18 @@ func file_v2ray_com_core_transport_internet_tcp_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_tcp_config_proto_rawDesc, + RawDescriptor: file_transport_internet_tcp_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_tcp_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_tcp_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_tcp_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_tcp_config_proto = out.File - file_v2ray_com_core_transport_internet_tcp_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_tcp_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_tcp_config_proto_depIdxs = nil + 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/transport/internet/tcp/config.proto b/transport/internet/tcp/config.proto index 92e060cd47..3915ba80f5 100644 --- a/transport/internet/tcp/config.proto +++ b/transport/internet/tcp/config.proto @@ -2,13 +2,14 @@ syntax = "proto3"; package v2ray.core.transport.internet.tcp; option csharp_namespace = "V2Ray.Core.Transport.Internet.Tcp"; -option go_package = "tcp"; +option go_package = "v2ray.com/core/transport/internet/tcp"; option java_package = "com.v2ray.core.transport.internet.tcp"; option java_multiple_files = true; -import "v2ray.com/core/common/serial/typed_message.proto"; +import "common/serial/typed_message.proto"; message Config { reserved 1; v2ray.core.common.serial.TypedMessage header_settings = 2; + bool accept_proxy_protocol = 3; } diff --git a/transport/internet/tcp/dialer.go b/transport/internet/tcp/dialer.go index 322583a4f0..6c744dead9 100644 --- a/transport/internet/tcp/dialer.go +++ b/transport/internet/tcp/dialer.go @@ -10,6 +10,7 @@ import ( "v2ray.com/core/common/session" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" ) // Dial dials a new TCP connection to the given destination. @@ -22,11 +23,17 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { tlsConfig := config.GetTLSConfig(tls.WithDestination(dest)) - if config.IsExperiment8357() { - conn = tls.UClient(conn, tlsConfig) - } else { - conn = tls.Client(conn, tlsConfig) - } + /* + if config.IsExperiment8357() { + conn = tls.UClient(conn, tlsConfig) + } else { + conn = tls.Client(conn, tlsConfig) + } + */ + conn = tls.Client(conn, tlsConfig) + } else if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + xtlsConfig := config.GetXTLSConfig(xtls.WithDestination(dest)) + conn = xtls.Client(conn, xtlsConfig) } tcpSettings := streamSettings.ProtocolSettings.(*Config) diff --git a/transport/internet/tcp/hub.go b/transport/internet/tcp/hub.go index f3e6ade0ca..de13e76f84 100644 --- a/transport/internet/tcp/hub.go +++ b/transport/internet/tcp/hub.go @@ -8,17 +8,22 @@ import ( "strings" "time" + "github.com/pires/go-proxyproto" + goxtls "github.com/xtls/go" + "v2ray.com/core/common" "v2ray.com/core/common/net" "v2ray.com/core/common/session" "v2ray.com/core/transport/internet" "v2ray.com/core/transport/internet/tls" + "v2ray.com/core/transport/internet/xtls" ) // Listener is an internet.Listener that listens for TCP connections. type Listener struct { listener net.Listener tlsConfig *gotls.Config + xtlsConfig *goxtls.Config authConfig internet.ConnectionAuthenticator config *Config addConn internet.ConnHandler @@ -31,20 +36,35 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, streamSe Port: int(port), }, streamSettings.SocketSettings) if err != nil { - return nil, err + return nil, newError("failed to listen TCP on", address, ":", port).Base(err) } newError("listening TCP on ", address, ":", port).WriteToLog(session.ExportIDToError(ctx)) tcpSettings := streamSettings.ProtocolSettings.(*Config) - l := &Listener{ - listener: listener, - config: tcpSettings, - addConn: handler, + var l *Listener + + if tcpSettings.AcceptProxyProtocol { + policyFunc := func(upstream net.Addr) (proxyproto.Policy, error) { return proxyproto.REQUIRE, nil } + l = &Listener{ + listener: &proxyproto.Listener{Listener: listener, Policy: policyFunc}, + config: tcpSettings, + addConn: handler, + } + newError("accepting PROXY protocol").AtWarning().WriteToLog(session.ExportIDToError(ctx)) + } else { + l = &Listener{ + listener: listener, + config: tcpSettings, + addConn: handler, + } } if config := tls.ConfigFromStreamSettings(streamSettings); config != nil { l.tlsConfig = config.GetTLSConfig(tls.WithNextProto("h2")) } + if config := xtls.ConfigFromStreamSettings(streamSettings); config != nil { + l.xtlsConfig = config.GetXTLSConfig(xtls.WithNextProto("h2")) + } if tcpSettings.HeaderSettings != nil { headerConfig, err := tcpSettings.HeaderSettings.GetInstance() @@ -57,6 +77,7 @@ func ListenTCP(ctx context.Context, address net.Address, port net.Port, streamSe } l.authConfig = auth } + go l.keepAccepting() return l, nil } @@ -78,6 +99,8 @@ func (v *Listener) keepAccepting() { if v.tlsConfig != nil { conn = tls.Server(conn, v.tlsConfig) + } else if v.xtlsConfig != nil { + conn = xtls.Server(conn, v.xtlsConfig) } if v.authConfig != nil { conn = v.authConfig.Server(conn) diff --git a/transport/internet/tcp/tcp.go b/transport/internet/tcp/tcp.go index 05307a111e..052d4eb753 100644 --- a/transport/internet/tcp/tcp.go +++ b/transport/internet/tcp/tcp.go @@ -1,3 +1,3 @@ package tcp -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/tls/config.pb.go b/transport/internet/tls/config.pb.go index 530a9b81c4..e7b3a62706 100644 --- a/transport/internet/tls/config.pb.go +++ b/transport/internet/tls/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/tls/config.proto + package tls import ( @@ -52,11 +58,11 @@ func (x Certificate_Usage) String() string { } func (Certificate_Usage) Descriptor() protoreflect.EnumDescriptor { - return file_v2ray_com_core_transport_internet_tls_config_proto_enumTypes[0].Descriptor() + return file_transport_internet_tls_config_proto_enumTypes[0].Descriptor() } func (Certificate_Usage) Type() protoreflect.EnumType { - return &file_v2ray_com_core_transport_internet_tls_config_proto_enumTypes[0] + return &file_transport_internet_tls_config_proto_enumTypes[0] } func (x Certificate_Usage) Number() protoreflect.EnumNumber { @@ -65,7 +71,7 @@ func (x Certificate_Usage) Number() protoreflect.EnumNumber { // Deprecated: Use Certificate_Usage.Descriptor instead. func (Certificate_Usage) EnumDescriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_tls_config_proto_rawDescGZIP(), []int{0, 0} + return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{0, 0} } type Certificate struct { @@ -83,7 +89,7 @@ type Certificate struct { func (x *Certificate) Reset() { *x = Certificate{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[0] + mi := &file_transport_internet_tls_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -96,7 +102,7 @@ func (x *Certificate) String() string { func (*Certificate) ProtoMessage() {} func (x *Certificate) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[0] + 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 { @@ -109,7 +115,7 @@ func (x *Certificate) ProtoReflect() protoreflect.Message { // Deprecated: Use Certificate.ProtoReflect.Descriptor instead. func (*Certificate) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_tls_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{0} } func (x *Certificate) GetCertificate() []byte { @@ -150,14 +156,15 @@ type Config struct { NextProtocol []string `protobuf:"bytes,4,rep,name=next_protocol,json=nextProtocol,proto3" json:"next_protocol,omitempty"` // Whether or not to disable session (ticket) resumption. DisableSessionResumption bool `protobuf:"varint,6,opt,name=disable_session_resumption,json=disableSessionResumption,proto3" json:"disable_session_resumption,omitempty"` - // If true, root certificates on the system will not be loaded for verification. + // If true, root certificates on the system will not be loaded for + // verification. DisableSystemRoot bool `protobuf:"varint,7,opt,name=disable_system_root,json=disableSystemRoot,proto3" json:"disable_system_root,omitempty"` } func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[1] + mi := &file_transport_internet_tls_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -170,7 +177,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[1] + 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 { @@ -183,7 +190,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_tls_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_tls_config_proto_rawDescGZIP(), []int{1} } func (x *Config) GetAllowInsecure() bool { @@ -235,79 +242,80 @@ func (x *Config) GetDisableSystemRoot() bool { return false } -var File_v2ray_com_core_transport_internet_tls_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_tls_config_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x6c, 0x73, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x05, 0x75, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0xeb, 0x02, - 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, - 0x34, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, - 0x65, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x43, 0x69, - 0x70, 0x68, 0x65, 0x72, 0x73, 0x12, 0x50, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x76, 0x32, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, 0x0a, - 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 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, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, - 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x52, 0x0a, 0x25, 0x63, - 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x03, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x21, 0x56, 0x32, - 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x6c, 0x73, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x4a, 0x0a, 0x05, + 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0xeb, + 0x02, 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, 0x34, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x43, + 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x12, 0x50, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x3c, + 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 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, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, + 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x74, 0x0a, 0x25, + 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x25, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 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, + 0x21, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_tls_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_tls_config_proto_rawDescData = file_v2ray_com_core_transport_internet_tls_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_tls_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_tls_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_tls_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_tls_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_tls_config_proto_rawDescData + return file_transport_internet_tls_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_tls_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_transport_internet_tls_config_proto_goTypes = []interface{}{ +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: v2ray.core.transport.internet.tls.Certificate.Usage (*Certificate)(nil), // 1: v2ray.core.transport.internet.tls.Certificate (*Config)(nil), // 2: v2ray.core.transport.internet.tls.Config } -var file_v2ray_com_core_transport_internet_tls_config_proto_depIdxs = []int32{ +var file_transport_internet_tls_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.transport.internet.tls.Certificate.usage:type_name -> v2ray.core.transport.internet.tls.Certificate.Usage 1, // 1: v2ray.core.transport.internet.tls.Config.certificate:type_name -> v2ray.core.transport.internet.tls.Certificate 2, // [2:2] is the sub-list for method output_type @@ -317,13 +325,13 @@ var file_v2ray_com_core_transport_internet_tls_config_proto_depIdxs = []int32{ 0, // [0:2] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_tls_config_proto_init() } -func file_v2ray_com_core_transport_internet_tls_config_proto_init() { - if File_v2ray_com_core_transport_internet_tls_config_proto != nil { +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_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -335,7 +343,7 @@ func file_v2ray_com_core_transport_internet_tls_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -352,19 +360,19 @@ func file_v2ray_com_core_transport_internet_tls_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_tls_config_proto_rawDesc, + RawDescriptor: file_transport_internet_tls_config_proto_rawDesc, NumEnums: 1, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_tls_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_tls_config_proto_depIdxs, - EnumInfos: file_v2ray_com_core_transport_internet_tls_config_proto_enumTypes, - MessageInfos: file_v2ray_com_core_transport_internet_tls_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_tls_config_proto = out.File - file_v2ray_com_core_transport_internet_tls_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_tls_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_tls_config_proto_depIdxs = nil + 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/transport/internet/tls/config.proto b/transport/internet/tls/config.proto index e1e9dcb5ed..036ce5b83a 100644 --- a/transport/internet/tls/config.proto +++ b/transport/internet/tls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.transport.internet.tls; option csharp_namespace = "V2Ray.Core.Transport.Internet.Tls"; -option go_package = "tls"; +option go_package = "v2ray.com/core/transport/internet/tls"; option java_package = "com.v2ray.core.transport.internet.tls"; option java_multiple_files = true; @@ -41,6 +41,7 @@ message Config { // Whether or not to disable session (ticket) resumption. bool disable_session_resumption = 6; - // If true, root certificates on the system will not be loaded for verification. + // If true, root certificates on the system will not be loaded for + // verification. bool disable_system_root = 7; } diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index baf5d39336..a102e1f081 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -7,11 +7,9 @@ import ( "v2ray.com/core/common/buf" "v2ray.com/core/common/net" - - utls "github.com/refraction-networking/utls" ) -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen var ( _ buf.Writer = (*Conn)(nil) @@ -45,6 +43,7 @@ func Client(c net.Conn, config *tls.Config) net.Conn { return &Conn{Conn: tlsConn} } +/* func copyConfig(c *tls.Config) *utls.Config { return &utls.Config{ NextProtos: c.NextProtos, @@ -59,6 +58,7 @@ func UClient(c net.Conn, config *tls.Config) net.Conn { uConfig := copyConfig(config) return utls.Client(c, uConfig) } +*/ // Server initiates a TLS server handshake on the given connection. func Server(c net.Conn, config *tls.Config) net.Conn { diff --git a/transport/internet/udp/config.pb.go b/transport/internet/udp/config.pb.go index 5b7fe6ea6d..d44d82db3d 100644 --- a/transport/internet/udp/config.pb.go +++ b/transport/internet/udp/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/udp/config.proto + package udp import ( @@ -28,7 +34,7 @@ type Config struct { func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_udp_config_proto_msgTypes[0] + mi := &file_transport_internet_udp_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -41,7 +47,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_udp_config_proto_msgTypes[0] + 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 { @@ -54,43 +60,44 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_udp_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_udp_config_proto_rawDescGZIP(), []int{0} } -var File_v2ray_com_core_transport_internet_udp_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_udp_config_proto_rawDesc = []byte{ - 0x0a, 0x32, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x52, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x72, 0x65, 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, 0x03, 0x75, 0x64, - 0x70, 0xaa, 0x02, 0x21, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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 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, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, + 0x65, 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, 0x74, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, + 0x63, 0x6f, 0x72, 0x65, 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, 0x25, 0x76, + 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x21, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, + 0x65, 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_v2ray_com_core_transport_internet_udp_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_udp_config_proto_rawDescData = file_v2ray_com_core_transport_internet_udp_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_udp_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_udp_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_udp_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_udp_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_udp_config_proto_rawDescData + return file_transport_internet_udp_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_udp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v2ray_com_core_transport_internet_udp_config_proto_goTypes = []interface{}{ +var file_transport_internet_udp_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_transport_internet_udp_config_proto_goTypes = []interface{}{ (*Config)(nil), // 0: v2ray.core.transport.internet.udp.Config } -var file_v2ray_com_core_transport_internet_udp_config_proto_depIdxs = []int32{ +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 @@ -98,13 +105,13 @@ var file_v2ray_com_core_transport_internet_udp_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_udp_config_proto_init() } -func file_v2ray_com_core_transport_internet_udp_config_proto_init() { - if File_v2ray_com_core_transport_internet_udp_config_proto != nil { +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_v2ray_com_core_transport_internet_udp_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + 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 @@ -121,18 +128,18 @@ func file_v2ray_com_core_transport_internet_udp_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_udp_config_proto_rawDesc, + RawDescriptor: file_transport_internet_udp_config_proto_rawDesc, NumEnums: 0, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_udp_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_udp_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_udp_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_udp_config_proto = out.File - file_v2ray_com_core_transport_internet_udp_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_udp_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_udp_config_proto_depIdxs = nil + 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/transport/internet/udp/config.proto b/transport/internet/udp/config.proto index 89ec1e6b19..ff40800262 100644 --- a/transport/internet/udp/config.proto +++ b/transport/internet/udp/config.proto @@ -2,9 +2,8 @@ syntax = "proto3"; package v2ray.core.transport.internet.udp; option csharp_namespace = "V2Ray.Core.Transport.Internet.Udp"; -option go_package = "udp"; +option go_package = "v2ray.com/core/transport/internet/udp"; option java_package = "com.v2ray.core.transport.internet.udp"; option java_multiple_files = true; -message Config { -} +message Config {} diff --git a/transport/internet/udp/udp.go b/transport/internet/udp/udp.go index cbcebe440f..444da1cdd1 100644 --- a/transport/internet/udp/udp.go +++ b/transport/internet/udp/udp.go @@ -1,5 +1,5 @@ package udp -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen const protocolName = "udp" diff --git a/transport/internet/websocket/config.pb.go b/transport/internet/websocket/config.pb.go index 510a5a1c9d..07fa6ed520 100644 --- a/transport/internet/websocket/config.pb.go +++ b/transport/internet/websocket/config.pb.go @@ -1,3 +1,9 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/websocket/config.proto + package websocket import ( @@ -31,7 +37,7 @@ type Header struct { func (x *Header) Reset() { *x = Header{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[0] + mi := &file_transport_internet_websocket_config_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +50,7 @@ func (x *Header) String() string { func (*Header) ProtoMessage() {} func (x *Header) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[0] + 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 { @@ -57,7 +63,7 @@ func (x *Header) ProtoReflect() protoreflect.Message { // Deprecated: Use Header.ProtoReflect.Descriptor instead. func (*Header) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescGZIP(), []int{0} + return file_transport_internet_websocket_config_proto_rawDescGZIP(), []int{0} } func (x *Header) GetKey() string { @@ -80,14 +86,15 @@ type Config struct { unknownFields protoimpl.UnknownFields // URL path to the WebSocket service. Empty value means root(/). - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - Header []*Header `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Header []*Header `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"` + AcceptProxyProtocol bool `protobuf:"varint,4,opt,name=accept_proxy_protocol,json=acceptProxyProtocol,proto3" json:"accept_proxy_protocol,omitempty"` } func (x *Config) Reset() { *x = Config{} if protoimpl.UnsafeEnabled { - mi := &file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[1] + mi := &file_transport_internet_websocket_config_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -100,7 +107,7 @@ func (x *Config) String() string { func (*Config) ProtoMessage() {} func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[1] + mi := &file_transport_internet_websocket_config_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -113,7 +120,7 @@ func (x *Config) ProtoReflect() protoreflect.Message { // Deprecated: Use Config.ProtoReflect.Descriptor instead. func (*Config) Descriptor() ([]byte, []int) { - return file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescGZIP(), []int{1} + return file_transport_internet_websocket_config_proto_rawDescGZIP(), []int{1} } func (x *Config) GetPath() string { @@ -130,52 +137,64 @@ func (x *Config) GetHeader() []*Header { return nil } -var File_v2ray_com_core_transport_internet_websocket_config_proto protoreflect.FileDescriptor - -var file_v2ray_com_core_transport_internet_websocket_config_proto_rawDesc = []byte{ - 0x0a, 0x38, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x2f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x27, 0x76, 0x32, 0x72, 0x61, - 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x6b, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x61, 0x74, 0x68, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, - 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, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4a, 0x04, 0x08, 0x01, - 0x10, 0x02, 0x42, 0x64, 0x0a, 0x2b, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, - 0x63, 0x6f, 0x72, 0x65, 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, 0x09, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0xaa, 0x02, - 0x27, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 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, +func (x *Config) GetAcceptProxyProtocol() bool { + if x != nil { + return x.AcceptProxyProtocol + } + return false +} + +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, 0x27, 0x76, 0x32, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x9f, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x47, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 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, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 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, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x86, 0x01, 0x0a, 0x2b, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 0x2b, 0x76, 0x32, 0x72, 0x61, + 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 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, 0x27, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, + 0x43, 0x6f, 0x72, 0x65, 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_v2ray_com_core_transport_internet_websocket_config_proto_rawDescOnce sync.Once - file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescData = file_v2ray_com_core_transport_internet_websocket_config_proto_rawDesc + 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_v2ray_com_core_transport_internet_websocket_config_proto_rawDescGZIP() []byte { - file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescOnce.Do(func() { - file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_v2ray_com_core_transport_internet_websocket_config_proto_rawDescData) +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_v2ray_com_core_transport_internet_websocket_config_proto_rawDescData + return file_transport_internet_websocket_config_proto_rawDescData } -var file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_v2ray_com_core_transport_internet_websocket_config_proto_goTypes = []interface{}{ +var file_transport_internet_websocket_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_transport_internet_websocket_config_proto_goTypes = []interface{}{ (*Header)(nil), // 0: v2ray.core.transport.internet.websocket.Header (*Config)(nil), // 1: v2ray.core.transport.internet.websocket.Config } -var file_v2ray_com_core_transport_internet_websocket_config_proto_depIdxs = []int32{ +var file_transport_internet_websocket_config_proto_depIdxs = []int32{ 0, // 0: v2ray.core.transport.internet.websocket.Config.header:type_name -> v2ray.core.transport.internet.websocket.Header 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type @@ -184,13 +203,13 @@ var file_v2ray_com_core_transport_internet_websocket_config_proto_depIdxs = []in 0, // [0:1] is the sub-list for field type_name } -func init() { file_v2ray_com_core_transport_internet_websocket_config_proto_init() } -func file_v2ray_com_core_transport_internet_websocket_config_proto_init() { - if File_v2ray_com_core_transport_internet_websocket_config_proto != nil { +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_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_websocket_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Header); i { case 0: return &v.state @@ -202,7 +221,7 @@ func file_v2ray_com_core_transport_internet_websocket_config_proto_init() { return nil } } - file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_transport_internet_websocket_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Config); i { case 0: return &v.state @@ -219,18 +238,18 @@ func file_v2ray_com_core_transport_internet_websocket_config_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v2ray_com_core_transport_internet_websocket_config_proto_rawDesc, + RawDescriptor: file_transport_internet_websocket_config_proto_rawDesc, NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_v2ray_com_core_transport_internet_websocket_config_proto_goTypes, - DependencyIndexes: file_v2ray_com_core_transport_internet_websocket_config_proto_depIdxs, - MessageInfos: file_v2ray_com_core_transport_internet_websocket_config_proto_msgTypes, + 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_v2ray_com_core_transport_internet_websocket_config_proto = out.File - file_v2ray_com_core_transport_internet_websocket_config_proto_rawDesc = nil - file_v2ray_com_core_transport_internet_websocket_config_proto_goTypes = nil - file_v2ray_com_core_transport_internet_websocket_config_proto_depIdxs = nil + 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/transport/internet/websocket/config.proto b/transport/internet/websocket/config.proto index 6e36467d1b..7d53f9d131 100644 --- a/transport/internet/websocket/config.proto +++ b/transport/internet/websocket/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package v2ray.core.transport.internet.websocket; option csharp_namespace = "V2Ray.Core.Transport.Internet.Websocket"; -option go_package = "websocket"; +option go_package = "v2ray.com/core/transport/internet/websocket"; option java_package = "com.v2ray.core.transport.internet.websocket"; option java_multiple_files = true; @@ -18,4 +18,6 @@ message Config { string path = 2; repeated Header header = 3; -} \ No newline at end of file + + bool accept_proxy_protocol = 4; +} diff --git a/transport/internet/websocket/hub.go b/transport/internet/websocket/hub.go index fc9d08c1d8..e7e90d35d7 100644 --- a/transport/internet/websocket/hub.go +++ b/transport/internet/websocket/hub.go @@ -10,6 +10,8 @@ import ( "time" "github.com/gorilla/websocket" + "github.com/pires/go-proxyproto" + "v2ray.com/core/common" "v2ray.com/core/common/net" http_proto "v2ray.com/core/common/protocol/http" @@ -61,16 +63,27 @@ type Listener struct { } func ListenWS(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, addConn internet.ConnHandler) (internet.Listener, error) { + listener, err := internet.ListenSystem(ctx, &net.TCPAddr{ + IP: address.IP(), + Port: int(port), + }, streamSettings.SocketSettings) + if err != nil { + return nil, newError("failed to listen TCP(for WS) on", address, ":", port).Base(err) + } + newError("listening TCP(for WS) on ", address, ":", port).WriteToLog(session.ExportIDToError(ctx)) + wsSettings := streamSettings.ProtocolSettings.(*Config) - var tlsConfig *tls.Config - if config := v2tls.ConfigFromStreamSettings(streamSettings); config != nil { - tlsConfig = config.GetTLSConfig() + if wsSettings.AcceptProxyProtocol { + policyFunc := func(upstream net.Addr) (proxyproto.Policy, error) { return proxyproto.REQUIRE, nil } + listener = &proxyproto.Listener{Listener: listener, Policy: policyFunc} + newError("accepting PROXY protocol").AtWarning().WriteToLog(session.ExportIDToError(ctx)) } - listener, err := listenTCP(ctx, address, port, tlsConfig, streamSettings.SocketSettings) - if err != nil { - return nil, err + if config := v2tls.ConfigFromStreamSettings(streamSettings); config != nil { + if tlsConfig := config.GetTLSConfig(); tlsConfig != nil { + listener = tls.NewListener(listener, tlsConfig) + } } l := &Listener{ @@ -97,22 +110,6 @@ func ListenWS(ctx context.Context, address net.Address, port net.Port, streamSet return l, err } -func listenTCP(ctx context.Context, address net.Address, port net.Port, tlsConfig *tls.Config, sockopt *internet.SocketConfig) (net.Listener, error) { - listener, err := internet.ListenSystem(ctx, &net.TCPAddr{ - IP: address.IP(), - Port: int(port), - }, sockopt) - if err != nil { - return nil, newError("failed to listen TCP on", address, ":", port).Base(err) - } - - if tlsConfig != nil { - return tls.NewListener(listener, tlsConfig), nil - } - - return listener, nil -} - // Addr implements net.Listener.Addr(). func (ln *Listener) Addr() net.Addr { return ln.listener.Addr() diff --git a/transport/internet/websocket/ws.go b/transport/internet/websocket/ws.go index 7edd134415..157f436a73 100644 --- a/transport/internet/websocket/ws.go +++ b/transport/internet/websocket/ws.go @@ -4,4 +4,4 @@ Websocket transport implements an HTTP(S) compliable, surveillance proof transpo */ package websocket -//go:generate errorgen +//go:generate go run v2ray.com/core/common/errors/errorgen diff --git a/transport/internet/xtls/config.go b/transport/internet/xtls/config.go new file mode 100644 index 0000000000..580d1ceadc --- /dev/null +++ b/transport/internet/xtls/config.go @@ -0,0 +1,231 @@ +// +build !confonly + +package xtls + +import ( + "crypto/x509" + "sync" + "time" + + xtls "github.com/xtls/go" + + "v2ray.com/core/common/net" + "v2ray.com/core/common/protocol/tls/cert" + "v2ray.com/core/transport/internet" +) + +var ( + globalSessionCache = xtls.NewLRUClientSessionCache(128) +) + +// ParseCertificate converts a cert.Certificate to Certificate. +func ParseCertificate(c *cert.Certificate) *Certificate { + certPEM, keyPEM := c.ToPEM() + return &Certificate{ + Certificate: certPEM, + Key: keyPEM, + } +} + +func (c *Config) loadSelfCertPool() (*x509.CertPool, error) { + root := x509.NewCertPool() + for _, cert := range c.Certificate { + if !root.AppendCertsFromPEM(cert.Certificate) { + return nil, newError("failed to append cert").AtWarning() + } + } + return root, nil +} + +// BuildCertificates builds a list of TLS certificates from proto definition. +func (c *Config) BuildCertificates() []xtls.Certificate { + certs := make([]xtls.Certificate, 0, len(c.Certificate)) + for _, entry := range c.Certificate { + if entry.Usage != Certificate_ENCIPHERMENT { + continue + } + keyPair, err := xtls.X509KeyPair(entry.Certificate, entry.Key) + if err != nil { + newError("ignoring invalid X509 key pair").Base(err).AtWarning().WriteToLog() + continue + } + certs = append(certs, keyPair) + } + return certs +} + +func isCertificateExpired(c *xtls.Certificate) bool { + if c.Leaf == nil && len(c.Certificate) > 0 { + if pc, err := x509.ParseCertificate(c.Certificate[0]); err == nil { + c.Leaf = pc + } + } + + // If leaf is not there, the certificate is probably not used yet. We trust user to provide a valid certificate. + return c.Leaf != nil && c.Leaf.NotAfter.Before(time.Now().Add(-time.Minute)) +} + +func issueCertificate(rawCA *Certificate, domain string) (*xtls.Certificate, error) { + parent, err := cert.ParseCertificate(rawCA.Certificate, rawCA.Key) + if err != nil { + return nil, newError("failed to parse raw certificate").Base(err) + } + newCert, err := cert.Generate(parent, cert.CommonName(domain), cert.DNSNames(domain)) + if err != nil { + return nil, newError("failed to generate new certificate for ", domain).Base(err) + } + newCertPEM, newKeyPEM := newCert.ToPEM() + cert, err := xtls.X509KeyPair(newCertPEM, newKeyPEM) + return &cert, err +} + +func (c *Config) getCustomCA() []*Certificate { + certs := make([]*Certificate, 0, len(c.Certificate)) + for _, certificate := range c.Certificate { + if certificate.Usage == Certificate_AUTHORITY_ISSUE { + certs = append(certs, certificate) + } + } + return certs +} + +func getGetCertificateFunc(c *xtls.Config, ca []*Certificate) func(hello *xtls.ClientHelloInfo) (*xtls.Certificate, error) { + var access sync.RWMutex + + return func(hello *xtls.ClientHelloInfo) (*xtls.Certificate, error) { + domain := hello.ServerName + certExpired := false + + access.RLock() + certificate, found := c.NameToCertificate[domain] + access.RUnlock() + + if found { + if !isCertificateExpired(certificate) { + return certificate, nil + } + certExpired = true + } + + if certExpired { + newCerts := make([]xtls.Certificate, 0, len(c.Certificates)) + + access.Lock() + for _, certificate := range c.Certificates { + if !isCertificateExpired(&certificate) { + newCerts = append(newCerts, certificate) + } + } + + c.Certificates = newCerts + access.Unlock() + } + + var issuedCertificate *xtls.Certificate + + // Create a new certificate from existing CA if possible + for _, rawCert := range ca { + if rawCert.Usage == Certificate_AUTHORITY_ISSUE { + newCert, err := issueCertificate(rawCert, domain) + if err != nil { + newError("failed to issue new certificate for ", domain).Base(err).WriteToLog() + continue + } + + access.Lock() + c.Certificates = append(c.Certificates, *newCert) + issuedCertificate = &c.Certificates[len(c.Certificates)-1] + access.Unlock() + break + } + } + + if issuedCertificate == nil { + return nil, newError("failed to create a new certificate for ", domain) + } + + access.Lock() + c.BuildNameToCertificate() + access.Unlock() + + return issuedCertificate, nil + } +} + +func (c *Config) parseServerName() string { + return c.ServerName +} + +// GetXTLSConfig converts this Config into xtls.Config. +func (c *Config) GetXTLSConfig(opts ...Option) *xtls.Config { + root, err := c.getCertPool() + if err != nil { + newError("failed to load system root certificate").AtError().Base(err).WriteToLog() + } + + config := &xtls.Config{ + ClientSessionCache: globalSessionCache, + RootCAs: root, + InsecureSkipVerify: c.AllowInsecure, + NextProtos: c.NextProtocol, + SessionTicketsDisabled: c.DisableSessionResumption, + } + if c == nil { + return config + } + + for _, opt := range opts { + opt(config) + } + + config.Certificates = c.BuildCertificates() + config.BuildNameToCertificate() + + caCerts := c.getCustomCA() + if len(caCerts) > 0 { + config.GetCertificate = getGetCertificateFunc(config, caCerts) + } + + if sn := c.parseServerName(); len(sn) > 0 { + config.ServerName = sn + } + + if len(config.NextProtos) == 0 { + config.NextProtos = []string{"h2", "http/1.1"} + } + + return config +} + +// Option for building XTLS config. +type Option func(*xtls.Config) + +// WithDestination sets the server name in XTLS config. +func WithDestination(dest net.Destination) Option { + return func(config *xtls.Config) { + if dest.Address.Family().IsDomain() && config.ServerName == "" { + config.ServerName = dest.Address.Domain() + } + } +} + +// WithNextProto sets the ALPN values in XTLS config. +func WithNextProto(protocol ...string) Option { + return func(config *xtls.Config) { + if len(config.NextProtos) == 0 { + config.NextProtos = protocol + } + } +} + +// ConfigFromStreamSettings fetches Config from stream settings. Nil if not found. +func ConfigFromStreamSettings(settings *internet.MemoryStreamConfig) *Config { + if settings == nil { + return nil + } + config, ok := settings.SecuritySettings.(*Config) + if !ok { + return nil + } + return config +} diff --git a/transport/internet/xtls/config.pb.go b/transport/internet/xtls/config.pb.go new file mode 100644 index 0000000000..862d5f26ef --- /dev/null +++ b/transport/internet/xtls/config.pb.go @@ -0,0 +1,379 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: transport/internet/xtls/config.proto + +package xtls + +import ( + proto "github.com/golang/protobuf/proto" + 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) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +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_xtls_config_proto_enumTypes[0].Descriptor() +} + +func (Certificate_Usage) Type() protoreflect.EnumType { + return &file_transport_internet_xtls_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_xtls_config_proto_rawDescGZIP(), []int{0, 0} +} + +type Certificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // XTLS certificate in x509 format. + Certificate []byte `protobuf:"bytes,1,opt,name=Certificate,proto3" json:"Certificate,omitempty"` + // XTLS 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=v2ray.core.transport.internet.xtls.Certificate_Usage" json:"usage,omitempty"` +} + +func (x *Certificate) Reset() { + *x = Certificate{} + if protoimpl.UnsafeEnabled { + mi := &file_transport_internet_xtls_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_xtls_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_xtls_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 +} + +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"` + // Whether or not to allow insecure cipher suites. + AllowInsecureCiphers bool `protobuf:"varint,5,opt,name=allow_insecure_ciphers,json=allowInsecureCiphers,proto3" json:"allow_insecure_ciphers,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 disable session (ticket) resumption. + DisableSessionResumption bool `protobuf:"varint,6,opt,name=disable_session_resumption,json=disableSessionResumption,proto3" json:"disable_session_resumption,omitempty"` + // If true, root certificates on the system will not be loaded for + // verification. + DisableSystemRoot bool `protobuf:"varint,7,opt,name=disable_system_root,json=disableSystemRoot,proto3" json:"disable_system_root,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + if protoimpl.UnsafeEnabled { + mi := &file_transport_internet_xtls_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_xtls_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_xtls_config_proto_rawDescGZIP(), []int{1} +} + +func (x *Config) GetAllowInsecure() bool { + if x != nil { + return x.AllowInsecure + } + return false +} + +func (x *Config) GetAllowInsecureCiphers() bool { + if x != nil { + return x.AllowInsecureCiphers + } + 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) GetDisableSessionResumption() bool { + if x != nil { + return x.DisableSessionResumption + } + return false +} + +func (x *Config) GetDisableSystemRoot() bool { + if x != nil { + return x.DisableSystemRoot + } + return false +} + +var File_transport_internet_xtls_config_proto protoreflect.FileDescriptor + +var file_transport_internet_xtls_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, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x22, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, 0x74, 0x6c, 0x73, 0x22, 0xd4, 0x01, 0x0a, 0x0b, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x4b, 0x65, 0x79, 0x12, 0x4b, + 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, + 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, 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, 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, 0xec, 0x02, 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, 0x34, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x14, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x49, 0x6e, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x43, 0x69, 0x70, 0x68, 0x65, 0x72, 0x73, 0x12, 0x51, 0x0a, 0x0b, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, + 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, 0x3c, 0x0a, 0x1a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x64, 0x69, 0x73, 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, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, + 0x42, 0x77, 0x0a, 0x26, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, 0x74, 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x26, 0x76, 0x32, + 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, + 0x78, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x22, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, + 0x65, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x58, 0x74, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_transport_internet_xtls_config_proto_rawDescOnce sync.Once + file_transport_internet_xtls_config_proto_rawDescData = file_transport_internet_xtls_config_proto_rawDesc +) + +func file_transport_internet_xtls_config_proto_rawDescGZIP() []byte { + file_transport_internet_xtls_config_proto_rawDescOnce.Do(func() { + file_transport_internet_xtls_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_internet_xtls_config_proto_rawDescData) + }) + return file_transport_internet_xtls_config_proto_rawDescData +} + +var file_transport_internet_xtls_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_transport_internet_xtls_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_transport_internet_xtls_config_proto_goTypes = []interface{}{ + (Certificate_Usage)(0), // 0: v2ray.core.transport.internet.xtls.Certificate.Usage + (*Certificate)(nil), // 1: v2ray.core.transport.internet.xtls.Certificate + (*Config)(nil), // 2: v2ray.core.transport.internet.xtls.Config +} +var file_transport_internet_xtls_config_proto_depIdxs = []int32{ + 0, // 0: v2ray.core.transport.internet.xtls.Certificate.usage:type_name -> v2ray.core.transport.internet.xtls.Certificate.Usage + 1, // 1: v2ray.core.transport.internet.xtls.Config.certificate:type_name -> v2ray.core.transport.internet.xtls.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_xtls_config_proto_init() } +func file_transport_internet_xtls_config_proto_init() { + if File_transport_internet_xtls_config_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_transport_internet_xtls_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_xtls_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_xtls_config_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_transport_internet_xtls_config_proto_goTypes, + DependencyIndexes: file_transport_internet_xtls_config_proto_depIdxs, + EnumInfos: file_transport_internet_xtls_config_proto_enumTypes, + MessageInfos: file_transport_internet_xtls_config_proto_msgTypes, + }.Build() + File_transport_internet_xtls_config_proto = out.File + file_transport_internet_xtls_config_proto_rawDesc = nil + file_transport_internet_xtls_config_proto_goTypes = nil + file_transport_internet_xtls_config_proto_depIdxs = nil +} diff --git a/transport/internet/xtls/config.proto b/transport/internet/xtls/config.proto new file mode 100644 index 0000000000..490ae6e95f --- /dev/null +++ b/transport/internet/xtls/config.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package v2ray.core.transport.internet.xtls; +option csharp_namespace = "V2Ray.Core.Transport.Internet.Xtls"; +option go_package = "v2ray.com/core/transport/internet/xtls"; +option java_package = "com.v2ray.core.transport.internet.xtls"; +option java_multiple_files = true; + +message Certificate { + // XTLS certificate in x509 format. + bytes Certificate = 1; + + // XTLS key in x509 format. + bytes Key = 2; + + enum Usage { + ENCIPHERMENT = 0; + AUTHORITY_VERIFY = 1; + AUTHORITY_ISSUE = 2; + } + + Usage usage = 3; +} + +message Config { + // Whether or not to allow self-signed certificates. + bool allow_insecure = 1; + + // Whether or not to allow insecure cipher suites. + bool allow_insecure_ciphers = 5; + + // List of certificates to be served on server. + repeated Certificate certificate = 2; + + // Override server name. + string server_name = 3; + + // Lists of string as ALPN values. + repeated string next_protocol = 4; + + // Whether or not to disable session (ticket) resumption. + bool disable_session_resumption = 6; + + // If true, root certificates on the system will not be loaded for + // verification. + bool disable_system_root = 7; +} diff --git a/transport/internet/xtls/config_other.go b/transport/internet/xtls/config_other.go new file mode 100644 index 0000000000..a1dda046cc --- /dev/null +++ b/transport/internet/xtls/config_other.go @@ -0,0 +1,53 @@ +// +build !windows +// +build !confonly + +package xtls + +import ( + "crypto/x509" + "sync" +) + +type rootCertsCache struct { + sync.Mutex + pool *x509.CertPool +} + +func (c *rootCertsCache) load() (*x509.CertPool, error) { + c.Lock() + defer c.Unlock() + + if c.pool != nil { + return c.pool, nil + } + + pool, err := x509.SystemCertPool() + if err != nil { + return nil, err + } + c.pool = pool + return pool, nil +} + +var rootCerts rootCertsCache + +func (c *Config) getCertPool() (*x509.CertPool, error) { + if c.DisableSystemRoot { + return c.loadSelfCertPool() + } + + if len(c.Certificate) == 0 { + return rootCerts.load() + } + + pool, err := x509.SystemCertPool() + if err != nil { + return nil, newError("system root").AtWarning().Base(err) + } + for _, cert := range c.Certificate { + if !pool.AppendCertsFromPEM(cert.Certificate) { + return nil, newError("append cert to root").AtWarning().Base(err) + } + } + return pool, err +} diff --git a/transport/internet/xtls/config_test.go b/transport/internet/xtls/config_test.go new file mode 100644 index 0000000000..9e7227c9cd --- /dev/null +++ b/transport/internet/xtls/config_test.go @@ -0,0 +1,100 @@ +package xtls_test + +import ( + "crypto/x509" + "testing" + "time" + + xtls "github.com/xtls/go" + + "v2ray.com/core/common" + "v2ray.com/core/common/protocol/tls/cert" + . "v2ray.com/core/transport/internet/xtls" +) + +func TestCertificateIssuing(t *testing.T) { + certificate := ParseCertificate(cert.MustGenerate(nil, cert.Authority(true), cert.KeyUsage(x509.KeyUsageCertSign))) + certificate.Usage = Certificate_AUTHORITY_ISSUE + + c := &Config{ + Certificate: []*Certificate{ + certificate, + }, + } + + xtlsConfig := c.GetXTLSConfig() + v2rayCert, err := xtlsConfig.GetCertificate(&xtls.ClientHelloInfo{ + ServerName: "www.v2fly.org", + }) + common.Must(err) + + x509Cert, err := x509.ParseCertificate(v2rayCert.Certificate[0]) + common.Must(err) + if !x509Cert.NotAfter.After(time.Now()) { + t.Error("NotAfter: ", x509Cert.NotAfter) + } +} + +func TestExpiredCertificate(t *testing.T) { + caCert := cert.MustGenerate(nil, cert.Authority(true), cert.KeyUsage(x509.KeyUsageCertSign)) + expiredCert := cert.MustGenerate(caCert, cert.NotAfter(time.Now().Add(time.Minute*-2)), cert.CommonName("www.v2fly.org"), cert.DNSNames("www.v2fly.org")) + + certificate := ParseCertificate(caCert) + certificate.Usage = Certificate_AUTHORITY_ISSUE + + certificate2 := ParseCertificate(expiredCert) + + c := &Config{ + Certificate: []*Certificate{ + certificate, + certificate2, + }, + } + + xtlsConfig := c.GetXTLSConfig() + v2rayCert, err := xtlsConfig.GetCertificate(&xtls.ClientHelloInfo{ + ServerName: "www.v2fly.org", + }) + common.Must(err) + + x509Cert, err := x509.ParseCertificate(v2rayCert.Certificate[0]) + common.Must(err) + if !x509Cert.NotAfter.After(time.Now()) { + t.Error("NotAfter: ", x509Cert.NotAfter) + } +} + +func TestInsecureCertificates(t *testing.T) { + c := &Config{ + AllowInsecureCiphers: true, + } + + xtlsConfig := c.GetXTLSConfig() + if len(xtlsConfig.CipherSuites) > 0 { + t.Fatal("Unexpected tls cipher suites list: ", xtlsConfig.CipherSuites) + } +} + +func BenchmarkCertificateIssuing(b *testing.B) { + certificate := ParseCertificate(cert.MustGenerate(nil, cert.Authority(true), cert.KeyUsage(x509.KeyUsageCertSign))) + certificate.Usage = Certificate_AUTHORITY_ISSUE + + c := &Config{ + Certificate: []*Certificate{ + certificate, + }, + } + + xtlsConfig := c.GetXTLSConfig() + lenCerts := len(xtlsConfig.Certificates) + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + _, _ = xtlsConfig.GetCertificate(&xtls.ClientHelloInfo{ + ServerName: "www.v2fly.org", + }) + delete(xtlsConfig.NameToCertificate, "www.v2fly.org") + xtlsConfig.Certificates = xtlsConfig.Certificates[:lenCerts] + } +} diff --git a/transport/internet/xtls/config_windows.go b/transport/internet/xtls/config_windows.go new file mode 100644 index 0000000000..8c5bf01d75 --- /dev/null +++ b/transport/internet/xtls/config_windows.go @@ -0,0 +1,14 @@ +// +build windows +// +build !confonly + +package xtls + +import "crypto/x509" + +func (c *Config) getCertPool() (*x509.CertPool, error) { + if c.DisableSystemRoot { + return c.loadSelfCertPool() + } + + return nil, nil +} diff --git a/transport/internet/xtls/errors.generated.go b/transport/internet/xtls/errors.generated.go new file mode 100644 index 0000000000..9269f55840 --- /dev/null +++ b/transport/internet/xtls/errors.generated.go @@ -0,0 +1,9 @@ +package xtls + +import "v2ray.com/core/common/errors" + +type errPathObjHolder struct{} + +func newError(values ...interface{}) *errors.Error { + return errors.New(values...).WithPathObj(errPathObjHolder{}) +} diff --git a/transport/internet/xtls/xtls.go b/transport/internet/xtls/xtls.go new file mode 100644 index 0000000000..8a1be33f31 --- /dev/null +++ b/transport/internet/xtls/xtls.go @@ -0,0 +1,50 @@ +// +build !confonly + +package xtls + +import ( + xtls "github.com/xtls/go" + + "v2ray.com/core/common/buf" + "v2ray.com/core/common/net" +) + +//go:generate go run v2ray.com/core/common/errors/errorgen + +var ( + _ buf.Writer = (*Conn)(nil) +) + +type Conn struct { + *xtls.Conn +} + +func (c *Conn) WriteMultiBuffer(mb buf.MultiBuffer) error { + mb = buf.Compact(mb) + mb, err := buf.WriteMultiBuffer(c, mb) + buf.ReleaseMulti(mb) + return err +} + +func (c *Conn) HandshakeAddress() net.Address { + if err := c.Handshake(); err != nil { + return nil + } + state := c.ConnectionState() + if state.ServerName == "" { + return nil + } + return net.ParseAddress(state.ServerName) +} + +// Client initiates a XTLS client handshake on the given connection. +func Client(c net.Conn, config *xtls.Config) net.Conn { + xtlsConn := xtls.Client(c, config) + return &Conn{Conn: xtlsConn} +} + +// Server initiates a XTLS server handshake on the given connection. +func Server(c net.Conn, config *xtls.Config) net.Conn { + xtlsConn := xtls.Server(c, config) + return &Conn{Conn: xtlsConn} +}