diff --git a/app/commander/commander.go b/app/commander/commander.go index 1a2dfd30..dc7a9b9a 100644 --- a/app/commander/commander.go +++ b/app/commander/commander.go @@ -2,7 +2,7 @@ package commander -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,10 +11,10 @@ import ( "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/signal/done" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/signal/done" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" ) // Commander is a Xray feature that provides gRPC methods to external clients. diff --git a/app/commander/config.pb.go b/app/commander/config.pb.go index 15940aee..c10693ec 100644 --- a/app/commander/config.pb.go +++ b/app/commander/config.pb.go @@ -8,7 +8,7 @@ package commander import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -139,13 +139,13 @@ var file_app_commander_config_proto_rawDesc = []byte{ 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, - 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x65, 0x72, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/app/commander/config.proto b/app/commander/config.proto index d80261ab..91d7b061 100644 --- a/app/commander/config.proto +++ b/app/commander/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.commander; option csharp_namespace = "Xray.App.Commander"; -option go_package = "github.com/xtls/xray-core/v1/app/commander"; +option go_package = "github.com/xtls/xray-core/app/commander"; option java_package = "com.xray.app.commander"; option java_multiple_files = true; diff --git a/app/commander/errors.generated.go b/app/commander/errors.generated.go index 058fb9cd..c3cac329 100644 --- a/app/commander/errors.generated.go +++ b/app/commander/errors.generated.go @@ -1,6 +1,6 @@ package commander -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/commander/outbound.go b/app/commander/outbound.go index 616a61f8..dac5982d 100644 --- a/app/commander/outbound.go +++ b/app/commander/outbound.go @@ -6,10 +6,10 @@ import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport" ) // OutboundListener is a net.Listener for listening gRPC connections. diff --git a/app/commander/service.go b/app/commander/service.go index 8039ade9..5b1e1acb 100644 --- a/app/commander/service.go +++ b/app/commander/service.go @@ -5,7 +5,7 @@ package commander import ( "context" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" "google.golang.org/grpc" "google.golang.org/grpc/reflection" ) diff --git a/app/dispatcher/config.pb.go b/app/dispatcher/config.pb.go index 1d994307..bb39e36e 100644 --- a/app/dispatcher/config.pb.go +++ b/app/dispatcher/config.pb.go @@ -122,13 +122,13 @@ var file_app_dispatcher_config_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x42, 0x5e, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x6e, 0x67, 0x73, 0x42, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50, 0x01, - 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, - 0x70, 0x70, 0x2f, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x13, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, - 0x68, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, + 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/dispatcher/config.proto b/app/dispatcher/config.proto index 7ffa96d6..e6794238 100644 --- a/app/dispatcher/config.proto +++ b/app/dispatcher/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.dispatcher; option csharp_namespace = "Xray.App.Dispatcher"; -option go_package = "github.com/xtls/xray-core/v1/app/dispatcher"; +option go_package = "github.com/xtls/xray-core/app/dispatcher"; option java_package = "com.xray.app.dispatcher"; option java_multiple_files = true; diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index 6ec313e7..27fb9831 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -2,7 +2,7 @@ package dispatcher -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -10,20 +10,20 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + routing_session "github.com/xtls/xray-core/features/routing/session" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) var ( diff --git a/app/dispatcher/dispatcher.go b/app/dispatcher/dispatcher.go index e8b24b51..521cebbc 100644 --- a/app/dispatcher/dispatcher.go +++ b/app/dispatcher/dispatcher.go @@ -2,4 +2,4 @@ package dispatcher -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/dispatcher/errors.generated.go b/app/dispatcher/errors.generated.go index 79f6094a..e13ee608 100644 --- a/app/dispatcher/errors.generated.go +++ b/app/dispatcher/errors.generated.go @@ -1,6 +1,6 @@ package dispatcher -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/dispatcher/sniffer.go b/app/dispatcher/sniffer.go index e7bdda6d..d14481d9 100644 --- a/app/dispatcher/sniffer.go +++ b/app/dispatcher/sniffer.go @@ -3,10 +3,10 @@ package dispatcher import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/bittorrent" - "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/protocol/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/bittorrent" + "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/protocol/tls" ) type SniffResult interface { diff --git a/app/dispatcher/stats.go b/app/dispatcher/stats.go index 02bd00ee..6f7bad9d 100644 --- a/app/dispatcher/stats.go +++ b/app/dispatcher/stats.go @@ -3,9 +3,9 @@ package dispatcher import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/features/stats" ) type SizeStatWriter struct { diff --git a/app/dispatcher/stats_test.go b/app/dispatcher/stats_test.go index e4f2f2ed..6eca32a4 100644 --- a/app/dispatcher/stats_test.go +++ b/app/dispatcher/stats_test.go @@ -3,9 +3,9 @@ package dispatcher_test import ( "testing" - . "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + . "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) type TestCounter int64 diff --git a/app/dns/config.pb.go b/app/dns/config.pb.go index fda7d91f..5a3368af 100644 --- a/app/dns/config.pb.go +++ b/app/dns/config.pb.go @@ -8,8 +8,8 @@ package dns import ( proto "github.com/golang/protobuf/proto" - router "github.com/xtls/xray-core/v1/app/router" - net "github.com/xtls/xray-core/v1/common/net" + router "github.com/xtls/xray-core/app/router" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -511,13 +511,12 @@ var file_app_dns_config_proto_rawDesc = []byte{ 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x75, 0x6c, 0x6c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, - 0x64, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x49, + 0x64, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x65, 0x67, 0x65, 0x78, 0x10, 0x03, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, - 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x61, 0x70, 0x70, 0x2f, 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, + 0x70, 0x70, 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/dns/config.proto b/app/dns/config.proto index 7da491bc..3ab82500 100644 --- a/app/dns/config.proto +++ b/app/dns/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.dns; option csharp_namespace = "Xray.App.Dns"; -option go_package = "github.com/xtls/xray-core/v1/app/dns"; +option go_package = "github.com/xtls/xray-core/app/dns"; option java_package = "com.xray.app.dns"; option java_multiple_files = true; diff --git a/app/dns/dns.go b/app/dns/dns.go index b64307ab..e56671e4 100644 --- a/app/dns/dns.go +++ b/app/dns/dns.go @@ -1,4 +1,4 @@ // Package dns is an implementation of core.DNS feature. package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/dns/dnscommon.go b/app/dns/dnscommon.go index c2f1f075..888c6c04 100644 --- a/app/dns/dnscommon.go +++ b/app/dns/dnscommon.go @@ -6,10 +6,10 @@ import ( "encoding/binary" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - dns_feature "github.com/xtls/xray-core/v1/features/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + dns_feature "github.com/xtls/xray-core/features/dns" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/dnscommon_test.go b/app/dns/dnscommon_test.go index cd715180..51d37a63 100644 --- a/app/dns/dnscommon_test.go +++ b/app/dns/dnscommon_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/dohdns.go b/app/dns/dohdns.go index ddfebb3b..1a1e8b94 100644 --- a/app/dns/dohdns.go +++ b/app/dns/dohdns.go @@ -14,15 +14,15 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/dns" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/pubsub" - "github.com/xtls/xray-core/v1/common/task" - dns_feature "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/dns" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/pubsub" + "github.com/xtls/xray-core/common/task" + dns_feature "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/dns/errors.generated.go b/app/dns/errors.generated.go index ce4c0605..d7375a9b 100644 --- a/app/dns/errors.generated.go +++ b/app/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/dns/hosts.go b/app/dns/hosts.go index cd8048f6..7275f2d6 100644 --- a/app/dns/hosts.go +++ b/app/dns/hosts.go @@ -3,10 +3,10 @@ package dns import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/features" ) // StaticHosts represents static domain-ip mapping in DNS server. diff --git a/app/dns/hosts_test.go b/app/dns/hosts_test.go index 401abdfd..c2f99694 100644 --- a/app/dns/hosts_test.go +++ b/app/dns/hosts_test.go @@ -5,9 +5,9 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) func TestStaticHosts(t *testing.T) { diff --git a/app/dns/nameserver.go b/app/dns/nameserver.go index 02cf8f59..14d3a217 100644 --- a/app/dns/nameserver.go +++ b/app/dns/nameserver.go @@ -5,8 +5,8 @@ package dns import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns/localdns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns/localdns" ) // IPOption is an object for IP query options. diff --git a/app/dns/nameserver_test.go b/app/dns/nameserver_test.go index 9aa90ae4..53638d2d 100644 --- a/app/dns/nameserver_test.go +++ b/app/dns/nameserver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/common" ) func TestLocalNameServer(t *testing.T) { diff --git a/app/dns/server.go b/app/dns/server.go index 40ff21a3..6c42911c 100644 --- a/app/dns/server.go +++ b/app/dns/server.go @@ -2,7 +2,7 @@ package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -13,17 +13,17 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" ) // Server is a DNS rely server. diff --git a/app/dns/server_test.go b/app/dns/server_test.go index d57a894e..2e517609 100644 --- a/app/dns/server_test.go +++ b/app/dns/server_test.go @@ -7,19 +7,19 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/app/dispatcher" - . "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - feature_dns "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + . "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + feature_dns "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/testing/servers/udp" ) type staticHandler struct { diff --git a/app/dns/udpns.go b/app/dns/udpns.go index ffcd8c04..a285a53b 100644 --- a/app/dns/udpns.go +++ b/app/dns/udpns.go @@ -9,16 +9,16 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/dns" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/pubsub" - "github.com/xtls/xray-core/v1/common/task" - dns_feature "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/dns" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/pubsub" + "github.com/xtls/xray-core/common/task" + dns_feature "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet/udp" "golang.org/x/net/dns/dnsmessage" ) diff --git a/app/log/command/command.go b/app/log/command/command.go index 56eb22e4..2c565b00 100644 --- a/app/log/command/command.go +++ b/app/log/command/command.go @@ -2,16 +2,16 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" ) type LoggerServer struct { diff --git a/app/log/command/command_test.go b/app/log/command/command_test.go index 6ca17ee0..bd3970a5 100644 --- a/app/log/command/command_test.go +++ b/app/log/command/command_test.go @@ -4,15 +4,15 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - . "github.com/xtls/xray-core/v1/app/log/command" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + . "github.com/xtls/xray-core/app/log/command" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" ) func TestLoggerRestart(t *testing.T) { diff --git a/app/log/command/config.pb.go b/app/log/command/config.pb.go index d782874e..db046b40 100644 --- a/app/log/command/config.pb.go +++ b/app/log/command/config.pb.go @@ -156,14 +156,14 @@ var file_app_log_command_config_proto_rawDesc = []byte{ 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x6f, 0x67, 0x67, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x61, 0x0a, 0x18, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, - 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, + 0x2e, 0x4c, 0x6f, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/log/command/config.proto b/app/log/command/config.proto index 1a24080f..2ebf40aa 100644 --- a/app/log/command/config.proto +++ b/app/log/command/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.log.command; option csharp_namespace = "Xray.App.Log.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/log/command"; +option go_package = "github.com/xtls/xray-core/app/log/command"; option java_package = "com.xray.app.log.command"; option java_multiple_files = true; diff --git a/app/log/command/config_grpc.pb.go b/app/log/command/config_grpc.pb.go index 464e950e..58439438 100644 --- a/app/log/command/config_grpc.pb.go +++ b/app/log/command/config_grpc.pb.go @@ -63,6 +63,7 @@ type UnsafeLoggerServiceServer interface { func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServer) { s.RegisterService(&_LoggerService_serviceDesc, srv) + s.RegisterService(&_LoggerService_serviceDesc2, srv) } func _LoggerService_RestartLogger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -95,3 +96,16 @@ var _LoggerService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/log/command/config.proto", } + +var _LoggerService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.log.command.LoggerService", + HandlerType: (*LoggerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RestartLogger", + Handler: _LoggerService_RestartLogger_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/log/command/config.proto", +} diff --git a/app/log/command/errors.generated.go b/app/log/command/errors.generated.go index 76b46f51..a1305932 100644 --- a/app/log/command/errors.generated.go +++ b/app/log/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/log/config.pb.go b/app/log/config.pb.go index 1253288b..85463847 100644 --- a/app/log/config.pb.go +++ b/app/log/config.pb.go @@ -8,7 +8,7 @@ package log import ( proto "github.com/golang/protobuf/proto" - log "github.com/xtls/xray-core/v1/common/log" + log "github.com/xtls/xray-core/common/log" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -184,12 +184,12 @@ var file_app_log_config_proto_rawDesc = []byte{ 0x74, 0x68, 0x2a, 0x35, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x6f, 0x6e, 0x65, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x10, 0x02, 0x12, 0x09, - 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x49, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x10, 0x03, 0x42, 0x46, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, - 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, - 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x6c, + 0x6f, 0x67, 0xaa, 0x02, 0x0c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x4c, 0x6f, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/log/config.proto b/app/log/config.proto index 32ac2b88..401e727c 100644 --- a/app/log/config.proto +++ b/app/log/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.log; option csharp_namespace = "Xray.App.Log"; -option go_package = "github.com/xtls/xray-core/v1/app/log"; +option go_package = "github.com/xtls/xray-core/app/log"; option java_package = "com.xray.app.log"; option java_multiple_files = true; diff --git a/app/log/errors.generated.go b/app/log/errors.generated.go index 6163bc84..e09634a9 100644 --- a/app/log/errors.generated.go +++ b/app/log/errors.generated.go @@ -1,6 +1,6 @@ package log -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/log/log.go b/app/log/log.go index 2260db4d..629a2420 100644 --- a/app/log/log.go +++ b/app/log/log.go @@ -2,14 +2,14 @@ package log -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/log" ) // Instance is a log.Handler that handles logs. diff --git a/app/log/log_creator.go b/app/log/log_creator.go index e62ffdcc..dca8b95f 100644 --- a/app/log/log_creator.go +++ b/app/log/log_creator.go @@ -3,8 +3,8 @@ package log import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/log" ) type HandlerCreatorOptions struct { diff --git a/app/log/log_test.go b/app/log/log_test.go index a3e6df2a..cda55f62 100644 --- a/app/log/log_test.go +++ b/app/log/log_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/testing/mocks" ) func TestCustomLogHandler(t *testing.T) { diff --git a/app/policy/config.go b/app/policy/config.go index 8ead6bd8..267307b7 100644 --- a/app/policy/config.go +++ b/app/policy/config.go @@ -3,7 +3,7 @@ package policy import ( "time" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/features/policy" ) // Duration converts Second to time.Duration. diff --git a/app/policy/config.pb.go b/app/policy/config.pb.go index 53986ec0..37597afd 100644 --- a/app/policy/config.pb.go +++ b/app/policy/config.pb.go @@ -554,12 +554,12 @@ var file_app_policy_config_proto_rawDesc = []byte{ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/policy/config.proto b/app/policy/config.proto index 14d5fa57..e5f29547 100644 --- a/app/policy/config.proto +++ b/app/policy/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.policy; option csharp_namespace = "Xray.App.Policy"; -option go_package = "github.com/xtls/xray-core/v1/app/policy"; +option go_package = "github.com/xtls/xray-core/app/policy"; option java_package = "com.xray.app.policy"; option java_multiple_files = true; diff --git a/app/policy/errors.generated.go b/app/policy/errors.generated.go index 506b4e7e..1fe4d613 100644 --- a/app/policy/errors.generated.go +++ b/app/policy/errors.generated.go @@ -1,6 +1,6 @@ package policy -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/policy/manager.go b/app/policy/manager.go index c99bb32e..ad2c6255 100644 --- a/app/policy/manager.go +++ b/app/policy/manager.go @@ -3,8 +3,8 @@ package policy import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/policy" ) // Instance is an instance of Policy manager. diff --git a/app/policy/manager_test.go b/app/policy/manager_test.go index 56167228..e738a380 100644 --- a/app/policy/manager_test.go +++ b/app/policy/manager_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/policy" + . "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/policy" ) func TestPolicy(t *testing.T) { diff --git a/app/policy/policy.go b/app/policy/policy.go index d91e4333..cbb1d90e 100644 --- a/app/policy/policy.go +++ b/app/policy/policy.go @@ -1,4 +1,4 @@ // Package policy is an implementation of policy.Manager feature. package policy -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/proxyman/command/command.go b/app/proxyman/command/command.go index 09aa4c75..e0404607 100644 --- a/app/proxyman/command/command.go +++ b/app/proxyman/command/command.go @@ -7,11 +7,11 @@ import ( grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/proxy" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/proxy" ) // InboundOperation is the interface for operations that applies to inbound handlers. diff --git a/app/proxyman/command/command.pb.go b/app/proxyman/command/command.pb.go index 02b5f4b6..74ad5cfd 100644 --- a/app/proxyman/command/command.pb.go +++ b/app/proxyman/command/command.pb.go @@ -8,9 +8,9 @@ package command import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" - serial "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" + protocol "github.com/xtls/xray-core/common/protocol" + serial "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -788,14 +788,14 @@ var file_app_proxyman_command_command_proto_rawDesc = []byte{ 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x70, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, + 0x00, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, - 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/proxyman/command/command.proto b/app/proxyman/command/command.proto index 6be2b123..5a09bd88 100644 --- a/app/proxyman/command/command.proto +++ b/app/proxyman/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.proxyman.command; option csharp_namespace = "Xray.App.Proxyman.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/proxyman/command"; +option go_package = "github.com/xtls/xray-core/app/proxyman/command"; option java_package = "com.xray.app.proxyman.command"; option java_multiple_files = true; diff --git a/app/proxyman/command/command_grpc.pb.go b/app/proxyman/command/command_grpc.pb.go index 41fb3e43..4069f25e 100644 --- a/app/proxyman/command/command_grpc.pb.go +++ b/app/proxyman/command/command_grpc.pb.go @@ -133,6 +133,7 @@ type UnsafeHandlerServiceServer interface { func RegisterHandlerServiceServer(s grpc.ServiceRegistrar, srv HandlerServiceServer) { s.RegisterService(&_HandlerService_serviceDesc, srv) + s.RegisterService(&_HandlerService_serviceDesc2, srv) } func _HandlerService_AddInbound_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -275,3 +276,36 @@ var _HandlerService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/proxyman/command/command.proto", } + +var _HandlerService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.proxyman.command.HandlerService", + HandlerType: (*HandlerServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AddInbound", + Handler: _HandlerService_AddInbound_Handler, + }, + { + MethodName: "RemoveInbound", + Handler: _HandlerService_RemoveInbound_Handler, + }, + { + MethodName: "AlterInbound", + Handler: _HandlerService_AlterInbound_Handler, + }, + { + MethodName: "AddOutbound", + Handler: _HandlerService_AddOutbound_Handler, + }, + { + MethodName: "RemoveOutbound", + Handler: _HandlerService_RemoveOutbound_Handler, + }, + { + MethodName: "AlterOutbound", + Handler: _HandlerService_AlterOutbound_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/proxyman/command/command.proto", +} diff --git a/app/proxyman/command/doc.go b/app/proxyman/command/doc.go index f6680e0d..2aa6d95f 100644 --- a/app/proxyman/command/doc.go +++ b/app/proxyman/command/doc.go @@ -1,3 +1,3 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/app/proxyman/command/errors.generated.go b/app/proxyman/command/errors.generated.go index 76b46f51..a1305932 100644 --- a/app/proxyman/command/errors.generated.go +++ b/app/proxyman/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/config.pb.go b/app/proxyman/config.pb.go index 7fa8a767..a4a20fc3 100644 --- a/app/proxyman/config.pb.go +++ b/app/proxyman/config.pb.go @@ -8,9 +8,9 @@ package proxyman import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - serial "github.com/xtls/xray-core/v1/common/serial" - internet "github.com/xtls/xray-core/v1/transport/internet" + net "github.com/xtls/xray-core/common/net" + serial "github.com/xtls/xray-core/common/serial" + internet "github.com/xtls/xray-core/transport/internet" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -835,13 +835,13 @@ var file_app_proxyman_config_proto_rawDesc = []byte{ 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, 0x58, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x03, 0x54, 0x4c, 0x53, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x50, - 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, + 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x6d, 0x61, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/proxyman/config.proto b/app/proxyman/config.proto index 3d84b575..e32d4503 100644 --- a/app/proxyman/config.proto +++ b/app/proxyman/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.proxyman; option csharp_namespace = "Xray.App.Proxyman"; -option go_package = "github.com/xtls/xray-core/v1/app/proxyman"; +option go_package = "github.com/xtls/xray-core/app/proxyman"; option java_package = "com.xray.app.proxyman"; option java_multiple_files = true; diff --git a/app/proxyman/inbound/always.go b/app/proxyman/inbound/always.go index c2a99646..43174a0f 100644 --- a/app/proxyman/inbound/always.go +++ b/app/proxyman/inbound/always.go @@ -3,17 +3,17 @@ package inbound import ( "context" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" ) func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) { diff --git a/app/proxyman/inbound/dynamic.go b/app/proxyman/inbound/dynamic.go index 90772e50..f6750976 100644 --- a/app/proxyman/inbound/dynamic.go +++ b/app/proxyman/inbound/dynamic.go @@ -5,14 +5,14 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" ) type DynamicInboundHandler struct { diff --git a/app/proxyman/inbound/errors.generated.go b/app/proxyman/inbound/errors.generated.go index f1f4116f..c2d7295e 100644 --- a/app/proxyman/inbound/errors.generated.go +++ b/app/proxyman/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/inbound/inbound.go b/app/proxyman/inbound/inbound.go index e734c7d4..0846b856 100644 --- a/app/proxyman/inbound/inbound.go +++ b/app/proxyman/inbound/inbound.go @@ -1,17 +1,17 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/inbound" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/inbound" ) // Manager is to manage all inbound handlers. diff --git a/app/proxyman/inbound/worker.go b/app/proxyman/inbound/worker.go index b59fde8e..94df0ddd 100644 --- a/app/proxyman/inbound/worker.go +++ b/app/proxyman/inbound/worker.go @@ -6,21 +6,21 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/pipe" ) type worker interface { @@ -78,17 +78,7 @@ func (w *tcpWorker) callback(conn internet.Connection) { }) } } - ctx = session.ContextWithInbound(ctx, &session.Inbound{ - Source: net.DestinationFromAddr(conn.RemoteAddr()), - Gateway: net.TCPDestination(w.address, w.port), - Tag: w.tag, - }) - content := new(session.Content) - if w.sniffingConfig != nil { - content.SniffingRequest.Enabled = w.sniffingConfig.Enabled - content.SniffingRequest.OverrideDestinationForProtocol = w.sniffingConfig.DestinationOverride - } - ctx = session.ContextWithContent(ctx, content) + if w.uplinkCounter != nil || w.downlinkCounter != nil { conn = &internet.StatCouterConnection{ Connection: conn, @@ -96,6 +86,20 @@ func (w *tcpWorker) callback(conn internet.Connection) { WriteCounter: w.downlinkCounter, } } + ctx = session.ContextWithInbound(ctx, &session.Inbound{ + Source: net.DestinationFromAddr(conn.RemoteAddr()), + Gateway: net.TCPDestination(w.address, w.port), + Tag: w.tag, + Conn: conn, + }) + + content := new(session.Content) + if w.sniffingConfig != nil { + content.SniffingRequest.Enabled = w.sniffingConfig.Enabled + content.SniffingRequest.OverrideDestinationForProtocol = w.sniffingConfig.DestinationOverride + } + ctx = session.ContextWithContent(ctx, content) + if err := w.proxy.Process(ctx, net.Network_TCP, conn, w.dispatcher); err != nil { newError("connection ends").Base(err).WriteToLog(session.ExportIDToError(ctx)) } diff --git a/app/proxyman/outbound/errors.generated.go b/app/proxyman/outbound/errors.generated.go index b6bfdd86..07966823 100644 --- a/app/proxyman/outbound/errors.generated.go +++ b/app/proxyman/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/proxyman/outbound/handler.go b/app/proxyman/outbound/handler.go index d71c0179..91945ea9 100644 --- a/app/proxyman/outbound/handler.go +++ b/app/proxyman/outbound/handler.go @@ -3,20 +3,20 @@ package outbound import ( "context" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/pipe" ) func getStatCounter(v *core.Instance, tag string) (stats.Counter, stats.Counter) { diff --git a/app/proxyman/outbound/handler_test.go b/app/proxyman/outbound/handler_test.go index cdb3047e..a557ddc0 100644 --- a/app/proxyman/outbound/handler_test.go +++ b/app/proxyman/outbound/handler_test.go @@ -4,15 +4,15 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/app/policy" - . "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/policy" + . "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/transport/internet" ) func TestInterfaces(t *testing.T) { diff --git a/app/proxyman/outbound/outbound.go b/app/proxyman/outbound/outbound.go index 5a526c43..40f98ba9 100644 --- a/app/proxyman/outbound/outbound.go +++ b/app/proxyman/outbound/outbound.go @@ -1,17 +1,17 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "strings" "sync" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" ) // Manager is to manage all outbound handlers. diff --git a/app/reverse/bridge.go b/app/reverse/bridge.go index 2f49a865..19160f4c 100644 --- a/app/reverse/bridge.go +++ b/app/reverse/bridge.go @@ -7,13 +7,13 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) // Bridge is a component in reverse proxy, that relays connections from Portal to local address. diff --git a/app/reverse/config.go b/app/reverse/config.go index 38b3bc83..ce70c71b 100644 --- a/app/reverse/config.go +++ b/app/reverse/config.go @@ -6,7 +6,7 @@ import ( "crypto/rand" "io" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) func (c *Control) FillInRandom() { diff --git a/app/reverse/config.pb.go b/app/reverse/config.pb.go index 810c113f..50e41edd 100644 --- a/app/reverse/config.pb.go +++ b/app/reverse/config.pb.go @@ -321,13 +321,12 @@ var file_app_reverse_config_proto_rawDesc = []byte{ 0x0b, 0x32, 0x1e, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0c, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x59, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, + 0x56, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x65, 0x76, 0x65, 0x72, + 0x73, 0x65, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, + 0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/reverse/config.proto b/app/reverse/config.proto index da5b5aa3..35bf74be 100644 --- a/app/reverse/config.proto +++ b/app/reverse/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.reverse; option csharp_namespace = "Xray.Proxy.Reverse"; -option go_package = "github.com/xtls/xray-core/v1/app/reverse"; +option go_package = "github.com/xtls/xray-core/app/reverse"; option java_package = "com.xray.proxy.reverse"; option java_multiple_files = true; diff --git a/app/reverse/errors.generated.go b/app/reverse/errors.generated.go index 821ec7b0..5dc907a2 100644 --- a/app/reverse/errors.generated.go +++ b/app/reverse/errors.generated.go @@ -1,6 +1,6 @@ package reverse -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/reverse/portal.go b/app/reverse/portal.go index 9c4ee190..460234e4 100644 --- a/app/reverse/portal.go +++ b/app/reverse/portal.go @@ -8,15 +8,15 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) type Portal struct { diff --git a/app/reverse/portal_test.go b/app/reverse/portal_test.go index 7a951f4a..0d42300d 100644 --- a/app/reverse/portal_test.go +++ b/app/reverse/portal_test.go @@ -3,8 +3,8 @@ package reverse_test import ( "testing" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/common" ) func TestStaticPickerEmpty(t *testing.T) { diff --git a/app/reverse/reverse.go b/app/reverse/reverse.go index c411fcf0..55e24bcc 100644 --- a/app/reverse/reverse.go +++ b/app/reverse/reverse.go @@ -2,17 +2,17 @@ package reverse -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" ) const ( diff --git a/app/router/balancing.go b/app/router/balancing.go index 6e84a805..b061fc1f 100644 --- a/app/router/balancing.go +++ b/app/router/balancing.go @@ -3,8 +3,8 @@ package router import ( - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/features/outbound" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/features/outbound" ) type BalancingStrategy interface { diff --git a/app/router/command/command.go b/app/router/command/command.go index 322708f0..2e9be65e 100644 --- a/app/router/command/command.go +++ b/app/router/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -10,10 +10,10 @@ import ( "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" ) // routingServer is an implementation of RoutingService. diff --git a/app/router/command/command.pb.go b/app/router/command/command.pb.go index fb3b9479..2017669d 100644 --- a/app/router/command/command.pb.go +++ b/app/router/command/command.pb.go @@ -8,7 +8,7 @@ package command import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -409,15 +409,14 @@ var file_app_router_command_command_proto_rawDesc = []byte{ 0x64, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x6f, 0x75, - 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x6a, 0x0a, + 0x74, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x72, 0x6f, - 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2f, + 0x75, 0x74, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, - 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, - 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, - 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, - 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, + 0x75, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x17, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/router/command/command.proto b/app/router/command/command.proto index 453797f7..5f777044 100644 --- a/app/router/command/command.proto +++ b/app/router/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.router.command; option csharp_namespace = "Xray.App.Router.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/router/command"; +option go_package = "github.com/xtls/xray-core/app/router/command"; option java_package = "com.xray.app.router.command"; option java_multiple_files = true; diff --git a/app/router/command/command_grpc.pb.go b/app/router/command/command_grpc.pb.go index 796212dd..70c5c532 100644 --- a/app/router/command/command_grpc.pb.go +++ b/app/router/command/command_grpc.pb.go @@ -100,6 +100,7 @@ type UnsafeRoutingServiceServer interface { func RegisterRoutingServiceServer(s grpc.ServiceRegistrar, srv RoutingServiceServer) { s.RegisterService(&_RoutingService_serviceDesc, srv) + s.RegisterService(&_RoutingService_serviceDesc2, srv) } func _RoutingService_SubscribeRoutingStats_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -159,3 +160,22 @@ var _RoutingService_serviceDesc = grpc.ServiceDesc{ }, Metadata: "app/router/command/command.proto", } + +var _RoutingService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.router.command.RoutingService", + HandlerType: (*RoutingServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "TestRoute", + Handler: _RoutingService_TestRoute_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeRoutingStats", + Handler: _RoutingService_SubscribeRoutingStats_Handler, + ServerStreams: true, + }, + }, + Metadata: "app/router/command/command.proto", +} diff --git a/app/router/command/command_test.go b/app/router/command/command_test.go index a609ba32..e8e50cc6 100644 --- a/app/router/command/command_test.go +++ b/app/router/command/command_test.go @@ -8,13 +8,13 @@ import ( "github.com/golang/mock/gomock" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/app/router" - . "github.com/xtls/xray-core/v1/app/router/command" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/app/router" + . "github.com/xtls/xray-core/app/router/command" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/testing/mocks" "google.golang.org/grpc" "google.golang.org/grpc/test/bufconn" ) diff --git a/app/router/command/config.go b/app/router/command/config.go index de0840b6..e95418dc 100644 --- a/app/router/command/config.go +++ b/app/router/command/config.go @@ -3,8 +3,8 @@ package command import ( "strings" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" ) // routingContext is an wrapper of protobuf RoutingContext as implementation of routing.Context and routing.Route. diff --git a/app/router/command/errors.generated.go b/app/router/command/errors.generated.go index 76b46f51..a1305932 100644 --- a/app/router/command/errors.generated.go +++ b/app/router/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/router/condition.go b/app/router/condition.go index 7b4a8e8d..afbe3345 100644 --- a/app/router/condition.go +++ b/app/router/condition.go @@ -8,9 +8,9 @@ import ( "go.starlark.net/starlark" "go.starlark.net/syntax" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/features/routing" ) type Condition interface { diff --git a/app/router/condition_geoip.go b/app/router/condition_geoip.go index 005f4cd1..e9cb0f29 100644 --- a/app/router/condition_geoip.go +++ b/app/router/condition_geoip.go @@ -6,7 +6,7 @@ import ( "encoding/binary" "sort" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type ipv6 struct { diff --git a/app/router/condition_geoip_test.go b/app/router/condition_geoip_test.go index b5d81ad8..614cafa5 100644 --- a/app/router/condition_geoip_test.go +++ b/app/router/condition_geoip_test.go @@ -6,11 +6,11 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" ) func init() { diff --git a/app/router/condition_test.go b/app/router/condition_test.go index a6096b83..3f7185e6 100644 --- a/app/router/condition_test.go +++ b/app/router/condition_test.go @@ -8,17 +8,17 @@ import ( "github.com/golang/protobuf/proto" - . "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/routing" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" + . "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/routing" + routing_session "github.com/xtls/xray-core/features/routing/session" ) func init() { diff --git a/app/router/config.go b/app/router/config.go index b965b532..e4c18d54 100644 --- a/app/router/config.go +++ b/app/router/config.go @@ -3,9 +3,9 @@ package router import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" ) // CIDRList is an alias of []*CIDR to provide sort.Interface. diff --git a/app/router/config.pb.go b/app/router/config.pb.go index e8d569eb..69abd370 100644 --- a/app/router/config.pb.go +++ b/app/router/config.pb.go @@ -8,7 +8,7 @@ package router import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -1018,12 +1018,12 @@ var file_app_router_config_proto_rawDesc = []byte{ 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, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, - 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, + 0x2e, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, - 0x65, 0x72, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, - 0x75, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x72, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, + 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/router/config.proto b/app/router/config.proto index d7a04f3c..c5e655ad 100644 --- a/app/router/config.proto +++ b/app/router/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.router; option csharp_namespace = "Xray.App.Router"; -option go_package = "github.com/xtls/xray-core/v1/app/router"; +option go_package = "github.com/xtls/xray-core/app/router"; option java_package = "com.xray.app.router"; option java_multiple_files = true; diff --git a/app/router/errors.generated.go b/app/router/errors.generated.go index 76bbc9c7..1e5d74ba 100644 --- a/app/router/errors.generated.go +++ b/app/router/errors.generated.go @@ -1,6 +1,6 @@ package router -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/router/router.go b/app/router/router.go index bc9b4bf6..2f7a28fc 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -2,17 +2,17 @@ package router -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/routing" - routing_dns "github.com/xtls/xray-core/v1/features/routing/dns" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/routing" + routing_dns "github.com/xtls/xray-core/features/routing/dns" ) // Router is an implementation of routing.Router. diff --git a/app/router/router_test.go b/app/router/router_test.go index 7644cee9..cd0b7154 100644 --- a/app/router/router_test.go +++ b/app/router/router_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/golang/mock/gomock" - . "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/outbound" - routing_session "github.com/xtls/xray-core/v1/features/routing/session" - "github.com/xtls/xray-core/v1/testing/mocks" + . "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/outbound" + routing_session "github.com/xtls/xray-core/features/routing/session" + "github.com/xtls/xray-core/testing/mocks" ) type mockOutboundManager struct { diff --git a/app/stats/channel.go b/app/stats/channel.go index 29822029..6dca076d 100644 --- a/app/stats/channel.go +++ b/app/stats/channel.go @@ -6,7 +6,7 @@ import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // Channel is an implementation of stats.Channel. diff --git a/app/stats/channel_test.go b/app/stats/channel_test.go index dc83711d..75764f0b 100644 --- a/app/stats/channel_test.go +++ b/app/stats/channel_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestStatsChannel(t *testing.T) { diff --git a/app/stats/command/command.go b/app/stats/command/command.go index eace983e..03b85df3 100644 --- a/app/stats/command/command.go +++ b/app/stats/command/command.go @@ -2,7 +2,7 @@ package command -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,11 +11,11 @@ import ( grpc "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/strmatcher" - "github.com/xtls/xray-core/v1/core" - feature_stats "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/strmatcher" + "github.com/xtls/xray-core/core" + feature_stats "github.com/xtls/xray-core/features/stats" ) // statsServer is an implementation of StatsService. diff --git a/app/stats/command/command.pb.go b/app/stats/command/command.pb.go index 8040b470..23e279e8 100644 --- a/app/stats/command/command.pb.go +++ b/app/stats/command/command.pb.go @@ -547,14 +547,14 @@ var file_app_stats_command_command_proto_rawDesc = []byte{ 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x53, 0x79, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x67, 0x0a, 0x1a, 0x63, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x2f, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, + 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/stats/command/command.proto b/app/stats/command/command.proto index 99f31816..bd1f9781 100644 --- a/app/stats/command/command.proto +++ b/app/stats/command/command.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.stats.command; option csharp_namespace = "Xray.App.Stats.Command"; -option go_package = "github.com/xtls/xray-core/v1/app/stats/command"; +option go_package = "github.com/xtls/xray-core/app/stats/command"; option java_package = "com.xray.app.stats.command"; option java_multiple_files = true; diff --git a/app/stats/command/command_grpc.pb.go b/app/stats/command/command_grpc.pb.go index 149ee996..1841a711 100644 --- a/app/stats/command/command_grpc.pb.go +++ b/app/stats/command/command_grpc.pb.go @@ -91,6 +91,7 @@ type UnsafeStatsServiceServer interface { func RegisterStatsServiceServer(s grpc.ServiceRegistrar, srv StatsServiceServer) { s.RegisterService(&_StatsService_serviceDesc, srv) + s.RegisterService(&_StatsService_serviceDesc2, srv) } func _StatsService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -167,3 +168,24 @@ var _StatsService_serviceDesc = grpc.ServiceDesc{ Streams: []grpc.StreamDesc{}, Metadata: "app/stats/command/command.proto", } + +var _StatsService_serviceDesc2 = grpc.ServiceDesc{ + ServiceName: "v2ray.core.app.stats.command.StatsService", + HandlerType: (*StatsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetStats", + Handler: _StatsService_GetStats_Handler, + }, + { + MethodName: "QueryStats", + Handler: _StatsService_QueryStats_Handler, + }, + { + MethodName: "GetSysStats", + Handler: _StatsService_GetSysStats_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "app/stats/command/command.proto", +} diff --git a/app/stats/command/command_test.go b/app/stats/command/command_test.go index 2534b87c..a58ba982 100644 --- a/app/stats/command/command_test.go +++ b/app/stats/command/command_test.go @@ -7,9 +7,9 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/app/stats" - . "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/app/stats" + . "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common" ) func TestGetStats(t *testing.T) { diff --git a/app/stats/command/errors.generated.go b/app/stats/command/errors.generated.go index 76b46f51..a1305932 100644 --- a/app/stats/command/errors.generated.go +++ b/app/stats/command/errors.generated.go @@ -1,6 +1,6 @@ package command -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/stats/config.pb.go b/app/stats/config.pb.go index cfb896bb..6640100c 100644 --- a/app/stats/config.pb.go +++ b/app/stats/config.pb.go @@ -139,13 +139,12 @@ var file_app_stats_config_proto_rawDesc = []byte{ 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x42, - 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, + 0x75, 0x66, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x73, 0x50, - 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x41, 0x70, 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x41, 0x70, + 0x70, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/app/stats/config.proto b/app/stats/config.proto index 3ba1e551..378d4ee8 100644 --- a/app/stats/config.proto +++ b/app/stats/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.app.stats; option csharp_namespace = "Xray.App.Stats"; -option go_package = "github.com/xtls/xray-core/v1/app/stats"; +option go_package = "github.com/xtls/xray-core/app/stats"; option java_package = "com.xray.app.stats"; option java_multiple_files = true; diff --git a/app/stats/counter_test.go b/app/stats/counter_test.go index 32bcb66e..81106468 100644 --- a/app/stats/counter_test.go +++ b/app/stats/counter_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestStatsCounter(t *testing.T) { diff --git a/app/stats/errors.generated.go b/app/stats/errors.generated.go index d0bc052a..c64386f3 100644 --- a/app/stats/errors.generated.go +++ b/app/stats/errors.generated.go @@ -1,6 +1,6 @@ package stats -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/app/stats/stats.go b/app/stats/stats.go index ef7d080d..2b4c0803 100644 --- a/app/stats/stats.go +++ b/app/stats/stats.go @@ -2,15 +2,15 @@ package stats -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/features/stats" ) // Manager is an implementation of stats.Manager. diff --git a/app/stats/stats_test.go b/app/stats/stats_test.go index 3a525818..cdbd404e 100644 --- a/app/stats/stats_test.go +++ b/app/stats/stats_test.go @@ -5,9 +5,9 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features/stats" + . "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features/stats" ) func TestInterface(t *testing.T) { diff --git a/common/bitmask/byte_test.go b/common/bitmask/byte_test.go index f9f46cfe..efce1be9 100644 --- a/common/bitmask/byte_test.go +++ b/common/bitmask/byte_test.go @@ -3,7 +3,7 @@ package bitmask_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/bitmask" + . "github.com/xtls/xray-core/common/bitmask" ) func TestBitmaskByte(t *testing.T) { diff --git a/common/buf/buf.go b/common/buf/buf.go index a0004905..dde7e22c 100644 --- a/common/buf/buf.go +++ b/common/buf/buf.go @@ -1,4 +1,4 @@ // Package buf provides a light-weight memory allocation mechanism. -package buf // import "github.com/xtls/xray-core/v1/common/buf" +package buf // import "github.com/xtls/xray-core/common/buf" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/buf/buffer.go b/common/buf/buffer.go index f8298e5a..2fa43ec5 100644 --- a/common/buf/buffer.go +++ b/common/buf/buffer.go @@ -3,7 +3,7 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common/bytespool" + "github.com/xtls/xray-core/common/bytespool" ) const ( diff --git a/common/buf/buffer_test.go b/common/buf/buffer_test.go index ebaf8ea0..811ef0c7 100644 --- a/common/buf/buffer_test.go +++ b/common/buf/buffer_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" ) func TestBufferClear(t *testing.T) { diff --git a/common/buf/copy.go b/common/buf/copy.go index a01a0638..dfacda36 100644 --- a/common/buf/copy.go +++ b/common/buf/copy.go @@ -4,8 +4,8 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/signal" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/signal" ) type dataHandler func(MultiBuffer) diff --git a/common/buf/copy_test.go b/common/buf/copy_test.go index 98c5c055..e5cd5ece 100644 --- a/common/buf/copy_test.go +++ b/common/buf/copy_test.go @@ -7,9 +7,9 @@ import ( "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/testing/mocks" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/testing/mocks" ) func TestReadError(t *testing.T) { diff --git a/common/buf/errors.generated.go b/common/buf/errors.generated.go index 3c44bcef..032c0701 100644 --- a/common/buf/errors.generated.go +++ b/common/buf/errors.generated.go @@ -1,6 +1,6 @@ package buf -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/buf/io_test.go b/common/buf/io_test.go index 40fdb9fd..d48304ea 100644 --- a/common/buf/io_test.go +++ b/common/buf/io_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestWriterCreation(t *testing.T) { diff --git a/common/buf/multi_buffer.go b/common/buf/multi_buffer.go index 9be6c0af..636eeb3a 100644 --- a/common/buf/multi_buffer.go +++ b/common/buf/multi_buffer.go @@ -3,9 +3,9 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/serial" ) // ReadAllToBytes reads all content from the reader into a byte array, until EOF. diff --git a/common/buf/multi_buffer_test.go b/common/buf/multi_buffer_test.go index 1cff7758..bdcd6e34 100644 --- a/common/buf/multi_buffer_test.go +++ b/common/buf/multi_buffer_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" ) func TestMultiBufferRead(t *testing.T) { diff --git a/common/buf/reader.go b/common/buf/reader.go index 432dd1aa..3e35ad62 100644 --- a/common/buf/reader.go +++ b/common/buf/reader.go @@ -3,8 +3,8 @@ package buf import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) func readOneUDP(r io.Reader) (*Buffer, error) { diff --git a/common/buf/reader_test.go b/common/buf/reader_test.go index 800201db..d2e95169 100644 --- a/common/buf/reader_test.go +++ b/common/buf/reader_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/pipe" ) func TestBytesReaderWriteTo(t *testing.T) { diff --git a/common/buf/readv_reader.go b/common/buf/readv_reader.go index 0107d7a7..0cbac072 100644 --- a/common/buf/readv_reader.go +++ b/common/buf/readv_reader.go @@ -7,7 +7,7 @@ import ( "runtime" "syscall" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/platform" ) type allocStrategy struct { diff --git a/common/buf/readv_test.go b/common/buf/readv_test.go index 553e9b93..d8186659 100644 --- a/common/buf/readv_test.go +++ b/common/buf/readv_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/testing/servers/tcp" "golang.org/x/sync/errgroup" ) diff --git a/common/buf/writer.go b/common/buf/writer.go index 169c9bb8..a3bfe560 100644 --- a/common/buf/writer.go +++ b/common/buf/writer.go @@ -5,8 +5,8 @@ import ( "net" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) // BufferToBytesWriter is a Writer that writes alloc.Buffer into underlying writer. diff --git a/common/buf/writer_test.go b/common/buf/writer_test.go index f28fef02..686527f5 100644 --- a/common/buf/writer_test.go +++ b/common/buf/writer_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/pipe" ) func TestWriter(t *testing.T) { diff --git a/common/common.go b/common/common.go index 6173efde..97cac83b 100644 --- a/common/common.go +++ b/common/common.go @@ -10,10 +10,10 @@ import ( "path/filepath" "strings" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common/errors" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen var ( // ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route. diff --git a/common/common_test.go b/common/common_test.go index b8992887..d661788c 100644 --- a/common/common_test.go +++ b/common/common_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - . "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/common" ) func TestMust(t *testing.T) { diff --git a/common/crypto/aes.go b/common/crypto/aes.go index 547b036d..3205a207 100644 --- a/common/crypto/aes.go +++ b/common/crypto/aes.go @@ -4,7 +4,7 @@ import ( "crypto/aes" "crypto/cipher" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // NewAesDecryptionStream creates a new AES encryption stream based on given key and IV. diff --git a/common/crypto/auth.go b/common/crypto/auth.go index e17b3efa..fc72405f 100644 --- a/common/crypto/auth.go +++ b/common/crypto/auth.go @@ -5,10 +5,10 @@ import ( "io" "math/rand" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/bytespool" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/bytespool" + "github.com/xtls/xray-core/common/protocol" ) type BytesGenerator func() []byte diff --git a/common/crypto/auth_test.go b/common/crypto/auth_test.go index 5a389f04..0f293b9a 100644 --- a/common/crypto/auth_test.go +++ b/common/crypto/auth_test.go @@ -10,10 +10,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/protocol" ) func TestAuthenticationReaderWriter(t *testing.T) { diff --git a/common/crypto/benchmark_test.go b/common/crypto/benchmark_test.go index faffa333..1f30c802 100644 --- a/common/crypto/benchmark_test.go +++ b/common/crypto/benchmark_test.go @@ -4,7 +4,7 @@ import ( "crypto/cipher" "testing" - . "github.com/xtls/xray-core/v1/common/crypto" + . "github.com/xtls/xray-core/common/crypto" ) const benchSize = 1024 * 1024 diff --git a/common/crypto/chacha20.go b/common/crypto/chacha20.go index 1015030e..87273c3c 100644 --- a/common/crypto/chacha20.go +++ b/common/crypto/chacha20.go @@ -3,7 +3,7 @@ package crypto import ( "crypto/cipher" - "github.com/xtls/xray-core/v1/common/crypto/internal" + "github.com/xtls/xray-core/common/crypto/internal" ) // NewChaCha20Stream creates a new Chacha20 encryption/descryption stream based on give key and IV. diff --git a/common/crypto/chacha20_test.go b/common/crypto/chacha20_test.go index 474ed196..e1237da4 100644 --- a/common/crypto/chacha20_test.go +++ b/common/crypto/chacha20_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/crypto" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/crypto" ) func mustDecodeHex(s string) []byte { diff --git a/common/crypto/chunk.go b/common/crypto/chunk.go index 657d8c0f..9cd48181 100644 --- a/common/crypto/chunk.go +++ b/common/crypto/chunk.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) // ChunkSizeDecoder is a utility class to decode size value from bytes. diff --git a/common/crypto/chunk_test.go b/common/crypto/chunk_test.go index ddfba889..7f874f3d 100644 --- a/common/crypto/chunk_test.go +++ b/common/crypto/chunk_test.go @@ -5,9 +5,9 @@ import ( "io" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/crypto" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/crypto" ) func TestChunkStreamIO(t *testing.T) { diff --git a/common/crypto/crypto.go b/common/crypto/crypto.go index 96ee32d7..a7ed1a4a 100644 --- a/common/crypto/crypto.go +++ b/common/crypto/crypto.go @@ -1,4 +1,4 @@ // Package crypto provides common crypto libraries for Xray. -package crypto // import "github.com/xtls/xray-core/v1/common/crypto" +package crypto // import "github.com/xtls/xray-core/common/crypto" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/crypto/errors.generated.go b/common/crypto/errors.generated.go index bc627cb2..2d983f89 100644 --- a/common/crypto/errors.generated.go +++ b/common/crypto/errors.generated.go @@ -1,6 +1,6 @@ package crypto -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/crypto/io.go b/common/crypto/io.go index f06ca7b5..9800c6a5 100644 --- a/common/crypto/io.go +++ b/common/crypto/io.go @@ -4,7 +4,7 @@ import ( "crypto/cipher" "io" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type CryptionReader struct { diff --git a/common/dice/dice.go b/common/dice/dice.go index 69fcc240..896c1e8e 100644 --- a/common/dice/dice.go +++ b/common/dice/dice.go @@ -1,6 +1,6 @@ // Package dice contains common functions to generate random number. // It also initialize math/rand with the time in seconds at launch time. -package dice // import "github.com/xtls/xray-core/v1/common/dice" +package dice // import "github.com/xtls/xray-core/common/dice" import ( "math/rand" diff --git a/common/dice/dice_test.go b/common/dice/dice_test.go index 9cf41ee3..02eba57b 100644 --- a/common/dice/dice_test.go +++ b/common/dice/dice_test.go @@ -4,7 +4,7 @@ import ( "math/rand" "testing" - . "github.com/xtls/xray-core/v1/common/dice" + . "github.com/xtls/xray-core/common/dice" ) func BenchmarkRoll1(b *testing.B) { diff --git a/common/errors.generated.go b/common/errors.generated.go index 9d6c1cc3..28b9a625 100644 --- a/common/errors.generated.go +++ b/common/errors.generated.go @@ -1,6 +1,6 @@ package common -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/errors/errorgen/main.go b/common/errors/errorgen/main.go index 1fb8ef78..bb12ed78 100644 --- a/common/errors/errorgen/main.go +++ b/common/errors/errorgen/main.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func main() { diff --git a/common/errors/errors.go b/common/errors/errors.go index 4b843be8..bb5ac2c8 100644 --- a/common/errors/errors.go +++ b/common/errors/errors.go @@ -1,15 +1,17 @@ // Package errors is a drop-in replacement for Golang lib 'errors'. -package errors // import "github.com/xtls/xray-core/v1/common/errors" +package errors // import "github.com/xtls/xray-core/common/errors" import ( "os" "reflect" "strings" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/serial" ) +const trim = len("github.com/xtls/xray-core/") + type hasInnerError interface { // Inner returns the underlying error of this one. Inner() error @@ -37,7 +39,7 @@ func (err *Error) pkgPath() string { if err.pathObj == nil { return "" } - return reflect.TypeOf(err.pathObj).PkgPath() + return reflect.TypeOf(err.pathObj).PkgPath()[trim:] } // Error implements error.Error(). diff --git a/common/errors/errors_test.go b/common/errors/errors_test.go index 5d87aca4..87537696 100644 --- a/common/errors/errors_test.go +++ b/common/errors/errors_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" + . "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" ) func TestError(t *testing.T) { @@ -46,11 +46,11 @@ func TestErrorMessage(t *testing.T) { }{ { err: New("a").Base(New("b")).WithPathObj(e{}), - msg: "github.com/xtls/xray-core/v1/common/errors_test: a > b", + msg: "common/errors_test: a > b", }, { err: New("a").Base(New("b").WithPathObj(e{})), - msg: "a > github.com/xtls/xray-core/v1/common/errors_test: b", + msg: "a > common/errors_test: b", }, } diff --git a/common/interfaces.go b/common/interfaces.go index 8d881e7d..80796a08 100644 --- a/common/interfaces.go +++ b/common/interfaces.go @@ -1,6 +1,6 @@ package common -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" // Closable is the interface for objects that can release its resources. // diff --git a/common/log/access.go b/common/log/access.go index c46dfda1..87bc1afe 100644 --- a/common/log/access.go +++ b/common/log/access.go @@ -4,7 +4,7 @@ import ( "context" "strings" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) type logKey int diff --git a/common/log/log.go b/common/log/log.go index 49dad3c2..3d478755 100644 --- a/common/log/log.go +++ b/common/log/log.go @@ -1,9 +1,9 @@ -package log // import "github.com/xtls/xray-core/v1/common/log" +package log // import "github.com/xtls/xray-core/common/log" import ( "sync" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) // Message is the interface for all log messages. diff --git a/common/log/log.pb.go b/common/log/log.pb.go index 9c6f06c5..4daf5de2 100644 --- a/common/log/log.pb.go +++ b/common/log/log.pb.go @@ -89,13 +89,13 @@ var file_common_log_log_proto_rawDesc = []byte{ 0x69, 0x74, 0x79, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, - 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, 0x04, 0x42, 0x52, 0x0a, + 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x2e, 0x6c, 0x6f, 0x67, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, - 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, - 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6c, 0x6f, 0x67, 0xaa, 0x02, 0x0f, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/log/log.proto b/common/log/log.proto index c5e83e20..e2145dc8 100644 --- a/common/log/log.proto +++ b/common/log/log.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.log; option csharp_namespace = "Xray.Common.Log"; -option go_package = "github.com/xtls/xray-core/v1/common/log"; +option go_package = "github.com/xtls/xray-core/common/log"; option java_package = "com.xray.common.log"; option java_multiple_files = true; diff --git a/common/log/log_test.go b/common/log/log_test.go index 38b6b268..28c47325 100644 --- a/common/log/log_test.go +++ b/common/log/log_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" ) type testLogger struct { diff --git a/common/log/logger.go b/common/log/logger.go index e581be01..6899fef5 100644 --- a/common/log/logger.go +++ b/common/log/logger.go @@ -6,9 +6,9 @@ import ( "os" "time" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/signal/semaphore" ) // Writer is the interface for writing logs. diff --git a/common/log/logger_test.go b/common/log/logger_test.go index 6ab91bf7..4ad7aee7 100644 --- a/common/log/logger_test.go +++ b/common/log/logger_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/log" ) func TestFileLogger(t *testing.T) { diff --git a/common/mux/client.go b/common/mux/client.go index 0395e36f..a3b5337f 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -6,18 +6,18 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/pipe" ) type ClientManager struct { diff --git a/common/mux/client_test.go b/common/mux/client_test.go index e31b9c4b..7837a86e 100644 --- a/common/mux/client_test.go +++ b/common/mux/client_test.go @@ -6,14 +6,14 @@ import ( "time" "github.com/golang/mock/gomock" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/testing/mocks" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/testing/mocks" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) func TestIncrementalPickerFailure(t *testing.T) { diff --git a/common/mux/errors.generated.go b/common/mux/errors.generated.go index 39cdfd1a..9318ceac 100644 --- a/common/mux/errors.generated.go +++ b/common/mux/errors.generated.go @@ -1,6 +1,6 @@ package mux -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/mux/frame.go b/common/mux/frame.go index 398ac42b..5e9c77d0 100644 --- a/common/mux/frame.go +++ b/common/mux/frame.go @@ -4,12 +4,12 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" ) type SessionStatus byte diff --git a/common/mux/frame_test.go b/common/mux/frame_test.go index e81c4d6e..e6d54ff1 100644 --- a/common/mux/frame_test.go +++ b/common/mux/frame_test.go @@ -3,10 +3,10 @@ package mux_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" ) func BenchmarkFrameWrite(b *testing.B) { diff --git a/common/mux/mux.go b/common/mux/mux.go index db41742a..0eaebf51 100644 --- a/common/mux/mux.go +++ b/common/mux/mux.go @@ -1,3 +1,3 @@ package mux -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/mux/mux_test.go b/common/mux/mux_test.go index c5e9ab79..282ff210 100644 --- a/common/mux/mux_test.go +++ b/common/mux/mux_test.go @@ -6,12 +6,12 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/common/mux" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/common/mux" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/transport/pipe" ) func readAll(reader buf.Reader) (buf.MultiBuffer, error) { diff --git a/common/mux/reader.go b/common/mux/reader.go index 31f39132..1013fcd0 100644 --- a/common/mux/reader.go +++ b/common/mux/reader.go @@ -3,9 +3,9 @@ package mux import ( "io" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/serial" ) // PacketReader is an io.Reader that reads whole chunk of Mux frames every time. diff --git a/common/mux/server.go b/common/mux/server.go index 1bf96dd2..0eccb6f2 100644 --- a/common/mux/server.go +++ b/common/mux/server.go @@ -4,17 +4,17 @@ import ( "context" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) type Server struct { diff --git a/common/mux/session.go b/common/mux/session.go index 2d009a4c..8237a1fe 100644 --- a/common/mux/session.go +++ b/common/mux/session.go @@ -3,9 +3,9 @@ package mux import ( "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" ) type SessionManager struct { diff --git a/common/mux/session_test.go b/common/mux/session_test.go index 2719fe28..7139df10 100644 --- a/common/mux/session_test.go +++ b/common/mux/session_test.go @@ -3,7 +3,7 @@ package mux_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/mux" + . "github.com/xtls/xray-core/common/mux" ) func TestSessionManagerAdd(t *testing.T) { diff --git a/common/mux/writer.go b/common/mux/writer.go index 48455bc4..492cc693 100644 --- a/common/mux/writer.go +++ b/common/mux/writer.go @@ -1,11 +1,11 @@ package mux import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" ) type Writer struct { diff --git a/common/net/address.pb.go b/common/net/address.pb.go index 890d2ff3..d838e094 100644 --- a/common/net/address.pb.go +++ b/common/net/address.pb.go @@ -119,12 +119,12 @@ var file_common_net_address_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x02, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, - 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, + 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/address.proto b/common/net/address.proto index 0498a1de..d83f0dfe 100644 --- a/common/net/address.proto +++ b/common/net/address.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/address_test.go b/common/net/address_test.go index 0fe4adb1..1fec3671 100644 --- a/common/net/address_test.go +++ b/common/net/address_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestAddressProperty(t *testing.T) { diff --git a/common/net/connection.go b/common/net/connection.go index bdf4dde4..563d81a3 100644 --- a/common/net/connection.go +++ b/common/net/connection.go @@ -7,9 +7,9 @@ import ( "net" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal/done" ) type ConnectionOption func(*connection) diff --git a/common/net/destination.pb.go b/common/net/destination.pb.go index 3f323d78..0eeb1ec5 100644 --- a/common/net/destination.pb.go +++ b/common/net/destination.pb.go @@ -107,12 +107,12 @@ var file_common_net_destination_proto_rawDesc = []byte{ 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x49, 0x50, 0x4f, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x42, - 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, - 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, + 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/destination.proto b/common/net/destination.proto index e8c1f638..c6c4230e 100644 --- a/common/net/destination.proto +++ b/common/net/destination.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/destination_test.go b/common/net/destination_test.go index a4a008ec..f6b19a4c 100644 --- a/common/net/destination_test.go +++ b/common/net/destination_test.go @@ -5,7 +5,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestDestinationProperty(t *testing.T) { diff --git a/common/net/errors.generated.go b/common/net/errors.generated.go index cb133cbe..fb64eac5 100644 --- a/common/net/errors.generated.go +++ b/common/net/errors.generated.go @@ -1,6 +1,6 @@ package net -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/net/net.go b/common/net/net.go index 96105820..5027617c 100644 --- a/common/net/net.go +++ b/common/net/net.go @@ -1,4 +1,4 @@ // Package net is a drop-in replacement to Golang's net package, with some more functionalities. -package net // import "github.com/xtls/xray-core/v1/common/net" +package net // import "github.com/xtls/xray-core/common/net" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/net/network.pb.go b/common/net/network.pb.go index b59d4300..1eb88b6d 100644 --- a/common/net/network.pb.go +++ b/common/net/network.pb.go @@ -143,12 +143,12 @@ var file_common_net_network_proto_rawDesc = []byte{ 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x06, 0x52, 0x61, 0x77, 0x54, 0x43, 0x50, 0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58, - 0x10, 0x04, 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, + 0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, + 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/network.proto b/common/net/network.proto index 205149e3..f2487fbc 100644 --- a/common/net/network.proto +++ b/common/net/network.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/port.pb.go b/common/net/port.pb.go index 0ed67140..5f8cf2c1 100644 --- a/common/net/port.pb.go +++ b/common/net/port.pb.go @@ -143,13 +143,12 @@ var file_common_net_port_proto_rawDesc = []byte{ 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, - 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/net/port.proto b/common/net/port.proto index b18df0c4..0b626f9e 100644 --- a/common/net/port.proto +++ b/common/net/port.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.net; option csharp_namespace = "Xray.Common.Net"; -option go_package = "github.com/xtls/xray-core/v1/common/net"; +option go_package = "github.com/xtls/xray-core/common/net"; option java_package = "com.xray.common.net"; option java_multiple_files = true; diff --git a/common/net/port_test.go b/common/net/port_test.go index cd66ac9b..23201f97 100644 --- a/common/net/port_test.go +++ b/common/net/port_test.go @@ -3,7 +3,7 @@ package net_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/net" + . "github.com/xtls/xray-core/common/net" ) func TestPortRangeContains(t *testing.T) { diff --git a/common/platform/ctlcmd/ctlcmd.go b/common/platform/ctlcmd/ctlcmd.go index 845a10be..ad9550fa 100644 --- a/common/platform/ctlcmd/ctlcmd.go +++ b/common/platform/ctlcmd/ctlcmd.go @@ -6,11 +6,11 @@ import ( "os/exec" "strings" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen func Run(args []string, input io.Reader) (buf.MultiBuffer, error) { xctl := platform.GetToolLocation("xctl") diff --git a/common/platform/ctlcmd/errors.generated.go b/common/platform/ctlcmd/errors.generated.go index 618c7f23..c861825c 100644 --- a/common/platform/ctlcmd/errors.generated.go +++ b/common/platform/ctlcmd/errors.generated.go @@ -1,6 +1,6 @@ package ctlcmd -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/platform/filesystem/file.go b/common/platform/filesystem/file.go index bfaf6f7d..632694a8 100644 --- a/common/platform/filesystem/file.go +++ b/common/platform/filesystem/file.go @@ -4,8 +4,8 @@ import ( "io" "os" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform" ) type FileReaderFunc func(path string) (io.ReadCloser, error) diff --git a/common/platform/platform.go b/common/platform/platform.go index 2370a445..d5149db4 100644 --- a/common/platform/platform.go +++ b/common/platform/platform.go @@ -1,4 +1,4 @@ -package platform // import "github.com/xtls/xray-core/v1/common/platform" +package platform // import "github.com/xtls/xray-core/common/platform" import ( "os" diff --git a/common/platform/platform_test.go b/common/platform/platform_test.go index b3196f15..ae823217 100644 --- a/common/platform/platform_test.go +++ b/common/platform/platform_test.go @@ -6,8 +6,8 @@ import ( "runtime" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/platform" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/platform" ) func TestNormalizeEnvName(t *testing.T) { diff --git a/common/protocol/address.go b/common/protocol/address.go index 74b04602..cf52a380 100644 --- a/common/protocol/address.go +++ b/common/protocol/address.go @@ -3,10 +3,10 @@ package protocol import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" ) type AddressOption func(*option) diff --git a/common/protocol/address_test.go b/common/protocol/address_test.go index 508db809..4733ea3d 100644 --- a/common/protocol/address_test.go +++ b/common/protocol/address_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" ) func TestAddressReading(t *testing.T) { diff --git a/common/protocol/bittorrent/bittorrent.go b/common/protocol/bittorrent/bittorrent.go index dee5816f..0ffc56a3 100644 --- a/common/protocol/bittorrent/bittorrent.go +++ b/common/protocol/bittorrent/bittorrent.go @@ -3,7 +3,7 @@ package bittorrent import ( "errors" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type SniffHeader struct { diff --git a/common/protocol/dns/errors.generated.go b/common/protocol/dns/errors.generated.go index ce4c0605..d7375a9b 100644 --- a/common/protocol/dns/errors.generated.go +++ b/common/protocol/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/dns/io.go b/common/protocol/dns/io.go index deeb8bb4..0c215a70 100644 --- a/common/protocol/dns/io.go +++ b/common/protocol/dns/io.go @@ -4,9 +4,9 @@ import ( "encoding/binary" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" "golang.org/x/net/dns/dnsmessage" ) diff --git a/common/protocol/errors.generated.go b/common/protocol/errors.generated.go index d09ca6a4..694dd667 100644 --- a/common/protocol/errors.generated.go +++ b/common/protocol/errors.generated.go @@ -1,6 +1,6 @@ package protocol -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/headers.go b/common/protocol/headers.go index 60e5da13..921b4d32 100644 --- a/common/protocol/headers.go +++ b/common/protocol/headers.go @@ -3,9 +3,9 @@ package protocol import ( "runtime" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/uuid" ) // RequestCommand is a custom command in a proxy request. diff --git a/common/protocol/headers.pb.go b/common/protocol/headers.pb.go index 11a2e6cb..eaa04d7e 100644 --- a/common/protocol/headers.pb.go +++ b/common/protocol/headers.pb.go @@ -147,13 +147,13 @@ var file_common_protocol_headers_proto_rawDesc = []byte{ 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x45, 0x53, 0x31, 0x32, 0x38, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, - 0x45, 0x10, 0x05, 0x42, 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x45, 0x10, 0x05, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, - 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, - 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/headers.proto b/common/protocol/headers.proto index 78150e64..8c1a957f 100644 --- a/common/protocol/headers.proto +++ b/common/protocol/headers.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/protocol/http/headers.go b/common/protocol/http/headers.go index ee16467a..e0346426 100644 --- a/common/protocol/http/headers.go +++ b/common/protocol/http/headers.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it. diff --git a/common/protocol/http/headers_test.go b/common/protocol/http/headers_test.go index ee9d5ef3..80a0402b 100644 --- a/common/protocol/http/headers_test.go +++ b/common/protocol/http/headers_test.go @@ -8,9 +8,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol/http" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol/http" ) func TestParseXForwardedFor(t *testing.T) { diff --git a/common/protocol/http/sniff.go b/common/protocol/http/sniff.go index 4cb42d82..ceedede2 100644 --- a/common/protocol/http/sniff.go +++ b/common/protocol/http/sniff.go @@ -5,8 +5,8 @@ import ( "errors" "strings" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) type version byte diff --git a/common/protocol/http/sniff_test.go b/common/protocol/http/sniff_test.go index dca249a8..fff66415 100644 --- a/common/protocol/http/sniff_test.go +++ b/common/protocol/http/sniff_test.go @@ -3,7 +3,7 @@ package http_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol/http" + . "github.com/xtls/xray-core/common/protocol/http" ) func TestHTTPHeaders(t *testing.T) { diff --git a/common/protocol/id.go b/common/protocol/id.go index a46f9128..2a1eb17a 100644 --- a/common/protocol/id.go +++ b/common/protocol/id.go @@ -5,8 +5,8 @@ import ( "crypto/md5" "hash" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/uuid" ) const ( diff --git a/common/protocol/id_test.go b/common/protocol/id_test.go index 1d6cb7d2..c2d6dad6 100644 --- a/common/protocol/id_test.go +++ b/common/protocol/id_test.go @@ -3,8 +3,8 @@ package protocol_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + . "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) func TestIdEquals(t *testing.T) { diff --git a/common/protocol/protocol.go b/common/protocol/protocol.go index dc52c2a7..bd49ba69 100644 --- a/common/protocol/protocol.go +++ b/common/protocol/protocol.go @@ -1,3 +1,3 @@ -package protocol // import "github.com/xtls/xray-core/v1/common/protocol" +package protocol // import "github.com/xtls/xray-core/common/protocol" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/common/protocol/server_picker_test.go b/common/protocol/server_picker_test.go index 674293a3..8919b10b 100644 --- a/common/protocol/server_picker_test.go +++ b/common/protocol/server_picker_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" ) func TestServerList(t *testing.T) { diff --git a/common/protocol/server_spec.go b/common/protocol/server_spec.go index f950b1cc..24b778bb 100644 --- a/common/protocol/server_spec.go +++ b/common/protocol/server_spec.go @@ -4,8 +4,8 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" ) type ValidationStrategy interface { diff --git a/common/protocol/server_spec.pb.go b/common/protocol/server_spec.pb.go index 5bc2d39c..54b9fa9c 100644 --- a/common/protocol/server_spec.pb.go +++ b/common/protocol/server_spec.pb.go @@ -8,7 +8,7 @@ package protocol import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -107,14 +107,14 @@ var file_common_protocol_server_spec_proto_rawDesc = []byte{ 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x61, 0x0a, + 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/server_spec.proto b/common/protocol/server_spec.proto index 7753b943..6b9cc04c 100644 --- a/common/protocol/server_spec.proto +++ b/common/protocol/server_spec.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/protocol/server_spec_test.go b/common/protocol/server_spec_test.go index 7b42b65e..10dfb8c5 100644 --- a/common/protocol/server_spec_test.go +++ b/common/protocol/server_spec_test.go @@ -5,11 +5,11 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vmess" ) func TestAlwaysValidStrategy(t *testing.T) { diff --git a/common/protocol/time.go b/common/protocol/time.go index 1cef8fb4..195496ed 100644 --- a/common/protocol/time.go +++ b/common/protocol/time.go @@ -3,7 +3,7 @@ package protocol import ( "time" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) type Timestamp int64 diff --git a/common/protocol/time_test.go b/common/protocol/time_test.go index 45a32d2a..9031b414 100644 --- a/common/protocol/time_test.go +++ b/common/protocol/time_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/common/protocol" + . "github.com/xtls/xray-core/common/protocol" ) func TestGenerateRandomInt64InRange(t *testing.T) { diff --git a/common/protocol/tls/cert/cert.go b/common/protocol/tls/cert/cert.go index cf19ca67..cd8e56f5 100644 --- a/common/protocol/tls/cert/cert.go +++ b/common/protocol/tls/cert/cert.go @@ -12,10 +12,10 @@ import ( "math/big" "time" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen type Certificate struct { // Cerificate in ASN.1 DER format diff --git a/common/protocol/tls/cert/cert_test.go b/common/protocol/tls/cert/cert_test.go index 7f92488a..3a1ef8ff 100644 --- a/common/protocol/tls/cert/cert_test.go +++ b/common/protocol/tls/cert/cert_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/task" ) func TestGenerate(t *testing.T) { diff --git a/common/protocol/tls/cert/errors.generated.go b/common/protocol/tls/cert/errors.generated.go index 20e2effd..6a4677f4 100644 --- a/common/protocol/tls/cert/errors.generated.go +++ b/common/protocol/tls/cert/errors.generated.go @@ -1,6 +1,6 @@ package cert -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/protocol/tls/sniff.go b/common/protocol/tls/sniff.go index 2d90268b..a8fec15f 100644 --- a/common/protocol/tls/sniff.go +++ b/common/protocol/tls/sniff.go @@ -5,7 +5,7 @@ import ( "errors" "strings" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type SniffHeader struct { diff --git a/common/protocol/tls/sniff_test.go b/common/protocol/tls/sniff_test.go index f5ae1eb4..d334089c 100644 --- a/common/protocol/tls/sniff_test.go +++ b/common/protocol/tls/sniff_test.go @@ -3,7 +3,7 @@ package tls_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/protocol/tls" + . "github.com/xtls/xray-core/common/protocol/tls" ) func TestTLSHeaders(t *testing.T) { diff --git a/common/protocol/udp/packet.go b/common/protocol/udp/packet.go index 28134559..cc17af98 100644 --- a/common/protocol/udp/packet.go +++ b/common/protocol/udp/packet.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" ) // Packet is a UDP packet together with its source and destination address. diff --git a/common/protocol/user.pb.go b/common/protocol/user.pb.go index 0aee3a61..3fdae9f8 100644 --- a/common/protocol/user.pb.go +++ b/common/protocol/user.pb.go @@ -8,7 +8,7 @@ package protocol import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -107,13 +107,13 @@ var file_common_protocol_user_proto_rawDesc = []byte{ 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, + 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protocol/user.proto b/common/protocol/user.proto index 26543062..44770edf 100644 --- a/common/protocol/user.proto +++ b/common/protocol/user.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.protocol; option csharp_namespace = "Xray.Common.Protocol"; -option go_package = "github.com/xtls/xray-core/v1/common/protocol"; +option go_package = "github.com/xtls/xray-core/common/protocol"; option java_package = "com.xray.common.protocol"; option java_multiple_files = true; diff --git a/common/retry/errors.generated.go b/common/retry/errors.generated.go index 68df9f0f..d9343213 100644 --- a/common/retry/errors.generated.go +++ b/common/retry/errors.generated.go @@ -1,6 +1,6 @@ package retry -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/common/retry/retry.go b/common/retry/retry.go index 17a9a054..594e10e9 100644 --- a/common/retry/retry.go +++ b/common/retry/retry.go @@ -1,6 +1,6 @@ -package retry // import "github.com/xtls/xray-core/v1/common/retry" +package retry // import "github.com/xtls/xray-core/common/retry" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "time" diff --git a/common/retry/retry_test.go b/common/retry/retry_test.go index 6f701798..38a38872 100644 --- a/common/retry/retry_test.go +++ b/common/retry/retry_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - . "github.com/xtls/xray-core/v1/common/retry" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + . "github.com/xtls/xray-core/common/retry" ) var ( diff --git a/common/serial/serial_test.go b/common/serial/serial_test.go index e47a5370..d6fb86ce 100644 --- a/common/serial/serial_test.go +++ b/common/serial/serial_test.go @@ -6,9 +6,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" ) func TestUint16Serial(t *testing.T) { diff --git a/common/serial/string_test.go b/common/serial/string_test.go index 6f122b54..f0967158 100644 --- a/common/serial/string_test.go +++ b/common/serial/string_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" - . "github.com/xtls/xray-core/v1/common/serial" + . "github.com/xtls/xray-core/common/serial" ) func TestToString(t *testing.T) { diff --git a/common/serial/typed_message.pb.go b/common/serial/typed_message.pb.go index 5b237911..1894d5bb 100644 --- a/common/serial/typed_message.pb.go +++ b/common/serial/typed_message.pb.go @@ -93,13 +93,13 @@ var file_common_serial_typed_message_proto_rawDesc = []byte{ 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x42, 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x2a, 0x67, + 0x65, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/common/serial/typed_message.proto b/common/serial/typed_message.proto index 25c8d7b7..558de64b 100644 --- a/common/serial/typed_message.proto +++ b/common/serial/typed_message.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.common.serial; option csharp_namespace = "Xray.Common.Serial"; -option go_package = "github.com/xtls/xray-core/v1/common/serial"; +option go_package = "github.com/xtls/xray-core/common/serial"; option java_package = "com.xray.common.serial"; option java_multiple_files = true; diff --git a/common/serial/typed_message_test.go b/common/serial/typed_message_test.go index 55c52271..726a7733 100644 --- a/common/serial/typed_message_test.go +++ b/common/serial/typed_message_test.go @@ -3,7 +3,7 @@ package serial_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/serial" + . "github.com/xtls/xray-core/common/serial" ) func TestGetInstance(t *testing.T) { diff --git a/common/session/session.go b/common/session/session.go index a0370ddc..683bf0b6 100644 --- a/common/session/session.go +++ b/common/session/session.go @@ -1,13 +1,13 @@ // Package session provides functions for sessions of incoming requests. -package session // import "github.com/xtls/xray-core/v1/common/session" +package session // import "github.com/xtls/xray-core/common/session" import ( "context" "math/rand" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) // ID of a session. @@ -37,12 +37,14 @@ func ExportIDToError(ctx context.Context) errors.ExportOption { type Inbound struct { // Source address of the inbound connection. Source net.Destination - // Getaway address + // Getaway address. Gateway net.Destination // Tag of the inbound proxy that handles the connection. Tag string // User is the user that authencates for the inbound. May be nil if the protocol allows anounymous traffic. User *protocol.MemoryUser + // Conn is actually internet.Connection. + Conn net.Conn } // Outbound is the metadata of an outbound connection. diff --git a/common/signal/notifier_test.go b/common/signal/notifier_test.go index 5fb72a36..c753e253 100644 --- a/common/signal/notifier_test.go +++ b/common/signal/notifier_test.go @@ -3,7 +3,7 @@ package signal_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/signal" + . "github.com/xtls/xray-core/common/signal" ) func TestNotifierSignal(t *testing.T) { diff --git a/common/signal/pubsub/pubsub.go b/common/signal/pubsub/pubsub.go index 51636d99..8612bb61 100644 --- a/common/signal/pubsub/pubsub.go +++ b/common/signal/pubsub/pubsub.go @@ -5,9 +5,9 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/common/task" ) type Subscriber struct { diff --git a/common/signal/pubsub/pubsub_test.go b/common/signal/pubsub/pubsub_test.go index 4ec99bc4..b330e8d9 100644 --- a/common/signal/pubsub/pubsub_test.go +++ b/common/signal/pubsub/pubsub_test.go @@ -3,7 +3,7 @@ package pubsub_test import ( "testing" - . "github.com/xtls/xray-core/v1/common/signal/pubsub" + . "github.com/xtls/xray-core/common/signal/pubsub" ) func TestPubsub(t *testing.T) { diff --git a/common/signal/timer.go b/common/signal/timer.go index b08f133f..a7f59cd9 100644 --- a/common/signal/timer.go +++ b/common/signal/timer.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/task" ) type ActivityUpdater interface { diff --git a/common/signal/timer_test.go b/common/signal/timer_test.go index 6987db11..d56eed2b 100644 --- a/common/signal/timer_test.go +++ b/common/signal/timer_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - . "github.com/xtls/xray-core/v1/common/signal" + . "github.com/xtls/xray-core/common/signal" ) func TestActivityTimer(t *testing.T) { diff --git a/common/strmatcher/benchmark_test.go b/common/strmatcher/benchmark_test.go index db365e50..3e70ca04 100644 --- a/common/strmatcher/benchmark_test.go +++ b/common/strmatcher/benchmark_test.go @@ -4,8 +4,8 @@ import ( "strconv" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func BenchmarkDomainMatcherGroup(b *testing.B) { diff --git a/common/strmatcher/domain_matcher_test.go b/common/strmatcher/domain_matcher_test.go index b67a6d23..5a8ca35b 100644 --- a/common/strmatcher/domain_matcher_test.go +++ b/common/strmatcher/domain_matcher_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - . "github.com/xtls/xray-core/v1/common/strmatcher" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestDomainMatcherGroup(t *testing.T) { diff --git a/common/strmatcher/full_matcher_test.go b/common/strmatcher/full_matcher_test.go index 51990e42..73d60d51 100644 --- a/common/strmatcher/full_matcher_test.go +++ b/common/strmatcher/full_matcher_test.go @@ -4,7 +4,7 @@ import ( "reflect" "testing" - . "github.com/xtls/xray-core/v1/common/strmatcher" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestFullMatcherGroup(t *testing.T) { diff --git a/common/strmatcher/matchers_test.go b/common/strmatcher/matchers_test.go index f9020153..d39c522c 100644 --- a/common/strmatcher/matchers_test.go +++ b/common/strmatcher/matchers_test.go @@ -3,8 +3,8 @@ package strmatcher_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestMatcher(t *testing.T) { diff --git a/common/strmatcher/strmatcher_test.go b/common/strmatcher/strmatcher_test.go index 1d795b8f..87d6c5b3 100644 --- a/common/strmatcher/strmatcher_test.go +++ b/common/strmatcher/strmatcher_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/strmatcher" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/strmatcher" ) func TestMatcherGroup(t *testing.T) { diff --git a/common/task/common.go b/common/task/common.go index 99bc4dc0..b43cc870 100644 --- a/common/task/common.go +++ b/common/task/common.go @@ -1,6 +1,6 @@ package task -import "github.com/xtls/xray-core/v1/common" +import "github.com/xtls/xray-core/common" // Close returns a func() that closes v. func Close(v interface{}) func() error { diff --git a/common/task/periodic_test.go b/common/task/periodic_test.go index d6a0c660..9cad3017 100644 --- a/common/task/periodic_test.go +++ b/common/task/periodic_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/task" ) func TestPeriodicTaskStop(t *testing.T) { diff --git a/common/task/task.go b/common/task/task.go index 2b64babf..52b0d44b 100644 --- a/common/task/task.go +++ b/common/task/task.go @@ -3,7 +3,7 @@ package task import ( "context" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/signal/semaphore" ) // OnSuccess executes g() after f() returns nil. diff --git a/common/task/task_test.go b/common/task/task_test.go index 6ffe4d61..d871e03e 100644 --- a/common/task/task_test.go +++ b/common/task/task_test.go @@ -9,8 +9,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/task" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/task" ) func TestExecuteParallel(t *testing.T) { diff --git a/common/type_test.go b/common/type_test.go index 46f9e34a..d074a391 100644 --- a/common/type_test.go +++ b/common/type_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/common" + . "github.com/xtls/xray-core/common" ) type TConfig struct { diff --git a/common/uuid/uuid.go b/common/uuid/uuid.go index 3adb2260..32085d49 100644 --- a/common/uuid/uuid.go +++ b/common/uuid/uuid.go @@ -1,12 +1,12 @@ -package uuid // import "github.com/xtls/xray-core/v1/common/uuid" +package uuid // import "github.com/xtls/xray-core/common/uuid" import ( "bytes" "crypto/rand" "encoding/hex" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" ) var ( diff --git a/common/uuid/uuid_test.go b/common/uuid/uuid_test.go index ba551819..982af41a 100644 --- a/common/uuid/uuid_test.go +++ b/common/uuid/uuid_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/common/uuid" ) func TestParseBytes(t *testing.T) { diff --git a/core/config.go b/core/config.go index b773eaac..15572e77 100644 --- a/core/config.go +++ b/core/config.go @@ -8,10 +8,10 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/main/confloader" ) // ConfigFormat is a configurable format of Xray config file. diff --git a/core/config.pb.go b/core/config.pb.go index 8b36d696..de3d26a2 100644 --- a/core/config.pb.go +++ b/core/config.pb.go @@ -8,8 +8,8 @@ package core import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" - transport "github.com/xtls/xray-core/v1/transport" + serial "github.com/xtls/xray-core/common/serial" + transport "github.com/xtls/xray-core/transport" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -331,11 +331,11 @@ var file_core_config_proto_rawDesc = []byte{ 0x69, 0x6e, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x40, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, - 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x3d, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x50, 0x01, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, - 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x09, 0x58, - 0x72, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0xaa, 0x02, 0x09, 0x58, 0x72, 0x61, 0x79, + 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/core/config.proto b/core/config.proto index 3299c670..65c2b0a1 100644 --- a/core/config.proto +++ b/core/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.core; option csharp_namespace = "Xray.Core"; -option go_package = "github.com/xtls/xray-core/v1/core"; +option go_package = "github.com/xtls/xray-core/core"; option java_package = "com.xray.core"; option java_multiple_files = true; diff --git a/core/context_test.go b/core/context_test.go index 508d15a3..a16f6120 100644 --- a/core/context_test.go +++ b/core/context_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/xtls/xray-core/v1/core" + . "github.com/xtls/xray-core/core" ) func TestContextPanic(t *testing.T) { diff --git a/core/core.go b/core/core.go index 5c784650..17abd43d 100644 --- a/core/core.go +++ b/core/core.go @@ -9,16 +9,16 @@ // connections. package core -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "runtime" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/serial" ) var ( - version = "1.0.0" + version = "1.1.0" build = "Custom" codename = "Xray, Penetrates Everything." intro = "A unified platform for anti-censorship." diff --git a/core/errors.generated.go b/core/errors.generated.go index 672b2684..47636b9c 100644 --- a/core/errors.generated.go +++ b/core/errors.generated.go @@ -1,6 +1,6 @@ package core -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/core/functions.go b/core/functions.go index 55ba5060..fbc8ca57 100644 --- a/core/functions.go +++ b/core/functions.go @@ -6,10 +6,10 @@ import ( "bytes" "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet/udp" ) // CreateObject creates a new object based on the given Xray instance and config. The Xray instance may be nil. diff --git a/core/functions_test.go b/core/functions_test.go index aebc231f..2439579e 100644 --- a/core/functions_test.go +++ b/core/functions_test.go @@ -10,15 +10,15 @@ import ( "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func xor(b []byte) []byte { diff --git a/core/mocks.go b/core/mocks.go index 025e22fd..ef43d5e5 100644 --- a/core/mocks.go +++ b/core/mocks.go @@ -1,8 +1,8 @@ package core //go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/io.go -mock_names Reader=Reader,Writer=Writer io Reader,Writer -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler github.com/xtls/xray-core/v1/common/log Handler -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory github.com/xtls/xray-core/v1/common/mux ClientWorkerFactory -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient github.com/xtls/xray-core/v1/features/dns Client -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector github.com/xtls/xray-core/v1/features/outbound Manager,HandlerSelector -//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound github.com/xtls/xray-core/v1/proxy Inbound,Outbound +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/log.go -mock_names Handler=LogHandler github.com/xtls/xray-core/common/log Handler +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/mux.go -mock_names ClientWorkerFactory=MuxClientWorkerFactory github.com/xtls/xray-core/common/mux ClientWorkerFactory +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/dns.go -mock_names Client=DNSClient github.com/xtls/xray-core/features/dns Client +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/outbound.go -mock_names Manager=OutboundManager,HandlerSelector=OutboundHandlerSelector github.com/xtls/xray-core/features/outbound Manager,HandlerSelector +//go:generate go run github.com/golang/mock/mockgen -package mocks -destination testing/mocks/proxy.go -mock_names Inbound=ProxyInbound,Outbound=ProxyOutbound github.com/xtls/xray-core/proxy Inbound,Outbound diff --git a/core/xray.go b/core/xray.go index a6e8e309..bb41044b 100644 --- a/core/xray.go +++ b/core/xray.go @@ -7,16 +7,16 @@ import ( "reflect" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/dns/localdns" - "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/outbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/dns/localdns" + "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/outbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" ) // Server is an instance of Xray. At any time, there must be at most one Server instance running. diff --git a/core/xray_test.go b/core/xray_test.go index e5f47c1b..bb831660 100644 --- a/core/xray_test.go +++ b/core/xray_test.go @@ -4,21 +4,21 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/dns/localdns" - _ "github.com/xtls/xray-core/v1/main/distro/all" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/dns/localdns" + _ "github.com/xtls/xray-core/main/distro/all" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestXrayDependency(t *testing.T) { diff --git a/features/dns/client.go b/features/dns/client.go index e6bdb645..5591a81d 100644 --- a/features/dns/client.go +++ b/features/dns/client.go @@ -1,10 +1,10 @@ package dns import ( - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" ) // Client is a Xray feature for querying DNS information. diff --git a/features/dns/localdns/client.go b/features/dns/localdns/client.go index 2cfe255d..c6a9297b 100644 --- a/features/dns/localdns/client.go +++ b/features/dns/localdns/client.go @@ -1,8 +1,8 @@ package localdns import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns" ) // Client is an implementation of dns.Client, which queries localhost for DNS. diff --git a/features/errors.generated.go b/features/errors.generated.go index 13fa0672..ee8a5182 100644 --- a/features/errors.generated.go +++ b/features/errors.generated.go @@ -1,6 +1,6 @@ package features -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/feature.go b/features/feature.go index efae323a..1288a86b 100644 --- a/features/feature.go +++ b/features/feature.go @@ -1,8 +1,8 @@ package features -import "github.com/xtls/xray-core/v1/common" +import "github.com/xtls/xray-core/common" -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen // Feature is the interface for Xray features. All features must implement this interface. // All existing features have an implementation in app directory. These features can be replaced by third-party ones. diff --git a/features/inbound/inbound.go b/features/inbound/inbound.go index ac57b9ea..fd3a3db5 100644 --- a/features/inbound/inbound.go +++ b/features/inbound/inbound.go @@ -3,9 +3,9 @@ package inbound import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features" ) // Handler is the interface for handlers that process inbound connections. diff --git a/features/outbound/outbound.go b/features/outbound/outbound.go index b25c4427..ed875439 100644 --- a/features/outbound/outbound.go +++ b/features/outbound/outbound.go @@ -3,9 +3,9 @@ package outbound import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/transport" ) // Handler is the interface for handlers that process outbound connections. diff --git a/features/policy/policy.go b/features/policy/policy.go index b10708ce..c3d48e6a 100644 --- a/features/policy/policy.go +++ b/features/policy/policy.go @@ -5,8 +5,8 @@ import ( "runtime" "time" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/features" ) // Timeout contains limits for connection timeout. diff --git a/features/routing/context.go b/features/routing/context.go index 667678c4..f5a732a4 100644 --- a/features/routing/context.go +++ b/features/routing/context.go @@ -1,7 +1,7 @@ package routing import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // Context is a feature to store connection information for routing. diff --git a/features/routing/dispatcher.go b/features/routing/dispatcher.go index e953bace..cfc3111a 100644 --- a/features/routing/dispatcher.go +++ b/features/routing/dispatcher.go @@ -3,9 +3,9 @@ package routing import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/transport" ) // Dispatcher is a feature that dispatches inbound requests to outbound handlers based on rules. diff --git a/features/routing/dns/context.go b/features/routing/dns/context.go index e3d78ddf..8c8c9332 100644 --- a/features/routing/dns/context.go +++ b/features/routing/dns/context.go @@ -1,11 +1,11 @@ package dns -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/routing" ) // ResolvableContext is an implementation of routing.Context, with domain resolving capability. diff --git a/features/routing/dns/errors.generated.go b/features/routing/dns/errors.generated.go index ce4c0605..d7375a9b 100644 --- a/features/routing/dns/errors.generated.go +++ b/features/routing/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/routing/router.go b/features/routing/router.go index d81a0b30..3d6f150a 100644 --- a/features/routing/router.go +++ b/features/routing/router.go @@ -1,8 +1,8 @@ package routing import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" ) // Router is a feature to choose an outbound tag for the given request. diff --git a/features/routing/session/context.go b/features/routing/session/context.go index c81cea50..0b37ebfa 100644 --- a/features/routing/session/context.go +++ b/features/routing/session/context.go @@ -3,9 +3,9 @@ package session import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/features/routing" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/features/routing" ) // Context is an implementation of routing.Context, which is a wrapper of context.context with session info. diff --git a/features/stats/errors.generated.go b/features/stats/errors.generated.go index d0bc052a..c64386f3 100644 --- a/features/stats/errors.generated.go +++ b/features/stats/errors.generated.go @@ -1,6 +1,6 @@ package stats -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/features/stats/stats.go b/features/stats/stats.go index b8a4906b..585a6298 100644 --- a/features/stats/stats.go +++ b/features/stats/stats.go @@ -1,12 +1,12 @@ package stats -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/features" ) // Counter is the interface for stats counters. diff --git a/go.mod b/go.mod index b2fe207c..1af28b47 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/xtls/xray-core/v1 +module github.com/xtls/xray-core go 1.15 @@ -6,7 +6,7 @@ require ( github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 // indirect github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.3 - github.com/google/go-cmp v0.5.3 + github.com/google/go-cmp v0.5.4 github.com/gorilla/websocket v1.4.2 github.com/lucas-clemente/quic-go v0.19.2 github.com/miekg/dns v1.1.35 @@ -15,10 +15,10 @@ require ( github.com/stretchr/testify v1.6.1 github.com/xtls/go v0.0.0-20201118062508-3632bf3b7499 go.starlark.net v0.0.0-20201118183435-e55f603d8c79 - golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b + golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 + golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 - golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 + golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 google.golang.org/grpc v1.33.2 google.golang.org/protobuf v1.25.0 h12.io/socks v1.0.1 diff --git a/go.sum b/go.sum index 720d5910..bf7150bb 100644 --- a/go.sum +++ b/go.sum @@ -64,7 +64,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -168,8 +168,8 @@ golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 h1:xYJJ3S178yv++9zXV/hnr29plCAGO9vAFG9dorqaFQc= +golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -190,8 +190,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7 h1:3uJsdck53FDIpWwLeAXlia9p4C8j0BO2xZrqzKpL0D8= +golang.org/x/net v0.0.0-20201201195509-5d6afe98e0b7/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -221,8 +221,8 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/infra/conf/api.go b/infra/conf/api.go index 1305ce4c..02bc77dc 100644 --- a/infra/conf/api.go +++ b/infra/conf/api.go @@ -3,11 +3,11 @@ package conf import ( "strings" - "github.com/xtls/xray-core/v1/app/commander" - loggerservice "github.com/xtls/xray-core/v1/app/log/command" - handlerservice "github.com/xtls/xray-core/v1/app/proxyman/command" - statsservice "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/app/commander" + loggerservice "github.com/xtls/xray-core/app/log/command" + handlerservice "github.com/xtls/xray-core/app/proxyman/command" + statsservice "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common/serial" ) type APIConfig struct { diff --git a/infra/conf/blackhole.go b/infra/conf/blackhole.go index 09050720..6c4f692c 100644 --- a/infra/conf/blackhole.go +++ b/infra/conf/blackhole.go @@ -5,8 +5,8 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/blackhole" ) type NoneResponse struct{} diff --git a/infra/conf/blackhole_test.go b/infra/conf/blackhole_test.go index c5e55253..2b0b9295 100644 --- a/infra/conf/blackhole_test.go +++ b/infra/conf/blackhole_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/blackhole" ) func TestHTTPResponseJSON(t *testing.T) { diff --git a/infra/conf/common.go b/infra/conf/common.go index a2674c61..0de30728 100644 --- a/infra/conf/common.go +++ b/infra/conf/common.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) type StringList []string diff --git a/infra/conf/common_test.go b/infra/conf/common_test.go index 325a1713..39e4cbea 100644 --- a/infra/conf/common_test.go +++ b/infra/conf/common_test.go @@ -8,10 +8,10 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/infra/conf" ) func TestStringListUnmarshalError(t *testing.T) { diff --git a/infra/conf/conf.go b/infra/conf/conf.go index d31fec57..9bd3f667 100644 --- a/infra/conf/conf.go +++ b/infra/conf/conf.go @@ -1,3 +1,3 @@ package conf -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/infra/conf/dns.go b/infra/conf/dns.go index 5a2e886c..7e7bc0df 100644 --- a/infra/conf/dns.go +++ b/infra/conf/dns.go @@ -5,9 +5,9 @@ import ( "sort" "strings" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" ) type NameServerConfig struct { diff --git a/infra/conf/dns_proxy.go b/infra/conf/dns_proxy.go index 6b53317f..922d32ba 100644 --- a/infra/conf/dns_proxy.go +++ b/infra/conf/dns_proxy.go @@ -2,8 +2,8 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/proxy/dns" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/proxy/dns" ) type DNSOutboundConfig struct { diff --git a/infra/conf/dns_proxy_test.go b/infra/conf/dns_proxy_test.go index 04699a91..805ac323 100644 --- a/infra/conf/dns_proxy_test.go +++ b/infra/conf/dns_proxy_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/dns" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/dns" ) func TestDnsProxyConfig(t *testing.T) { diff --git a/infra/conf/dns_test.go b/infra/conf/dns_test.go index bb5f5c73..680a1f4a 100644 --- a/infra/conf/dns_test.go +++ b/infra/conf/dns_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/platform/filesystem" + . "github.com/xtls/xray-core/infra/conf" ) func init() { diff --git a/infra/conf/dokodemo.go b/infra/conf/dokodemo.go index 5a9a3665..03a21d71 100644 --- a/infra/conf/dokodemo.go +++ b/infra/conf/dokodemo.go @@ -2,7 +2,7 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/dokodemo" ) type DokodemoConfig struct { diff --git a/infra/conf/dokodemo_test.go b/infra/conf/dokodemo_test.go index 8e3b5632..6432eb42 100644 --- a/infra/conf/dokodemo_test.go +++ b/infra/conf/dokodemo_test.go @@ -3,9 +3,9 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/dokodemo" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/dokodemo" ) func TestDokodemoConfig(t *testing.T) { diff --git a/infra/conf/errors.generated.go b/infra/conf/errors.generated.go index 47ff06bf..a80cc140 100644 --- a/infra/conf/errors.generated.go +++ b/infra/conf/errors.generated.go @@ -1,6 +1,6 @@ package conf -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/infra/conf/freedom.go b/infra/conf/freedom.go index 15a377c1..29e778d2 100644 --- a/infra/conf/freedom.go +++ b/infra/conf/freedom.go @@ -5,9 +5,9 @@ import ( "strings" "github.com/golang/protobuf/proto" - v2net "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/freedom" + v2net "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/freedom" ) type FreedomConfig struct { diff --git a/infra/conf/freedom_test.go b/infra/conf/freedom_test.go index ed501eb6..0d061558 100644 --- a/infra/conf/freedom_test.go +++ b/infra/conf/freedom_test.go @@ -3,10 +3,10 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/freedom" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/freedom" ) func TestFreedomConfig(t *testing.T) { diff --git a/infra/conf/general_test.go b/infra/conf/general_test.go index d537e615..1de1109c 100644 --- a/infra/conf/general_test.go +++ b/infra/conf/general_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf" ) func loadJSON(creator func() Buildable) func(string) (proto.Message, error) { diff --git a/infra/conf/http.go b/infra/conf/http.go index ad47d6e3..e6969582 100644 --- a/infra/conf/http.go +++ b/infra/conf/http.go @@ -4,9 +4,9 @@ import ( "encoding/json" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/http" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/http" ) type HTTPAccount struct { diff --git a/infra/conf/http_test.go b/infra/conf/http_test.go index fd7d9559..110cac6b 100644 --- a/infra/conf/http_test.go +++ b/infra/conf/http_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/http" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/http" ) func TestHTTPServerConfig(t *testing.T) { diff --git a/infra/conf/json/reader.go b/infra/conf/json/reader.go index faa01baa..5a675557 100644 --- a/infra/conf/json/reader.go +++ b/infra/conf/json/reader.go @@ -3,7 +3,7 @@ package json import ( "io" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // State is the internal state of parser. diff --git a/infra/conf/json/reader_test.go b/infra/conf/json/reader_test.go index 05890a55..6999c245 100644 --- a/infra/conf/json/reader_test.go +++ b/infra/conf/json/reader_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf/json" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf/json" ) func TestReader(t *testing.T) { diff --git a/infra/conf/log.go b/infra/conf/log.go index 00a02ba8..932a9b25 100644 --- a/infra/conf/log.go +++ b/infra/conf/log.go @@ -3,8 +3,8 @@ package conf import ( "strings" - "github.com/xtls/xray-core/v1/app/log" - clog "github.com/xtls/xray-core/v1/common/log" + "github.com/xtls/xray-core/app/log" + clog "github.com/xtls/xray-core/common/log" ) func DefaultLogConfig() *log.Config { diff --git a/infra/conf/mtproto.go b/infra/conf/mtproto.go index 07229b5c..a9bc8eec 100644 --- a/infra/conf/mtproto.go +++ b/infra/conf/mtproto.go @@ -6,9 +6,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/mtproto" ) type MTProtoAccount struct { diff --git a/infra/conf/mtproto_test.go b/infra/conf/mtproto_test.go index c7b1d3ae..f44cb19a 100644 --- a/infra/conf/mtproto_test.go +++ b/infra/conf/mtproto_test.go @@ -3,10 +3,10 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/mtproto" ) func TestMTProtoServerConfig(t *testing.T) { diff --git a/infra/conf/policy.go b/infra/conf/policy.go index 704cc085..5fbf01e6 100644 --- a/infra/conf/policy.go +++ b/infra/conf/policy.go @@ -1,7 +1,7 @@ package conf import ( - "github.com/xtls/xray-core/v1/app/policy" + "github.com/xtls/xray-core/app/policy" ) type Policy struct { diff --git a/infra/conf/policy_test.go b/infra/conf/policy_test.go index ca2d3111..c880f463 100644 --- a/infra/conf/policy_test.go +++ b/infra/conf/policy_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/infra/conf" ) func TestBufferSize(t *testing.T) { diff --git a/infra/conf/reverse.go b/infra/conf/reverse.go index 4fb78e1d..1b42a63a 100644 --- a/infra/conf/reverse.go +++ b/infra/conf/reverse.go @@ -2,7 +2,7 @@ package conf import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/reverse" + "github.com/xtls/xray-core/app/reverse" ) type BridgeConfig struct { diff --git a/infra/conf/reverse_test.go b/infra/conf/reverse_test.go index 2eb739e9..15da2b1a 100644 --- a/infra/conf/reverse_test.go +++ b/infra/conf/reverse_test.go @@ -3,8 +3,8 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/infra/conf" ) func TestReverseConfig(t *testing.T) { diff --git a/infra/conf/router.go b/infra/conf/router.go index 156d81a4..236277d9 100644 --- a/infra/conf/router.go +++ b/infra/conf/router.go @@ -7,9 +7,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform/filesystem" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform/filesystem" ) type RouterRulesConfig struct { diff --git a/infra/conf/router_test.go b/infra/conf/router_test.go index 3500be87..bb4fdc7d 100644 --- a/infra/conf/router_test.go +++ b/infra/conf/router_test.go @@ -6,9 +6,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/infra/conf" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/infra/conf" ) func TestRouterConfig(t *testing.T) { diff --git a/infra/conf/serial/errors.generated.go b/infra/conf/serial/errors.generated.go index a75a8a30..e78fc61e 100644 --- a/infra/conf/serial/errors.generated.go +++ b/infra/conf/serial/errors.generated.go @@ -1,6 +1,6 @@ package serial -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/infra/conf/serial/loader.go b/infra/conf/serial/loader.go index f56101b1..03075d96 100644 --- a/infra/conf/serial/loader.go +++ b/infra/conf/serial/loader.go @@ -5,10 +5,10 @@ import ( "encoding/json" "io" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/infra/conf" - json_reader "github.com/xtls/xray-core/v1/infra/conf/json" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/infra/conf" + json_reader "github.com/xtls/xray-core/infra/conf/json" ) type offset struct { diff --git a/infra/conf/serial/loader_test.go b/infra/conf/serial/loader_test.go index 0847989c..e6a745b4 100644 --- a/infra/conf/serial/loader_test.go +++ b/infra/conf/serial/loader_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/infra/conf/serial" + "github.com/xtls/xray-core/infra/conf/serial" ) func TestLoaderError(t *testing.T) { diff --git a/infra/conf/serial/serial.go b/infra/conf/serial/serial.go index 81ccf771..3e6711ff 100644 --- a/infra/conf/serial/serial.go +++ b/infra/conf/serial/serial.go @@ -1,3 +1,3 @@ package serial -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/infra/conf/shadowsocks.go b/infra/conf/shadowsocks.go index 3b032b72..9ccd37b4 100644 --- a/infra/conf/shadowsocks.go +++ b/infra/conf/shadowsocks.go @@ -5,9 +5,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func cipherFromString(c string) shadowsocks.CipherType { diff --git a/infra/conf/shadowsocks_test.go b/infra/conf/shadowsocks_test.go index 65114295..2455551a 100644 --- a/infra/conf/shadowsocks_test.go +++ b/infra/conf/shadowsocks_test.go @@ -3,11 +3,11 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func TestShadowsocksServerConfigParsing(t *testing.T) { diff --git a/infra/conf/socks.go b/infra/conf/socks.go index 4214551d..05dad7bc 100644 --- a/infra/conf/socks.go +++ b/infra/conf/socks.go @@ -4,9 +4,9 @@ import ( "encoding/json" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/socks" ) type SocksAccount struct { diff --git a/infra/conf/socks_test.go b/infra/conf/socks_test.go index 4ea2aedd..ff1833b8 100644 --- a/infra/conf/socks_test.go +++ b/infra/conf/socks_test.go @@ -3,11 +3,11 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/socks" ) func TestSocksInboundConfig(t *testing.T) { diff --git a/infra/conf/transport.go b/infra/conf/transport.go index a8899431..69d74832 100644 --- a/infra/conf/transport.go +++ b/infra/conf/transport.go @@ -1,9 +1,9 @@ package conf import ( - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) type TransportConfig struct { diff --git a/infra/conf/transport_authenticators.go b/infra/conf/transport_authenticators.go index a19dd930..c9e42605 100644 --- a/infra/conf/transport_authenticators.go +++ b/infra/conf/transport_authenticators.go @@ -5,13 +5,13 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/srtp" + "github.com/xtls/xray-core/transport/internet/headers/tls" + "github.com/xtls/xray-core/transport/internet/headers/utp" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" ) type NoOpAuthenticator struct{} diff --git a/infra/conf/transport_internet.go b/infra/conf/transport_internet.go index 3c3b2053..926a71b6 100644 --- a/infra/conf/transport_internet.go +++ b/infra/conf/transport_internet.go @@ -5,18 +5,18 @@ import ( "strings" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/platform/filesystem" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/kcp" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/platform/filesystem" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/domainsocket" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/kcp" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/infra/conf/transport_test.go b/infra/conf/transport_test.go index 5ba05607..55551521 100644 --- a/infra/conf/transport_test.go +++ b/infra/conf/transport_test.go @@ -5,18 +5,18 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - "github.com/xtls/xray-core/v1/transport/internet/kcp" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tcp" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/tls" + "github.com/xtls/xray-core/transport/internet/kcp" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tcp" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestSocketConfig(t *testing.T) { diff --git a/infra/conf/trojan.go b/infra/conf/trojan.go index dc36b039..0412be6c 100644 --- a/infra/conf/trojan.go +++ b/infra/conf/trojan.go @@ -8,10 +8,10 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/trojan" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/trojan" ) // TrojanServerTarget is configuration of a single trojan server diff --git a/infra/conf/vless.go b/infra/conf/vless.go index c2d5e5ec..521ad650 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -8,12 +8,12 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/inbound" - "github.com/xtls/xray-core/v1/proxy/vless/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/inbound" + "github.com/xtls/xray-core/proxy/vless/outbound" ) type VLessInboundFallback struct { @@ -47,6 +47,8 @@ func (c *VLessInboundConfig) Build() (proto.Message, error) { switch account.Flow { case "", "xtls-rprx-origin", "xtls-rprx-direct": + case "xtls-rprx-splice": + return nil, newError(`VLESS clients: inbound doesn't support "xtls-rprx-splice" in this version, please use "xtls-rprx-direct" instead`) default: return nil, newError(`VLESS clients: "flow" doesn't support "` + account.Flow + `" in this version`) } @@ -167,6 +169,10 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) { switch account.Flow { case "", "xtls-rprx-origin", "xtls-rprx-origin-udp443", "xtls-rprx-direct", "xtls-rprx-direct-udp443": + case "xtls-rprx-splice", "xtls-rprx-splice-udp443": + if runtime.GOOS != "linux" { + return nil, newError(`VLESS users: "` + account.Flow + `" only support linux in this version`) + } default: return nil, newError(`VLESS users: "flow" doesn't support "` + account.Flow + `" in this version`) } diff --git a/infra/conf/vless_test.go b/infra/conf/vless_test.go index cfdde078..819ee942 100644 --- a/infra/conf/vless_test.go +++ b/infra/conf/vless_test.go @@ -3,13 +3,13 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/inbound" - "github.com/xtls/xray-core/v1/proxy/vless/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/inbound" + "github.com/xtls/xray-core/proxy/vless/outbound" ) func TestVLessOutbound(t *testing.T) { diff --git a/infra/conf/vmess.go b/infra/conf/vmess.go index b8e0b7d4..56639f1a 100644 --- a/infra/conf/vmess.go +++ b/infra/conf/vmess.go @@ -6,11 +6,11 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" ) type VMessAccount struct { diff --git a/infra/conf/vmess_test.go b/infra/conf/vmess_test.go index 9ad0db5e..e6b9d58b 100644 --- a/infra/conf/vmess_test.go +++ b/infra/conf/vmess_test.go @@ -3,13 +3,13 @@ package conf_test import ( "testing" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" ) func TestVMessOutbound(t *testing.T) { diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 17e20fb8..34f30afa 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -6,12 +6,12 @@ import ( "os" "strings" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/stats" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/stats" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/infra/conf/xray_test.go b/infra/conf/xray_test.go index 55ba54f2..d4f0ba6b 100644 --- a/infra/conf/xray_test.go +++ b/infra/conf/xray_test.go @@ -7,26 +7,26 @@ import ( "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" - . "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/proxy/blackhole" - dns_proxy "github.com/xtls/xray-core/v1/proxy/dns" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" + . "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/proxy/blackhole" + dns_proxy "github.com/xtls/xray-core/proxy/dns" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestXrayConfig(t *testing.T) { diff --git a/infra/vprotogen/main.go b/infra/vprotogen/main.go index 5a286524..35bd3592 100644 --- a/infra/vprotogen/main.go +++ b/infra/vprotogen/main.go @@ -8,8 +8,8 @@ import ( "runtime" "strings" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/core" ) func main() { diff --git a/main/commands/all/api.go b/main/commands/all/api.go deleted file mode 100644 index 20aa3fb2..00000000 --- a/main/commands/all/api.go +++ /dev/null @@ -1,164 +0,0 @@ -package all - -import ( - "context" - "errors" - "fmt" - "strings" - "time" - - "google.golang.org/grpc" - "google.golang.org/protobuf/proto" - - logService "github.com/xtls/xray-core/v1/app/log/command" - statsService "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/main/commands/base" -) - -// cmdAPI calls an API in an Xray process -var cmdAPI = &base.Command{ - UsageLine: "{{.Exec}} api [-server 127.0.0.1:8080] ", - Short: "Call an API in a Xray process", - Long: ` -Call an API in a Xray process, API calls in this command have a timeout to the server of 3 seconds. - -The following methods are currently supported: - - LoggerService.RestartLogger - StatsService.GetStats - StatsService.QueryStats - -Examples: - - {{.Exec}} api --server=127.0.0.1:8080 LoggerService.RestartLogger '' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.QueryStats 'pattern: "" reset: false' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.GetStats 'name: "inbound>>>statin>>>traffic>>>downlink" reset: false' - {{.Exec}} api --server=127.0.0.1:8080 StatsService.GetSysStats '' - `, -} - -func init() { - cmdAPI.Run = executeAPI // break init loop -} - -var ( - apiServerAddrPtr = cmdAPI.Flag.String("server", "127.0.0.1:8080", "") -) - -func executeAPI(cmd *base.Command, args []string) { - unnamedArgs := cmdAPI.Flag.Args() - if len(unnamedArgs) < 2 { - base.Fatalf("service name or request not specified.") - } - - service, method := getServiceMethod(unnamedArgs[0]) - handler, found := serivceHandlerMap[strings.ToLower(service)] - if !found { - base.Fatalf("unknown service: %s", service) - } - - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) - defer cancel() - - conn, err := grpc.DialContext(ctx, *apiServerAddrPtr, grpc.WithInsecure(), grpc.WithBlock()) - if err != nil { - base.Fatalf("failed to dial %s", *apiServerAddrPtr) - } - defer conn.Close() - - response, err := handler(ctx, conn, method, unnamedArgs[1]) - if err != nil { - base.Fatalf("failed to call service %s", unnamedArgs[0]) - } - - fmt.Println(response) -} - -func getServiceMethod(s string) (string, string) { - ss := strings.Split(s, ".") - service := ss[0] - var method string - if len(ss) > 1 { - method = ss[1] - } - return service, method -} - -type serviceHandler func(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) - -var serivceHandlerMap = map[string]serviceHandler{ - "statsservice": callStatsService, - "loggerservice": callLogService, -} - -func callLogService(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) { - client := logService.NewLoggerServiceClient(conn) - - switch strings.ToLower(method) { - case "restartlogger": - r := &logService.RestartLoggerRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.RestartLogger(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - default: - return "", errors.New("Unknown method: " + method) - } -} - -func callStatsService(ctx context.Context, conn *grpc.ClientConn, method string, request string) (string, error) { - client := statsService.NewStatsServiceClient(conn) - - switch strings.ToLower(method) { - case "getstats": - r := &statsService.GetStatsRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.GetStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - case "querystats": - r := &statsService.QueryStatsRequest{} - if err := proto.Unmarshal([]byte(request), r); err != nil { - return "", err - } - resp, err := client.QueryStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - case "getsysstats": - // SysStatsRequest is an empty message - r := &statsService.SysStatsRequest{} - resp, err := client.GetSysStats(ctx, r) - if err != nil { - return "", err - } - m, err := proto.Marshal(resp) - if err != nil { - return "", err - } - return string(m), nil - default: - return "", errors.New("Unknown method: " + method) - } -} diff --git a/main/commands/all/api/api.go b/main/commands/all/api/api.go new file mode 100644 index 00000000..9986329b --- /dev/null +++ b/main/commands/all/api/api.go @@ -0,0 +1,23 @@ +package api + +import ( + "github.com/xtls/xray-core/main/commands/base" +) + +// CmdAPI calls an API in an Xray process +var CmdAPI = &base.Command{ + UsageLine: "{{.Exec}} api", + Short: "Call an API in an Xray process", + Long: `{{.Exec}} {{.LongName}} provides tools to manipulate Xray via its API. +`, + Commands: []*base.Command{ + cmdRestartLogger, + cmdGetStats, + cmdQueryStats, + cmdSysStats, + cmdAddInbounds, + cmdAddOutbounds, + cmdRemoveInbounds, + cmdRemoveOutbounds, + }, +} diff --git a/main/commands/all/api/inbounds_add.go b/main/commands/all/api/inbounds_add.go new file mode 100644 index 00000000..30c72a4a --- /dev/null +++ b/main/commands/all/api/inbounds_add.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdAddInbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api adi [--server=127.0.0.1:8080] [c2.json]...", + Short: "Add inbounds", + Long: ` +Add inbounds to Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json +`, + Run: executeAddInbounds, +} + +func executeAddInbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + ins := make([]conf.InboundDetourConfig, 0) + for _, arg := range unnamedArgs { + r, err := loadArg(arg) + if err != nil { + base.Fatalf("failed to load %s: %s", arg, err) + } + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + ins = append(ins, conf.InboundConfigs...) + } + if len(ins) == 0 { + base.Fatalf("no valid inbound found") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, in := range ins { + fmt.Println("adding:", in.Tag) + i, err := in.Build() + if err != nil { + base.Fatalf("failed to build conf: %s", err) + } + r := &handlerService.AddInboundRequest{ + Inbound: i, + } + resp, err := client.AddInbound(ctx, r) + if err != nil { + base.Fatalf("failed to add inbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/inbounds_remove.go b/main/commands/all/api/inbounds_remove.go new file mode 100644 index 00000000..1673943a --- /dev/null +++ b/main/commands/all/api/inbounds_remove.go @@ -0,0 +1,74 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRemoveInbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api rmi [--server=127.0.0.1:8080] [json_file] [tag]...", + Short: "Remove inbounds", + Long: ` +Remove inbounds from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" +`, + Run: executeRemoveInbounds, +} + +func executeRemoveInbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + tags := make([]string, 0) + for _, arg := range unnamedArgs { + if r, err := loadArg(arg); err == nil { + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + ins := conf.InboundConfigs + for _, i := range ins { + tags = append(tags, i.Tag) + } + } else { + // take request as tag + tags = append(tags, arg) + } + } + + if len(tags) == 0 { + base.Fatalf("no inbound to remove") + } + fmt.Println("removing inbounds:", tags) + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, tag := range tags { + fmt.Println("removing:", tag) + r := &handlerService.RemoveInboundRequest{ + Tag: tag, + } + resp, err := client.RemoveInbound(ctx, r) + if err != nil { + base.Fatalf("failed to remove inbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/logger_restart.go b/main/commands/all/api/logger_restart.go new file mode 100644 index 00000000..259ac962 --- /dev/null +++ b/main/commands/all/api/logger_restart.go @@ -0,0 +1,37 @@ +package api + +import ( + logService "github.com/xtls/xray-core/app/log/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRestartLogger = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api restartlogger [--server=127.0.0.1:8080]", + Short: "Restart the logger", + Long: ` +Restart the logger of Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +`, + Run: executeRestartLogger, +} + +func executeRestartLogger(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := logService.NewLoggerServiceClient(conn) + r := &logService.RestartLoggerRequest{} + resp, err := client.RestartLogger(ctx, r) + if err != nil { + base.Fatalf("failed to restart logger: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/outbounds_add.go b/main/commands/all/api/outbounds_add.go new file mode 100644 index 00000000..5d99de4f --- /dev/null +++ b/main/commands/all/api/outbounds_add.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdAddOutbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api ado [--server=127.0.0.1:8080] [c2.json]...", + Short: "Add outbounds", + Long: ` +Add outbounds to Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json c2.json +`, + Run: executeAddOutbounds, +} + +func executeAddOutbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("Reading from STDIN") + unnamedArgs = []string{"stdin:"} + } + + outs := make([]conf.OutboundDetourConfig, 0) + for _, arg := range unnamedArgs { + r, err := loadArg(arg) + if err != nil { + base.Fatalf("failed to load %s: %s", arg, err) + } + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + outs = append(outs, conf.OutboundConfigs...) + } + if len(outs) == 0 { + base.Fatalf("no valid outbound found") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, out := range outs { + fmt.Println("adding:", out.Tag) + o, err := out.Build() + if err != nil { + base.Fatalf("failed to build conf: %s", err) + } + r := &handlerService.AddOutboundRequest{ + Outbound: o, + } + resp, err := client.AddOutbound(ctx, r) + if err != nil { + base.Fatalf("failed to add outbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/outbounds_remove.go b/main/commands/all/api/outbounds_remove.go new file mode 100644 index 00000000..d9a8a945 --- /dev/null +++ b/main/commands/all/api/outbounds_remove.go @@ -0,0 +1,73 @@ +package api + +import ( + "fmt" + + handlerService "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdRemoveOutbounds = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api rmo [--server=127.0.0.1:8080] [json_file] [tag]...", + Short: "Remove outbounds", + Long: ` +Remove outbounds from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 c1.json "tag name" +`, + Run: executeRemoveOutbounds, +} + +func executeRemoveOutbounds(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + unnamedArgs := cmd.Flag.Args() + if len(unnamedArgs) == 0 { + fmt.Println("reading from stdin:") + unnamedArgs = []string{"stdin:"} + } + + tags := make([]string, 0) + for _, arg := range unnamedArgs { + if r, err := loadArg(arg); err == nil { + conf, err := serial.DecodeJSONConfig(r) + if err != nil { + base.Fatalf("failed to decode %s: %s", arg, err) + } + outs := conf.OutboundConfigs + for _, o := range outs { + tags = append(tags, o.Tag) + } + } else { + // take request as tag + tags = append(tags, arg) + } + } + + if len(tags) == 0 { + base.Fatalf("no outbound to remove") + } + + conn, ctx, close := dialAPIServer() + defer close() + + client := handlerService.NewHandlerServiceClient(conn) + for _, tag := range tags { + fmt.Println("removing:", tag) + r := &handlerService.RemoveOutboundRequest{ + Tag: tag, + } + resp, err := client.RemoveOutbound(ctx, r) + if err != nil { + base.Fatalf("failed to remove outbound: %s", err) + } + showResponese(resp) + } +} diff --git a/main/commands/all/api/shared.go b/main/commands/all/api/shared.go new file mode 100644 index 00000000..71ae6247 --- /dev/null +++ b/main/commands/all/api/shared.go @@ -0,0 +1,119 @@ +package api + +import ( + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "os" + "strings" + "time" + + "google.golang.org/grpc" + "google.golang.org/protobuf/proto" + + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/main/commands/base" +) + +type serviceHandler func(ctx context.Context, conn *grpc.ClientConn, cmd *base.Command, args []string) string + +var ( + apiServerAddrPtr string + apiTimeout int +) + +func setSharedFlags(cmd *base.Command) { + cmd.Flag.StringVar(&apiServerAddrPtr, "s", "127.0.0.1:8080", "") + cmd.Flag.StringVar(&apiServerAddrPtr, "server", "127.0.0.1:8080", "") + cmd.Flag.IntVar(&apiTimeout, "t", 3, "") + cmd.Flag.IntVar(&apiTimeout, "timeout", 3, "") +} + +func dialAPIServer() (conn *grpc.ClientConn, ctx context.Context, close func()) { + ctx, cancel := context.WithTimeout(context.Background(), time.Duration(apiTimeout)*time.Second) + conn, err := grpc.DialContext(ctx, apiServerAddrPtr, grpc.WithInsecure(), grpc.WithBlock()) + if err != nil { + base.Fatalf("failed to dial %s", apiServerAddrPtr) + } + close = func() { + cancel() + conn.Close() + } + return +} + +// loadArg loads one arg, maybe an remote url, or local file path +func loadArg(arg string) (out io.Reader, err error) { + var data []byte + switch { + case strings.HasPrefix(arg, "http://"), strings.HasPrefix(arg, "https://"): + data, err = fetchHTTPContent(arg) + + case arg == "stdin:": + data, err = ioutil.ReadAll(os.Stdin) + + default: + data, err = ioutil.ReadFile(arg) + } + + if err != nil { + return + } + out = bytes.NewBuffer(data) + return +} + +// fetchHTTPContent dials https for remote content +func fetchHTTPContent(target string) ([]byte, error) { + parsedTarget, err := url.Parse(target) + if err != nil { + return nil, err + } + + if s := strings.ToLower(parsedTarget.Scheme); s != "http" && s != "https" { + return nil, fmt.Errorf("invalid scheme: %s", parsedTarget.Scheme) + } + + client := &http.Client{ + Timeout: 30 * time.Second, + } + resp, err := client.Do(&http.Request{ + Method: "GET", + URL: parsedTarget, + Close: true, + }) + if err != nil { + return nil, fmt.Errorf("failed to dial to %s", target) + } + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return nil, fmt.Errorf("unexpected HTTP status code: %d", resp.StatusCode) + } + + content, err := buf.ReadAllToBytes(resp.Body) + if err != nil { + return nil, fmt.Errorf("failed to read HTTP response") + } + + return content, nil +} + +func showResponese(m proto.Message) { + msg := "" + bs, err := proto.Marshal(m) + if err != nil { + msg = err.Error() + } else { + msg = string(bs) + msg = strings.TrimSpace(msg) + } + if msg == "" { + return + } + fmt.Println(msg) +} diff --git a/main/commands/all/api/stats_get.go b/main/commands/all/api/stats_get.go new file mode 100644 index 00000000..7e87cb98 --- /dev/null +++ b/main/commands/all/api/stats_get.go @@ -0,0 +1,48 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdGetStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api stats [--server=127.0.0.1:8080] [-name '']", + Short: "Get statistics", + Long: ` +Get statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 + -name + Name of the stat counter. + -reset + Reset the counter to fetching its value. +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -name "inbound>>>statin>>>traffic>>>downlink" +`, + Run: executeGetStats, +} + +func executeGetStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + statName := cmd.Flag.String("name", "", "") + reset := cmd.Flag.Bool("reset", false, "") + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.GetStatsRequest{ + Name: *statName, + Reset_: *reset, + } + resp, err := client.GetStats(ctx, r) + if err != nil { + base.Fatalf("failed to get stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/stats_query.go b/main/commands/all/api/stats_query.go new file mode 100644 index 00000000..725b506b --- /dev/null +++ b/main/commands/all/api/stats_query.go @@ -0,0 +1,48 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdQueryStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api statsquery [--server=127.0.0.1:8080] [-pattern '']", + Short: "Query statistics", + Long: ` +Query statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 + -pattern + Pattern of the query. + -reset + Reset the counter to fetching its value. +Example: + {{.Exec}} {{.LongName}} --server=127.0.0.1:8080 -pattern "counter_" +`, + Run: executeQueryStats, +} + +func executeQueryStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + pattern := cmd.Flag.String("pattern", "", "") + reset := cmd.Flag.Bool("reset", false, "") + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.QueryStatsRequest{ + Pattern: *pattern, + Reset_: *reset, + } + resp, err := client.QueryStats(ctx, r) + if err != nil { + base.Fatalf("failed to query stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/api/stats_sys.go b/main/commands/all/api/stats_sys.go new file mode 100644 index 00000000..5f32d05b --- /dev/null +++ b/main/commands/all/api/stats_sys.go @@ -0,0 +1,37 @@ +package api + +import ( + statsService "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/main/commands/base" +) + +var cmdSysStats = &base.Command{ + CustomFlags: true, + UsageLine: "{{.Exec}} api statssys [--server=127.0.0.1:8080]", + Short: "Get system statistics", + Long: ` +Get system statistics from Xray. +Arguments: + -s, -server + The API server address. Default 127.0.0.1:8080 + -t, -timeout + Timeout seconds to call API. Default 3 +`, + Run: executeSysStats, +} + +func executeSysStats(cmd *base.Command, args []string) { + setSharedFlags(cmd) + cmd.Flag.Parse(args) + + conn, ctx, close := dialAPIServer() + defer close() + + client := statsService.NewStatsServiceClient(conn) + r := &statsService.SysStatsRequest{} + resp, err := client.GetSysStats(ctx, r) + if err != nil { + base.Fatalf("failed to get sys stats: %s", err) + } + showResponese(resp) +} diff --git a/main/commands/all/commands.go b/main/commands/all/commands.go index fe08c2f8..a4945c8e 100644 --- a/main/commands/all/commands.go +++ b/main/commands/all/commands.go @@ -1,15 +1,19 @@ package all -import "github.com/xtls/xray-core/v1/main/commands/base" +import ( + "github.com/xtls/xray-core/main/commands/all/api" + "github.com/xtls/xray-core/main/commands/all/tls" + "github.com/xtls/xray-core/main/commands/base" +) -// go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +// go:generate go run github.com/xtls/xray-core/common/errors/errorgen func init() { base.RootCommand.Commands = append( base.RootCommand.Commands, - cmdAPI, - cmdConvert, - cmdTLS, + api.CmdAPI, + //cmdConvert, + tls.CmdTLS, cmdUUID, ) } diff --git a/main/commands/all/convert.go b/main/commands/all/convert.go index d98813b1..c580fc50 100644 --- a/main/commands/all/convert.go +++ b/main/commands/all/convert.go @@ -11,11 +11,11 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/infra/conf/serial" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/commands/base" "google.golang.org/protobuf/proto" ) diff --git a/main/commands/all/errors.generated.go b/main/commands/all/errors.generated.go index 254912c1..ff138a8a 100644 --- a/main/commands/all/errors.generated.go +++ b/main/commands/all/errors.generated.go @@ -1,6 +1,6 @@ package all -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/commands/all/tls.go b/main/commands/all/tls.go deleted file mode 100644 index 2274d535..00000000 --- a/main/commands/all/tls.go +++ /dev/null @@ -1,18 +0,0 @@ -package all - -import ( - "github.com/xtls/xray-core/v1/main/commands/all/tlscmd" - "github.com/xtls/xray-core/v1/main/commands/base" -) - -var cmdTLS = &base.Command{ - UsageLine: "{{.Exec}} tls", - Short: "TLS tools", - Long: `{{.Exec}} tls provides tools for TLS. - `, - - Commands: []*base.Command{ - tlscmd.CmdCert, - tlscmd.CmdPing, - }, -} diff --git a/main/commands/all/tlscmd/cert.go b/main/commands/all/tls/cert.go similarity index 67% rename from main/commands/all/tlscmd/cert.go rename to main/commands/all/tls/cert.go index d4372109..03dd764f 100644 --- a/main/commands/all/tlscmd/cert.go +++ b/main/commands/all/tls/cert.go @@ -1,4 +1,4 @@ -package tlscmd +package tls import ( "context" @@ -8,53 +8,58 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/main/commands/base" ) -// CmdCert is the tls cert command -var CmdCert = &base.Command{ - UsageLine: "{{.Exec}} tls cert [--ca] [--domain=xray.com] [--expire=240h]", +// cmdCert is the tls cert command +var cmdCert = &base.Command{ + UsageLine: "{{.Exec}} tls cert [--ca] [--domain=example.com] [--expire=240h]", Short: "Generate TLS certificates", Long: ` Generate TLS certificates. -The -domain=domain_name flag sets the domain name for the -certificate. +Arguments: -The -org=organization flag sets the organization name for the -certificate. + -domain=domain_name + The domain name for the certificate. -The -ca flag sets whether this certificate is a CA + -org=organization + The organization name for the certificate. -The -json flag sets the output of certificate to JSON + -ca + Whether this certificate is a CA -The -file flag sets the certificate path to save. + -json + The output of certificate to JSON -The -expire flag expire time of the certificate. Default -value 3 months. - `, + -file + The certificate path to save. + + -expire + Expire time of the certificate. Default value 3 months. +`, } func init() { - CmdCert.Run = executeCert // break init loop + cmdCert.Run = executeCert // break init loop } var ( certDomainNames stringList _ = func() bool { - CmdCert.Flag.Var(&certDomainNames, "domain", "Domain name for the certificate") + cmdCert.Flag.Var(&certDomainNames, "domain", "Domain name for the certificate") return true }() - certCommonName = CmdCert.Flag.String("name", "Xray Inc", "The common name of this certificate") - certOrganization = CmdCert.Flag.String("org", "Xray Inc", "Organization of the certificate") - certIsCA = CmdCert.Flag.Bool("ca", false, "Whether this certificate is a CA") - certJSONOutput = CmdCert.Flag.Bool("json", true, "Print certificate in JSON format") - certFileOutput = CmdCert.Flag.String("file", "", "Save certificate in file.") - certExpire = CmdCert.Flag.Duration("expire", time.Hour*24*90 /* 90 days */, "Time until the certificate expires. Default value 3 months.") + certCommonName = cmdCert.Flag.String("name", "Xray Inc", "The common name of this certificate") + certOrganization = cmdCert.Flag.String("org", "Xray Inc", "Organization of the certificate") + certIsCA = cmdCert.Flag.Bool("ca", false, "Whether this certificate is a CA") + certJSONOutput = cmdCert.Flag.Bool("json", true, "Print certificate in JSON format") + certFileOutput = cmdCert.Flag.String("file", "", "Save certificate in file.") + certExpire = cmdCert.Flag.Duration("expire", time.Hour*24*90 /* 90 days */, "Time until the certificate expires. Default value 3 months.") ) func executeCert(cmd *base.Command, args []string) { diff --git a/main/commands/all/tlscmd/ping.go b/main/commands/all/tls/ping.go similarity index 86% rename from main/commands/all/tlscmd/ping.go rename to main/commands/all/tls/ping.go index 09772a4e..a3697d28 100644 --- a/main/commands/all/tlscmd/ping.go +++ b/main/commands/all/tls/ping.go @@ -1,4 +1,4 @@ -package tlscmd +package tls import ( "crypto/tls" @@ -6,34 +6,37 @@ import ( "fmt" "net" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/main/commands/base" ) -// CmdPing is the tls ping command -var CmdPing = &base.Command{ +// cmdPing is the tls ping command +var cmdPing = &base.Command{ UsageLine: "{{.Exec}} tls ping [-ip ] ", Short: "Ping the domain with TLS handshake", Long: ` Ping the domain with TLS handshake. -The -ip flag sets the IP address of the domain. - `, +Arguments: + + -ip + The IP address of the domain. +`, } func init() { - CmdPing.Run = executePing // break init loop + cmdPing.Run = executePing // break init loop } var ( - pingIPStr = CmdPing.Flag.String("ip", "", "") + pingIPStr = cmdPing.Flag.String("ip", "", "") ) func executePing(cmd *base.Command, args []string) { - if CmdPing.Flag.NArg() < 1 { + if cmdPing.Flag.NArg() < 1 { base.Fatalf("domain not specified") } - domain := CmdPing.Flag.Arg(0) + domain := cmdPing.Flag.Arg(0) fmt.Println("Tls ping: ", domain) var ip net.IP diff --git a/main/commands/all/tls/tls.go b/main/commands/all/tls/tls.go new file mode 100644 index 00000000..55824d94 --- /dev/null +++ b/main/commands/all/tls/tls.go @@ -0,0 +1,17 @@ +package tls + +import ( + "github.com/xtls/xray-core/main/commands/base" +) + +// CmdTLS holds all tls sub commands +var CmdTLS = &base.Command{ + UsageLine: "{{.Exec}} tls", + Short: "TLS tools", + Long: `{{.Exec}} {{.LongName}} provides tools for TLS. +`, + Commands: []*base.Command{ + cmdCert, + cmdPing, + }, +} diff --git a/main/commands/all/uuid.go b/main/commands/all/uuid.go index 0fdbdb17..ef819f17 100644 --- a/main/commands/all/uuid.go +++ b/main/commands/all/uuid.go @@ -3,8 +3,8 @@ package all import ( "fmt" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/main/commands/base" ) var cmdUUID = &base.Command{ diff --git a/main/commands/base/command.go b/main/commands/base/command.go index 0dcdc1d3..98237595 100644 --- a/main/commands/base/command.go +++ b/main/commands/base/command.go @@ -22,13 +22,19 @@ type Command struct { Run func(cmd *Command, args []string) // UsageLine is the one-line usage message. - // The words between "go" and the first flag or argument in the line are taken to be the command name. + // The words between the first word (the "executable name") and the first flag or argument in the line are taken to be the command name. + // + // UsageLine supports go template syntax. It's recommended to use "{{.Exec}}" instead of hardcoding name UsageLine string // Short is the short description shown in the 'go help' output. + // + // Note: Short does not support go template syntax. Short string // Long is the long message shown in the 'go help ' output. + // + // Long supports go template syntax. It's recommended to use "{{.Exec}}", "{{.LongName}}" instead of hardcoding strings Long string // Flag is a set of flags specific to this command. @@ -44,16 +50,18 @@ type Command struct { Commands []*Command } -// LongName returns the command's long name: all the words in the usage line between "go" and a flag or argument, +// LongName returns the command's long name: all the words in the usage line between first word (e.g. "xray") and a flag or argument, func (c *Command) LongName() string { name := c.UsageLine if i := strings.Index(name, " ["); i >= 0 { - name = name[:i] + name = strings.TrimSpace(name[:i]) } - if name == CommandEnv.Exec { - return "" + if i := strings.Index(name, " "); i >= 0 { + name = name[i+1:] + } else { + name = "" } - return strings.TrimPrefix(name, CommandEnv.Exec+" ") + return strings.TrimSpace(name) } // Name returns the command's short name: the last word in the usage line before a flag or argument. @@ -62,11 +70,12 @@ func (c *Command) Name() string { if i := strings.LastIndex(name, " "); i >= 0 { name = name[i+1:] } - return name + return strings.TrimSpace(name) } // Usage prints usage of the Command func (c *Command) Usage() { + buildCommandText(c) fmt.Fprintf(os.Stderr, "usage: %s\n", c.UsageLine) fmt.Fprintf(os.Stderr, "Run 'xray help %s' for details.\n", c.LongName()) SetExitStatus(2) diff --git a/main/commands/base/env.go b/main/commands/base/env.go index ffb71503..476ed133 100644 --- a/main/commands/base/env.go +++ b/main/commands/base/env.go @@ -7,7 +7,10 @@ import ( // CommandEnvHolder is a struct holds the environment info of commands type CommandEnvHolder struct { + // Excutable name of current binary Exec string + // commands column width of current command + CommandsWidth int } // CommandEnv holds the environment info of commands diff --git a/main/commands/base/execute.go b/main/commands/base/execute.go index b0aba96b..2d18371e 100644 --- a/main/commands/base/execute.go +++ b/main/commands/base/execute.go @@ -14,7 +14,6 @@ import ( // Execute excute the commands func Execute() { - buildCommandsText(RootCommand) flag.Parse() args := flag.Args() if len(args) < 1 { @@ -61,6 +60,7 @@ BigCmdLoop: args = cmd.Flag.Args() } + buildCommandText(cmd) cmd.Run(cmd, args) Exit() return diff --git a/main/commands/base/help.go b/main/commands/base/help.go index 89dbb6dd..95cdc4ae 100644 --- a/main/commands/base/help.go +++ b/main/commands/base/help.go @@ -41,6 +41,7 @@ Args: if len(cmd.Commands) > 0 { PrintUsage(os.Stdout, cmd) } else { + buildCommandText(cmd) tmpl(os.Stdout, helpTemplate, makeTmplData(cmd)) } } @@ -49,11 +50,11 @@ var usageTemplate = `{{.Long | trim}} Usage: - {{.Exec}} [arguments] + {{.UsageLine}} [arguments] The commands are: {{range .Commands}}{{if and (ne .Short "") (or (.Runnable) .Commands)}} - {{.Name | printf "%-12s"}} {{.Short}}{{end}}{{end}} + {{.Name | width $.CommandsWidth}} {{.Short}}{{end}}{{end}} Use "{{.Exec}} help{{with .LongName}} {{.}}{{end}} " for more information about a command. ` @@ -91,7 +92,7 @@ func (w *errWriter) Write(b []byte) (int, error) { // tmpl executes the given template text on data, writing the result to w. func tmpl(w io.Writer, text string, data interface{}) { t := template.New("top") - t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize}) + t.Funcs(template.FuncMap{"trim": strings.TrimSpace, "capitalize": capitalize, "width": width}) template.Must(t.Parse(text)) ew := &errWriter{w: w} err := t.Execute(ew, data) @@ -116,26 +117,28 @@ func capitalize(s string) string { return string(unicode.ToTitle(r)) + s[n:] } +func width(width int, value string) string { + format := fmt.Sprintf("%%-%ds", width) + return fmt.Sprintf(format, value) +} + // PrintUsage prints usage of cmd to w func PrintUsage(w io.Writer, cmd *Command) { + buildCommandText(cmd) bw := bufio.NewWriter(w) tmpl(bw, usageTemplate, makeTmplData(cmd)) bw.Flush() } -// buildCommandsText build text of command and its children as template -func buildCommandsText(cmd *Command) { - buildCommandText(cmd) - for _, cmd := range cmd.Commands { - buildCommandsText(cmd) - } -} - // buildCommandText build command text as template func buildCommandText(cmd *Command) { - cmd.UsageLine = buildText(cmd.UsageLine, makeTmplData(cmd)) - cmd.Short = buildText(cmd.Short, makeTmplData(cmd)) - cmd.Long = buildText(cmd.Long, makeTmplData(cmd)) + data := makeTmplData(cmd) + cmd.UsageLine = buildText(cmd.UsageLine, data) + // DO NOT SUPPORT ".Short": + // - It's not necessary + // - Or, we have to build text for all sub commands of current command, like "xray help api" + // cmd.Short = buildText(cmd.Short, data) + cmd.Long = buildText(cmd.Long, data) } func buildText(text string, data interface{}) string { @@ -150,6 +153,15 @@ type tmplData struct { } func makeTmplData(cmd *Command) tmplData { + // Minimum width of the command column + width := 12 + for _, c := range cmd.Commands { + l := len(c.Name()) + if width < l { + width = l + } + } + CommandEnv.CommandsWidth = width return tmplData{ Command: cmd, CommandEnvHolder: &CommandEnv, diff --git a/main/confloader/errors.generated.go b/main/confloader/errors.generated.go index 037851a8..1c234856 100644 --- a/main/confloader/errors.generated.go +++ b/main/confloader/errors.generated.go @@ -1,6 +1,6 @@ package confloader -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/confloader/external/errors.generated.go b/main/confloader/external/errors.generated.go index b1dcb94f..992674b7 100644 --- a/main/confloader/external/errors.generated.go +++ b/main/confloader/external/errors.generated.go @@ -1,6 +1,6 @@ package external -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/confloader/external/external.go b/main/confloader/external/external.go index eaa9e835..6a40f066 100644 --- a/main/confloader/external/external.go +++ b/main/confloader/external/external.go @@ -1,6 +1,6 @@ package external -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "bytes" @@ -12,9 +12,9 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/platform/ctlcmd" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/platform/ctlcmd" + "github.com/xtls/xray-core/main/confloader" ) func ConfigLoader(arg string) (out io.Reader, err error) { diff --git a/main/distro/all/all.go b/main/distro/all/all.go index b89a25f2..ee7babf8 100644 --- a/main/distro/all/all.go +++ b/main/distro/all/all.go @@ -4,68 +4,68 @@ import ( // The following are necessary as they register handlers in their init functions. // Required features. Can't remove unless there is replacements. - _ "github.com/xtls/xray-core/v1/app/dispatcher" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" + _ "github.com/xtls/xray-core/app/dispatcher" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" // Default commander and all its services. This is an optional feature. - _ "github.com/xtls/xray-core/v1/app/commander" - _ "github.com/xtls/xray-core/v1/app/log/command" - _ "github.com/xtls/xray-core/v1/app/proxyman/command" - _ "github.com/xtls/xray-core/v1/app/stats/command" + _ "github.com/xtls/xray-core/app/commander" + _ "github.com/xtls/xray-core/app/log/command" + _ "github.com/xtls/xray-core/app/proxyman/command" + _ "github.com/xtls/xray-core/app/stats/command" // Other optional features. - _ "github.com/xtls/xray-core/v1/app/dns" - _ "github.com/xtls/xray-core/v1/app/log" - _ "github.com/xtls/xray-core/v1/app/policy" - _ "github.com/xtls/xray-core/v1/app/reverse" - _ "github.com/xtls/xray-core/v1/app/router" - _ "github.com/xtls/xray-core/v1/app/stats" + _ "github.com/xtls/xray-core/app/dns" + _ "github.com/xtls/xray-core/app/log" + _ "github.com/xtls/xray-core/app/policy" + _ "github.com/xtls/xray-core/app/reverse" + _ "github.com/xtls/xray-core/app/router" + _ "github.com/xtls/xray-core/app/stats" // Inbound and outbound proxies. - _ "github.com/xtls/xray-core/v1/proxy/blackhole" - _ "github.com/xtls/xray-core/v1/proxy/dns" - _ "github.com/xtls/xray-core/v1/proxy/dokodemo" - _ "github.com/xtls/xray-core/v1/proxy/freedom" - _ "github.com/xtls/xray-core/v1/proxy/http" - _ "github.com/xtls/xray-core/v1/proxy/mtproto" - _ "github.com/xtls/xray-core/v1/proxy/shadowsocks" - _ "github.com/xtls/xray-core/v1/proxy/socks" - _ "github.com/xtls/xray-core/v1/proxy/trojan" - _ "github.com/xtls/xray-core/v1/proxy/vless/inbound" - _ "github.com/xtls/xray-core/v1/proxy/vless/outbound" - _ "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - _ "github.com/xtls/xray-core/v1/proxy/vmess/outbound" + _ "github.com/xtls/xray-core/proxy/blackhole" + _ "github.com/xtls/xray-core/proxy/dns" + _ "github.com/xtls/xray-core/proxy/dokodemo" + _ "github.com/xtls/xray-core/proxy/freedom" + _ "github.com/xtls/xray-core/proxy/http" + _ "github.com/xtls/xray-core/proxy/mtproto" + _ "github.com/xtls/xray-core/proxy/shadowsocks" + _ "github.com/xtls/xray-core/proxy/socks" + _ "github.com/xtls/xray-core/proxy/trojan" + _ "github.com/xtls/xray-core/proxy/vless/inbound" + _ "github.com/xtls/xray-core/proxy/vless/outbound" + _ "github.com/xtls/xray-core/proxy/vmess/inbound" + _ "github.com/xtls/xray-core/proxy/vmess/outbound" // Transports - _ "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - _ "github.com/xtls/xray-core/v1/transport/internet/http" - _ "github.com/xtls/xray-core/v1/transport/internet/kcp" - _ "github.com/xtls/xray-core/v1/transport/internet/quic" - _ "github.com/xtls/xray-core/v1/transport/internet/tcp" - _ "github.com/xtls/xray-core/v1/transport/internet/tls" - _ "github.com/xtls/xray-core/v1/transport/internet/udp" - _ "github.com/xtls/xray-core/v1/transport/internet/websocket" - _ "github.com/xtls/xray-core/v1/transport/internet/xtls" + _ "github.com/xtls/xray-core/transport/internet/domainsocket" + _ "github.com/xtls/xray-core/transport/internet/http" + _ "github.com/xtls/xray-core/transport/internet/kcp" + _ "github.com/xtls/xray-core/transport/internet/quic" + _ "github.com/xtls/xray-core/transport/internet/tcp" + _ "github.com/xtls/xray-core/transport/internet/tls" + _ "github.com/xtls/xray-core/transport/internet/udp" + _ "github.com/xtls/xray-core/transport/internet/websocket" + _ "github.com/xtls/xray-core/transport/internet/xtls" // Transport headers - _ "github.com/xtls/xray-core/v1/transport/internet/headers/http" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/tls" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - _ "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + _ "github.com/xtls/xray-core/transport/internet/headers/http" + _ "github.com/xtls/xray-core/transport/internet/headers/noop" + _ "github.com/xtls/xray-core/transport/internet/headers/srtp" + _ "github.com/xtls/xray-core/transport/internet/headers/tls" + _ "github.com/xtls/xray-core/transport/internet/headers/utp" + _ "github.com/xtls/xray-core/transport/internet/headers/wechat" + _ "github.com/xtls/xray-core/transport/internet/headers/wireguard" // JSON config support. Choose only one from the two below. // The following line loads JSON from xctl - // _ "github.com/xtls/xray-core/v1/main/json" + // _ "github.com/xtls/xray-core/main/json" // The following line loads JSON internally - _ "github.com/xtls/xray-core/v1/main/jsonem" + _ "github.com/xtls/xray-core/main/jsonem" // Load config from file or http(s) - _ "github.com/xtls/xray-core/v1/main/confloader/external" + _ "github.com/xtls/xray-core/main/confloader/external" // commands - _ "github.com/xtls/xray-core/v1/main/commands/all" + _ "github.com/xtls/xray-core/main/commands/all" ) diff --git a/main/errors.generated.go b/main/errors.generated.go index 4287a6d9..e898cb5f 100644 --- a/main/errors.generated.go +++ b/main/errors.generated.go @@ -1,6 +1,6 @@ package main -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/json/config_json.go b/main/json/config_json.go index 5514bea2..90a169a0 100644 --- a/main/json/config_json.go +++ b/main/json/config_json.go @@ -1,15 +1,15 @@ package json -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "io" "os" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/cmdarg" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/cmdarg" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/confloader" ) func init() { diff --git a/main/json/errors.generated.go b/main/json/errors.generated.go index 71d741bf..2c1b1452 100644 --- a/main/json/errors.generated.go +++ b/main/json/errors.generated.go @@ -1,6 +1,6 @@ package json -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/jsonem/errors.generated.go b/main/jsonem/errors.generated.go index ac1760f3..1c3f60e9 100644 --- a/main/jsonem/errors.generated.go +++ b/main/jsonem/errors.generated.go @@ -1,6 +1,6 @@ package jsonem -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/main/jsonem/jsonem.go b/main/jsonem/jsonem.go index 66a16bc4..cf9227aa 100644 --- a/main/jsonem/jsonem.go +++ b/main/jsonem/jsonem.go @@ -3,12 +3,12 @@ package jsonem import ( "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/infra/conf" - "github.com/xtls/xray-core/v1/infra/conf/serial" - "github.com/xtls/xray-core/v1/main/confloader" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/infra/conf" + "github.com/xtls/xray-core/infra/conf/serial" + "github.com/xtls/xray-core/main/confloader" ) func init() { @@ -19,12 +19,18 @@ func init() { switch v := input.(type) { case cmdarg.Arg: cf := &conf.Config{} - for _, arg := range v { + for i, arg := range v { newError("Reading config: ", arg).AtInfo().WriteToLog() r, err := confloader.LoadConfig(arg) common.Must(err) c, err := serial.DecodeJSONConfig(r) common.Must(err) + if i == 0 { + // This ensure even if the muti-json parser do not support a setting, + // It is still respected automatically for the first configure file + *cf = *c + continue + } cf.Override(c, arg) } return cf.Build() diff --git a/main/main.go b/main/main.go index e3759cf3..22d60bdf 100644 --- a/main/main.go +++ b/main/main.go @@ -4,8 +4,8 @@ import ( "flag" "os" - "github.com/xtls/xray-core/v1/main/commands/base" - _ "github.com/xtls/xray-core/v1/main/distro/all" + "github.com/xtls/xray-core/main/commands/base" + _ "github.com/xtls/xray-core/main/distro/all" ) func main() { diff --git a/main/run.go b/main/run.go index b9349c75..1f794cc2 100644 --- a/main/run.go +++ b/main/run.go @@ -12,10 +12,10 @@ import ( "strings" "syscall" - "github.com/xtls/xray-core/v1/common/cmdarg" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/common/cmdarg" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/commands/base" ) var cmdRun = &base.Command{ diff --git a/main/version.go b/main/version.go index 730372e3..9c1fa736 100644 --- a/main/version.go +++ b/main/version.go @@ -3,8 +3,8 @@ package main import ( "fmt" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/main/commands/base" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/main/commands/base" ) var cmdVersion = &base.Command{ diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index 82320b0d..526332dc 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -3,15 +3,15 @@ // Package blackhole is an outbound handler that blocks all connections. package blackhole -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Handler is an outbound connection that silently swallow the entire payload. diff --git a/proxy/blackhole/blackhole_test.go b/proxy/blackhole/blackhole_test.go index 84c1ed45..8e487e0c 100644 --- a/proxy/blackhole/blackhole_test.go +++ b/proxy/blackhole/blackhole_test.go @@ -4,12 +4,12 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/pipe" ) func TestBlackholeHTTPResponse(t *testing.T) { diff --git a/proxy/blackhole/config.go b/proxy/blackhole/config.go index f31d7977..b0f8e60c 100644 --- a/proxy/blackhole/config.go +++ b/proxy/blackhole/config.go @@ -1,8 +1,8 @@ package blackhole import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) const ( diff --git a/proxy/blackhole/config.pb.go b/proxy/blackhole/config.pb.go index d0010e5d..08ffed36 100644 --- a/proxy/blackhole/config.pb.go +++ b/proxy/blackhole/config.pb.go @@ -8,7 +8,7 @@ package blackhole import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -164,13 +164,13 @@ var file_proxy_blackhole_config_proto_rawDesc = []byte{ 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x61, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x2c, 0x67, + 0x5e, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x14, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, - 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x62, + 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0xaa, 0x02, 0x14, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x68, 0x6f, 0x6c, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/blackhole/config.proto b/proxy/blackhole/config.proto index d1dbfcee..3214c1b5 100644 --- a/proxy/blackhole/config.proto +++ b/proxy/blackhole/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.blackhole; option csharp_namespace = "Xray.Proxy.Blackhole"; -option go_package = "github.com/xtls/xray-core/v1/proxy/blackhole"; +option go_package = "github.com/xtls/xray-core/proxy/blackhole"; option java_package = "com.xray.proxy.blackhole"; option java_multiple_files = true; diff --git a/proxy/blackhole/config_test.go b/proxy/blackhole/config_test.go index 5f3e5113..f2755b50 100644 --- a/proxy/blackhole/config_test.go +++ b/proxy/blackhole/config_test.go @@ -5,9 +5,9 @@ import ( "net/http" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/proxy/blackhole" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/proxy/blackhole" ) func TestHTTPResponse(t *testing.T) { diff --git a/proxy/blackhole/errors.generated.go b/proxy/blackhole/errors.generated.go index 5def7a78..344f86cb 100644 --- a/proxy/blackhole/errors.generated.go +++ b/proxy/blackhole/errors.generated.go @@ -1,6 +1,6 @@ package blackhole -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/dns/config.pb.go b/proxy/dns/config.pb.go index 0c0a8991..62b7bf8d 100644 --- a/proxy/dns/config.pb.go +++ b/proxy/dns/config.pb.go @@ -8,7 +8,7 @@ package dns import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,12 +86,12 @@ var file_proxy_dns_config_proto_rawDesc = []byte{ 0x12, 0x31, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, + 0x76, 0x65, 0x72, 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x64, 0x6e, 0x73, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x64, 0x6e, 0x73, 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x44, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6e, 0x73, + 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6e, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/dns/config.proto b/proxy/dns/config.proto index 0e59f2ac..d4f4a308 100644 --- a/proxy/dns/config.proto +++ b/proxy/dns/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.dns; option csharp_namespace = "Xray.Proxy.Dns"; -option go_package = "github.com/xtls/xray-core/v1/proxy/dns"; +option go_package = "github.com/xtls/xray-core/proxy/dns"; option java_package = "com.xray.proxy.dns"; option java_multiple_files = true; diff --git a/proxy/dns/dns.go b/proxy/dns/dns.go index 1326a664..89f49209 100644 --- a/proxy/dns/dns.go +++ b/proxy/dns/dns.go @@ -9,16 +9,16 @@ import ( "golang.org/x/net/dns/dnsmessage" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - dns_proto "github.com/xtls/xray-core/v1/common/protocol/dns" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + dns_proto "github.com/xtls/xray-core/common/protocol/dns" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/dns/dns_test.go b/proxy/dns/dns_test.go index 92bd8e9b..cc43c251 100644 --- a/proxy/dns/dns_test.go +++ b/proxy/dns/dns_test.go @@ -8,20 +8,20 @@ import ( "github.com/google/go-cmp/cmp" "github.com/miekg/dns" - "github.com/xtls/xray-core/v1/app/dispatcher" - dnsapp "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - dns_proxy "github.com/xtls/xray-core/v1/proxy/dns" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/dispatcher" + dnsapp "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + dns_proxy "github.com/xtls/xray-core/proxy/dns" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) type staticHandler struct { diff --git a/proxy/dns/errors.generated.go b/proxy/dns/errors.generated.go index ce4c0605..d7375a9b 100644 --- a/proxy/dns/errors.generated.go +++ b/proxy/dns/errors.generated.go @@ -1,6 +1,6 @@ package dns -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/dokodemo/config.go b/proxy/dokodemo/config.go index 12f1086b..bb367051 100644 --- a/proxy/dokodemo/config.go +++ b/proxy/dokodemo/config.go @@ -1,7 +1,7 @@ package dokodemo import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) // GetPredefinedAddress returns the defined address from proto config. Null if address is not valid. diff --git a/proxy/dokodemo/config.pb.go b/proxy/dokodemo/config.pb.go index 18c5af49..e176ac4d 100644 --- a/proxy/dokodemo/config.pb.go +++ b/proxy/dokodemo/config.pb.go @@ -8,7 +8,7 @@ package dokodemo import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" + net "github.com/xtls/xray-core/common/net" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -157,14 +157,14 @@ var file_proxy_dokodemo_config_proto_rawDesc = []byte{ 0x72, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5e, 0x0a, + 0x28, 0x0d, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x5b, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, + 0x64, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, - 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x44, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x64, 0x6f, 0x6b, 0x6f, + 0x64, 0x65, 0x6d, 0x6f, 0xaa, 0x02, 0x13, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x44, 0x6f, 0x6b, 0x6f, 0x64, 0x65, 0x6d, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/dokodemo/config.proto b/proxy/dokodemo/config.proto index a12f9907..6b5b262b 100644 --- a/proxy/dokodemo/config.proto +++ b/proxy/dokodemo/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.dokodemo; option csharp_namespace = "Xray.Proxy.Dokodemo"; -option go_package = "github.com/xtls/xray-core/v1/proxy/dokodemo"; +option go_package = "github.com/xtls/xray-core/proxy/dokodemo"; option java_package = "com.xray.proxy.dokodemo"; option java_multiple_files = true; diff --git a/proxy/dokodemo/dokodemo.go b/proxy/dokodemo/dokodemo.go index dba80672..e9bb975f 100644 --- a/proxy/dokodemo/dokodemo.go +++ b/proxy/dokodemo/dokodemo.go @@ -2,25 +2,25 @@ package dokodemo -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/dokodemo/errors.generated.go b/proxy/dokodemo/errors.generated.go index d570d667..cc4fd09c 100644 --- a/proxy/dokodemo/errors.generated.go +++ b/proxy/dokodemo/errors.generated.go @@ -1,6 +1,6 @@ package dokodemo -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/freedom/config.pb.go b/proxy/freedom/config.pb.go index f929118d..d06f0147 100644 --- a/proxy/freedom/config.pb.go +++ b/proxy/freedom/config.pb.go @@ -8,7 +8,7 @@ package freedom import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -231,13 +231,13 @@ var file_proxy_freedom_config_proto_rawDesc = []byte{ 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, - 0x36, 0x10, 0x03, 0x42, 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x36, 0x10, 0x03, 0x42, 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x50, 0x01, 0x5a, - 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x12, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x46, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2f, 0x66, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x46, 0x72, 0x65, 0x65, 0x64, 0x6f, 0x6d, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/freedom/config.proto b/proxy/freedom/config.proto index eb0de1ad..7578a43f 100644 --- a/proxy/freedom/config.proto +++ b/proxy/freedom/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.freedom; option csharp_namespace = "Xray.Proxy.Freedom"; -option go_package = "github.com/xtls/xray-core/v1/proxy/freedom"; +option go_package = "github.com/xtls/xray-core/proxy/freedom"; option java_package = "com.xray.proxy.freedom"; option java_multiple_files = true; diff --git a/proxy/freedom/errors.generated.go b/proxy/freedom/errors.generated.go index f6c1cb83..344fbb2f 100644 --- a/proxy/freedom/errors.generated.go +++ b/proxy/freedom/errors.generated.go @@ -1,6 +1,6 @@ package freedom -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/freedom/freedom.go b/proxy/freedom/freedom.go index fb7a8ff0..c0f887a7 100644 --- a/proxy/freedom/freedom.go +++ b/proxy/freedom/freedom.go @@ -2,25 +2,25 @@ package freedom -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/proxy/http/client.go b/proxy/http/client.go index 0010a330..8f8ffa42 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -13,20 +13,20 @@ import ( "golang.org/x/net/http2" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/bytespool" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/bytespool" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type Client struct { diff --git a/proxy/http/config.go b/proxy/http/config.go index e12bd43c..00ce0795 100644 --- a/proxy/http/config.go +++ b/proxy/http/config.go @@ -1,7 +1,7 @@ package http import ( - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) func (a *Account) Equals(another protocol.Account) bool { diff --git a/proxy/http/config.pb.go b/proxy/http/config.pb.go index 79966d11..b5a53864 100644 --- a/proxy/http/config.pb.go +++ b/proxy/http/config.pb.go @@ -8,7 +8,7 @@ package http import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -237,12 +237,12 @@ var file_proxy_http_config_proto_rawDesc = []byte{ 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x42, - 0x52, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, - 0x70, 0xaa, 0x02, 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, - 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, + 0x0f, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x48, 0x74, 0x74, 0x70, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/http/config.proto b/proxy/http/config.proto index 212e7227..bcb11ebf 100644 --- a/proxy/http/config.proto +++ b/proxy/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.http; option csharp_namespace = "Xray.Proxy.Http"; -option go_package = "github.com/xtls/xray-core/v1/proxy/http"; +option go_package = "github.com/xtls/xray-core/proxy/http"; option java_package = "com.xray.proxy.http"; option java_multiple_files = true; diff --git a/proxy/http/errors.generated.go b/proxy/http/errors.generated.go index b07b3fec..f0048165 100644 --- a/proxy/http/errors.generated.go +++ b/proxy/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/http/http.go b/proxy/http/http.go index 9dc78532..3c0d015f 100644 --- a/proxy/http/http.go +++ b/proxy/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/http/server.go b/proxy/http/server.go index acdc1665..e3ff8d68 100644 --- a/proxy/http/server.go +++ b/proxy/http/server.go @@ -11,20 +11,20 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) // Server is an HTTP proxy server. diff --git a/proxy/mtproto/auth.go b/proxy/mtproto/auth.go index 1261d199..00857d73 100644 --- a/proxy/mtproto/auth.go +++ b/proxy/mtproto/auth.go @@ -7,7 +7,7 @@ import ( "io" "sync" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) const ( diff --git a/proxy/mtproto/auth_test.go b/proxy/mtproto/auth_test.go index 3bdff593..9fc6a9a0 100644 --- a/proxy/mtproto/auth_test.go +++ b/proxy/mtproto/auth_test.go @@ -7,8 +7,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/proxy/mtproto" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/proxy/mtproto" ) func TestInverse(t *testing.T) { diff --git a/proxy/mtproto/client.go b/proxy/mtproto/client.go index 6c2f4439..ee4e7a8e 100644 --- a/proxy/mtproto/client.go +++ b/proxy/mtproto/client.go @@ -3,14 +3,14 @@ package mtproto import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) type Client struct { diff --git a/proxy/mtproto/config.go b/proxy/mtproto/config.go index 016efcde..fcd203d7 100644 --- a/proxy/mtproto/config.go +++ b/proxy/mtproto/config.go @@ -1,7 +1,7 @@ package mtproto import ( - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) func (a *Account) Equals(another protocol.Account) bool { diff --git a/proxy/mtproto/config.pb.go b/proxy/mtproto/config.pb.go index 268dc44c..c8bb8d04 100644 --- a/proxy/mtproto/config.pb.go +++ b/proxy/mtproto/config.pb.go @@ -8,7 +8,7 @@ package mtproto import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -176,13 +176,13 @@ var file_proxy_mtproto_config_proto_rawDesc = []byte{ 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, - 0x5b, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, + 0x58, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, - 0x6d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x4d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x6d, 0x74, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x12, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x4d, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/proxy/mtproto/config.proto b/proxy/mtproto/config.proto index 20be7569..65997bc0 100644 --- a/proxy/mtproto/config.proto +++ b/proxy/mtproto/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.mtproto; option csharp_namespace = "Xray.Proxy.Mtproto"; -option go_package = "github.com/xtls/xray-core/v1/proxy/mtproto"; +option go_package = "github.com/xtls/xray-core/proxy/mtproto"; option java_package = "com.xray.proxy.mtproto"; option java_multiple_files = true; diff --git a/proxy/mtproto/errors.generated.go b/proxy/mtproto/errors.generated.go index 5dd70350..012202d6 100644 --- a/proxy/mtproto/errors.generated.go +++ b/proxy/mtproto/errors.generated.go @@ -1,6 +1,6 @@ package mtproto -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/mtproto/mtproto.go b/proxy/mtproto/mtproto.go index 2103186d..af7983a5 100644 --- a/proxy/mtproto/mtproto.go +++ b/proxy/mtproto/mtproto.go @@ -1,3 +1,3 @@ package mtproto -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/mtproto/server.go b/proxy/mtproto/server.go index 6e4d3ddc..df3e1439 100644 --- a/proxy/mtproto/server.go +++ b/proxy/mtproto/server.go @@ -7,18 +7,18 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/proxy/proxy.go b/proxy/proxy.go index 59b95a5a..a32a1ef1 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -8,11 +8,11 @@ package proxy import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // An Inbound processes inbound connections. diff --git a/proxy/shadowsocks/client.go b/proxy/shadowsocks/client.go index 94a984ab..0a2254ed 100644 --- a/proxy/shadowsocks/client.go +++ b/proxy/shadowsocks/client.go @@ -5,18 +5,18 @@ package shadowsocks import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Client is a inbound handler for Shadowsocks protocol diff --git a/proxy/shadowsocks/config.go b/proxy/shadowsocks/config.go index 5c21541f..dfc3ce3d 100644 --- a/proxy/shadowsocks/config.go +++ b/proxy/shadowsocks/config.go @@ -11,10 +11,10 @@ import ( "golang.org/x/crypto/chacha20poly1305" "golang.org/x/crypto/hkdf" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/protocol" ) // MemoryAccount is an account type converted from Account. diff --git a/proxy/shadowsocks/config.pb.go b/proxy/shadowsocks/config.pb.go index b32f92bc..fcf321d9 100644 --- a/proxy/shadowsocks/config.pb.go +++ b/proxy/shadowsocks/config.pb.go @@ -8,8 +8,8 @@ package shadowsocks import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - protocol "github.com/xtls/xray-core/v1/common/protocol" + net "github.com/xtls/xray-core/common/net" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -307,14 +307,14 @@ var file_proxy_shadowsocks_config_proto_rawDesc = []byte{ 0x47, 0x43, 0x4d, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x43, 0x48, 0x41, 0x32, 0x30, 0x5f, 0x50, 0x4f, 0x4c, 0x59, 0x31, 0x33, 0x30, 0x35, 0x10, 0x07, 0x12, 0x08, 0x0a, - 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x67, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x08, 0x42, 0x64, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, - 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, - 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, + 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x16, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x53, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/shadowsocks/config.proto b/proxy/shadowsocks/config.proto index baab7c02..8d5bb502 100644 --- a/proxy/shadowsocks/config.proto +++ b/proxy/shadowsocks/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.shadowsocks; option csharp_namespace = "Xray.Proxy.Shadowsocks"; -option go_package = "github.com/xtls/xray-core/v1/proxy/shadowsocks"; +option go_package = "github.com/xtls/xray-core/proxy/shadowsocks"; option java_package = "com.xray.proxy.shadowsocks"; option java_multiple_files = true; diff --git a/proxy/shadowsocks/config_test.go b/proxy/shadowsocks/config_test.go index 49d99d05..cfc7a43b 100644 --- a/proxy/shadowsocks/config_test.go +++ b/proxy/shadowsocks/config_test.go @@ -6,9 +6,9 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/proxy/shadowsocks" ) func TestAEADCipherUDP(t *testing.T) { diff --git a/proxy/shadowsocks/errors.generated.go b/proxy/shadowsocks/errors.generated.go index 8b1b33d9..dd33902b 100644 --- a/proxy/shadowsocks/errors.generated.go +++ b/proxy/shadowsocks/errors.generated.go @@ -1,6 +1,6 @@ package shadowsocks -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/shadowsocks/protocol.go b/proxy/shadowsocks/protocol.go index 8322b52e..1f5f4bbc 100644 --- a/proxy/shadowsocks/protocol.go +++ b/proxy/shadowsocks/protocol.go @@ -10,11 +10,11 @@ import ( "io" "io/ioutil" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) const ( diff --git a/proxy/shadowsocks/protocol_test.go b/proxy/shadowsocks/protocol_test.go index 43fa331b..5429a8b9 100644 --- a/proxy/shadowsocks/protocol_test.go +++ b/proxy/shadowsocks/protocol_test.go @@ -5,11 +5,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/shadowsocks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/shadowsocks" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/shadowsocks/server.go b/proxy/shadowsocks/server.go index b16fcf3e..7134fb9c 100644 --- a/proxy/shadowsocks/server.go +++ b/proxy/shadowsocks/server.go @@ -6,20 +6,20 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" ) type Server struct { diff --git a/proxy/shadowsocks/shadowsocks.go b/proxy/shadowsocks/shadowsocks.go index 5214a24c..6d950db2 100644 --- a/proxy/shadowsocks/shadowsocks.go +++ b/proxy/shadowsocks/shadowsocks.go @@ -5,4 +5,4 @@ // R.I.P Shadowsocks package shadowsocks -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/socks/client.go b/proxy/socks/client.go index 5266dbd0..568f5d70 100644 --- a/proxy/socks/client.go +++ b/proxy/socks/client.go @@ -6,18 +6,18 @@ import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Client is a Socks5 client. diff --git a/proxy/socks/config.go b/proxy/socks/config.go index 17074630..1d0ae6ec 100644 --- a/proxy/socks/config.go +++ b/proxy/socks/config.go @@ -2,7 +2,7 @@ package socks -import "github.com/xtls/xray-core/v1/common/protocol" +import "github.com/xtls/xray-core/common/protocol" func (a *Account) Equals(another protocol.Account) bool { if account, ok := another.(*Account); ok { diff --git a/proxy/socks/config.pb.go b/proxy/socks/config.pb.go index c6c27150..7557d07e 100644 --- a/proxy/socks/config.pb.go +++ b/proxy/socks/config.pb.go @@ -8,8 +8,8 @@ package socks import ( proto "github.com/golang/protobuf/proto" - net "github.com/xtls/xray-core/v1/common/net" - protocol "github.com/xtls/xray-core/v1/common/protocol" + net "github.com/xtls/xray-core/common/net" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -314,13 +314,13 @@ var file_proxy_socks_config_proto_rawDesc = []byte{ 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2a, 0x25, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x53, - 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x42, 0x55, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x53, 0x57, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0x50, - 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x73, 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/socks/config.proto b/proxy/socks/config.proto index ff1c1385..994663bb 100644 --- a/proxy/socks/config.proto +++ b/proxy/socks/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.socks; option csharp_namespace = "Xray.Proxy.Socks"; -option go_package = "github.com/xtls/xray-core/v1/proxy/socks"; +option go_package = "github.com/xtls/xray-core/proxy/socks"; option java_package = "com.xray.proxy.socks"; option java_multiple_files = true; diff --git a/proxy/socks/errors.generated.go b/proxy/socks/errors.generated.go index 023bf9e0..f466011d 100644 --- a/proxy/socks/errors.generated.go +++ b/proxy/socks/errors.generated.go @@ -1,6 +1,6 @@ package socks -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/socks/protocol.go b/proxy/socks/protocol.go index 20b91dd0..ce8e1f22 100644 --- a/proxy/socks/protocol.go +++ b/proxy/socks/protocol.go @@ -6,10 +6,10 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) const ( diff --git a/proxy/socks/protocol_test.go b/proxy/socks/protocol_test.go index 861d7a0b..006fb7f1 100644 --- a/proxy/socks/protocol_test.go +++ b/proxy/socks/protocol_test.go @@ -6,11 +6,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/socks" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/socks" ) func TestUDPEncoding(t *testing.T) { diff --git a/proxy/socks/server.go b/proxy/socks/server.go index 8633146e..de24ad1e 100644 --- a/proxy/socks/server.go +++ b/proxy/socks/server.go @@ -7,21 +7,21 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" ) // Server is a SOCKS 5 proxy server diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index f268b02e..557609c7 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -1,4 +1,4 @@ // Package socks provides implements of Socks protocol 4, 4a and 5. package socks -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/proxy/trojan/client.go b/proxy/trojan/client.go index f7f2b0e5..a1219343 100644 --- a/proxy/trojan/client.go +++ b/proxy/trojan/client.go @@ -7,21 +7,21 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Client is a inbound handler for trojan protocol diff --git a/proxy/trojan/config.go b/proxy/trojan/config.go index 05c4e50e..ffac7854 100644 --- a/proxy/trojan/config.go +++ b/proxy/trojan/config.go @@ -5,8 +5,8 @@ import ( "encoding/hex" fmt "fmt" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" ) // MemoryAccount is an account type converted from Account. diff --git a/proxy/trojan/config.pb.go b/proxy/trojan/config.pb.go index 85b8b7ad..391a7569 100644 --- a/proxy/trojan/config.pb.go +++ b/proxy/trojan/config.pb.go @@ -8,7 +8,7 @@ package trojan import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -295,13 +295,13 @@ var file_proxy_trojan_config_proto_rawDesc = []byte{ 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x2e, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x73, 0x42, 0x58, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x29, + 0x63, 0x6b, 0x73, 0x42, 0x55, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, - 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2f, 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, + 0x74, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0xaa, 0x02, 0x11, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x54, 0x72, 0x6f, 0x6a, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/trojan/config.proto b/proxy/trojan/config.proto index 1fb865a8..b4376a82 100644 --- a/proxy/trojan/config.proto +++ b/proxy/trojan/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.trojan; option csharp_namespace = "Xray.Proxy.Trojan"; -option go_package = "github.com/xtls/xray-core/v1/proxy/trojan"; +option go_package = "github.com/xtls/xray-core/proxy/trojan"; option java_package = "com.xray.proxy.trojan"; option java_multiple_files = true; diff --git a/proxy/trojan/errors.generated.go b/proxy/trojan/errors.generated.go index 10d02653..7fb81279 100644 --- a/proxy/trojan/errors.generated.go +++ b/proxy/trojan/errors.generated.go @@ -1,6 +1,6 @@ package trojan -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/trojan/protocol.go b/proxy/trojan/protocol.go index ff8e83eb..3b161163 100644 --- a/proxy/trojan/protocol.go +++ b/proxy/trojan/protocol.go @@ -6,13 +6,13 @@ import ( "io" "syscall" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/proxy/trojan/protocol_test.go b/proxy/trojan/protocol_test.go index da23035b..ea1cf7ac 100644 --- a/proxy/trojan/protocol_test.go +++ b/proxy/trojan/protocol_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - . "github.com/xtls/xray-core/v1/proxy/trojan" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + . "github.com/xtls/xray-core/proxy/trojan" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/trojan/server.go b/proxy/trojan/server.go index a0e857b0..9f0d3e58 100644 --- a/proxy/trojan/server.go +++ b/proxy/trojan/server.go @@ -10,25 +10,25 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - udp_proto "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + udp_proto "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/internet/xtls" ) func init() { diff --git a/proxy/trojan/validator.go b/proxy/trojan/validator.go index 7ea503e1..4279934e 100644 --- a/proxy/trojan/validator.go +++ b/proxy/trojan/validator.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/protocol" ) // Validator stores valid trojan users. diff --git a/proxy/vless/account.go b/proxy/vless/account.go index 03563653..c6dfdb72 100644 --- a/proxy/vless/account.go +++ b/proxy/vless/account.go @@ -3,8 +3,8 @@ package vless import ( - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // AsAccount implements protocol.Account.AsAccount(). diff --git a/proxy/vless/account.pb.go b/proxy/vless/account.pb.go index ff629e61..17029cbe 100644 --- a/proxy/vless/account.pb.go +++ b/proxy/vless/account.pb.go @@ -101,13 +101,13 @@ var file_proxy_vless_account_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x55, 0x0a, 0x14, + 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6c, 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, - 0xaa, 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, - 0x65, 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x10, + 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/account.proto b/proxy/vless/account.proto index 298bdfda..38bd6144 100644 --- a/proxy/vless/account.proto +++ b/proxy/vless/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless; option csharp_namespace = "Xray.Proxy.Vless"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless"; +option go_package = "github.com/xtls/xray-core/proxy/vless"; option java_package = "com.xray.proxy.vless"; option java_multiple_files = true; diff --git a/proxy/vless/encoding/addons.go b/proxy/vless/encoding/addons.go index c0ee0b02..cc4a7865 100644 --- a/proxy/vless/encoding/addons.go +++ b/proxy/vless/encoding/addons.go @@ -7,9 +7,9 @@ import ( "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/vless" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/vless" ) func EncodeHeaderAddons(buffer *buf.Buffer, addons *Addons) error { diff --git a/proxy/vless/encoding/addons.pb.go b/proxy/vless/encoding/addons.pb.go index 86429d5e..97c90521 100644 --- a/proxy/vless/encoding/addons.pb.go +++ b/proxy/vless/encoding/addons.pb.go @@ -84,20 +84,19 @@ func init() { func init() { proto.RegisterFile("proxy/vless/encoding/addons.proto", fileDescriptor_75ab671b0ca8b1cc) } var fileDescriptor_75ab671b0ca8b1cc = []byte{ - // 195 bytes of a gzipped FileDescriptorProto + // 191 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0x28, 0xca, 0xaf, 0xa8, 0xd4, 0x2f, 0xcb, 0x49, 0x2d, 0x2e, 0xd6, 0x4f, 0xcd, 0x4b, 0xce, 0x4f, 0xc9, 0xcc, 0x4b, 0xd7, 0x4f, 0x4c, 0x49, 0xc9, 0xcf, 0x2b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xac, 0x28, 0x4a, 0xac, 0xd4, 0x03, 0xab, 0xd3, 0x03, 0xab, 0xd3, 0x83, 0xa9, 0x53, 0x32, 0xe0, 0x62, 0x73, 0x04, 0x2b, 0x15, 0x12, 0xe2, 0x62, 0x71, 0xcb, 0xc9, 0x2f, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x41, 0x62, 0xc1, 0xa9, 0xa9, 0x29, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0x3c, - 0x41, 0x60, 0xb6, 0x53, 0x03, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x6c, 0x72, 0x7e, 0xae, 0x1e, 0x4e, 0x3b, 0x02, - 0x18, 0xa3, 0x0c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x2b, 0x4a, - 0x72, 0x8a, 0xf5, 0x41, 0x8a, 0x75, 0x93, 0xf3, 0x8b, 0x52, 0xf5, 0xcb, 0x0c, 0xf5, 0xb1, 0x79, - 0x60, 0x15, 0x93, 0x64, 0x04, 0xc8, 0xc0, 0x00, 0xb0, 0x81, 0x61, 0x60, 0x03, 0x5d, 0xa1, 0x72, - 0x49, 0x6c, 0x60, 0x6f, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xda, 0x20, 0x32, 0x3e, 0xfb, - 0x00, 0x00, 0x00, + 0x41, 0x60, 0xb6, 0x53, 0xed, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, + 0xc7, 0x38, 0xe3, 0xb1, 0x1c, 0x03, 0x97, 0x6c, 0x72, 0x7e, 0xae, 0x1e, 0x4e, 0x2b, 0x02, 0x18, + 0xa3, 0xf4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x2b, 0x4a, 0x72, + 0x8a, 0xf5, 0x41, 0x8a, 0x75, 0x93, 0xf3, 0x8b, 0x52, 0xf5, 0xb1, 0x39, 0x7e, 0x15, 0x93, 0x64, + 0x04, 0xc8, 0xb4, 0x00, 0xb0, 0x69, 0x61, 0x60, 0xd3, 0x5c, 0xa1, 0x72, 0x49, 0x6c, 0x60, 0x2f, + 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x32, 0xfc, 0x98, 0x28, 0xf7, 0x00, 0x00, 0x00, } func (m *Addons) Marshal() (dAtA []byte, err error) { diff --git a/proxy/vless/encoding/addons.proto b/proxy/vless/encoding/addons.proto index b913a53f..3730e87f 100644 --- a/proxy/vless/encoding/addons.proto +++ b/proxy/vless/encoding/addons.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.encoding; option csharp_namespace = "Xray.Proxy.Vless.Encoding"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/encoding"; +option go_package = "github.com/xtls/xray-core/proxy/vless/encoding"; option java_package = "com.xray.proxy.vless.encoding"; option java_multiple_files = true; diff --git a/proxy/vless/encoding/encoding.go b/proxy/vless/encoding/encoding.go index 7f24c1c2..04b84955 100644 --- a/proxy/vless/encoding/encoding.go +++ b/proxy/vless/encoding/encoding.go @@ -2,21 +2,25 @@ package encoding -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( + "context" "fmt" "io" "syscall" + "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) const ( @@ -174,12 +178,39 @@ func DecodeResponseHeader(reader io.Reader, request *protocol.RequestHeader) (*A return responseAddons, nil } -func ReadV(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn *xtls.Conn, rawConn syscall.RawConn, counter stats.Counter) error { +func ReadV(reader buf.Reader, writer buf.Writer, timer signal.ActivityUpdater, conn *xtls.Conn, rawConn syscall.RawConn, counter stats.Counter, sctx context.Context) error { err := func() error { var ct stats.Counter for { if conn.DirectIn { conn.DirectIn = false + if sctx != nil { + if inbound := session.InboundFromContext(sctx); inbound != nil { + iConn := inbound.Conn + statConn, ok := iConn.(*internet.StatCouterConnection) + if ok { + iConn = statConn.Connection + } + if tc, ok := iConn.(*net.TCPConn); ok { + if conn.SHOW { + fmt.Println(conn.MARK, "Splice") + } + time.Sleep(time.Millisecond) // necessary + w, err := tc.ReadFrom(conn.Connection) + if counter != nil { + counter.Add(w) + } + if statConn != nil && statConn.WriteCounter != nil { + statConn.WriteCounter.Add(w) + } + return err + } else { + panic("XTLS Splice: not TCP inbound") + } + } else { + panic("XTLS Splice: nil inbound") + } + } reader = buf.NewReadVReader(conn.Connection, rawConn) ct = counter if conn.SHOW { diff --git a/proxy/vless/encoding/encoding_test.go b/proxy/vless/encoding/encoding_test.go index 5e5e2812..b8bfa73c 100644 --- a/proxy/vless/encoding/encoding_test.go +++ b/proxy/vless/encoding/encoding_test.go @@ -5,13 +5,13 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vless" - . "github.com/xtls/xray-core/v1/proxy/vless/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vless" + . "github.com/xtls/xray-core/proxy/vless/encoding" ) func toAccount(a *vless.Account) protocol.Account { diff --git a/proxy/vless/encoding/errors.generated.go b/proxy/vless/encoding/errors.generated.go index b12e7ece..267711d9 100644 --- a/proxy/vless/encoding/errors.generated.go +++ b/proxy/vless/encoding/errors.generated.go @@ -1,6 +1,6 @@ package encoding -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/errors.generated.go b/proxy/vless/errors.generated.go index 533d8cb8..9487ff0e 100644 --- a/proxy/vless/errors.generated.go +++ b/proxy/vless/errors.generated.go @@ -1,6 +1,6 @@ package vless -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/inbound/config.pb.go b/proxy/vless/inbound/config.pb.go index 35527fad..a2be91a2 100644 --- a/proxy/vless/inbound/config.pb.go +++ b/proxy/vless/inbound/config.pb.go @@ -8,7 +8,7 @@ package inbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -195,15 +195,14 @@ var file_proxy_vless_inbound_config_proto_rawDesc = []byte{ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, - 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x42, 0x6d, 0x0a, 0x1c, 0x63, + 0x52, 0x09, 0x66, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x42, 0x6a, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, - 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x30, 0x67, + 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, - 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, - 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, - 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, + 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x18, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, + 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/inbound/config.proto b/proxy/vless/inbound/config.proto index 664e0f09..ee24161f 100644 --- a/proxy/vless/inbound/config.proto +++ b/proxy/vless/inbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.inbound; option csharp_namespace = "Xray.Proxy.Vless.Inbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vless/inbound"; option java_package = "com.xray.proxy.vless.inbound"; option java_multiple_files = true; diff --git a/proxy/vless/inbound/errors.generated.go b/proxy/vless/inbound/errors.generated.go index f1f4116f..c2d7295e 100644 --- a/proxy/vless/inbound/errors.generated.go +++ b/proxy/vless/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/inbound/inbound.go b/proxy/vless/inbound/inbound.go index 00df133c..16ab7cd3 100644 --- a/proxy/vless/inbound/inbound.go +++ b/proxy/vless/inbound/inbound.go @@ -2,7 +2,7 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,28 +11,28 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/dns" - feature_inbound "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/encoding" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/dns" + feature_inbound "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/encoding" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( @@ -445,7 +445,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i if statConn != nil { counter = statConn.ReadCounter } - err = encoding.ReadV(clientReader, serverWriter, timer, iConn.(*xtls.Conn), rawConn, counter) + err = encoding.ReadV(clientReader, serverWriter, timer, iConn.(*xtls.Conn), rawConn, counter, nil) } else { // from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer err = buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)) diff --git a/proxy/vless/outbound/config.pb.go b/proxy/vless/outbound/config.pb.go index fc968177..b39657ff 100644 --- a/proxy/vless/outbound/config.pb.go +++ b/proxy/vless/outbound/config.pb.go @@ -8,7 +8,7 @@ package outbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,15 +86,14 @@ var file_proxy_vless_outbound_config_proto_rawDesc = []byte{ 0x6e, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, - 0x52, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x70, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x52, 0x05, 0x76, 0x6e, 0x65, 0x78, 0x74, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6c, 0x65, 0x73, 0x73, 0x2e, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, + 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, - 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, - 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6c, 0x65, 0x73, + 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6c, 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, + 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vless/outbound/config.proto b/proxy/vless/outbound/config.proto index a7a8d0e1..55455cbf 100644 --- a/proxy/vless/outbound/config.proto +++ b/proxy/vless/outbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vless.outbound; option csharp_namespace = "Xray.Proxy.Vless.Outbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vless/outbound"; +option go_package = "github.com/xtls/xray-core/proxy/vless/outbound"; option java_package = "com.xray.proxy.vless.outbound"; option java_multiple_files = true; diff --git a/proxy/vless/outbound/errors.generated.go b/proxy/vless/outbound/errors.generated.go index b6bfdd86..07966823 100644 --- a/proxy/vless/outbound/errors.generated.go +++ b/proxy/vless/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vless/outbound/outbound.go b/proxy/vless/outbound/outbound.go index 937a44cc..84c5e199 100644 --- a/proxy/vless/outbound/outbound.go +++ b/proxy/vless/outbound/outbound.go @@ -2,30 +2,30 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "syscall" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/stats" - "github.com/xtls/xray-core/v1/proxy/vless" - "github.com/xtls/xray-core/v1/proxy/vless/encoding" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/stats" + "github.com/xtls/xray-core/proxy/vless" + "github.com/xtls/xray-core/proxy/vless/encoding" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( @@ -128,14 +128,15 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte } var rawConn syscall.RawConn + var sctx context.Context allowUDP443 := false switch requestAddons.Flow { - case vless.XRO + "-udp443", vless.XRD + "-udp443": + case vless.XRO + "-udp443", vless.XRD + "-udp443", vless.XRS + "-udp443": allowUDP443 = true requestAddons.Flow = requestAddons.Flow[:16] fallthrough - case vless.XRO, vless.XRD: + case vless.XRO, vless.XRD, vless.XRS: switch request.Command { case protocol.RequestCommandMux: return newError(requestAddons.Flow + " doesn't support Mux").AtWarning() @@ -149,6 +150,10 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte xtlsConn.RPRX = true xtlsConn.SHOW = xtls_show xtlsConn.MARK = "XTLS" + if requestAddons.Flow == vless.XRS { + sctx = ctx + requestAddons.Flow = vless.XRD + } if requestAddons.Flow == vless.XRD { xtlsConn.DirectMode = true if sc, ok := xtlsConn.Connection.(syscall.Conn); ok { @@ -219,7 +224,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte if statConn != nil { counter = statConn.ReadCounter } - err = encoding.ReadV(serverReader, clientWriter, timer, iConn.(*xtls.Conn), rawConn, counter) + err = encoding.ReadV(serverReader, clientWriter, timer, iConn.(*xtls.Conn), rawConn, counter, sctx) } else { // from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer err = buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)) diff --git a/proxy/vless/validator.go b/proxy/vless/validator.go index 41566fe3..663ba49f 100644 --- a/proxy/vless/validator.go +++ b/proxy/vless/validator.go @@ -6,8 +6,8 @@ import ( "strings" "sync" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // Validator stores valid VLESS users. diff --git a/proxy/vless/vless.go b/proxy/vless/vless.go index f4026804..a9e847ec 100644 --- a/proxy/vless/vless.go +++ b/proxy/vless/vless.go @@ -5,9 +5,10 @@ // clients with 'socks' for proxying. package vless -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const ( XRO = "xtls-rprx-origin" XRD = "xtls-rprx-direct" + XRS = "xtls-rprx-splice" ) diff --git a/proxy/vmess/account.go b/proxy/vmess/account.go index a9917e4c..eaf104bc 100644 --- a/proxy/vmess/account.go +++ b/proxy/vmess/account.go @@ -3,9 +3,9 @@ package vmess import ( - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" ) // MemoryAccount is an in-memory form of VMess account. diff --git a/proxy/vmess/account.pb.go b/proxy/vmess/account.pb.go index 0772f339..74339fe6 100644 --- a/proxy/vmess/account.pb.go +++ b/proxy/vmess/account.pb.go @@ -8,7 +8,7 @@ package vmess import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -120,13 +120,13 @@ var file_proxy_vmess_account_proto_rawDesc = []byte{ 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, - 0x65, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x55, 0x0a, 0x14, 0x63, + 0x65, 0x73, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x42, 0x52, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, - 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x65, 0x73, 0x73, 0x50, 0x01, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0xaa, - 0x02, 0x10, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, - 0x73, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0xaa, 0x02, 0x10, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, 0x73, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vmess/account.proto b/proxy/vmess/account.proto index 1572d268..98dc681e 100644 --- a/proxy/vmess/account.proto +++ b/proxy/vmess/account.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess; option csharp_namespace = "Xray.Proxy.Vmess"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess"; +option go_package = "github.com/xtls/xray-core/proxy/vmess"; option java_package = "com.xray.proxy.vmess"; option java_multiple_files = true; diff --git a/proxy/vmess/aead/authid.go b/proxy/vmess/aead/authid.go index c744a8ce..2ec48f11 100644 --- a/proxy/vmess/aead/authid.go +++ b/proxy/vmess/aead/authid.go @@ -12,8 +12,8 @@ import ( "math" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/antireplay" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/antireplay" ) var ( diff --git a/proxy/vmess/aead/encrypt.go b/proxy/vmess/aead/encrypt.go index bcdf922d..bd7df0ec 100644 --- a/proxy/vmess/aead/encrypt.go +++ b/proxy/vmess/aead/encrypt.go @@ -9,7 +9,7 @@ import ( "io" "time" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func SealVMessAEADHeader(key [16]byte, data []byte) []byte { diff --git a/proxy/vmess/encoding/auth.go b/proxy/vmess/encoding/auth.go index a6e3dc2f..1761238c 100644 --- a/proxy/vmess/encoding/auth.go +++ b/proxy/vmess/encoding/auth.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "hash/fnv" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" "golang.org/x/crypto/sha3" ) diff --git a/proxy/vmess/encoding/auth_test.go b/proxy/vmess/encoding/auth_test.go index b841901c..87e414c1 100644 --- a/proxy/vmess/encoding/auth_test.go +++ b/proxy/vmess/encoding/auth_test.go @@ -6,8 +6,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func TestFnvAuth(t *testing.T) { diff --git a/proxy/vmess/encoding/client.go b/proxy/vmess/encoding/client.go index b9161c78..d46e8fb6 100644 --- a/proxy/vmess/encoding/client.go +++ b/proxy/vmess/encoding/client.go @@ -15,15 +15,15 @@ import ( "golang.org/x/crypto/chacha20poly1305" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/proxy/vmess" - vmessaead "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/proxy/vmess" + vmessaead "github.com/xtls/xray-core/proxy/vmess/aead" ) func hashTimestamp(h hash.Hash, t protocol.Timestamp) []byte { diff --git a/proxy/vmess/encoding/commands.go b/proxy/vmess/encoding/commands.go index 305b7fb2..c71d6460 100644 --- a/proxy/vmess/encoding/commands.go +++ b/proxy/vmess/encoding/commands.go @@ -4,12 +4,12 @@ import ( "encoding/binary" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" ) var ( diff --git a/proxy/vmess/encoding/commands_test.go b/proxy/vmess/encoding/commands_test.go index b29de3c0..12acfba4 100644 --- a/proxy/vmess/encoding/commands_test.go +++ b/proxy/vmess/encoding/commands_test.go @@ -5,11 +5,11 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func TestSwitchAccount(t *testing.T) { diff --git a/proxy/vmess/encoding/encoding.go b/proxy/vmess/encoding/encoding.go index f69ec74f..6a93dd12 100644 --- a/proxy/vmess/encoding/encoding.go +++ b/proxy/vmess/encoding/encoding.go @@ -1,11 +1,11 @@ package encoding import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const ( Version = byte(1) diff --git a/proxy/vmess/encoding/encoding_test.go b/proxy/vmess/encoding/encoding_test.go index 5dd9ed5d..c136731e 100644 --- a/proxy/vmess/encoding/encoding_test.go +++ b/proxy/vmess/encoding/encoding_test.go @@ -6,13 +6,13 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/proxy/vmess" - . "github.com/xtls/xray-core/v1/proxy/vmess/encoding" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/proxy/vmess" + . "github.com/xtls/xray-core/proxy/vmess/encoding" ) func toAccount(a *vmess.Account) protocol.Account { diff --git a/proxy/vmess/encoding/errors.generated.go b/proxy/vmess/encoding/errors.generated.go index b12e7ece..267711d9 100644 --- a/proxy/vmess/encoding/errors.generated.go +++ b/proxy/vmess/encoding/errors.generated.go @@ -1,6 +1,6 @@ package encoding -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/encoding/server.go b/proxy/vmess/encoding/server.go index b4995908..9951919f 100644 --- a/proxy/vmess/encoding/server.go +++ b/proxy/vmess/encoding/server.go @@ -13,16 +13,16 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/bitmask" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/crypto" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy/vmess" - vmessaead "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/bitmask" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/crypto" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy/vmess" + vmessaead "github.com/xtls/xray-core/proxy/vmess/aead" "golang.org/x/crypto/chacha20poly1305" ) diff --git a/proxy/vmess/errors.generated.go b/proxy/vmess/errors.generated.go index bf5f70da..29d69d74 100644 --- a/proxy/vmess/errors.generated.go +++ b/proxy/vmess/errors.generated.go @@ -1,6 +1,6 @@ package vmess -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/inbound/config.pb.go b/proxy/vmess/inbound/config.pb.go index 36fa1660..b1a52ac4 100644 --- a/proxy/vmess/inbound/config.pb.go +++ b/proxy/vmess/inbound/config.pb.go @@ -8,7 +8,7 @@ package inbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -228,15 +228,15 @@ var file_proxy_vmess_inbound_config_proto_rawDesc = []byte{ 0x52, 0x06, 0x64, 0x65, 0x74, 0x6f, 0x75, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, - 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x6d, + 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x6e, 0x6c, 0x79, 0x42, 0x6a, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0xaa, 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x56, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0xaa, + 0x02, 0x18, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, 0x65, + 0x73, 0x73, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/proxy/vmess/inbound/config.proto b/proxy/vmess/inbound/config.proto index 0d901424..9fc7e36f 100644 --- a/proxy/vmess/inbound/config.proto +++ b/proxy/vmess/inbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess.inbound; option csharp_namespace = "Xray.Proxy.Vmess.Inbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess/inbound"; +option go_package = "github.com/xtls/xray-core/proxy/vmess/inbound"; option java_package = "com.xray.proxy.vmess.inbound"; option java_multiple_files = true; diff --git a/proxy/vmess/inbound/errors.generated.go b/proxy/vmess/inbound/errors.generated.go index f1f4116f..c2d7295e 100644 --- a/proxy/vmess/inbound/errors.generated.go +++ b/proxy/vmess/inbound/errors.generated.go @@ -1,6 +1,6 @@ package inbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/inbound/inbound.go b/proxy/vmess/inbound/inbound.go index 182def61..af362e18 100644 --- a/proxy/vmess/inbound/inbound.go +++ b/proxy/vmess/inbound/inbound.go @@ -2,7 +2,7 @@ package inbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" @@ -11,23 +11,23 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - feature_inbound "github.com/xtls/xray-core/v1/features/inbound" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/encoding" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + feature_inbound "github.com/xtls/xray-core/features/inbound" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/encoding" + "github.com/xtls/xray-core/transport/internet" ) type userByEmail struct { diff --git a/proxy/vmess/outbound/command.go b/proxy/vmess/outbound/command.go index bd45cfcd..19a7877b 100644 --- a/proxy/vmess/outbound/command.go +++ b/proxy/vmess/outbound/command.go @@ -5,10 +5,10 @@ package outbound import ( "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/proxy/vmess" ) func (h *Handler) handleSwitchAccount(cmd *protocol.CommandSwitchAccount) { diff --git a/proxy/vmess/outbound/config.pb.go b/proxy/vmess/outbound/config.pb.go index 1812818d..7a6783bb 100644 --- a/proxy/vmess/outbound/config.pb.go +++ b/proxy/vmess/outbound/config.pb.go @@ -8,7 +8,7 @@ package outbound import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" + protocol "github.com/xtls/xray-core/common/protocol" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -86,15 +86,15 @@ var file_proxy_vmess_outbound_config_proto_rawDesc = []byte{ 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6e, 0x64, 0x70, 0x6f, - 0x69, 0x6e, 0x74, 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x42, 0x70, 0x0a, + 0x69, 0x6e, 0x74, 0x52, 0x08, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x42, 0x6d, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x01, - 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, - 0x75, 0x6e, 0x64, 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x56, 0x6d, 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x76, 0x6d, 0x65, 0x73, 0x73, 0x2f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, + 0xaa, 0x02, 0x19, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x56, 0x6d, + 0x65, 0x73, 0x73, 0x2e, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proxy/vmess/outbound/config.proto b/proxy/vmess/outbound/config.proto index 0ac0f410..2a827158 100644 --- a/proxy/vmess/outbound/config.proto +++ b/proxy/vmess/outbound/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.proxy.vmess.outbound; option csharp_namespace = "Xray.Proxy.Vmess.Outbound"; -option go_package = "github.com/xtls/xray-core/v1/proxy/vmess/outbound"; +option go_package = "github.com/xtls/xray-core/proxy/vmess/outbound"; option java_package = "com.xray.proxy.vmess.outbound"; option java_multiple_files = true; diff --git a/proxy/vmess/outbound/errors.generated.go b/proxy/vmess/outbound/errors.generated.go index b6bfdd86..07966823 100644 --- a/proxy/vmess/outbound/errors.generated.go +++ b/proxy/vmess/outbound/errors.generated.go @@ -1,6 +1,6 @@ package outbound -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index 148f85ea..56ef4993 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -2,27 +2,27 @@ package outbound -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "context" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/platform" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/task" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/features/policy" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/encoding" - "github.com/xtls/xray-core/v1/transport" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/platform" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/task" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/features/policy" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/encoding" + "github.com/xtls/xray-core/transport" + "github.com/xtls/xray-core/transport/internet" ) // Handler is an outbound connection handler for VMess protocol. diff --git a/proxy/vmess/validator.go b/proxy/vmess/validator.go index c1cc256f..86089de2 100644 --- a/proxy/vmess/validator.go +++ b/proxy/vmess/validator.go @@ -11,12 +11,12 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/proxy/vmess/aead" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/proxy/vmess/aead" ) const ( diff --git a/proxy/vmess/validator_test.go b/proxy/vmess/validator_test.go index 0a22ea31..634b4e23 100644 --- a/proxy/vmess/validator_test.go +++ b/proxy/vmess/validator_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - . "github.com/xtls/xray-core/v1/proxy/vmess" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + . "github.com/xtls/xray-core/proxy/vmess" ) func toAccount(a *Account) protocol.Account { diff --git a/proxy/vmess/vmess.go b/proxy/vmess/vmess.go index d58abca7..836b1889 100644 --- a/proxy/vmess/vmess.go +++ b/proxy/vmess/vmess.go @@ -5,4 +5,4 @@ // clients with 'socks' for proxying. package vmess -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/testing/mocks/dns.go b/testing/mocks/dns.go index 8b1776df..98267107 100644 --- a/testing/mocks/dns.go +++ b/testing/mocks/dns.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/features/dns (interfaces: Client) +// Source: github.com/xtls/xray-core/features/dns (interfaces: Client) // Package mocks is a generated GoMock package. package mocks diff --git a/testing/mocks/log.go b/testing/mocks/log.go index 94bab43e..77c821f5 100644 --- a/testing/mocks/log.go +++ b/testing/mocks/log.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/common/log (interfaces: Handler) +// Source: github.com/xtls/xray-core/common/log (interfaces: Handler) // Package mocks is a generated GoMock package. package mocks import ( gomock "github.com/golang/mock/gomock" - log "github.com/xtls/xray-core/v1/common/log" + log "github.com/xtls/xray-core/common/log" reflect "reflect" ) diff --git a/testing/mocks/mux.go b/testing/mocks/mux.go index 18464dba..07d4c4ad 100644 --- a/testing/mocks/mux.go +++ b/testing/mocks/mux.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/common/mux (interfaces: ClientWorkerFactory) +// Source: github.com/xtls/xray-core/common/mux (interfaces: ClientWorkerFactory) // Package mocks is a generated GoMock package. package mocks import ( gomock "github.com/golang/mock/gomock" - mux "github.com/xtls/xray-core/v1/common/mux" + mux "github.com/xtls/xray-core/common/mux" reflect "reflect" ) diff --git a/testing/mocks/outbound.go b/testing/mocks/outbound.go index fd370c29..9cab8c34 100644 --- a/testing/mocks/outbound.go +++ b/testing/mocks/outbound.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/features/outbound (interfaces: Manager,HandlerSelector) +// Source: github.com/xtls/xray-core/features/outbound (interfaces: Manager,HandlerSelector) // Package mocks is a generated GoMock package. package mocks @@ -7,7 +7,7 @@ package mocks import ( context "context" gomock "github.com/golang/mock/gomock" - outbound "github.com/xtls/xray-core/v1/features/outbound" + outbound "github.com/xtls/xray-core/features/outbound" reflect "reflect" ) diff --git a/testing/mocks/proxy.go b/testing/mocks/proxy.go index e8a1fe35..cba5b3ca 100644 --- a/testing/mocks/proxy.go +++ b/testing/mocks/proxy.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/xtls/xray-core/v1/proxy (interfaces: Inbound,Outbound) +// Source: github.com/xtls/xray-core/proxy (interfaces: Inbound,Outbound) // Package mocks is a generated GoMock package. package mocks @@ -7,10 +7,10 @@ package mocks import ( context "context" gomock "github.com/golang/mock/gomock" - net "github.com/xtls/xray-core/v1/common/net" - routing "github.com/xtls/xray-core/v1/features/routing" - transport "github.com/xtls/xray-core/v1/transport" - internet "github.com/xtls/xray-core/v1/transport/internet" + net "github.com/xtls/xray-core/common/net" + routing "github.com/xtls/xray-core/features/routing" + transport "github.com/xtls/xray-core/transport" + internet "github.com/xtls/xray-core/transport/internet" reflect "reflect" ) diff --git a/testing/scenarios/command_test.go b/testing/scenarios/command_test.go index cd7dc0c8..7e5f1ef8 100644 --- a/testing/scenarios/command_test.go +++ b/testing/scenarios/command_test.go @@ -12,25 +12,25 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "google.golang.org/grpc" - "github.com/xtls/xray-core/v1/app/commander" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/proxyman/command" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/app/stats" - statscmd "github.com/xtls/xray-core/v1/app/stats/command" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/commander" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/proxyman/command" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/app/stats" + statscmd "github.com/xtls/xray-core/app/stats/command" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestCommanderRemoveHandler(t *testing.T) { diff --git a/testing/scenarios/common.go b/testing/scenarios/common.go index 364e376b..2a7cbfd0 100644 --- a/testing/scenarios/common.go +++ b/testing/scenarios/common.go @@ -14,15 +14,15 @@ import ( "time" "github.com/golang/protobuf/proto" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/retry" - "github.com/xtls/xray-core/v1/common/serial" - core "github.com/xtls/xray-core/v1/core" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/retry" + "github.com/xtls/xray-core/common/serial" + core "github.com/xtls/xray-core/core" ) func xor(b []byte) []byte { diff --git a/testing/scenarios/common_coverage.go b/testing/scenarios/common_coverage.go index 0082097d..aa4b7968 100644 --- a/testing/scenarios/common_coverage.go +++ b/testing/scenarios/common_coverage.go @@ -7,7 +7,7 @@ import ( "os" "os/exec" - "github.com/xtls/xray-core/v1/common/uuid" + "github.com/xtls/xray-core/common/uuid" ) func BuildXray() error { @@ -16,7 +16,7 @@ func BuildXray() error { return nil } - cmd := exec.Command("go", "test", "-tags", "coverage coveragemain", "-coverpkg", "github.com/xtls/xray-core/v1/...", "-c", "-o", testBinaryPath, GetSourcePath()) + cmd := exec.Command("go", "test", "-tags", "coverage coveragemain", "-coverpkg", "github.com/xtls/xray-core/...", "-c", "-o", testBinaryPath, GetSourcePath()) return cmd.Run() } diff --git a/testing/scenarios/dns_test.go b/testing/scenarios/dns_test.go index 1b289bc9..886068d7 100644 --- a/testing/scenarios/dns_test.go +++ b/testing/scenarios/dns_test.go @@ -5,17 +5,17 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/dns" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/dns" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/testing/servers/tcp" xproxy "golang.org/x/net/proxy" ) diff --git a/testing/scenarios/dokodemo_test.go b/testing/scenarios/dokodemo_test.go index 7a73ee5e..ac8dda90 100644 --- a/testing/scenarios/dokodemo_test.go +++ b/testing/scenarios/dokodemo_test.go @@ -6,22 +6,22 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestDokodemoTCP(t *testing.T) { diff --git a/testing/scenarios/feature_test.go b/testing/scenarios/feature_test.go index d49bb689..3977606d 100644 --- a/testing/scenarios/feature_test.go +++ b/testing/scenarios/feature_test.go @@ -8,30 +8,30 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/dispatcher" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - _ "github.com/xtls/xray-core/v1/app/proxyman/inbound" - _ "github.com/xtls/xray-core/v1/app/proxyman/outbound" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - v2http "github.com/xtls/xray-core/v1/proxy/http" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/app/dispatcher" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + _ "github.com/xtls/xray-core/app/proxyman/inbound" + _ "github.com/xtls/xray-core/app/proxyman/outbound" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + v2http "github.com/xtls/xray-core/proxy/http" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" xproxy "golang.org/x/net/proxy" ) diff --git a/testing/scenarios/http_test.go b/testing/scenarios/http_test.go index d89b31b8..4ab8b812 100644 --- a/testing/scenarios/http_test.go +++ b/testing/scenarios/http_test.go @@ -13,16 +13,16 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/freedom" - v2http "github.com/xtls/xray-core/v1/proxy/http" - v2httptest "github.com/xtls/xray-core/v1/testing/servers/http" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/freedom" + v2http "github.com/xtls/xray-core/proxy/http" + v2httptest "github.com/xtls/xray-core/testing/servers/http" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestHttpConformance(t *testing.T) { diff --git a/testing/scenarios/policy_test.go b/testing/scenarios/policy_test.go index dcf807d8..de744389 100644 --- a/testing/scenarios/policy_test.go +++ b/testing/scenarios/policy_test.go @@ -7,22 +7,22 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func startQuickClosingTCPServer() (net.Listener, error) { diff --git a/testing/scenarios/reverse_test.go b/testing/scenarios/reverse_test.go index 50f22733..cbe9abdf 100644 --- a/testing/scenarios/reverse_test.go +++ b/testing/scenarios/reverse_test.go @@ -6,25 +6,25 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/policy" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/reverse" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/policy" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/reverse" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" ) func TestReverseProxy(t *testing.T) { diff --git a/testing/scenarios/shadowsocks_test.go b/testing/scenarios/shadowsocks_test.go index db2f0b23..de842afc 100644 --- a/testing/scenarios/shadowsocks_test.go +++ b/testing/scenarios/shadowsocks_test.go @@ -8,20 +8,20 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/shadowsocks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/shadowsocks" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestShadowsocksAES256TCP(t *testing.T) { diff --git a/testing/scenarios/socks_test.go b/testing/scenarios/socks_test.go index 913291d2..72da1d84 100644 --- a/testing/scenarios/socks_test.go +++ b/testing/scenarios/socks_test.go @@ -7,19 +7,19 @@ import ( xproxy "golang.org/x/net/proxy" socks4 "h12.io/socks" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/app/router" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/blackhole" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/socks" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/app/router" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/blackhole" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/socks" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" ) func TestSocksBridgeTCP(t *testing.T) { diff --git a/testing/scenarios/tls_test.go b/testing/scenarios/tls_test.go index d2531c1f..c81e5122 100644 --- a/testing/scenarios/tls_test.go +++ b/testing/scenarios/tls_test.go @@ -8,25 +8,25 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/websocket" ) func TestSimpleTLSConnection(t *testing.T) { diff --git a/testing/scenarios/transport_test.go b/testing/scenarios/transport_test.go index b46a4f65..5ffd4569 100644 --- a/testing/scenarios/transport_test.go +++ b/testing/scenarios/transport_test.go @@ -8,27 +8,27 @@ import ( "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/domainsocket" - "github.com/xtls/xray-core/v1/transport/internet/headers/http" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/quic" - tcptransport "github.com/xtls/xray-core/v1/transport/internet/tcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/domainsocket" + "github.com/xtls/xray-core/transport/internet/headers/http" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/quic" + tcptransport "github.com/xtls/xray-core/transport/internet/tcp" ) func TestHTTPConnectionHeader(t *testing.T) { diff --git a/testing/scenarios/vmess_test.go b/testing/scenarios/vmess_test.go index 4c1772dc..0bec333c 100644 --- a/testing/scenarios/vmess_test.go +++ b/testing/scenarios/vmess_test.go @@ -5,24 +5,24 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/app/log" - "github.com/xtls/xray-core/v1/app/proxyman" - "github.com/xtls/xray-core/v1/common" - clog "github.com/xtls/xray-core/v1/common/log" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/uuid" - core "github.com/xtls/xray-core/v1/core" - "github.com/xtls/xray-core/v1/proxy/dokodemo" - "github.com/xtls/xray-core/v1/proxy/freedom" - "github.com/xtls/xray-core/v1/proxy/vmess" - "github.com/xtls/xray-core/v1/proxy/vmess/inbound" - "github.com/xtls/xray-core/v1/proxy/vmess/outbound" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/app/log" + "github.com/xtls/xray-core/app/proxyman" + "github.com/xtls/xray-core/common" + clog "github.com/xtls/xray-core/common/log" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/uuid" + core "github.com/xtls/xray-core/core" + "github.com/xtls/xray-core/proxy/dokodemo" + "github.com/xtls/xray-core/proxy/freedom" + "github.com/xtls/xray-core/proxy/vmess" + "github.com/xtls/xray-core/proxy/vmess/inbound" + "github.com/xtls/xray-core/proxy/vmess/outbound" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/kcp" "golang.org/x/sync/errgroup" ) diff --git a/testing/servers/http/http.go b/testing/servers/http/http.go index 8d76809e..dabd6a2a 100644 --- a/testing/servers/http/http.go +++ b/testing/servers/http/http.go @@ -3,7 +3,7 @@ package tcp import ( "net/http" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type Server struct { diff --git a/testing/servers/tcp/port.go b/testing/servers/tcp/port.go index fe99ad24..67f85c87 100644 --- a/testing/servers/tcp/port.go +++ b/testing/servers/tcp/port.go @@ -1,8 +1,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) // PickPort returns an unused TCP port in the system. The port returned is highly likely to be unused, but not guaranteed. diff --git a/testing/servers/tcp/tcp.go b/testing/servers/tcp/tcp.go index 04443c58..484f2d76 100644 --- a/testing/servers/tcp/tcp.go +++ b/testing/servers/tcp/tcp.go @@ -5,11 +5,11 @@ import ( "fmt" "io" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/pipe" ) type Server struct { diff --git a/testing/servers/udp/port.go b/testing/servers/udp/port.go index 51e3559e..ca8d3e47 100644 --- a/testing/servers/udp/port.go +++ b/testing/servers/udp/port.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" ) // PickPort returns an unused UDP port in the system. The port returned is highly likely to be unused, but not guaranteed. diff --git a/testing/servers/udp/udp.go b/testing/servers/udp/udp.go index 9e9f0671..c927d5e0 100644 --- a/testing/servers/udp/udp.go +++ b/testing/servers/udp/udp.go @@ -3,7 +3,7 @@ package udp import ( "fmt" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) type Server struct { diff --git a/transport/config.go b/transport/config.go index b25bb537..c4a6c124 100644 --- a/transport/config.go +++ b/transport/config.go @@ -1,7 +1,7 @@ package transport import ( - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/transport/internet" ) // Apply applies this Config. diff --git a/transport/config.pb.go b/transport/config.pb.go index 2918d120..adc76565 100644 --- a/transport/config.pb.go +++ b/transport/config.pb.go @@ -8,7 +8,7 @@ package transport import ( proto "github.com/golang/protobuf/proto" - internet "github.com/xtls/xray-core/v1/transport/internet" + internet "github.com/xtls/xray-core/transport/internet" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -91,12 +91,12 @@ var file_transport_config_proto_rawDesc = []byte{ 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x3a, 0x02, 0x18, 0x01, - 0x42, 0x4f, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x42, 0x4c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x01, 0x5a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0xaa, 0x02, 0x0e, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0xaa, 0x02, 0x0e, + 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/config.proto b/transport/config.proto index b71a9914..2380307d 100644 --- a/transport/config.proto +++ b/transport/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport; option csharp_namespace = "Xray.Transport"; -option go_package = "github.com/xtls/xray-core/v1/transport"; +option go_package = "github.com/xtls/xray-core/transport"; option java_package = "com.xray.transport"; option java_multiple_files = true; diff --git a/transport/internet/config.go b/transport/internet/config.go index 74db07c7..a7ff96c6 100644 --- a/transport/internet/config.go +++ b/transport/internet/config.go @@ -1,8 +1,8 @@ package internet import ( - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/features" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/features" ) type ConfigCreator func() interface{} diff --git a/transport/internet/config.pb.go b/transport/internet/config.pb.go index e80031fc..3ed6b6e5 100644 --- a/transport/internet/config.pb.go +++ b/transport/internet/config.pb.go @@ -8,7 +8,7 @@ package internet import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -584,14 +584,14 @@ var file_transport_internet_config_proto_rawDesc = []byte{ 0x08, 0x0a, 0x04, 0x4d, 0x4b, 0x43, 0x50, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, - 0x65, 0x74, 0x10, 0x05, 0x42, 0x6a, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, + 0x65, 0x74, 0x10, 0x05, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/config.proto b/transport/internet/config.proto index d6dc354e..c45aa3a1 100644 --- a/transport/internet/config.proto +++ b/transport/internet/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet; option csharp_namespace = "Xray.Transport.Internet"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet"; +option go_package = "github.com/xtls/xray-core/transport/internet"; option java_package = "com.xray.transport.internet"; option java_multiple_files = true; diff --git a/transport/internet/connection.go b/transport/internet/connection.go index 1f083142..4c04f89e 100644 --- a/transport/internet/connection.go +++ b/transport/internet/connection.go @@ -3,7 +3,7 @@ package internet import ( "net" - "github.com/xtls/xray-core/v1/features/stats" + "github.com/xtls/xray-core/features/stats" ) type Connection interface { diff --git a/transport/internet/dialer.go b/transport/internet/dialer.go index cfd40c93..5c13b799 100644 --- a/transport/internet/dialer.go +++ b/transport/internet/dialer.go @@ -3,8 +3,8 @@ package internet import ( "context" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) // Dialer is the interface for dialing outbound connections. diff --git a/transport/internet/dialer_test.go b/transport/internet/dialer_test.go index 793c60b6..232ee709 100644 --- a/transport/internet/dialer_test.go +++ b/transport/internet/dialer_test.go @@ -6,10 +6,10 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestDialWithLocalAddr(t *testing.T) { diff --git a/transport/internet/domainsocket/config.go b/transport/internet/domainsocket/config.go index 68dc60a9..950246dd 100644 --- a/transport/internet/domainsocket/config.go +++ b/transport/internet/domainsocket/config.go @@ -3,9 +3,9 @@ package domainsocket import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "domainsocket" diff --git a/transport/internet/domainsocket/config.pb.go b/transport/internet/domainsocket/config.pb.go index 3aff9d64..0334e109 100644 --- a/transport/internet/domainsocket/config.pb.go +++ b/transport/internet/domainsocket/config.pb.go @@ -108,17 +108,17 @@ var file_transport_internet_domainsocket_config_proto_rawDesc = []byte{ 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x91, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, + 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, - 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, - 0x6f, 0x63, 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x6f, 0x63, 0x6b, + 0x65, 0x74, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, + 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/transport/internet/domainsocket/config.proto b/transport/internet/domainsocket/config.proto index dcefa75d..900dbbe3 100644 --- a/transport/internet/domainsocket/config.proto +++ b/transport/internet/domainsocket/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.domainsocket; option csharp_namespace = "Xray.Transport.Internet.DomainSocket"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/domainsocket"; +option go_package = "github.com/xtls/xray-core/transport/internet/domainsocket"; option java_package = "com.xray.transport.internet.domainsocket"; option java_multiple_files = true; diff --git a/transport/internet/domainsocket/dial.go b/transport/internet/domainsocket/dial.go index 86e144ff..ea3ad609 100644 --- a/transport/internet/domainsocket/dial.go +++ b/transport/internet/domainsocket/dial.go @@ -7,11 +7,11 @@ package domainsocket import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.MemoryStreamConfig) (internet.Connection, error) { diff --git a/transport/internet/domainsocket/errgen.go b/transport/internet/domainsocket/errgen.go index 3df24e14..83ac04d0 100644 --- a/transport/internet/domainsocket/errgen.go +++ b/transport/internet/domainsocket/errgen.go @@ -1,3 +1,3 @@ package domainsocket -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/domainsocket/errors.generated.go b/transport/internet/domainsocket/errors.generated.go index ff14bd14..451b1aa6 100644 --- a/transport/internet/domainsocket/errors.generated.go +++ b/transport/internet/domainsocket/errors.generated.go @@ -1,6 +1,6 @@ package domainsocket -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/domainsocket/listener.go b/transport/internet/domainsocket/listener.go index 60827076..25cf75fd 100644 --- a/transport/internet/domainsocket/listener.go +++ b/transport/internet/domainsocket/listener.go @@ -13,11 +13,11 @@ import ( goxtls "github.com/xtls/go" "golang.org/x/sys/unix" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) type Listener struct { diff --git a/transport/internet/domainsocket/listener_test.go b/transport/internet/domainsocket/listener_test.go index 662d45d1..ee8f4a0b 100644 --- a/transport/internet/domainsocket/listener_test.go +++ b/transport/internet/domainsocket/listener_test.go @@ -7,11 +7,11 @@ import ( "runtime" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/domainsocket" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/domainsocket" ) func TestListen(t *testing.T) { diff --git a/transport/internet/errors.generated.go b/transport/internet/errors.generated.go index b1390705..caf158a1 100644 --- a/transport/internet/errors.generated.go +++ b/transport/internet/errors.generated.go @@ -1,6 +1,6 @@ package internet -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/header.go b/transport/internet/header.go index 6e7ed4e0..1fc67133 100644 --- a/transport/internet/header.go +++ b/transport/internet/header.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type PacketHeader interface { diff --git a/transport/internet/header_test.go b/transport/internet/header_test.go index 587339eb..e87ee784 100644 --- a/transport/internet/header_test.go +++ b/transport/internet/header_test.go @@ -3,13 +3,13 @@ package internet_test import ( "testing" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/noop" - "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" - "github.com/xtls/xray-core/v1/transport/internet/headers/utp" - "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/noop" + "github.com/xtls/xray-core/transport/internet/headers/srtp" + "github.com/xtls/xray-core/transport/internet/headers/utp" + "github.com/xtls/xray-core/transport/internet/headers/wechat" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" ) func TestAllHeadersLoadable(t *testing.T) { diff --git a/transport/internet/headers/http/config.go b/transport/internet/headers/http/config.go index 2778e364..baa69663 100644 --- a/transport/internet/headers/http/config.go +++ b/transport/internet/headers/http/config.go @@ -3,7 +3,7 @@ package http import ( "strings" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common/dice" ) func pickString(arr []string) string { diff --git a/transport/internet/headers/http/config.pb.go b/transport/internet/headers/http/config.pb.go index 6bfdb07d..f370a968 100644 --- a/transport/internet/headers/http/config.pb.go +++ b/transport/internet/headers/http/config.pb.go @@ -491,17 +491,17 @@ var file_transport_internet_headers_http_config_proto_rawDesc = []byte{ 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x91, 0x01, 0x0a, + 0x69, 0x67, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, + 0x64, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, - 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, - 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x48, 0x74, 0x74, 0x70, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, + 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/http/config.proto b/transport/internet/headers/http/config.proto index 9e09871e..c7659371 100644 --- a/transport/internet/headers/http/config.proto +++ b/transport/internet/headers/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.http; option csharp_namespace = "Xray.Transport.Internet.Headers.Http"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/http"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/http"; option java_package = "com.xray.transport.internet.headers.http"; option java_multiple_files = true; diff --git a/transport/internet/headers/http/errors.generated.go b/transport/internet/headers/http/errors.generated.go index b07b3fec..f0048165 100644 --- a/transport/internet/headers/http/errors.generated.go +++ b/transport/internet/headers/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/headers/http/http.go b/transport/internet/headers/http/http.go index c6be0487..8b9340de 100644 --- a/transport/internet/headers/http/http.go +++ b/transport/internet/headers/http/http.go @@ -1,6 +1,6 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen import ( "bufio" @@ -12,8 +12,8 @@ import ( "strings" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" ) const ( diff --git a/transport/internet/headers/http/http_test.go b/transport/internet/headers/http/http_test.go index 6a5540df..8591a199 100644 --- a/transport/internet/headers/http/http_test.go +++ b/transport/internet/headers/http/http_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - . "github.com/xtls/xray-core/v1/transport/internet/headers/http" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + . "github.com/xtls/xray-core/transport/internet/headers/http" ) func TestReaderWriter(t *testing.T) { diff --git a/transport/internet/headers/noop/config.pb.go b/transport/internet/headers/noop/config.pb.go index fc6f3399..d8cce354 100644 --- a/transport/internet/headers/noop/config.pb.go +++ b/transport/internet/headers/noop/config.pb.go @@ -111,16 +111,16 @@ var file_transport_internet_headers_noop_config_proto_rawDesc = []byte{ 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x91, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x69, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x50, - 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, 0x70, 0xaa, - 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2e, 0x4e, 0x6f, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x6e, 0x6f, 0x6f, 0x70, 0xaa, 0x02, 0x24, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x4e, + 0x6f, 0x6f, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/noop/config.proto b/transport/internet/headers/noop/config.proto index 0b63cc26..f23bc0a8 100644 --- a/transport/internet/headers/noop/config.proto +++ b/transport/internet/headers/noop/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.noop; option csharp_namespace = "Xray.Transport.Internet.Headers.Noop"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/noop"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/noop"; option java_package = "com.xray.transport.internet.headers.noop"; option java_multiple_files = true; diff --git a/transport/internet/headers/noop/noop.go b/transport/internet/headers/noop/noop.go index 76413612..90dae2ed 100644 --- a/transport/internet/headers/noop/noop.go +++ b/transport/internet/headers/noop/noop.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type NoOpHeader struct{} diff --git a/transport/internet/headers/srtp/config.pb.go b/transport/internet/headers/srtp/config.pb.go index e48cb176..300e4504 100644 --- a/transport/internet/headers/srtp/config.pb.go +++ b/transport/internet/headers/srtp/config.pb.go @@ -131,17 +131,17 @@ var file_transport_internet_headers_srtp_config_proto_rawDesc = []byte{ 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x42, 0x91, 0x01, 0x0a, 0x28, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x42, 0x8e, 0x01, 0x0a, 0x28, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x73, 0x72, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3c, 0x67, 0x69, 0x74, 0x68, + 0x65, 0x72, 0x73, 0x2e, 0x73, 0x72, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2f, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x72, 0x74, 0x70, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x2f, 0x73, 0x72, 0x74, 0x70, 0xaa, 0x02, 0x24, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x53, 0x72, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/srtp/config.proto b/transport/internet/headers/srtp/config.proto index e7a4c662..491e299c 100644 --- a/transport/internet/headers/srtp/config.proto +++ b/transport/internet/headers/srtp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.srtp; option csharp_namespace = "Xray.Transport.Internet.Headers.Srtp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/srtp"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/srtp"; option java_package = "com.xray.transport.internet.headers.srtp"; option java_multiple_files = true; diff --git a/transport/internet/headers/srtp/srtp.go b/transport/internet/headers/srtp/srtp.go index 50c10735..f85b04d7 100644 --- a/transport/internet/headers/srtp/srtp.go +++ b/transport/internet/headers/srtp/srtp.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type SRTP struct { diff --git a/transport/internet/headers/srtp/srtp_test.go b/transport/internet/headers/srtp/srtp_test.go index f9230d3c..e350dba7 100644 --- a/transport/internet/headers/srtp/srtp_test.go +++ b/transport/internet/headers/srtp/srtp_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/srtp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/srtp" ) func TestSRTPWrite(t *testing.T) { diff --git a/transport/internet/headers/tls/config.pb.go b/transport/internet/headers/tls/config.pb.go index c3ecaa88..95b21e56 100644 --- a/transport/internet/headers/tls/config.pb.go +++ b/transport/internet/headers/tls/config.pb.go @@ -72,16 +72,16 @@ var file_transport_internet_headers_tls_config_proto_rawDesc = []byte{ 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, 0x6c, 0x73, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x42, 0x8e, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, + 0x69, 0x67, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x74, 0x6c, 0x73, 0x50, 0x01, - 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, - 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, - 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x23, - 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x54, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, + 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x23, 0x58, 0x72, 0x61, + 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x54, 0x6c, 0x73, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/tls/config.proto b/transport/internet/headers/tls/config.proto index a4d3fcd7..f939adfc 100644 --- a/transport/internet/headers/tls/config.proto +++ b/transport/internet/headers/tls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.tls; option csharp_namespace = "Xray.Transport.Internet.Headers.Tls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/tls"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/tls"; option java_package = "com.xray.transport.internet.headers.tls"; option java_multiple_files = true; diff --git a/transport/internet/headers/tls/dtls.go b/transport/internet/headers/tls/dtls.go index 8483a9ef..dda903c0 100644 --- a/transport/internet/headers/tls/dtls.go +++ b/transport/internet/headers/tls/dtls.go @@ -3,8 +3,8 @@ package tls import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) // DTLS writes header as DTLS. See https://tools.ietf.org/html/rfc6347 diff --git a/transport/internet/headers/tls/dtls_test.go b/transport/internet/headers/tls/dtls_test.go index 7ee0be1d..26fd3aab 100644 --- a/transport/internet/headers/tls/dtls_test.go +++ b/transport/internet/headers/tls/dtls_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/tls" ) func TestDTLSWrite(t *testing.T) { diff --git a/transport/internet/headers/utp/config.pb.go b/transport/internet/headers/utp/config.pb.go index 00757f71..ebaa4978 100644 --- a/transport/internet/headers/utp/config.pb.go +++ b/transport/internet/headers/utp/config.pb.go @@ -82,16 +82,16 @@ var file_transport_internet_headers_utp_config_proto_rawDesc = []byte{ 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, 0x74, 0x70, 0x22, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8e, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x8b, 0x01, 0x0a, 0x27, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x75, - 0x74, 0x70, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x74, 0x70, 0x50, 0x01, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, - 0x70, 0xaa, 0x02, 0x23, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x55, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x74, 0x70, 0xaa, 0x02, + 0x23, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x2e, 0x55, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/utp/config.proto b/transport/internet/headers/utp/config.proto index a3d480fb..0b3627d2 100644 --- a/transport/internet/headers/utp/config.proto +++ b/transport/internet/headers/utp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.utp; option csharp_namespace = "Xray.Transport.Internet.Headers.Utp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/utp"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/utp"; option java_package = "com.xray.transport.internet.headers.utp"; option java_multiple_files = true; diff --git a/transport/internet/headers/utp/utp.go b/transport/internet/headers/utp/utp.go index 9709afe2..89688068 100644 --- a/transport/internet/headers/utp/utp.go +++ b/transport/internet/headers/utp/utp.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type UTP struct { diff --git a/transport/internet/headers/utp/utp_test.go b/transport/internet/headers/utp/utp_test.go index 25af8897..b98755cd 100644 --- a/transport/internet/headers/utp/utp_test.go +++ b/transport/internet/headers/utp/utp_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/utp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/utp" ) func TestUTPWrite(t *testing.T) { diff --git a/transport/internet/headers/wechat/config.pb.go b/transport/internet/headers/wechat/config.pb.go index 17635f05..7dd697f8 100644 --- a/transport/internet/headers/wechat/config.pb.go +++ b/transport/internet/headers/wechat/config.pb.go @@ -72,17 +72,17 @@ var file_transport_internet_headers_wechat_config_proto_rawDesc = []byte{ 0x12, 0x26, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x97, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, + 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x94, 0x01, 0x0a, 0x2a, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0x50, 0x01, 0x5a, 0x3b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x2f, 0x77, 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x26, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x65, 0x63, 0x68, 0x61, - 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, + 0x65, 0x63, 0x68, 0x61, 0x74, 0xaa, 0x02, 0x26, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x65, 0x63, 0x68, 0x61, 0x74, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/wechat/config.proto b/transport/internet/headers/wechat/config.proto index 5b268c55..524c6dc0 100644 --- a/transport/internet/headers/wechat/config.proto +++ b/transport/internet/headers/wechat/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.wechat; option csharp_namespace = "Xray.Transport.Internet.Headers.Wechat"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/wechat"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/wechat"; option java_package = "com.xray.transport.internet.headers.wechat"; option java_multiple_files = true; diff --git a/transport/internet/headers/wechat/wechat.go b/transport/internet/headers/wechat/wechat.go index d7d71ef1..ec6f0821 100644 --- a/transport/internet/headers/wechat/wechat.go +++ b/transport/internet/headers/wechat/wechat.go @@ -4,8 +4,8 @@ import ( "context" "encoding/binary" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" ) type VideoChat struct { diff --git a/transport/internet/headers/wechat/wechat_test.go b/transport/internet/headers/wechat/wechat_test.go index 4a254f0a..5942a7dd 100644 --- a/transport/internet/headers/wechat/wechat_test.go +++ b/transport/internet/headers/wechat/wechat_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/headers/wechat" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/headers/wechat" ) func TestUTPWrite(t *testing.T) { diff --git a/transport/internet/headers/wireguard/config.pb.go b/transport/internet/headers/wireguard/config.pb.go index 0c9ac3fc..4c78e85d 100644 --- a/transport/internet/headers/wireguard/config.pb.go +++ b/transport/internet/headers/wireguard/config.pb.go @@ -73,17 +73,17 @@ var file_transport_internet_headers_wireguard_config_proto_rawDesc = []byte{ 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x42, 0xa0, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, + 0x67, 0x42, 0x9d, 0x01, 0x0a, 0x2d, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x77, 0x69, 0x72, 0x65, 0x67, 0x75, - 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x61, 0x72, 0x64, 0x50, 0x01, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, - 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x29, 0x58, 0x72, 0x61, 0x79, 0x2e, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x67, - 0x75, 0x61, 0x72, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x77, 0x69, 0x72, 0x65, + 0x67, 0x75, 0x61, 0x72, 0x64, 0xaa, 0x02, 0x29, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x57, 0x69, 0x72, 0x65, 0x67, 0x75, 0x61, 0x72, + 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/headers/wireguard/config.proto b/transport/internet/headers/wireguard/config.proto index e917bf43..a115797a 100644 --- a/transport/internet/headers/wireguard/config.proto +++ b/transport/internet/headers/wireguard/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.headers.wireguard; option csharp_namespace = "Xray.Transport.Internet.Headers.Wireguard"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard"; +option go_package = "github.com/xtls/xray-core/transport/internet/headers/wireguard"; option java_package = "com.xray.transport.internet.headers.wireguard"; option java_multiple_files = true; diff --git a/transport/internet/headers/wireguard/wireguard.go b/transport/internet/headers/wireguard/wireguard.go index b7425bdf..4ced1bc3 100644 --- a/transport/internet/headers/wireguard/wireguard.go +++ b/transport/internet/headers/wireguard/wireguard.go @@ -3,7 +3,7 @@ package wireguard import ( "context" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) type Wireguard struct{} diff --git a/transport/internet/http/config.go b/transport/internet/http/config.go index dc9260ba..d8139677 100644 --- a/transport/internet/http/config.go +++ b/transport/internet/http/config.go @@ -3,9 +3,9 @@ package http import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "http" diff --git a/transport/internet/http/config.pb.go b/transport/internet/http/config.pb.go index 44552c4b..94b7d434 100644 --- a/transport/internet/http/config.pb.go +++ b/transport/internet/http/config.pb.go @@ -90,15 +90,15 @@ var file_transport_internet_http_config_proto_rawDesc = []byte{ 0x68, 0x74, 0x74, 0x70, 0x22, 0x30, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, - 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, - 0x74, 0x70, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, - 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x68, 0x74, 0x74, 0x70, 0xaa, + 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/http/config.proto b/transport/internet/http/config.proto index 2b86e9c8..34433af5 100644 --- a/transport/internet/http/config.proto +++ b/transport/internet/http/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.http; option csharp_namespace = "Xray.Transport.Internet.Http"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/http"; +option go_package = "github.com/xtls/xray-core/transport/internet/http"; option java_package = "com.xray.transport.internet.http"; option java_multiple_files = true; diff --git a/transport/internet/http/dialer.go b/transport/internet/http/dialer.go index 59a13d4d..610fd8cf 100644 --- a/transport/internet/http/dialer.go +++ b/transport/internet/http/dialer.go @@ -9,12 +9,12 @@ import ( "net/url" "sync" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/pipe" "golang.org/x/net/http2" ) diff --git a/transport/internet/http/errors.generated.go b/transport/internet/http/errors.generated.go index b07b3fec..f0048165 100644 --- a/transport/internet/http/errors.generated.go +++ b/transport/internet/http/errors.generated.go @@ -1,6 +1,6 @@ package http -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/http/http.go b/transport/internet/http/http.go index 9dc78532..3c0d015f 100644 --- a/transport/internet/http/http.go +++ b/transport/internet/http/http.go @@ -1,3 +1,3 @@ package http -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/http/http_test.go b/transport/internet/http/http_test.go index 5e954e6e..ca1d9f2b 100644 --- a/transport/internet/http/http_test.go +++ b/transport/internet/http/http_test.go @@ -8,14 +8,14 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/http" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/http" + "github.com/xtls/xray-core/transport/internet/tls" ) func TestHTTPConnection(t *testing.T) { diff --git a/transport/internet/http/hub.go b/transport/internet/http/hub.go index 356679b5..712ee6d3 100644 --- a/transport/internet/http/hub.go +++ b/transport/internet/http/hub.go @@ -14,14 +14,14 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type Listener struct { diff --git a/transport/internet/internet.go b/transport/internet/internet.go index c880eca3..694129ad 100644 --- a/transport/internet/internet.go +++ b/transport/internet/internet.go @@ -1,3 +1,3 @@ package internet -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/kcp/config.go b/transport/internet/kcp/config.go index e6af64ef..51630e08 100644 --- a/transport/internet/kcp/config.go +++ b/transport/internet/kcp/config.go @@ -5,8 +5,8 @@ package kcp import ( "crypto/cipher" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "mkcp" diff --git a/transport/internet/kcp/config.pb.go b/transport/internet/kcp/config.pb.go index e7c21cdf..fb5f2564 100644 --- a/transport/internet/kcp/config.pb.go +++ b/transport/internet/kcp/config.pb.go @@ -8,7 +8,7 @@ package kcp import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -586,15 +586,14 @@ var file_transport_internet_kcp_config_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x6b, 0x63, 0x70, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x04, 0x73, 0x65, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x09, 0x10, - 0x0a, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, + 0x0a, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x6b, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x2e, 0x6b, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x4b, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x6b, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2e, 0x4b, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/kcp/config.proto b/transport/internet/kcp/config.proto index c8761eda..a9806e6f 100644 --- a/transport/internet/kcp/config.proto +++ b/transport/internet/kcp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.kcp; option csharp_namespace = "Xray.Transport.Internet.Kcp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/kcp"; +option go_package = "github.com/xtls/xray-core/transport/internet/kcp"; option java_package = "com.xray.transport.internet.kcp"; option java_multiple_files = true; diff --git a/transport/internet/kcp/connection.go b/transport/internet/kcp/connection.go index 561afd3a..ce46e931 100644 --- a/transport/internet/kcp/connection.go +++ b/transport/internet/kcp/connection.go @@ -11,9 +11,9 @@ import ( "sync/atomic" "time" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/semaphore" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/semaphore" ) var ( diff --git a/transport/internet/kcp/connection_test.go b/transport/internet/kcp/connection_test.go index f6d64f8e..daa45820 100644 --- a/transport/internet/kcp/connection_test.go +++ b/transport/internet/kcp/connection_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/internet/kcp" ) type NoOpCloser int diff --git a/transport/internet/kcp/crypt.go b/transport/internet/kcp/crypt.go index 7ccb737c..b29da679 100644 --- a/transport/internet/kcp/crypt.go +++ b/transport/internet/kcp/crypt.go @@ -7,7 +7,7 @@ import ( "encoding/binary" "hash/fnv" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) // SimpleAuthenticator is a legacy AEAD used for KCP encryption. diff --git a/transport/internet/kcp/crypt_test.go b/transport/internet/kcp/crypt_test.go index 8a61c8f5..42b177d7 100644 --- a/transport/internet/kcp/crypt_test.go +++ b/transport/internet/kcp/crypt_test.go @@ -5,8 +5,8 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestSimpleAuthenticator(t *testing.T) { diff --git a/transport/internet/kcp/cryptreal.go b/transport/internet/kcp/cryptreal.go index 51aa0fef..e86bba98 100644 --- a/transport/internet/kcp/cryptreal.go +++ b/transport/internet/kcp/cryptreal.go @@ -5,7 +5,7 @@ import ( "crypto/cipher" "crypto/sha256" - "github.com/xtls/xray-core/v1/common" + "github.com/xtls/xray-core/common" ) func NewAEADAESGCMBasedOnSeed(seed string) cipher.AEAD { diff --git a/transport/internet/kcp/dialer.go b/transport/internet/kcp/dialer.go index 3ee506a4..61b1afd6 100644 --- a/transport/internet/kcp/dialer.go +++ b/transport/internet/kcp/dialer.go @@ -7,13 +7,13 @@ import ( "io" "sync/atomic" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/dice" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/dice" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) var ( diff --git a/transport/internet/kcp/errors.generated.go b/transport/internet/kcp/errors.generated.go index 604d4fe4..63c51c6f 100644 --- a/transport/internet/kcp/errors.generated.go +++ b/transport/internet/kcp/errors.generated.go @@ -1,6 +1,6 @@ package kcp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/kcp/io.go b/transport/internet/kcp/io.go index 3a92a404..dd7aecb3 100644 --- a/transport/internet/kcp/io.go +++ b/transport/internet/kcp/io.go @@ -7,9 +7,9 @@ import ( "crypto/rand" "io" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/transport/internet" ) type PacketReader interface { diff --git a/transport/internet/kcp/io_test.go b/transport/internet/kcp/io_test.go index d15dd77b..0e9f6291 100644 --- a/transport/internet/kcp/io_test.go +++ b/transport/internet/kcp/io_test.go @@ -3,7 +3,7 @@ package kcp_test import ( "testing" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestKCPPacketReader(t *testing.T) { diff --git a/transport/internet/kcp/kcp.go b/transport/internet/kcp/kcp.go index ebcf7c52..242dce94 100644 --- a/transport/internet/kcp/kcp.go +++ b/transport/internet/kcp/kcp.go @@ -5,4 +5,4 @@ // xtaci@github for translating to Golang package kcp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/kcp/kcp_test.go b/transport/internet/kcp/kcp_test.go index 0557664b..c6086bc5 100644 --- a/transport/internet/kcp/kcp_test.go +++ b/transport/internet/kcp/kcp_test.go @@ -10,11 +10,11 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestDialAndListen(t *testing.T) { diff --git a/transport/internet/kcp/listener.go b/transport/internet/kcp/listener.go index 88073207..08d0421b 100644 --- a/transport/internet/kcp/listener.go +++ b/transport/internet/kcp/listener.go @@ -10,13 +10,13 @@ import ( goxtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/internet/xtls" ) type ConnectionID struct { diff --git a/transport/internet/kcp/output.go b/transport/internet/kcp/output.go index 087ee017..0302048d 100644 --- a/transport/internet/kcp/output.go +++ b/transport/internet/kcp/output.go @@ -6,9 +6,9 @@ import ( "io" "sync" - "github.com/xtls/xray-core/v1/common/retry" + "github.com/xtls/xray-core/common/retry" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type SegmentWriter interface { diff --git a/transport/internet/kcp/receiving.go b/transport/internet/kcp/receiving.go index c21091b2..de1c53a0 100644 --- a/transport/internet/kcp/receiving.go +++ b/transport/internet/kcp/receiving.go @@ -5,7 +5,7 @@ package kcp import ( "sync" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type ReceivingWindow struct { diff --git a/transport/internet/kcp/segment.go b/transport/internet/kcp/segment.go index 9743061c..aa8bfd04 100644 --- a/transport/internet/kcp/segment.go +++ b/transport/internet/kcp/segment.go @@ -5,7 +5,7 @@ package kcp import ( "encoding/binary" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Command is a KCP command that indicate the purpose of a Segment. diff --git a/transport/internet/kcp/segment_test.go b/transport/internet/kcp/segment_test.go index 5d099ce1..57102342 100644 --- a/transport/internet/kcp/segment_test.go +++ b/transport/internet/kcp/segment_test.go @@ -6,7 +6,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - . "github.com/xtls/xray-core/v1/transport/internet/kcp" + . "github.com/xtls/xray-core/transport/internet/kcp" ) func TestBadSegment(t *testing.T) { diff --git a/transport/internet/kcp/sending.go b/transport/internet/kcp/sending.go index 84e15d2c..67e6790f 100644 --- a/transport/internet/kcp/sending.go +++ b/transport/internet/kcp/sending.go @@ -6,7 +6,7 @@ import ( "container/list" "sync" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) type SendingWindow struct { diff --git a/transport/internet/quic/config.go b/transport/internet/quic/config.go index 79e7d132..79d24682 100644 --- a/transport/internet/quic/config.go +++ b/transport/internet/quic/config.go @@ -7,9 +7,9 @@ import ( "crypto/cipher" "crypto/sha256" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/transport/internet" "golang.org/x/crypto/chacha20poly1305" ) diff --git a/transport/internet/quic/config.pb.go b/transport/internet/quic/config.pb.go index b58ab3f5..839c5305 100644 --- a/transport/internet/quic/config.pb.go +++ b/transport/internet/quic/config.pb.go @@ -8,8 +8,8 @@ package quic import ( proto "github.com/golang/protobuf/proto" - protocol "github.com/xtls/xray-core/v1/common/protocol" - serial "github.com/xtls/xray-core/v1/common/serial" + protocol "github.com/xtls/xray-core/common/protocol" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -111,15 +111,14 @@ var file_transport_internet_quic_config_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x42, - 0x79, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, + 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x71, - 0x75, 0x69, 0x63, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x75, 0x69, 0x63, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, - 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0xaa, 0x02, 0x1c, 0x58, 0x72, - 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x69, 0x63, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/quic/config.proto b/transport/internet/quic/config.proto index 92888d24..b08e531e 100644 --- a/transport/internet/quic/config.proto +++ b/transport/internet/quic/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.quic; option csharp_namespace = "Xray.Transport.Internet.Quic"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/quic"; +option go_package = "github.com/xtls/xray-core/transport/internet/quic"; option java_package = "com.xray.transport.internet.quic"; option java_multiple_files = true; diff --git a/transport/internet/quic/conn.go b/transport/internet/quic/conn.go index 23f3c279..bd9c5366 100644 --- a/transport/internet/quic/conn.go +++ b/transport/internet/quic/conn.go @@ -9,10 +9,10 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) type sysConn struct { diff --git a/transport/internet/quic/dialer.go b/transport/internet/quic/dialer.go index 30029d5c..ad332191 100644 --- a/transport/internet/quic/dialer.go +++ b/transport/internet/quic/dialer.go @@ -8,11 +8,11 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/task" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/task" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) type sessionContext struct { diff --git a/transport/internet/quic/errors.generated.go b/transport/internet/quic/errors.generated.go index b64d6f39..808fd980 100644 --- a/transport/internet/quic/errors.generated.go +++ b/transport/internet/quic/errors.generated.go @@ -1,6 +1,6 @@ package quic -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/quic/hub.go b/transport/internet/quic/hub.go index 73fb7700..bea6c2ac 100644 --- a/transport/internet/quic/hub.go +++ b/transport/internet/quic/hub.go @@ -7,12 +7,12 @@ import ( "time" "github.com/lucas-clemente/quic-go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) // Listener is an internet.Listener that listens for TCP connections. diff --git a/transport/internet/quic/pool.go b/transport/internet/quic/pool.go index 2809520a..124daa28 100644 --- a/transport/internet/quic/pool.go +++ b/transport/internet/quic/pool.go @@ -5,7 +5,7 @@ package quic import ( "sync" - "github.com/xtls/xray-core/v1/common/bytespool" + "github.com/xtls/xray-core/common/bytespool" ) var pool *sync.Pool diff --git a/transport/internet/quic/quic.go b/transport/internet/quic/quic.go index 47c3cc94..d11854e8 100644 --- a/transport/internet/quic/quic.go +++ b/transport/internet/quic/quic.go @@ -3,11 +3,11 @@ package quic import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen // Here is some modification needs to be done before update quic vendor. // * use bytespool in buffer_pool.go diff --git a/transport/internet/quic/quic_test.go b/transport/internet/quic/quic_test.go index defa80a6..bf353d83 100644 --- a/transport/internet/quic/quic_test.go +++ b/transport/internet/quic/quic_test.go @@ -8,17 +8,17 @@ import ( "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/common/serial" - "github.com/xtls/xray-core/v1/testing/servers/udp" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/headers/wireguard" - "github.com/xtls/xray-core/v1/transport/internet/quic" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/common/serial" + "github.com/xtls/xray-core/testing/servers/udp" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/headers/wireguard" + "github.com/xtls/xray-core/transport/internet/quic" + "github.com/xtls/xray-core/transport/internet/tls" ) func TestQuicConnection(t *testing.T) { diff --git a/transport/internet/sockopt_linux_test.go b/transport/internet/sockopt_linux_test.go index 40745d22..17b7cee0 100644 --- a/transport/internet/sockopt_linux_test.go +++ b/transport/internet/sockopt_linux_test.go @@ -5,10 +5,10 @@ import ( "syscall" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestSockOptMark(t *testing.T) { diff --git a/transport/internet/sockopt_test.go b/transport/internet/sockopt_test.go index a1944cbd..729fb684 100644 --- a/transport/internet/sockopt_test.go +++ b/transport/internet/sockopt_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - . "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/testing/servers/tcp" + . "github.com/xtls/xray-core/transport/internet" ) func TestTCPFastOpen(t *testing.T) { diff --git a/transport/internet/system_dialer.go b/transport/internet/system_dialer.go index 4a1052eb..ef925971 100644 --- a/transport/internet/system_dialer.go +++ b/transport/internet/system_dialer.go @@ -5,8 +5,8 @@ import ( "syscall" "time" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) var ( diff --git a/transport/internet/system_listener.go b/transport/internet/system_listener.go index 54ea4cfe..2dc8a15a 100644 --- a/transport/internet/system_listener.go +++ b/transport/internet/system_listener.go @@ -6,8 +6,8 @@ import ( "syscall" "github.com/pires/go-proxyproto" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" ) var ( diff --git a/transport/internet/system_listener_test.go b/transport/internet/system_listener_test.go index cdb90c18..0fcc9a95 100644 --- a/transport/internet/system_listener_test.go +++ b/transport/internet/system_listener_test.go @@ -5,8 +5,8 @@ import ( "net" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) func TestRegisterListenerController(t *testing.T) { diff --git a/transport/internet/tcp/config.go b/transport/internet/tcp/config.go index 7b42b682..46395748 100644 --- a/transport/internet/tcp/config.go +++ b/transport/internet/tcp/config.go @@ -3,8 +3,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "tcp" diff --git a/transport/internet/tcp/config.pb.go b/transport/internet/tcp/config.pb.go index 28d715a3..addb4613 100644 --- a/transport/internet/tcp/config.pb.go +++ b/transport/internet/tcp/config.pb.go @@ -8,7 +8,7 @@ package tcp import ( proto "github.com/golang/protobuf/proto" - serial "github.com/xtls/xray-core/v1/common/serial" + serial "github.com/xtls/xray-core/common/serial" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -99,15 +99,15 @@ var file_transport_internet_tcp_config_proto_rawDesc = []byte{ 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, - 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, + 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, + 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, - 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, - 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58, + 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/transport/internet/tcp/config.proto b/transport/internet/tcp/config.proto index 7ded6421..a12acdfa 100644 --- a/transport/internet/tcp/config.proto +++ b/transport/internet/tcp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.tcp; option csharp_namespace = "Xray.Transport.Internet.Tcp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/tcp"; +option go_package = "github.com/xtls/xray-core/transport/internet/tcp"; option java_package = "com.xray.transport.internet.tcp"; option java_multiple_files = true; diff --git a/transport/internet/tcp/dialer.go b/transport/internet/tcp/dialer.go index 388aa90e..819f7d62 100644 --- a/transport/internet/tcp/dialer.go +++ b/transport/internet/tcp/dialer.go @@ -5,12 +5,12 @@ package tcp import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Dial dials a new TCP connection to the given destination. diff --git a/transport/internet/tcp/errors.generated.go b/transport/internet/tcp/errors.generated.go index 590fc4c7..0832d114 100644 --- a/transport/internet/tcp/errors.generated.go +++ b/transport/internet/tcp/errors.generated.go @@ -1,6 +1,6 @@ package tcp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/tcp/hub.go b/transport/internet/tcp/hub.go index f367b628..009b838a 100644 --- a/transport/internet/tcp/hub.go +++ b/transport/internet/tcp/hub.go @@ -10,12 +10,12 @@ import ( goxtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + "github.com/xtls/xray-core/transport/internet/xtls" ) // Listener is an internet.Listener that listens for TCP connections. diff --git a/transport/internet/tcp/sockopt_freebsd.go b/transport/internet/tcp/sockopt_freebsd.go index 70bb3549..88391613 100644 --- a/transport/internet/tcp/sockopt_freebsd.go +++ b/transport/internet/tcp/sockopt_freebsd.go @@ -4,8 +4,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) // GetOriginalDestination from tcp conn diff --git a/transport/internet/tcp/sockopt_linux.go b/transport/internet/tcp/sockopt_linux.go index d53c5352..d954a5cb 100644 --- a/transport/internet/tcp/sockopt_linux.go +++ b/transport/internet/tcp/sockopt_linux.go @@ -6,8 +6,8 @@ package tcp import ( "syscall" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) const SO_ORIGINAL_DST = 80 diff --git a/transport/internet/tcp/sockopt_linux_test.go b/transport/internet/tcp/sockopt_linux_test.go index 0b56f27c..c879b2bf 100644 --- a/transport/internet/tcp/sockopt_linux_test.go +++ b/transport/internet/tcp/sockopt_linux_test.go @@ -7,10 +7,10 @@ import ( "strings" "testing" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/testing/servers/tcp" - "github.com/xtls/xray-core/v1/transport/internet" - . "github.com/xtls/xray-core/v1/transport/internet/tcp" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/testing/servers/tcp" + "github.com/xtls/xray-core/transport/internet" + . "github.com/xtls/xray-core/transport/internet/tcp" ) func TestGetOriginalDestination(t *testing.T) { diff --git a/transport/internet/tcp/sockopt_other.go b/transport/internet/tcp/sockopt_other.go index 2c2075be..f21ba52f 100644 --- a/transport/internet/tcp/sockopt_other.go +++ b/transport/internet/tcp/sockopt_other.go @@ -4,8 +4,8 @@ package tcp import ( - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) func GetOriginalDestination(conn internet.Connection) (net.Destination, error) { diff --git a/transport/internet/tcp/tcp.go b/transport/internet/tcp/tcp.go index d528c367..f9e66d84 100644 --- a/transport/internet/tcp/tcp.go +++ b/transport/internet/tcp/tcp.go @@ -1,3 +1,3 @@ package tcp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/tcp_hub.go b/transport/internet/tcp_hub.go index 5cece5c0..fb5562dd 100644 --- a/transport/internet/tcp_hub.go +++ b/transport/internet/tcp_hub.go @@ -3,7 +3,7 @@ package internet import ( "context" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) var ( diff --git a/transport/internet/tls/config.go b/transport/internet/tls/config.go index adca4a2b..856ab595 100644 --- a/transport/internet/tls/config.go +++ b/transport/internet/tls/config.go @@ -9,9 +9,9 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/transport/internet/tls/config.pb.go b/transport/internet/tls/config.pb.go index 38092740..69cda53a 100644 --- a/transport/internet/tls/config.pb.go +++ b/transport/internet/tls/config.pb.go @@ -284,15 +284,15 @@ var file_transport_internet_tls_config_proto_rawDesc = []byte{ 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x6c, 0x73, 0x50, 0x01, 0x5a, - 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, - 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2f, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, - 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, + 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x6c, + 0x73, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, + 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x6c, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/tls/config.proto b/transport/internet/tls/config.proto index e03c0d65..732bb72d 100644 --- a/transport/internet/tls/config.proto +++ b/transport/internet/tls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.tls; option csharp_namespace = "Xray.Transport.Internet.Tls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/tls"; +option go_package = "github.com/xtls/xray-core/transport/internet/tls"; option java_package = "com.xray.transport.internet.tls"; option java_multiple_files = true; diff --git a/transport/internet/tls/config_test.go b/transport/internet/tls/config_test.go index 41a5c7ab..5c8f567c 100644 --- a/transport/internet/tls/config_test.go +++ b/transport/internet/tls/config_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - . "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + . "github.com/xtls/xray-core/transport/internet/tls" ) func TestCertificateIssuing(t *testing.T) { diff --git a/transport/internet/tls/errors.generated.go b/transport/internet/tls/errors.generated.go index 8890e007..ba1851c8 100644 --- a/transport/internet/tls/errors.generated.go +++ b/transport/internet/tls/errors.generated.go @@ -1,6 +1,6 @@ package tls -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index f7889be6..3f2af9f9 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -5,11 +5,11 @@ package tls import ( "crypto/tls" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen var ( _ buf.Writer = (*Conn)(nil) diff --git a/transport/internet/udp/config.go b/transport/internet/udp/config.go index 15b45ce9..fada89c2 100644 --- a/transport/internet/udp/config.go +++ b/transport/internet/udp/config.go @@ -1,8 +1,8 @@ package udp import ( - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/transport/internet/udp/config.pb.go b/transport/internet/udp/config.pb.go index d5a7796a..7e22cf26 100644 --- a/transport/internet/udp/config.pb.go +++ b/transport/internet/udp/config.pb.go @@ -70,15 +70,15 @@ var file_transport_internet_udp_config_proto_rawDesc = []byte{ 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x75, 0x64, 0x70, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, - 0x64, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x76, 0x0a, 0x1f, + 0x64, 0x70, 0x22, 0x08, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x73, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x75, 0x64, 0x70, 0x50, - 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, - 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x65, 0x74, 0x2f, 0x75, 0x64, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, - 0x2e, 0x55, 0x64, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, + 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, + 0x75, 0x64, 0x70, 0xaa, 0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x55, 0x64, + 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/udp/config.proto b/transport/internet/udp/config.proto index ffd00f7b..16e043f9 100644 --- a/transport/internet/udp/config.proto +++ b/transport/internet/udp/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.udp; option csharp_namespace = "Xray.Transport.Internet.Udp"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/udp"; +option go_package = "github.com/xtls/xray-core/transport/internet/udp"; option java_package = "com.xray.transport.internet.udp"; option java_multiple_files = true; diff --git a/transport/internet/udp/dialer.go b/transport/internet/udp/dialer.go index 653b4e96..28306112 100644 --- a/transport/internet/udp/dialer.go +++ b/transport/internet/udp/dialer.go @@ -3,9 +3,9 @@ package udp import ( "context" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) func init() { diff --git a/transport/internet/udp/dispatcher.go b/transport/internet/udp/dispatcher.go index 73989ba8..11c8357e 100644 --- a/transport/internet/udp/dispatcher.go +++ b/transport/internet/udp/dispatcher.go @@ -6,16 +6,16 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common/signal/done" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" ) type ResponseCallback func(ctx context.Context, packet *udp.Packet) diff --git a/transport/internet/udp/dispatcher_test.go b/transport/internet/udp/dispatcher_test.go index ce4de0fc..a9e3c1fd 100644 --- a/transport/internet/udp/dispatcher_test.go +++ b/transport/internet/udp/dispatcher_test.go @@ -6,14 +6,14 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/features/routing" - "github.com/xtls/xray-core/v1/transport" - . "github.com/xtls/xray-core/v1/transport/internet/udp" - "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/features/routing" + "github.com/xtls/xray-core/transport" + . "github.com/xtls/xray-core/transport/internet/udp" + "github.com/xtls/xray-core/transport/pipe" ) type TestDispatcher struct { diff --git a/transport/internet/udp/errors.generated.go b/transport/internet/udp/errors.generated.go index 3d6b44f2..b1b4aa70 100644 --- a/transport/internet/udp/errors.generated.go +++ b/transport/internet/udp/errors.generated.go @@ -1,6 +1,6 @@ package udp -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/udp/hub.go b/transport/internet/udp/hub.go index ab20e580..d91f5536 100644 --- a/transport/internet/udp/hub.go +++ b/transport/internet/udp/hub.go @@ -3,10 +3,10 @@ package udp import ( "context" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/udp" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/udp" + "github.com/xtls/xray-core/transport/internet" ) type HubOption func(h *Hub) diff --git a/transport/internet/udp/hub_freebsd.go b/transport/internet/udp/hub_freebsd.go index bc7649fd..0438eeb2 100644 --- a/transport/internet/udp/hub_freebsd.go +++ b/transport/internet/udp/hub_freebsd.go @@ -7,8 +7,8 @@ import ( "encoding/gob" "io" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/transport/internet" ) // RetrieveOriginalDest from stored laddr, caddr diff --git a/transport/internet/udp/hub_linux.go b/transport/internet/udp/hub_linux.go index e0cfda7b..b01dbd0b 100644 --- a/transport/internet/udp/hub_linux.go +++ b/transport/internet/udp/hub_linux.go @@ -5,7 +5,7 @@ package udp import ( "syscall" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" "golang.org/x/sys/unix" ) diff --git a/transport/internet/udp/hub_other.go b/transport/internet/udp/hub_other.go index 10d16d54..1a3c6773 100644 --- a/transport/internet/udp/hub_other.go +++ b/transport/internet/udp/hub_other.go @@ -3,7 +3,7 @@ package udp import ( - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) func RetrieveOriginalDest(oob []byte) net.Destination { diff --git a/transport/internet/udp/udp.go b/transport/internet/udp/udp.go index 525d6a85..d01148b2 100644 --- a/transport/internet/udp/udp.go +++ b/transport/internet/udp/udp.go @@ -1,5 +1,5 @@ package udp -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen const protocolName = "udp" diff --git a/transport/internet/websocket/config.go b/transport/internet/websocket/config.go index 2dbbf993..939d4335 100644 --- a/transport/internet/websocket/config.go +++ b/transport/internet/websocket/config.go @@ -5,8 +5,8 @@ package websocket import ( "net/http" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/transport/internet" ) const protocolName = "websocket" diff --git a/transport/internet/websocket/config.pb.go b/transport/internet/websocket/config.pb.go index 9009bdba..1d3f8e22 100644 --- a/transport/internet/websocket/config.pb.go +++ b/transport/internet/websocket/config.pb.go @@ -164,16 +164,16 @@ var file_transport_internet_websocket_config_proto_rawDesc = []byte{ 0x65, 0x72, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x88, 0x01, 0x0a, + 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x85, 0x01, 0x0a, 0x25, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x77, 0x65, 0x62, - 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, - 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, - 0x6b, 0x65, 0x74, 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x57, 0x65, - 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x77, 0x65, 0x62, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, + 0xaa, 0x02, 0x21, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, + 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x6f, + 0x63, 0x6b, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/websocket/config.proto b/transport/internet/websocket/config.proto index e8ef9d1f..0795c326 100644 --- a/transport/internet/websocket/config.proto +++ b/transport/internet/websocket/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.websocket; option csharp_namespace = "Xray.Transport.Internet.Websocket"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/websocket"; +option go_package = "github.com/xtls/xray-core/transport/internet/websocket"; option java_package = "com.xray.transport.internet.websocket"; option java_multiple_files = true; diff --git a/transport/internet/websocket/connection.go b/transport/internet/websocket/connection.go index 1bae37ff..5ef2a030 100644 --- a/transport/internet/websocket/connection.go +++ b/transport/internet/websocket/connection.go @@ -8,9 +8,9 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/errors" - "github.com/xtls/xray-core/v1/common/serial" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/errors" + "github.com/xtls/xray-core/common/serial" ) var ( diff --git a/transport/internet/websocket/dialer.go b/transport/internet/websocket/dialer.go index ab3afa9d..b58e341d 100644 --- a/transport/internet/websocket/dialer.go +++ b/transport/internet/websocket/dialer.go @@ -7,11 +7,11 @@ import ( "time" "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" ) // Dial dials a WebSocket connection to the given destination. diff --git a/transport/internet/websocket/errors.generated.go b/transport/internet/websocket/errors.generated.go index 3f628958..2361d0a6 100644 --- a/transport/internet/websocket/errors.generated.go +++ b/transport/internet/websocket/errors.generated.go @@ -1,6 +1,6 @@ package websocket -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/websocket/hub.go b/transport/internet/websocket/hub.go index 6b8e4733..aa20640c 100644 --- a/transport/internet/websocket/hub.go +++ b/transport/internet/websocket/hub.go @@ -11,12 +11,12 @@ import ( "github.com/gorilla/websocket" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - http_proto "github.com/xtls/xray-core/v1/common/protocol/http" - "github.com/xtls/xray-core/v1/common/session" - "github.com/xtls/xray-core/v1/transport/internet" - v2tls "github.com/xtls/xray-core/v1/transport/internet/tls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + http_proto "github.com/xtls/xray-core/common/protocol/http" + "github.com/xtls/xray-core/common/session" + "github.com/xtls/xray-core/transport/internet" + v2tls "github.com/xtls/xray-core/transport/internet/tls" ) type requestHandler struct { diff --git a/transport/internet/websocket/ws.go b/transport/internet/websocket/ws.go index c28df03a..661bb4c0 100644 --- a/transport/internet/websocket/ws.go +++ b/transport/internet/websocket/ws.go @@ -4,4 +4,4 @@ Websocket transport implements an HTTP(S) compliable, surveillance proof transpo */ package websocket -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen diff --git a/transport/internet/websocket/ws_test.go b/transport/internet/websocket/ws_test.go index c1b8e1cb..15a11449 100644 --- a/transport/internet/websocket/ws_test.go +++ b/transport/internet/websocket/ws_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" - "github.com/xtls/xray-core/v1/transport/internet/tls" - . "github.com/xtls/xray-core/v1/transport/internet/websocket" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" + "github.com/xtls/xray-core/transport/internet/tls" + . "github.com/xtls/xray-core/transport/internet/websocket" ) func Test_listenWSAndDial(t *testing.T) { diff --git a/transport/internet/xtls/config.go b/transport/internet/xtls/config.go index 3ebc503a..d3c21eb0 100644 --- a/transport/internet/xtls/config.go +++ b/transport/internet/xtls/config.go @@ -9,9 +9,9 @@ import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common/net" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - "github.com/xtls/xray-core/v1/transport/internet" + "github.com/xtls/xray-core/common/net" + "github.com/xtls/xray-core/common/protocol/tls/cert" + "github.com/xtls/xray-core/transport/internet" ) var ( diff --git a/transport/internet/xtls/config.pb.go b/transport/internet/xtls/config.pb.go index 701581bc..349ebbf5 100644 --- a/transport/internet/xtls/config.pb.go +++ b/transport/internet/xtls/config.pb.go @@ -284,16 +284,15 @@ var file_transport_internet_xtls_config_proto_rawDesc = []byte{ 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x79, + 0x61, 0x62, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x76, 0x0a, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x78, 0x74, - 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x6c, 0x73, 0x50, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, - 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, - 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x58, 0x74, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, + 0x65, 0x74, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0xaa, 0x02, 0x1c, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, + 0x74, 0x2e, 0x58, 0x74, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/transport/internet/xtls/config.proto b/transport/internet/xtls/config.proto index 9cd0bb7c..eceb406c 100644 --- a/transport/internet/xtls/config.proto +++ b/transport/internet/xtls/config.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package xray.transport.internet.xtls; option csharp_namespace = "Xray.Transport.Internet.Xtls"; -option go_package = "github.com/xtls/xray-core/v1/transport/internet/xtls"; +option go_package = "github.com/xtls/xray-core/transport/internet/xtls"; option java_package = "com.xray.transport.internet.xtls"; option java_multiple_files = true; diff --git a/transport/internet/xtls/config_test.go b/transport/internet/xtls/config_test.go index b63cea84..8f5b5ad4 100644 --- a/transport/internet/xtls/config_test.go +++ b/transport/internet/xtls/config_test.go @@ -7,9 +7,9 @@ import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/protocol/tls/cert" - . "github.com/xtls/xray-core/v1/transport/internet/xtls" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/protocol/tls/cert" + . "github.com/xtls/xray-core/transport/internet/xtls" ) func TestCertificateIssuing(t *testing.T) { diff --git a/transport/internet/xtls/errors.generated.go b/transport/internet/xtls/errors.generated.go index 044b7579..bce26cc1 100644 --- a/transport/internet/xtls/errors.generated.go +++ b/transport/internet/xtls/errors.generated.go @@ -1,6 +1,6 @@ package xtls -import "github.com/xtls/xray-core/v1/common/errors" +import "github.com/xtls/xray-core/common/errors" type errPathObjHolder struct{} diff --git a/transport/internet/xtls/xtls.go b/transport/internet/xtls/xtls.go index e0787a7b..3923d052 100644 --- a/transport/internet/xtls/xtls.go +++ b/transport/internet/xtls/xtls.go @@ -5,10 +5,10 @@ package xtls import ( xtls "github.com/xtls/go" - "github.com/xtls/xray-core/v1/common/net" + "github.com/xtls/xray-core/common/net" ) -//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen +//go:generate go run github.com/xtls/xray-core/common/errors/errorgen type Conn struct { *xtls.Conn diff --git a/transport/link.go b/transport/link.go index e9ffd1c0..53e310e0 100644 --- a/transport/link.go +++ b/transport/link.go @@ -1,6 +1,6 @@ package transport -import "github.com/xtls/xray-core/v1/common/buf" +import "github.com/xtls/xray-core/common/buf" // Link is a utility for connecting between an inbound and an outbound proxy handler. type Link struct { diff --git a/transport/pipe/impl.go b/transport/pipe/impl.go index b0011f2b..4d0929f8 100644 --- a/transport/pipe/impl.go +++ b/transport/pipe/impl.go @@ -7,10 +7,10 @@ import ( "sync" "time" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/done" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/done" ) type state byte diff --git a/transport/pipe/pipe.go b/transport/pipe/pipe.go index 45b00402..1706fdab 100644 --- a/transport/pipe/pipe.go +++ b/transport/pipe/pipe.go @@ -3,9 +3,9 @@ package pipe import ( "context" - "github.com/xtls/xray-core/v1/common/signal" - "github.com/xtls/xray-core/v1/common/signal/done" - "github.com/xtls/xray-core/v1/features/policy" + "github.com/xtls/xray-core/common/signal" + "github.com/xtls/xray-core/common/signal/done" + "github.com/xtls/xray-core/features/policy" ) // Option for creating new Pipes. diff --git a/transport/pipe/pipe_test.go b/transport/pipe/pipe_test.go index 446fb824..a5cb25c5 100644 --- a/transport/pipe/pipe_test.go +++ b/transport/pipe/pipe_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - "github.com/xtls/xray-core/v1/common" - "github.com/xtls/xray-core/v1/common/buf" - . "github.com/xtls/xray-core/v1/transport/pipe" + "github.com/xtls/xray-core/common" + "github.com/xtls/xray-core/common/buf" + . "github.com/xtls/xray-core/transport/pipe" ) func TestPipeReadWrite(t *testing.T) { diff --git a/transport/pipe/reader.go b/transport/pipe/reader.go index ba722154..66733436 100644 --- a/transport/pipe/reader.go +++ b/transport/pipe/reader.go @@ -3,7 +3,7 @@ package pipe import ( "time" - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Reader is a buf.Reader that reads content from a pipe. diff --git a/transport/pipe/writer.go b/transport/pipe/writer.go index a954fc9c..8230ec76 100644 --- a/transport/pipe/writer.go +++ b/transport/pipe/writer.go @@ -1,7 +1,7 @@ package pipe import ( - "github.com/xtls/xray-core/v1/common/buf" + "github.com/xtls/xray-core/common/buf" ) // Writer is a buf.Writer that writes data into a pipe.