1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-29 05:27:02 -05:00

Chore: change module name (#677)

This commit is contained in:
Loyalsoldier 2021-02-17 04:31:50 +08:00 committed by GitHub
parent 0957442e01
commit f94dd11a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
623 changed files with 2532 additions and 2404 deletions

View File

@ -2,7 +2,7 @@
package commander 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 ( import (
"context" "context"
@ -11,10 +11,10 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/signal/done" "github.com/v2fly/v2ray-core/v4/common/signal/done"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
) )
// Commander is a V2Ray feature that provides gRPC methods to external clients. // Commander is a V2Ray feature that provides gRPC methods to external clients.

View File

@ -8,11 +8,11 @@ package commander
import ( import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
serial "github.com/v2fly/v2ray-core/v4/common/serial"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
serial "v2ray.com/core/common/serial"
) )
const ( 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, 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, 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, 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, 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, 0x70, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2c, 0x67,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 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, 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, 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, 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; package v2ray.core.app.commander;
option csharp_namespace = "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_package = "com.v2ray.core.app.commander";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

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

View File

@ -7,7 +7,8 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/reflection" "google.golang.org/grpc/reflection"
"v2ray.com/core/common"
"github.com/v2fly/v2ray-core/v4/common"
) )
// Service is a Commander service. // 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, 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, 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, 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, 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, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76,
0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 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, 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, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.dispatcher; package v2ray.core.app.dispatcher;
option csharp_namespace = "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_package = "com.v2ray.core.app.dispatcher";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

@ -2,4 +2,4 @@
package dispatcher 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 package dispatcher
import "v2ray.com/core/common/errors" import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{} type errPathObjHolder struct{}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,12 +8,12 @@ package dns
import ( import (
proto "github.com/golang/protobuf/proto" 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" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
router "v2ray.com/core/app/router"
net "v2ray.com/core/common/net"
) )
const ( 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, 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, 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, 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, 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, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x12, 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, 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, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.dns; package v2ray.core.app.dns;
option csharp_namespace = "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_package = "com.v2ray.core.app.dns";
option java_multiple_files = true; option java_multiple_files = true;

View File

@ -3,21 +3,21 @@
// Package dns is an implementation of core.DNS feature. // Package dns is an implementation of core.DNS feature.
package dns 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 ( import (
"context" "context"
"fmt" "fmt"
"sync" "sync"
"v2ray.com/core/app/router" "github.com/v2fly/v2ray-core/v4/app/router"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/errors" "github.com/v2fly/v2ray-core/v4/common/errors"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/common/session" "github.com/v2fly/v2ray-core/v4/common/session"
"v2ray.com/core/common/strmatcher" "github.com/v2fly/v2ray-core/v4/common/strmatcher"
"v2ray.com/core/features" "github.com/v2fly/v2ray-core/v4/features"
"v2ray.com/core/features/dns" "github.com/v2fly/v2ray-core/v4/features/dns"
) )
// DNS is a DNS rely server. // DNS is a DNS rely server.

View File

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

View File

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

View File

@ -10,8 +10,9 @@ import (
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"github.com/miekg/dns" "github.com/miekg/dns"
"golang.org/x/net/dns/dnsmessage" "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) { func Test_parseResponse(t *testing.T) {
@ -147,8 +148,8 @@ func TestFqdn(t *testing.T) {
args args args args
want string want string
}{ }{
{"with fqdn", args{"www.v2ray.com."}, "www.v2ray.com."}, {"with fqdn", args{"www.v2fly.org."}, "www.v2fly.org."},
{"without fqdn", args{"www.v2ray.com"}, "www.v2ray.com."}, {"without fqdn", args{"www.v2fly.org"}, "www.v2fly.org."},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {

View File

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

View File

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

View File

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

View File

@ -2,4 +2,4 @@
package fakedns 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, 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, 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, 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, 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, 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, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32,
0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0x2f, 0x66, 0x61, 0x6b, 0x65, 0x64, 0x6e, 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, 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, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x2e, 0x46, 0x61, 0x6b, 0x65, 0x64, 0x6e, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.dns.fakedns; package v2ray.core.app.dns.fakedns;
option csharp_namespace = "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_package = "com.v2ray.core.app.dns.fakedns";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,16 +2,16 @@
package command 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 ( import (
"context" "context"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/app/log" "github.com/v2fly/v2ray-core/v4/app/log"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
) )
type LoggerServer struct { type LoggerServer struct {

View File

@ -4,15 +4,15 @@ import (
"context" "context"
"testing" "testing"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/app/dispatcher" "github.com/v2fly/v2ray-core/v4/app/dispatcher"
"v2ray.com/core/app/log" "github.com/v2fly/v2ray-core/v4/app/log"
. "v2ray.com/core/app/log/command" . "github.com/v2fly/v2ray-core/v4/app/log/command"
"v2ray.com/core/app/proxyman" "github.com/v2fly/v2ray-core/v4/app/proxyman"
_ "v2ray.com/core/app/proxyman/inbound" _ "github.com/v2fly/v2ray-core/v4/app/proxyman/inbound"
_ "v2ray.com/core/app/proxyman/outbound" _ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/serial" "github.com/v2fly/v2ray-core/v4/common/serial"
) )
func TestLoggerRestart(t *testing.T) { 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, 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, 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, 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, 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, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 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, 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, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.log.command; package v2ray.core.app.log.command;
option csharp_namespace = "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_package = "com.v2ray.core.app.log.command";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

@ -8,11 +8,11 @@ package log
import ( import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
log "github.com/v2fly/v2ray-core/v4/common/log"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
log "v2ray.com/core/common/log"
) )
const ( 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, 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, 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, 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, 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, 0x16, 0x76, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x26, 0x67,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 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, 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, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.log; package v2ray.core.app.log;
option csharp_namespace = "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_package = "com.v2ray.core.app.log";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

@ -2,14 +2,14 @@
package log 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 ( import (
"context" "context"
"sync" "sync"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/log" "github.com/v2fly/v2ray-core/v4/common/log"
) )
// Instance is a log.Handler that handles logs. // Instance is a log.Handler that handles logs.

View File

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

View File

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

View File

@ -3,7 +3,7 @@ package policy
import ( import (
"time" "time"
"v2ray.com/core/features/policy" "github.com/v2fly/v2ray-core/v4/features/policy"
) )
// Duration converts Second to time.Duration. // 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, 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, 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, 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, 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, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 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, 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, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.policy; package v2ray.core.app.policy;
option csharp_namespace = "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_package = "com.v2ray.core.app.policy";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
// Package policy is an implementation of policy.Manager feature. // Package policy is an implementation of policy.Manager feature.
package policy 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

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

View File

@ -8,13 +8,13 @@ package command
import ( import (
proto "github.com/golang/protobuf/proto" 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" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
core "v2ray.com/core"
protocol "v2ray.com/core/common/protocol"
serial "v2ray.com/core/common/serial"
) )
const ( const (
@ -127,7 +127,7 @@ type AddInboundRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields 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() { func (x *AddInboundRequest) Reset() {
@ -162,7 +162,7 @@ func (*AddInboundRequest) Descriptor() ([]byte, []int) {
return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{2} 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 { if x != nil {
return x.Inbound return x.Inbound
} }
@ -390,7 +390,7 @@ type AddOutboundRequest struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields 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() { func (x *AddOutboundRequest) Reset() {
@ -425,7 +425,7 @@ func (*AddOutboundRequest) Descriptor() ([]byte, []int) {
return file_app_proxyman_command_command_proto_rawDescGZIP(), []int{8} 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 { if x != nil {
return x.Outbound 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, 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, 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, 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, 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, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68,
0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 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, 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, 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, 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_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_app_proxyman_command_command_proto_goTypes = []interface{}{ var file_app_proxyman_command_command_proto_goTypes = []interface{}{
(*AddUserOperation)(nil), // 0: v2ray.core.app.proxyman.command.AddUserOperation (*AddUserOperation)(nil), // 0: v2ray.core.app.proxyman.command.AddUserOperation
(*RemoveUserOperation)(nil), // 1: v2ray.core.app.proxyman.command.RemoveUserOperation (*RemoveUserOperation)(nil), // 1: v2ray.core.app.proxyman.command.RemoveUserOperation
(*AddInboundRequest)(nil), // 2: v2ray.core.app.proxyman.command.AddInboundRequest (*AddInboundRequest)(nil), // 2: v2ray.core.app.proxyman.command.AddInboundRequest
(*AddInboundResponse)(nil), // 3: v2ray.core.app.proxyman.command.AddInboundResponse (*AddInboundResponse)(nil), // 3: v2ray.core.app.proxyman.command.AddInboundResponse
(*RemoveInboundRequest)(nil), // 4: v2ray.core.app.proxyman.command.RemoveInboundRequest (*RemoveInboundRequest)(nil), // 4: v2ray.core.app.proxyman.command.RemoveInboundRequest
(*RemoveInboundResponse)(nil), // 5: v2ray.core.app.proxyman.command.RemoveInboundResponse (*RemoveInboundResponse)(nil), // 5: v2ray.core.app.proxyman.command.RemoveInboundResponse
(*AlterInboundRequest)(nil), // 6: v2ray.core.app.proxyman.command.AlterInboundRequest (*AlterInboundRequest)(nil), // 6: v2ray.core.app.proxyman.command.AlterInboundRequest
(*AlterInboundResponse)(nil), // 7: v2ray.core.app.proxyman.command.AlterInboundResponse (*AlterInboundResponse)(nil), // 7: v2ray.core.app.proxyman.command.AlterInboundResponse
(*AddOutboundRequest)(nil), // 8: v2ray.core.app.proxyman.command.AddOutboundRequest (*AddOutboundRequest)(nil), // 8: v2ray.core.app.proxyman.command.AddOutboundRequest
(*AddOutboundResponse)(nil), // 9: v2ray.core.app.proxyman.command.AddOutboundResponse (*AddOutboundResponse)(nil), // 9: v2ray.core.app.proxyman.command.AddOutboundResponse
(*RemoveOutboundRequest)(nil), // 10: v2ray.core.app.proxyman.command.RemoveOutboundRequest (*RemoveOutboundRequest)(nil), // 10: v2ray.core.app.proxyman.command.RemoveOutboundRequest
(*RemoveOutboundResponse)(nil), // 11: v2ray.core.app.proxyman.command.RemoveOutboundResponse (*RemoveOutboundResponse)(nil), // 11: v2ray.core.app.proxyman.command.RemoveOutboundResponse
(*AlterOutboundRequest)(nil), // 12: v2ray.core.app.proxyman.command.AlterOutboundRequest (*AlterOutboundRequest)(nil), // 12: v2ray.core.app.proxyman.command.AlterOutboundRequest
(*AlterOutboundResponse)(nil), // 13: v2ray.core.app.proxyman.command.AlterOutboundResponse (*AlterOutboundResponse)(nil), // 13: v2ray.core.app.proxyman.command.AlterOutboundResponse
(*Config)(nil), // 14: v2ray.core.app.proxyman.command.Config (*Config)(nil), // 14: v2ray.core.app.proxyman.command.Config
(*protocol.User)(nil), // 15: v2ray.core.common.protocol.User (*protocol.User)(nil), // 15: v2ray.core.common.protocol.User
(*core.InboundHandlerConfig)(nil), // 16: v2ray.core.InboundHandlerConfig (*v4.InboundHandlerConfig)(nil), // 16: v2ray.core.InboundHandlerConfig
(*serial.TypedMessage)(nil), // 17: v2ray.core.common.serial.TypedMessage (*serial.TypedMessage)(nil), // 17: v2ray.core.common.serial.TypedMessage
(*core.OutboundHandlerConfig)(nil), // 18: v2ray.core.OutboundHandlerConfig (*v4.OutboundHandlerConfig)(nil), // 18: v2ray.core.OutboundHandlerConfig
} }
var file_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 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; package v2ray.core.app.proxyman.command;
option csharp_namespace = "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_package = "com.v2ray.core.app.proxyman.command";
option java_multiple_files = true; option java_multiple_files = true;

View File

@ -1,3 +1,3 @@
package command 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 package command
import "v2ray.com/core/common/errors" import "github.com/v2fly/v2ray-core/v4/common/errors"
type errPathObjHolder struct{} type errPathObjHolder struct{}

View File

@ -8,13 +8,13 @@ package proxyman
import ( import (
proto "github.com/golang/protobuf/proto" 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" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
net "v2ray.com/core/common/net"
serial "v2ray.com/core/common/serial"
internet "v2ray.com/core/transport/internet"
) )
const ( 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, 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, 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, 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, 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, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x2b, 0x67,
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 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, 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, 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, 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; package v2ray.core.app.proxyman;
option csharp_namespace = "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_package = "com.v2ray.core.app.proxyman";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

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

View File

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

View File

@ -1,17 +1,17 @@
package inbound 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 ( import (
"context" "context"
"sync" "sync"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/app/proxyman" "github.com/v2fly/v2ray-core/v4/app/proxyman"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/serial" "github.com/v2fly/v2ray-core/v4/common/serial"
"v2ray.com/core/common/session" "github.com/v2fly/v2ray-core/v4/common/session"
"v2ray.com/core/features/inbound" "github.com/v2fly/v2ray-core/v4/features/inbound"
) )
// Manager is to manage all inbound handlers. // Manager is to manage all inbound handlers.

View File

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

View File

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

View File

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

View File

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

View File

@ -1,17 +1,17 @@
package outbound 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 ( import (
"context" "context"
"strings" "strings"
"sync" "sync"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/app/proxyman" "github.com/v2fly/v2ray-core/v4/app/proxyman"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/errors" "github.com/v2fly/v2ray-core/v4/common/errors"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
) )
// Manager is to manage all outbound handlers. // Manager is to manage all outbound handlers.

View File

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

View File

@ -6,7 +6,7 @@ import (
"crypto/rand" "crypto/rand"
"io" "io"
"v2ray.com/core/common/dice" "github.com/v2fly/v2ray-core/v4/common/dice"
) )
func (c *Control) FillInRandom() { 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, 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, 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, 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, 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, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, 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, 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, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.app.reverse; package v2ray.core.app.reverse;
option csharp_namespace = "V2Ray.Core.Proxy.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_package = "com.v2ray.core.proxy.reverse";
option java_multiple_files = true; option java_multiple_files = true;

View File

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

View File

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

View File

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

View File

@ -2,21 +2,21 @@
package reverse 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 ( import (
"context" "context"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/errors" "github.com/v2fly/v2ray-core/v4/common/errors"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/features/routing"
) )
const ( const (
internalDomain = "reverse.internal.v2ray.com" internalDomain = "reverse.internal.v2fly.org"
) )
func isDomain(dest net.Destination, domain string) bool { func isDomain(dest net.Destination, domain string) bool {

View File

@ -3,8 +3,8 @@
package router package router
import ( import (
"v2ray.com/core/common/dice" "github.com/v2fly/v2ray-core/v4/common/dice"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
) )
type BalancingStrategy interface { type BalancingStrategy interface {

View File

@ -2,17 +2,18 @@
package command 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 ( import (
"context" "context"
"time" "time"
"google.golang.org/grpc" "google.golang.org/grpc"
"v2ray.com/core"
"v2ray.com/core/common" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/features/stats" "github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/features/stats"
) )
// routingServer is an implementation of RoutingService. // routingServer is an implementation of RoutingService.

View File

@ -8,11 +8,11 @@ package command
import ( import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
net "github.com/v2fly/v2ray-core/v4/common/net"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
net "v2ray.com/core/common/net"
) )
const ( const (
@ -412,11 +412,12 @@ var file_app_router_command_command_proto_rawDesc = []byte{
0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 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, 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, 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, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x78,
0x0a, 0x21, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 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, 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, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 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, 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, 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, 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.router.command; package v2ray.core.app.router.command;
option csharp_namespace = "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_package = "com.v2ray.core.app.router.command";
option java_multiple_files = true; option java_multiple_files = true;

View File

@ -10,13 +10,14 @@ import (
"github.com/google/go-cmp/cmp/cmpopts" "github.com/google/go-cmp/cmp/cmpopts"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn" "google.golang.org/grpc/test/bufconn"
"v2ray.com/core/app/router"
. "v2ray.com/core/app/router/command" "github.com/v2fly/v2ray-core/v4/app/router"
"v2ray.com/core/app/stats" . "github.com/v2fly/v2ray-core/v4/app/router/command"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/app/stats"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/testing/mocks" "github.com/v2fly/v2ray-core/v4/features/routing"
"github.com/v2fly/v2ray-core/v4/testing/mocks"
) )
func TestServiceSubscribeRoutingStats(t *testing.T) { func TestServiceSubscribeRoutingStats(t *testing.T) {

View File

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

View File

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

View File

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

View File

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

View File

@ -6,11 +6,12 @@ import (
"testing" "testing"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"v2ray.com/core/app/router"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/app/router"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/platform" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/common/platform/filesystem" "github.com/v2fly/v2ray-core/v4/common/platform"
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
) )
func init() { func init() {

View File

@ -8,17 +8,17 @@ import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
. "v2ray.com/core/app/router" . "github.com/v2fly/v2ray-core/v4/app/router"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/errors" "github.com/v2fly/v2ray-core/v4/common/errors"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/common/platform" "github.com/v2fly/v2ray-core/v4/common/platform"
"v2ray.com/core/common/platform/filesystem" "github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
"v2ray.com/core/common/protocol" "github.com/v2fly/v2ray-core/v4/common/protocol"
"v2ray.com/core/common/protocol/http" "github.com/v2fly/v2ray-core/v4/common/protocol/http"
"v2ray.com/core/common/session" "github.com/v2fly/v2ray-core/v4/common/session"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/features/routing"
routing_session "v2ray.com/core/features/routing/session" routing_session "github.com/v2fly/v2ray-core/v4/features/routing/session"
) )
func init() { func init() {
@ -63,7 +63,7 @@ func TestRoutingRule(t *testing.T) {
rule: &RoutingRule{ rule: &RoutingRule{
Domain: []*Domain{ Domain: []*Domain{
{ {
Value: "v2ray.com", Value: "v2fly.org",
Type: Domain_Plain, Type: Domain_Plain,
}, },
{ {
@ -78,11 +78,11 @@ func TestRoutingRule(t *testing.T) {
}, },
test: []ruleTest{ test: []ruleTest{
{ {
input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}), input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2fly.org"), 80)}),
output: true, output: true,
}, },
{ {
input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.DomainAddress("www.v2ray.com.www"), 80)}), input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.DomainAddress("www.v2fly.org.www"), 80)}),
output: true, output: true,
}, },
{ {
@ -206,16 +206,16 @@ func TestRoutingRule(t *testing.T) {
{ {
rule: &RoutingRule{ rule: &RoutingRule{
UserEmail: []string{ UserEmail: []string{
"admin@v2ray.com", "admin@v2fly.org",
}, },
}, },
test: []ruleTest{ test: []ruleTest{
{ {
input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "admin@v2ray.com"}}), input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "admin@v2fly.org"}}),
output: true, output: true,
}, },
{ {
input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "love@v2ray.com"}}), input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "love@v2fly.org"}}),
output: false, output: false,
}, },
{ {

View File

@ -3,9 +3,9 @@
package router package router
import ( import (
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/features/routing"
) )
// CIDRList is an alias of []*CIDR to provide sort.Interface. // CIDRList is an alias of []*CIDR to provide sort.Interface.

View File

@ -8,11 +8,11 @@ package router
import ( import (
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
net "github.com/v2fly/v2ray-core/v4/common/net"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
net "v2ray.com/core/common/net"
) )
const ( const (
@ -1025,10 +1025,11 @@ var file_app_router_config_proto_rawDesc = []byte{
0x79, 0x12, 0x08, 0x0a, 0x04, 0x41, 0x73, 0x49, 0x73, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 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, 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, 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, 0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x42, 0x60, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 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, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 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, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 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, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33, 0x6f, 0x33,

View File

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

View File

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

View File

@ -2,17 +2,17 @@
package router package router
//go:generate go run v2ray.com/core/common/errors/errorgen //go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
import ( import (
"context" "context"
"v2ray.com/core" core "github.com/v2fly/v2ray-core/v4"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/features/dns" "github.com/v2fly/v2ray-core/v4/features/dns"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/features/outbound"
"v2ray.com/core/features/routing" "github.com/v2fly/v2ray-core/v4/features/routing"
routing_dns "v2ray.com/core/features/routing/dns" routing_dns "github.com/v2fly/v2ray-core/v4/features/routing/dns"
) )
// Router is an implementation of routing.Router. // Router is an implementation of routing.Router.

View File

@ -5,13 +5,14 @@ import (
"testing" "testing"
"github.com/golang/mock/gomock" "github.com/golang/mock/gomock"
. "v2ray.com/core/app/router"
"v2ray.com/core/common" . "github.com/v2fly/v2ray-core/v4/app/router"
"v2ray.com/core/common/net" "github.com/v2fly/v2ray-core/v4/common"
"v2ray.com/core/common/session" "github.com/v2fly/v2ray-core/v4/common/net"
"v2ray.com/core/features/outbound" "github.com/v2fly/v2ray-core/v4/common/session"
routing_session "v2ray.com/core/features/routing/session" "github.com/v2fly/v2ray-core/v4/features/outbound"
"v2ray.com/core/testing/mocks" routing_session "github.com/v2fly/v2ray-core/v4/features/routing/session"
"github.com/v2fly/v2ray-core/v4/testing/mocks"
) )
type mockOutboundManager struct { type mockOutboundManager struct {
@ -44,7 +45,7 @@ func TestSimpleRouter(t *testing.T) {
HandlerSelector: mockHs, HandlerSelector: mockHs,
})) }))
ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2fly.org"), 80)})
route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) route, err := r.PickRoute(routing_session.AsRoutingContext(ctx))
common.Must(err) common.Must(err)
if tag := route.GetOutboundTag(); tag != "test" { if tag := route.GetOutboundTag(); tag != "test" {
@ -85,7 +86,7 @@ func TestSimpleBalancer(t *testing.T) {
HandlerSelector: mockHs, HandlerSelector: mockHs,
})) }))
ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2fly.org"), 80)})
route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) route, err := r.PickRoute(routing_session.AsRoutingContext(ctx))
common.Must(err) common.Must(err)
if tag := route.GetOutboundTag(); tag != "test" { if tag := route.GetOutboundTag(); tag != "test" {
@ -115,12 +116,12 @@ func TestIPOnDemand(t *testing.T) {
defer mockCtl.Finish() defer mockCtl.Finish()
mockDNS := mocks.NewDNSClient(mockCtl) mockDNS := mocks.NewDNSClient(mockCtl)
mockDNS.EXPECT().LookupIP(gomock.Eq("v2ray.com")).Return([]net.IP{{192, 168, 0, 1}}, nil).AnyTimes() mockDNS.EXPECT().LookupIP(gomock.Eq("v2fly.org")).Return([]net.IP{{192, 168, 0, 1}}, nil).AnyTimes()
r := new(Router) r := new(Router)
common.Must(r.Init(config, mockDNS, nil)) common.Must(r.Init(config, mockDNS, nil))
ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2fly.org"), 80)})
route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) route, err := r.PickRoute(routing_session.AsRoutingContext(ctx))
common.Must(err) common.Must(err)
if tag := route.GetOutboundTag(); tag != "test" { if tag := route.GetOutboundTag(); tag != "test" {
@ -150,12 +151,12 @@ func TestIPIfNonMatchDomain(t *testing.T) {
defer mockCtl.Finish() defer mockCtl.Finish()
mockDNS := mocks.NewDNSClient(mockCtl) mockDNS := mocks.NewDNSClient(mockCtl)
mockDNS.EXPECT().LookupIP(gomock.Eq("v2ray.com")).Return([]net.IP{{192, 168, 0, 1}}, nil).AnyTimes() mockDNS.EXPECT().LookupIP(gomock.Eq("v2fly.org")).Return([]net.IP{{192, 168, 0, 1}}, nil).AnyTimes()
r := new(Router) r := new(Router)
common.Must(r.Init(config, mockDNS, nil)) common.Must(r.Init(config, mockDNS, nil))
ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2ray.com"), 80)}) ctx := session.ContextWithOutbound(context.Background(), &session.Outbound{Target: net.TCPDestination(net.DomainAddress("v2fly.org"), 80)})
route, err := r.PickRoute(routing_session.AsRoutingContext(ctx)) route, err := r.PickRoute(routing_session.AsRoutingContext(ctx))
common.Must(err) common.Must(err)
if tag := route.GetOutboundTag(); tag != "test" { if tag := route.GetOutboundTag(); tag != "test" {

View File

@ -6,7 +6,7 @@ import (
"context" "context"
"sync" "sync"
"v2ray.com/core/common" "github.com/v2fly/v2ray-core/v4/common"
) )
// Channel is an implementation of stats.Channel. // Channel is an implementation of stats.Channel.

View File

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

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