Merge branch 'master' into v5

This commit is contained in:
loyalsoldier 2021-02-17 08:07:12 +08:00
commit d581fb9c00
No known key found for this signature in database
GPG Key ID: 23829BBC1ACF2C90
648 changed files with 2587 additions and 2494 deletions

View File

@ -2,67 +2,41 @@ name: CodeQL
on:
push:
branches:
- master
- v*
paths:
- "**/*.go"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
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
language: ["go"]
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
- name: Checkout repository
uses: actions/checkout@v2
# 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' }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# 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
# 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
# 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
# ✏️ 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
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -10,7 +10,6 @@ on:
jobs:
coverage:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
@ -21,17 +20,7 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v2
- name: Cache go module
uses: actions/cache@v2.1.4
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

View File

@ -14,7 +14,6 @@ on:
jobs:
lint:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x

View File

@ -23,7 +23,6 @@ on:
jobs:
build:
if: github.repository != 'v2ray/v2ray-core'
strategy:
matrix:
# Include amd64 on all platforms.
@ -97,7 +96,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: ^1.15
- name: Get project dependencies
run: go mod download
@ -142,7 +141,6 @@ jobs:
tag: ${{ github.ref }}
signature:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
needs: build
steps:
@ -154,7 +152,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: ^1.15
- uses: actions/download-artifact@v2
with:

View File

@ -5,7 +5,7 @@ jobs:
name: Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
env: # Optional environment variable for inline PR comments (beta)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,7 +6,6 @@ on:
jobs:
sign:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ubuntu-latest
steps:
- name: Checkout default branch

View File

@ -18,7 +18,6 @@ on:
jobs:
test:
if: github.repository != 'v2ray/v2ray-core'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@ -34,4 +33,4 @@ jobs:
uses: actions/checkout@v2
- name: Test
run: go test -v -timeout 1h ./...
run: go test -v -timeout 1h ./...

23
.gitignore vendored
View File

@ -1,3 +1,22 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
*.DS_Store
bazel-*
.idea
.idea
*.zip
*.tar.gz
v2ray
v2ctl

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015-2020 V2Fly Community
Copyright (c) 2015-2021 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
@ -19,4 +19,3 @@ 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.

View File

@ -1,6 +1,6 @@
package commander
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
@ -9,10 +9,10 @@ import (
"google.golang.org/grpc"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/common/signal/done"
"v2ray.com/core/features/outbound"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/signal/done"
"github.com/v2fly/v2ray-core/v4/features/outbound"
)
// Commander is a V2Ray feature that provides gRPC methods to external clients.

View File

@ -8,11 +8,11 @@ package commander
import (
proto "github.com/golang/protobuf/proto"
serial "github.com/v2fly/v2ray-core/v4/common/serial"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
serial "v2ray.com/core/common/serial"
)
const (
@ -139,10 +139,11 @@ var file_app_commander_config_proto_rawDesc = []byte{
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, 0x22, 0x12, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x6c, 0x65,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x59, 0x0a, 0x1c, 0x63,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x69, 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, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2c, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.commander;
option csharp_namespace = "V2Ray.Core.App.Commander";
option go_package = "v2ray.com/core/app/commander";
option go_package = "github.com/v2fly/v2ray-core/v4/app/commander";
option java_package = "com.v2ray.core.app.commander";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package commander
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -4,10 +4,10 @@ import (
"context"
"sync"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/signal/done"
"v2ray.com/core/transport"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/signal/done"
"github.com/v2fly/v2ray-core/v4/transport"
)
// OutboundListener is a net.Listener for listening gRPC connections.

View File

@ -5,7 +5,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"v2ray.com/core/common"
"github.com/v2fly/v2ray-core/v4/common"
)
// Service is a Commander service.

View File

@ -123,10 +123,11 @@ var file_app_dispatcher_config_proto_rawDesc = []byte{
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,
0x5c, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72,
0x6c, 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,
0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76,
0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f,
0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.dispatcher;
option csharp_namespace = "V2Ray.Core.App.Dispatcher";
option go_package = "v2ray.com/core/app/dispatcher";
option go_package = "github.com/v2fly/v2ray-core/v4/app/dispatcher";
option java_package = "com.v2ray.core.app.dispatcher";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package dispatcher
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
@ -8,20 +8,20 @@ import (
"sync"
"time"
"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"
"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"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/log"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/features/policy"
"github.com/v2fly/v2ray-core/v4/features/routing"
routing_session "github.com/v2fly/v2ray-core/v4/features/routing/session"
"github.com/v2fly/v2ray-core/v4/features/stats"
"github.com/v2fly/v2ray-core/v4/transport"
"github.com/v2fly/v2ray-core/v4/transport/pipe"
)
var (

View File

@ -1,3 +1,3 @@
package dispatcher
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

View File

@ -1,6 +1,6 @@
package dispatcher
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -3,11 +3,11 @@ package dispatcher
import (
"context"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/features/dns"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/features/dns"
)
// newFakeDNSSniffer Create a Fake DNS metadata sniffer

View File

@ -3,10 +3,10 @@ package dispatcher
import (
"context"
"v2ray.com/core/common"
"v2ray.com/core/common/protocol/bittorrent"
"v2ray.com/core/common/protocol/http"
"v2ray.com/core/common/protocol/tls"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/protocol/bittorrent"
"github.com/v2fly/v2ray-core/v4/common/protocol/http"
"github.com/v2fly/v2ray-core/v4/common/protocol/tls"
)
type SniffResult interface {

View File

@ -1,9 +1,9 @@
package dispatcher
import (
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/features/stats"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/features/stats"
)
type SizeStatWriter struct {

View File

@ -3,9 +3,9 @@ package dispatcher_test
import (
"testing"
. "v2ray.com/core/app/dispatcher"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
. "github.com/v2fly/v2ray-core/v4/app/dispatcher"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
)
type TestCounter int64

View File

@ -1,9 +1,9 @@
package dns
import (
"v2ray.com/core/common/net"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/common/uuid"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
"github.com/v2fly/v2ray-core/v4/common/uuid"
)
var typeMap = map[DomainMatchingType]strmatcher.Type{

View File

@ -8,12 +8,12 @@ package dns
import (
proto "github.com/golang/protobuf/proto"
router "github.com/v2fly/v2ray-core/v4/app/router"
net "github.com/v2fly/v2ray-core/v4/common/net"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
router "v2ray.com/core/app/router"
net "v2ray.com/core/common/net"
)
const (
@ -526,10 +526,11 @@ var file_app_dns_config_proto_rawDesc = []byte{
0x68, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c,
0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10,
0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x10, 0x02, 0x12, 0x09,
0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x47, 0x0a, 0x16, 0x63, 0x6f, 0x6d,
0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x57, 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, 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,
0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f,
0x72, 0x65, 0x2f, 0x76, 0x34, 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,
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.dns;
option csharp_namespace = "V2Ray.Core.App.Dns";
option go_package = "v2ray.com/core/app/dns";
option go_package = "github.com/v2fly/v2ray-core/v4/app/dns";
option java_package = "com.v2ray.core.app.dns";
option java_multiple_files = true;

View File

@ -1,21 +1,21 @@
// Package dns is an implementation of core.DNS feature.
package dns
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"fmt"
"sync"
"v2ray.com/core/app/router"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/features"
"v2ray.com/core/features/dns"
"github.com/v2fly/v2ray-core/v4/app/router"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
"github.com/v2fly/v2ray-core/v4/features"
"github.com/v2fly/v2ray-core/v4/features/dns"
)
// DNS is a DNS rely server.

View File

@ -6,19 +6,20 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/miekg/dns"
"v2ray.com/core"
"v2ray.com/core/app/dispatcher"
. "v2ray.com/core/app/dns"
"v2ray.com/core/app/policy"
"v2ray.com/core/app/proxyman"
_ "v2ray.com/core/app/proxyman/outbound"
"v2ray.com/core/app/router"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
feature_dns "v2ray.com/core/features/dns"
"v2ray.com/core/proxy/freedom"
"v2ray.com/core/testing/servers/udp"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
. "github.com/v2fly/v2ray-core/v4/app/dns"
"github.com/v2fly/v2ray-core/v4/app/policy"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v4/app/router"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/serial"
feature_dns "github.com/v2fly/v2ray-core/v4/features/dns"
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
"github.com/v2fly/v2ray-core/v4/testing/servers/udp"
)
type staticHandler struct {

View File

@ -5,10 +5,11 @@ import (
"time"
"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/net"
dns_feature "v2ray.com/core/features/dns"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/net"
dns_feature "github.com/v2fly/v2ray-core/v4/features/dns"
)
// Fqdn normalize domain make sure it ends with '.'

View File

@ -8,8 +8,9 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/miekg/dns"
"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
)
func Test_parseResponse(t *testing.T) {
@ -145,8 +146,8 @@ func TestFqdn(t *testing.T) {
args args
want string
}{
{"with fqdn", args{"www.v2ray.com."}, "www.v2ray.com."},
{"without fqdn", args{"www.v2ray.com"}, "www.v2ray.com."},
{"with fqdn", args{"www.v2fly.org."}, "www.v2fly.org."},
{"without fqdn", args{"www.v2fly.org"}, "www.v2fly.org."},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {

View File

@ -1,6 +1,6 @@
package dns
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -1,6 +1,6 @@
package fakedns
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -6,10 +6,10 @@ import (
"math/big"
gonet "net"
"v2ray.com/core/common"
"v2ray.com/core/common/cache"
"v2ray.com/core/common/net"
"v2ray.com/core/features/dns"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/cache"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/dns"
)
type Holder struct {

View File

@ -1,3 +1,3 @@
package fakedns
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

View File

@ -90,11 +90,12 @@ var file_app_dns_fakedns_fakedns_proto_rawDesc = []byte{
0x61, 0x6b, 0x65, 0x44, 0x6e, 0x73, 0x50, 0x6f, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x70,
0x5f, 0x70, 0x6f, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x70, 0x50,
0x6f, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x72, 0x75, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x72, 0x75, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x5f, 0x0a,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x72, 0x75, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x6f, 0x0a,
0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
0x61, 0x70, 0x70, 0x2e, 0x64, 0x6e, 0x73, 0x2e, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, 0x50,
0x01, 0x5a, 0x1e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72,
0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e,
0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32,
0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76,
0x34, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e,
0x73, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x41,
0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x2e, 0x46, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -2,11 +2,11 @@ syntax = "proto3";
package v2ray.core.app.dns.fakedns;
option csharp_namespace = "V2Ray.Core.App.Dns.Fakedns";
option go_package = "v2ray.com/core/app/dns/fakedns";
option go_package = "github.com/v2fly/v2ray-core/v4/app/dns/fakedns";
option java_package = "com.v2ray.core.app.dns.fakedns";
option java_multiple_files = true;
message FakeDnsPool{
string ip_pool = 1; //CIDR of IP pool used as fake DNS IP
int64 lruSize = 2; //Size of Pool for remembering relationship between domain name and IP address
}
}

View File

@ -4,9 +4,10 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/uuid"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/uuid"
)
func TestNewFakeDnsHolder(_ *testing.T) {

View File

@ -1,10 +1,10 @@
package dns
import (
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/features"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
"github.com/v2fly/v2ray-core/v4/features"
)
// StaticHosts represents static domain-ip mapping in DNS server.

View File

@ -4,16 +4,17 @@ import (
"testing"
"github.com/google/go-cmp/cmp"
. "v2ray.com/core/app/dns"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
. "github.com/v2fly/v2ray-core/v4/app/dns"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
)
func TestStaticHosts(t *testing.T) {
pb := []*Config_HostMapping{
{
Type: DomainMatchingType_Full,
Domain: "v2ray.com",
Domain: "v2fly.org",
Ip: [][]byte{
{1, 1, 1, 1},
},
@ -38,7 +39,7 @@ func TestStaticHosts(t *testing.T) {
common.Must(err)
{
ips := hosts.Lookup("v2ray.com", IPOption{
ips := hosts.Lookup("v2fly.org", IPOption{
IPv4Enable: true,
IPv6Enable: true,
})

View File

@ -5,12 +5,12 @@ import (
"net/url"
"time"
"v2ray.com/core"
"v2ray.com/core/app/router"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/net"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/features/routing"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/router"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
"github.com/v2fly/v2ray-core/v4/features/routing"
)
// IPOption is an object for IP query options.

View File

@ -13,15 +13,16 @@ import (
"time"
"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol/dns"
"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"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/protocol/dns"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/signal/pubsub"
"github.com/v2fly/v2ray-core/v4/common/task"
dns_feature "github.com/v2fly/v2ray-core/v4/features/dns"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/transport/internet"
)
// DoHNameServer implemented DNS over HTTPS (RFC8484) Wire Format,

View File

@ -3,9 +3,9 @@ package dns
import (
"context"
"v2ray.com/core"
"v2ray.com/core/common/net"
"v2ray.com/core/features/dns"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/dns"
)
type FakeDNSServer struct {

View File

@ -3,8 +3,8 @@ package dns
import (
"context"
"v2ray.com/core/common/net"
"v2ray.com/core/features/dns/localdns"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/dns/localdns"
)
// LocalNameServer is an wrapper over local DNS feature.

View File

@ -5,9 +5,9 @@ import (
"testing"
"time"
. "v2ray.com/core/app/dns"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
. "github.com/v2fly/v2ray-core/v4/app/dns"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
)
func TestLocalNameServer(t *testing.T) {

View File

@ -10,15 +10,16 @@ import (
"github.com/lucas-clemente/quic-go"
"golang.org/x/net/dns/dnsmessage"
"golang.org/x/net/http2"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol/dns"
"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/transport/internet/tls"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/protocol/dns"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/signal/pubsub"
"github.com/v2fly/v2ray-core/v4/common/task"
dns_feature "github.com/v2fly/v2ray-core/v4/features/dns"
"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
)
// NextProtoDQ - During connection establishment, DNS/QUIC support is indicated

View File

@ -6,9 +6,9 @@ import (
"testing"
"time"
. "v2ray.com/core/app/dns"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
. "github.com/v2fly/v2ray-core/v4/app/dns"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
)
func TestQUICNameServer(t *testing.T) {

View File

@ -8,16 +8,17 @@ import (
"time"
"golang.org/x/net/dns/dnsmessage"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol/dns"
udp_proto "v2ray.com/core/common/protocol/udp"
"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/udp"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/protocol/dns"
udp_proto "github.com/v2fly/v2ray-core/v4/common/protocol/udp"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/signal/pubsub"
"github.com/v2fly/v2ray-core/v4/common/task"
dns_feature "github.com/v2fly/v2ray-core/v4/features/dns"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/transport/internet/udp"
)
// ClassicNameServer implemented traditional UDP DNS.

View File

@ -1,15 +1,15 @@
package command
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
grpc "google.golang.org/grpc"
"v2ray.com/core"
"v2ray.com/core/app/log"
"v2ray.com/core/common"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/log"
"github.com/v2fly/v2ray-core/v4/common"
)
type LoggerServer struct {

View File

@ -4,15 +4,15 @@ import (
"context"
"testing"
"v2ray.com/core"
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/app/log"
. "v2ray.com/core/app/log/command"
"v2ray.com/core/app/proxyman"
_ "v2ray.com/core/app/proxyman/inbound"
_ "v2ray.com/core/app/proxyman/outbound"
"v2ray.com/core/common"
"v2ray.com/core/common/serial"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
"github.com/v2fly/v2ray-core/v4/app/log"
. "github.com/v2fly/v2ray-core/v4/app/log/command"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/inbound"
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/serial"
)
func TestLoggerRestart(t *testing.T) {

View File

@ -158,10 +158,11 @@ var file_app_log_command_config_proto_rawDesc = []byte{
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,
0x6f, 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,
0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65,
0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.log.command;
option csharp_namespace = "V2Ray.Core.App.Log.Command";
option go_package = "v2ray.com/core/app/log/command";
option go_package = "github.com/v2fly/v2ray-core/v4/app/log/command";
option java_package = "com.v2ray.core.app.log.command";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package command
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -8,11 +8,11 @@ package log
import (
proto "github.com/golang/protobuf/proto"
log "github.com/v2fly/v2ray-core/v4/common/log"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
log "v2ray.com/core/common/log"
)
const (
@ -186,9 +186,10 @@ var file_app_log_config_proto_rawDesc = []byte{
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,
0x03, 0x42, 0x57, 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, 0x26, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.log;
option csharp_namespace = "V2Ray.Core.App.Log";
option go_package = "v2ray.com/core/app/log";
option go_package = "github.com/v2fly/v2ray-core/v4/app/log";
option java_package = "com.v2ray.core.app.log";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package log
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -1,13 +1,13 @@
package log
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"sync"
"v2ray.com/core/common"
"v2ray.com/core/common/log"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/log"
)
// Instance is a log.Handler that handles logs.

View File

@ -1,8 +1,8 @@
package log
import (
"v2ray.com/core/common"
"v2ray.com/core/common/log"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/log"
)
type HandlerCreatorOptions struct {

View File

@ -5,10 +5,11 @@ import (
"testing"
"github.com/golang/mock/gomock"
"v2ray.com/core/app/log"
"v2ray.com/core/common"
clog "v2ray.com/core/common/log"
"v2ray.com/core/testing/mocks"
"github.com/v2fly/v2ray-core/v4/app/log"
"github.com/v2fly/v2ray-core/v4/common"
clog "github.com/v2fly/v2ray-core/v4/common/log"
"github.com/v2fly/v2ray-core/v4/testing/mocks"
)
func TestCustomLogHandler(t *testing.T) {

View File

@ -3,7 +3,7 @@ package policy
import (
"time"
"v2ray.com/core/features/policy"
"github.com/v2fly/v2ray-core/v4/features/policy"
)
// Duration converts Second to time.Duration.

View File

@ -558,10 +558,11 @@ var file_app_policy_config_proto_rawDesc = []byte{
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,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x60, 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,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d,
0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.policy;
option csharp_namespace = "V2Ray.Core.App.Policy";
option go_package = "v2ray.com/core/app/policy";
option go_package = "github.com/v2fly/v2ray-core/v4/app/policy";
option java_package = "com.v2ray.core.app.policy";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package policy
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -3,8 +3,8 @@ package policy
import (
"context"
"v2ray.com/core/common"
"v2ray.com/core/features/policy"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/features/policy"
)
// Instance is an instance of Policy manager.

View File

@ -5,9 +5,9 @@ import (
"testing"
"time"
. "v2ray.com/core/app/policy"
"v2ray.com/core/common"
"v2ray.com/core/features/policy"
. "github.com/v2fly/v2ray-core/v4/app/policy"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/features/policy"
)
func TestPolicy(t *testing.T) {

View File

@ -1,4 +1,4 @@
// Package policy is an implementation of policy.Manager feature.
package policy
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

View File

@ -5,11 +5,11 @@ import (
grpc "google.golang.org/grpc"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/features/inbound"
"v2ray.com/core/features/outbound"
"v2ray.com/core/proxy"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/features/inbound"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/proxy"
)
// InboundOperation is the interface for operations that applies to inbound handlers.

View File

@ -8,13 +8,13 @@ package command
import (
proto "github.com/golang/protobuf/proto"
v4 "github.com/v2fly/v2ray-core/v4"
protocol "github.com/v2fly/v2ray-core/v4/common/protocol"
serial "github.com/v2fly/v2ray-core/v4/common/serial"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
core "v2ray.com/core"
protocol "v2ray.com/core/common/protocol"
serial "v2ray.com/core/common/serial"
)
const (
@ -127,7 +127,7 @@ type AddInboundRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Inbound *core.InboundHandlerConfig `protobuf:"bytes,1,opt,name=inbound,proto3" json:"inbound,omitempty"`
Inbound *v4.InboundHandlerConfig `protobuf:"bytes,1,opt,name=inbound,proto3" json:"inbound,omitempty"`
}
func (x *AddInboundRequest) Reset() {
@ -162,7 +162,7 @@ func (*AddInboundRequest) Descriptor() ([]byte, []int) {
return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{2}
}
func (x *AddInboundRequest) GetInbound() *core.InboundHandlerConfig {
func (x *AddInboundRequest) GetInbound() *v4.InboundHandlerConfig {
if x != nil {
return x.Inbound
}
@ -390,7 +390,7 @@ type AddOutboundRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Outbound *core.OutboundHandlerConfig `protobuf:"bytes,1,opt,name=outbound,proto3" json:"outbound,omitempty"`
Outbound *v4.OutboundHandlerConfig `protobuf:"bytes,1,opt,name=outbound,proto3" json:"outbound,omitempty"`
}
func (x *AddOutboundRequest) Reset() {
@ -425,7 +425,7 @@ func (*AddOutboundRequest) Descriptor() ([]byte, []int) {
return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{8}
}
func (x *AddOutboundRequest) GetOutbound() *core.OutboundHandlerConfig {
func (x *AddOutboundRequest) GetOutbound() *v4.OutboundHandlerConfig {
if x != nil {
return x.Outbound
}
@ -794,10 +794,11 @@ var file_app_proxyman_command_command_proto_rawDesc = []byte{
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,
0x00, 0x42, 0x7e, 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,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72,
0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,
@ -818,25 +819,25 @@ func file_app_proxyman_command_command_proto_rawDescGZIP() []byte {
var file_app_proxyman_command_command_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_app_proxyman_command_command_proto_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
(*AddInboundResponse)(nil), // 3: v2ray.core.app.proxyman.command.AddInboundResponse
(*RemoveInboundRequest)(nil), // 4: v2ray.core.app.proxyman.command.RemoveInboundRequest
(*RemoveInboundResponse)(nil), // 5: v2ray.core.app.proxyman.command.RemoveInboundResponse
(*AlterInboundRequest)(nil), // 6: v2ray.core.app.proxyman.command.AlterInboundRequest
(*AlterInboundResponse)(nil), // 7: v2ray.core.app.proxyman.command.AlterInboundResponse
(*AddOutboundRequest)(nil), // 8: v2ray.core.app.proxyman.command.AddOutboundRequest
(*AddOutboundResponse)(nil), // 9: v2ray.core.app.proxyman.command.AddOutboundResponse
(*RemoveOutboundRequest)(nil), // 10: v2ray.core.app.proxyman.command.RemoveOutboundRequest
(*RemoveOutboundResponse)(nil), // 11: v2ray.core.app.proxyman.command.RemoveOutboundResponse
(*AlterOutboundRequest)(nil), // 12: v2ray.core.app.proxyman.command.AlterOutboundRequest
(*AlterOutboundResponse)(nil), // 13: v2ray.core.app.proxyman.command.AlterOutboundResponse
(*Config)(nil), // 14: v2ray.core.app.proxyman.command.Config
(*protocol.User)(nil), // 15: v2ray.core.common.protocol.User
(*core.InboundHandlerConfig)(nil), // 16: v2ray.core.InboundHandlerConfig
(*serial.TypedMessage)(nil), // 17: v2ray.core.common.serial.TypedMessage
(*core.OutboundHandlerConfig)(nil), // 18: v2ray.core.OutboundHandlerConfig
(*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
(*AddInboundResponse)(nil), // 3: v2ray.core.app.proxyman.command.AddInboundResponse
(*RemoveInboundRequest)(nil), // 4: v2ray.core.app.proxyman.command.RemoveInboundRequest
(*RemoveInboundResponse)(nil), // 5: v2ray.core.app.proxyman.command.RemoveInboundResponse
(*AlterInboundRequest)(nil), // 6: v2ray.core.app.proxyman.command.AlterInboundRequest
(*AlterInboundResponse)(nil), // 7: v2ray.core.app.proxyman.command.AlterInboundResponse
(*AddOutboundRequest)(nil), // 8: v2ray.core.app.proxyman.command.AddOutboundRequest
(*AddOutboundResponse)(nil), // 9: v2ray.core.app.proxyman.command.AddOutboundResponse
(*RemoveOutboundRequest)(nil), // 10: v2ray.core.app.proxyman.command.RemoveOutboundRequest
(*RemoveOutboundResponse)(nil), // 11: v2ray.core.app.proxyman.command.RemoveOutboundResponse
(*AlterOutboundRequest)(nil), // 12: v2ray.core.app.proxyman.command.AlterOutboundRequest
(*AlterOutboundResponse)(nil), // 13: v2ray.core.app.proxyman.command.AlterOutboundResponse
(*Config)(nil), // 14: v2ray.core.app.proxyman.command.Config
(*protocol.User)(nil), // 15: v2ray.core.common.protocol.User
(*v4.InboundHandlerConfig)(nil), // 16: v2ray.core.InboundHandlerConfig
(*serial.TypedMessage)(nil), // 17: v2ray.core.common.serial.TypedMessage
(*v4.OutboundHandlerConfig)(nil), // 18: v2ray.core.OutboundHandlerConfig
}
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

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.proxyman.command;
option csharp_namespace = "V2Ray.Core.App.Proxyman.Command";
option go_package = "v2ray.com/core/app/proxyman/command";
option go_package = "github.com/v2fly/v2ray-core/v4/app/proxyman/command";
option java_package = "com.v2ray.core.app.proxyman.command";
option java_multiple_files = true;

View File

@ -1,3 +1,3 @@
package command
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen

View File

@ -1,6 +1,6 @@
package command
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -8,13 +8,13 @@ package proxyman
import (
proto "github.com/golang/protobuf/proto"
net "github.com/v2fly/v2ray-core/v4/common/net"
serial "github.com/v2fly/v2ray-core/v4/common/serial"
internet "github.com/v2fly/v2ray-core/v4/transport/internet"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
net "v2ray.com/core/common/net"
serial "v2ray.com/core/common/serial"
internet "v2ray.com/core/transport/internet"
)
const (
@ -853,10 +853,11 @@ var file_app_proxyman_config_proto_rawDesc = []byte{
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,
0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, 0x42, 0x66, 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, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x2b, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.proxyman;
option csharp_namespace = "V2Ray.Core.App.Proxyman";
option go_package = "v2ray.com/core/app/proxyman";
option go_package = "github.com/v2fly/v2ray-core/v4/app/proxyman";
option java_package = "com.v2ray.core.app.proxyman";
option java_multiple_files = true;

View File

@ -3,17 +3,17 @@ package inbound
import (
"context"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/dice"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/features/policy"
"v2ray.com/core/features/stats"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/internet"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/dice"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/policy"
"github.com/v2fly/v2ray-core/v4/features/stats"
"github.com/v2fly/v2ray-core/v4/proxy"
"github.com/v2fly/v2ray-core/v4/transport/internet"
)
func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) {

View File

@ -5,14 +5,14 @@ import (
"sync"
"time"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common/dice"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/task"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/internet"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common/dice"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/task"
"github.com/v2fly/v2ray-core/v4/proxy"
"github.com/v2fly/v2ray-core/v4/transport/internet"
)
type DynamicInboundHandler struct {

View File

@ -1,6 +1,6 @@
package inbound
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -1,17 +1,17 @@
package inbound
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"sync"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/serial"
"v2ray.com/core/common/session"
"v2ray.com/core/features/inbound"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/features/inbound"
)
// Manager is to manage all inbound handlers.

View File

@ -6,21 +6,21 @@ import (
"sync/atomic"
"time"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
"v2ray.com/core/common/session"
"v2ray.com/core/common/signal/done"
"v2ray.com/core/common/task"
"v2ray.com/core/features/routing"
"v2ray.com/core/features/stats"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/internet/tcp"
"v2ray.com/core/transport/internet/udp"
"v2ray.com/core/transport/pipe"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/signal/done"
"github.com/v2fly/v2ray-core/v4/common/task"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/features/stats"
"github.com/v2fly/v2ray-core/v4/proxy"
"github.com/v2fly/v2ray-core/v4/transport/internet"
"github.com/v2fly/v2ray-core/v4/transport/internet/tcp"
"github.com/v2fly/v2ray-core/v4/transport/internet/udp"
"github.com/v2fly/v2ray-core/v4/transport/pipe"
)
type worker interface {

View File

@ -1,6 +1,6 @@
package outbound
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -3,20 +3,20 @@ package outbound
import (
"context"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/features/outbound"
"v2ray.com/core/features/policy"
"v2ray.com/core/features/stats"
"v2ray.com/core/proxy"
"v2ray.com/core/transport"
"v2ray.com/core/transport/internet"
"v2ray.com/core/transport/internet/tls"
"v2ray.com/core/transport/pipe"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/features/policy"
"github.com/v2fly/v2ray-core/v4/features/stats"
"github.com/v2fly/v2ray-core/v4/proxy"
"github.com/v2fly/v2ray-core/v4/transport"
"github.com/v2fly/v2ray-core/v4/transport/internet"
"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
"github.com/v2fly/v2ray-core/v4/transport/pipe"
)
func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) {

View File

@ -4,15 +4,15 @@ import (
"context"
"testing"
"v2ray.com/core"
"v2ray.com/core/app/policy"
. "v2ray.com/core/app/proxyman/outbound"
"v2ray.com/core/app/stats"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
"v2ray.com/core/features/outbound"
"v2ray.com/core/proxy/freedom"
"v2ray.com/core/transport/internet"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/policy"
. "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
"github.com/v2fly/v2ray-core/v4/app/stats"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
"github.com/v2fly/v2ray-core/v4/transport/internet"
)
func TestInterfaces(t *testing.T) {

View File

@ -1,17 +1,17 @@
package outbound
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"strings"
"sync"
"v2ray.com/core"
"v2ray.com/core/app/proxyman"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
"v2ray.com/core/features/outbound"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/app/proxyman"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/features/outbound"
)
// Manager is to manage all outbound handlers.

View File

@ -5,13 +5,14 @@ import (
"time"
"google.golang.org/protobuf/proto"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/task"
"v2ray.com/core/features/routing"
"v2ray.com/core/transport"
"v2ray.com/core/transport/pipe"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/task"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/transport"
"github.com/v2fly/v2ray-core/v4/transport/pipe"
)
// Bridge is a component in reverse proxy, that relays connections from Portal to local address.

View File

@ -4,7 +4,7 @@ import (
"crypto/rand"
"io"
"v2ray.com/core/common/dice"
"github.com/v2fly/v2ray-core/v4/common/dice"
)
func (c *Control) FillInRandom() {

View File

@ -322,10 +322,11 @@ var file_app_reverse_config_proto_rawDesc = []byte{
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,
0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x67, 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,
0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61,
0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.reverse;
option csharp_namespace = "V2Ray.Core.Proxy.Reverse";
option go_package = "v2ray.com/core/app/reverse";
option go_package = "github.com/v2fly/v2ray-core/v4/app/reverse";
option java_package = "com.v2ray.core.proxy.reverse";
option java_multiple_files = true;

View File

@ -1,6 +1,6 @@
package reverse
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -6,15 +6,16 @@ import (
"time"
"google.golang.org/protobuf/proto"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/mux"
"v2ray.com/core/common/net"
"v2ray.com/core/common/session"
"v2ray.com/core/common/task"
"v2ray.com/core/features/outbound"
"v2ray.com/core/transport"
"v2ray.com/core/transport/pipe"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/mux"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/session"
"github.com/v2fly/v2ray-core/v4/common/task"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/transport"
"github.com/v2fly/v2ray-core/v4/transport/pipe"
)
type Portal struct {

View File

@ -3,8 +3,8 @@ package reverse_test
import (
"testing"
"v2ray.com/core/app/reverse"
"v2ray.com/core/common"
"github.com/v2fly/v2ray-core/v4/app/reverse"
"github.com/v2fly/v2ray-core/v4/common"
)
func TestStaticPickerEmpty(t *testing.T) {

View File

@ -1,20 +1,20 @@
package reverse
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/common/errors"
"v2ray.com/core/common/net"
"v2ray.com/core/features/outbound"
"v2ray.com/core/features/routing"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/errors"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/features/routing"
)
const (
internalDomain = "reverse.internal.v2ray.com"
internalDomain = "reverse.internal.v2fly.org"
)
func isDomain(dest net.Destination, domain string) bool {

View File

@ -1,8 +1,8 @@
package router
import (
"v2ray.com/core/features/outbound"
"v2ray.com/core/features/routing"
"github.com/v2fly/v2ray-core/v4/features/outbound"
"github.com/v2fly/v2ray-core/v4/features/routing"
)
// Balancer represents a balancer

View File

@ -1,10 +1,10 @@
package router
import (
sync "sync"
"sync"
"time"
"v2ray.com/core/features/outbound"
"github.com/v2fly/v2ray-core/v4/features/outbound"
)
func (b *Balancer) overrideSelecting(selects []string, validity time.Duration) error {

View File

@ -1,18 +1,19 @@
package command
//go:generate go run v2ray.com/core/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import (
"context"
"time"
"google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/features/routing"
"v2ray.com/core/features/stats"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/features/stats"
)
// routingServer is an implementation of RoutingService.

View File

@ -8,11 +8,11 @@ package command
import (
proto "github.com/golang/protobuf/proto"
net "github.com/v2fly/v2ray-core/v4/common/net"
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 (
@ -967,10 +967,11 @@ var file_app_router_command_command_proto_rawDesc = []byte{
0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x53, 0x65, 0x6c,
0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x42, 0x68, 0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f,
0x42, 0x78, 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,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d,
0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 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,

View File

@ -2,7 +2,7 @@ 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 go_package = "github.com/v2fly/v2ray-core/v4/app/router/command";
option java_package = "com.v2ray.core.app.router.command";
option java_multiple_files = true;

View File

@ -10,13 +10,14 @@ import (
"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"
"github.com/v2fly/v2ray-core/v4/app/router"
. "github.com/v2fly/v2ray-core/v4/app/router/command"
"github.com/v2fly/v2ray-core/v4/app/stats"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/testing/mocks"
)
func TestServiceSubscribeRoutingStats(t *testing.T) {

View File

@ -3,8 +3,8 @@ package command
import (
"strings"
"v2ray.com/core/common/net"
"v2ray.com/core/features/routing"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/features/routing"
)
// routingContext is an wrapper of protobuf RoutingContext as implementation of routing.Context and routing.Route.

View File

@ -1,6 +1,6 @@
package command
import "v2ray.com/core/common/errors"
import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{}

View File

@ -5,9 +5,10 @@ import (
"go.starlark.net/starlark"
"go.starlark.net/syntax"
"v2ray.com/core/common/net"
"v2ray.com/core/common/strmatcher"
"v2ray.com/core/features/routing"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
"github.com/v2fly/v2ray-core/v4/features/routing"
)
type Condition interface {

View File

@ -4,7 +4,7 @@ import (
"encoding/binary"
"sort"
"v2ray.com/core/common/net"
"github.com/v2fly/v2ray-core/v4/common/net"
)
type ipv6 struct {

Some files were not shown because too many files have changed in this diff Show More