This commit is contained in:
RPRX 2020-12-04 09:36:16 +08:00
parent ed8d6d743c
commit 16544c18ab
627 changed files with 3247 additions and 2635 deletions

View file

@ -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.

View file

@ -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 (

View file

@ -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;

View file

@ -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) {

View file

@ -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."

View file

@ -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{}

View file

@ -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.

View file

@ -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 {

View file

@ -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

View file

@ -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.

View file

@ -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) {