mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
Chore: change module name (#677)
This commit is contained in:
parent
0957442e01
commit
f94dd11a8c
@ -2,7 +2,7 @@
|
||||
|
||||
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"
|
||||
@ -11,10 +11,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.
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package commander
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -6,10 +6,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.
|
||||
|
@ -7,7 +7,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.
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
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"
|
||||
@ -10,20 +10,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 (
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
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
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dispatcher
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -5,11 +5,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
|
||||
|
@ -5,10 +5,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 {
|
||||
|
@ -3,9 +3,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 {
|
||||
|
@ -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
|
||||
|
@ -3,9 +3,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{
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -3,21 +3,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.
|
||||
|
@ -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 {
|
||||
|
@ -7,10 +7,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 '.'
|
||||
|
@ -10,8 +10,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) {
|
||||
@ -147,8 +148,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) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package dns
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package fakedns
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -8,10 +8,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 {
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
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
|
||||
|
@ -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,
|
||||
|
@ -2,7 +2,7 @@ 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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -3,10 +3,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.
|
||||
|
@ -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,
|
||||
})
|
||||
|
@ -7,12 +7,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.
|
||||
|
@ -15,15 +15,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,
|
||||
|
@ -5,9 +5,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 {
|
||||
|
@ -5,8 +5,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.
|
||||
|
@ -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) {
|
||||
|
@ -12,15 +12,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
|
||||
|
@ -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) {
|
||||
|
@ -10,16 +10,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.
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
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 {
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package command
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package log
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
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.
|
||||
|
@ -3,8 +3,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 {
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package policy
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -7,11 +7,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.
|
||||
|
@ -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,
|
||||
@ -834,9 +835,9 @@ var file_app_proxyman_command_command_proto_goTypes = []interface{}{
|
||||
(*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
|
||||
(*v4.InboundHandlerConfig)(nil), // 16: v2ray.core.InboundHandlerConfig
|
||||
(*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{
|
||||
15, // 0: v2ray.core.app.proxyman.command.AddUserOperation.user:type_name -> v2ray.core.common.protocol.User
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -1,6 +1,6 @@
|
||||
package command
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package inbound
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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 {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package outbound
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -7,13 +7,14 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/golang/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.
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"crypto/rand"
|
||||
"io"
|
||||
|
||||
"v2ray.com/core/common/dice"
|
||||
"github.com/v2fly/v2ray-core/v4/common/dice"
|
||||
)
|
||||
|
||||
func (c *Control) FillInRandom() {
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package reverse
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -8,15 +8,16 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/golang/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 {
|
||||
|
@ -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) {
|
||||
|
@ -2,21 +2,21 @@
|
||||
|
||||
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 {
|
||||
|
@ -3,8 +3,8 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"v2ray.com/core/common/dice"
|
||||
"v2ray.com/core/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/common/dice"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
)
|
||||
|
||||
type BalancingStrategy interface {
|
||||
|
@ -2,17 +2,18 @@
|
||||
|
||||
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"
|
||||
"v2ray.com/core"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/features/routing"
|
||||
"v2ray.com/core/features/stats"
|
||||
|
||||
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.
|
||||
|
@ -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 (
|
||||
@ -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,
|
||||
0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72,
|
||||
0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f,
|
||||
0x75, 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x68,
|
||||
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,
|
||||
0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
|
||||
0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x21, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72,
|
||||
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, 0x6f, 0x33,
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
package command
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -7,9 +7,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 {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"encoding/binary"
|
||||
"sort"
|
||||
|
||||
"v2ray.com/core/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
)
|
||||
|
||||
type ipv6 struct {
|
||||
|
@ -6,11 +6,12 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/platform"
|
||||
"v2ray.com/core/common/platform/filesystem"
|
||||
|
||||
"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/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@ -8,17 +8,17 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
. "v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/errors"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/platform"
|
||||
"v2ray.com/core/common/platform/filesystem"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/common/protocol/http"
|
||||
"v2ray.com/core/common/session"
|
||||
"v2ray.com/core/features/routing"
|
||||
routing_session "v2ray.com/core/features/routing/session"
|
||||
. "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/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol/http"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
"github.com/v2fly/v2ray-core/v4/features/routing"
|
||||
routing_session "github.com/v2fly/v2ray-core/v4/features/routing/session"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -63,7 +63,7 @@ func TestRoutingRule(t *testing.T) {
|
||||
rule: &RoutingRule{
|
||||
Domain: []*Domain{
|
||||
{
|
||||
Value: "v2ray.com",
|
||||
Value: "v2fly.org",
|
||||
Type: Domain_Plain,
|
||||
},
|
||||
{
|
||||
@ -78,11 +78,11 @@ func TestRoutingRule(t *testing.T) {
|
||||
},
|
||||
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,
|
||||
},
|
||||
{
|
||||
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,
|
||||
},
|
||||
{
|
||||
@ -206,16 +206,16 @@ func TestRoutingRule(t *testing.T) {
|
||||
{
|
||||
rule: &RoutingRule{
|
||||
UserEmail: []string{
|
||||
"admin@v2ray.com",
|
||||
"admin@v2fly.org",
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
{
|
||||
input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "love@v2ray.com"}}),
|
||||
input: withInbound(&session.Inbound{User: &protocol.MemoryUser{Email: "love@v2fly.org"}}),
|
||||
output: false,
|
||||
},
|
||||
{
|
||||
|
@ -3,9 +3,9 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/features/outbound"
|
||||
"v2ray.com/core/features/routing"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/features/routing"
|
||||
)
|
||||
|
||||
// CIDRList is an alias of []*CIDR to provide sort.Interface.
|
||||
|
@ -8,11 +8,11 @@ package router
|
||||
|
||||
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 (
|
||||
@ -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,
|
||||
0x73, 0x65, 0x49, 0x70, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x70, 0x49, 0x66, 0x4e, 0x6f,
|
||||
0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x70, 0x4f, 0x6e,
|
||||
0x44, 0x65, 0x6d, 0x61, 0x6e, 0x64, 0x10, 0x03, 0x42, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
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,
|
||||
0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x19, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63,
|
||||
0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74,
|
||||
0x6f, 0x75, 0x74, 0x65, 0x72, 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, 0x72, 0x6f, 0x75, 0x74,
|
||||
0x65, 0x72, 0xaa, 0x02, 0x15, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e,
|
||||
0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
|
@ -2,7 +2,7 @@ syntax = "proto3";
|
||||
|
||||
package 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_multiple_files = true;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package router
|
||||
|
||||
import "v2ray.com/core/common/errors"
|
||||
import "github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
|
||||
type errPathObjHolder struct{}
|
||||
|
||||
|
@ -2,17 +2,17 @@
|
||||
|
||||
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 (
|
||||
"context"
|
||||
|
||||
"v2ray.com/core"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/features/dns"
|
||||
"v2ray.com/core/features/outbound"
|
||||
"v2ray.com/core/features/routing"
|
||||
routing_dns "v2ray.com/core/features/routing/dns"
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/features/routing"
|
||||
routing_dns "github.com/v2fly/v2ray-core/v4/features/routing/dns"
|
||||
)
|
||||
|
||||
// Router is an implementation of routing.Router.
|
||||
|
@ -5,13 +5,14 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
. "v2ray.com/core/app/router"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/session"
|
||||
"v2ray.com/core/features/outbound"
|
||||
routing_session "v2ray.com/core/features/routing/session"
|
||||
"v2ray.com/core/testing/mocks"
|
||||
|
||||
. "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/session"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
routing_session "github.com/v2fly/v2ray-core/v4/features/routing/session"
|
||||
"github.com/v2fly/v2ray-core/v4/testing/mocks"
|
||||
)
|
||||
|
||||
type mockOutboundManager struct {
|
||||
@ -44,7 +45,7 @@ func TestSimpleRouter(t *testing.T) {
|
||||
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))
|
||||
common.Must(err)
|
||||
if tag := route.GetOutboundTag(); tag != "test" {
|
||||
@ -85,7 +86,7 @@ func TestSimpleBalancer(t *testing.T) {
|
||||
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))
|
||||
common.Must(err)
|
||||
if tag := route.GetOutboundTag(); tag != "test" {
|
||||
@ -115,12 +116,12 @@ func TestIPOnDemand(t *testing.T) {
|
||||
defer mockCtl.Finish()
|
||||
|
||||
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)
|
||||
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))
|
||||
common.Must(err)
|
||||
if tag := route.GetOutboundTag(); tag != "test" {
|
||||
@ -150,12 +151,12 @@ func TestIPIfNonMatchDomain(t *testing.T) {
|
||||
defer mockCtl.Finish()
|
||||
|
||||
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)
|
||||
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))
|
||||
common.Must(err)
|
||||
if tag := route.GetOutboundTag(); tag != "test" {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
)
|
||||
|
||||
// Channel is an implementation of stats.Channel.
|
||||
|
@ -6,9 +6,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
. "v2ray.com/core/app/stats"
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/features/stats"
|
||||
. "github.com/v2fly/v2ray-core/v4/app/stats"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features/stats"
|
||||
)
|
||||
|
||||
func TestStatsChannel(t *testing.T) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user