mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
v1.1.0
This commit is contained in:
parent
ed8d6d743c
commit
16544c18ab
627 changed files with 3247 additions and 2635 deletions
|
@ -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 {
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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{}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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{}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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`)
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue