mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
Reformat code
This commit is contained in:
parent
0f1e21ceba
commit
a66bb28aee
@ -4,8 +4,6 @@ package commander
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
@ -13,8 +11,10 @@ import (
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/common/signal/done"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
|
||||
)
|
||||
|
||||
// Commander is a V2Ray feature that provides gRPC methods to external clients.
|
||||
|
@ -9,9 +9,6 @@ package dns
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@ -19,10 +16,13 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"github.com/v2fly/v2ray-core/v4/features/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
)
|
||||
|
||||
// DNS is a DNS rely server.
|
||||
|
@ -1,13 +1,12 @@
|
||||
package dns_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/miekg/dns"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
@ -15,6 +14,7 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/policy"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
_ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
@ -3,10 +3,12 @@ package command
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
|
@ -2,6 +2,7 @@ package instman
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
@ -28,7 +29,7 @@ func (i InstanceMgr) Close() error {
|
||||
|
||||
func (i InstanceMgr) ListInstance(ctx context.Context) ([]string, error) {
|
||||
var instanceNames []string
|
||||
for k, _ := range i.instances {
|
||||
for k := range i.instances {
|
||||
instanceNames = append(instanceNames, k)
|
||||
}
|
||||
return instanceNames, nil
|
||||
|
@ -2,9 +2,10 @@ package command_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"testing"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/app/log"
|
||||
|
@ -2,14 +2,16 @@ package burst
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/signal/done"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type Observer struct {
|
||||
|
@ -1,11 +1,12 @@
|
||||
package burst_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
|
||||
"math"
|
||||
reflect "reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
|
||||
)
|
||||
|
||||
func TestHealthPingResults(t *testing.T) {
|
||||
|
@ -2,11 +2,11 @@ package burst
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/tagged"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/tagged"
|
||||
)
|
||||
|
||||
type pingClient struct {
|
||||
|
@ -7,14 +7,14 @@ package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
)
|
||||
|
||||
|
@ -2,8 +2,10 @@ package multiObservatory
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
|
@ -2,12 +2,12 @@ package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/features/inbound"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy"
|
||||
|
@ -2,13 +2,13 @@ package outbound
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/mux"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
"github.com/v2fly/v2ray-core/v4/features/outbound"
|
||||
"github.com/v2fly/v2ray-core/v4/features/policy"
|
||||
|
@ -2,10 +2,11 @@ package outbound_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"testing"
|
||||
_ "unsafe"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/policy"
|
||||
. "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound"
|
||||
|
@ -2,6 +2,7 @@ package restful_api
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
)
|
||||
|
||||
|
@ -1,16 +1,17 @@
|
||||
package restful_api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/go-chi/render"
|
||||
"github.com/go-playground/validator/v10"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var validate *validator.Validate
|
||||
|
@ -2,11 +2,12 @@ package restful_api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
feature_stats "github.com/v2fly/v2ray-core/v4/features/stats"
|
||||
"net"
|
||||
"sync"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -1,9 +1,10 @@
|
||||
package restful_api
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestTypeReturnAnonymousType(t *testing.T) {
|
||||
|
@ -6,11 +6,12 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features/routing"
|
||||
"github.com/v2fly/v2ray-core/v4/features/stats"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// routingServer is an implementation of RoutingService.
|
||||
|
@ -2,7 +2,6 @@ package command_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -14,6 +13,7 @@ import (
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
. "github.com/v2fly/v2ray-core/v4/app/router/command"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/app/stats"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
|
@ -1,12 +1,12 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"strings"
|
||||
|
||||
"go.starlark.net/starlark"
|
||||
"go.starlark.net/syntax"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/strmatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/features/routing"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"inet.af/netaddr"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
)
|
||||
|
||||
|
@ -2,7 +2,6 @@ package router_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -12,6 +11,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
|
@ -2,7 +2,6 @@ package router_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -13,6 +12,7 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
|
@ -6,7 +6,9 @@ package router
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
@ -4,6 +4,7 @@ package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
|
@ -2,12 +2,12 @@ package router_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
. "github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
|
@ -2,17 +2,18 @@ package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/golang/protobuf/proto"
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
"math"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/dice"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
)
|
||||
|
||||
// LeastLoadStrategy represents a least load balancing strategy
|
||||
|
@ -5,11 +5,11 @@ package router
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"github.com/v2fly/v2ray-core/v4/features/extension"
|
||||
)
|
||||
|
||||
|
@ -3,9 +3,10 @@ package net
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -1,12 +1,12 @@
|
||||
package filesystem
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem/fsifce"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem/fsifce"
|
||||
)
|
||||
|
||||
var NewFileSeeker fsifce.FileSeekerFunc = func(path string) (io.ReadSeekCloser, error) {
|
||||
|
@ -1,10 +1,12 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
)
|
||||
|
||||
func TestMessageOpt(t *testing.T) {
|
||||
|
@ -2,13 +2,15 @@ package protofilter
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
|
||||
"github.com/v2fly/v2ray-core/v4/common/environment/filesystemcap"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"io"
|
||||
"net"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -2,6 +2,7 @@ package registry
|
||||
|
||||
import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
)
|
||||
|
||||
|
@ -3,15 +3,17 @@ package registry
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protofilter"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
protov2 "google.golang.org/protobuf/proto"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
protov2 "google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/protoext"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protofilter"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
)
|
||||
|
||||
type implementationRegistry struct {
|
||||
|
@ -2,11 +2,11 @@ package serial
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
const V2RayTypeURLHeader = "types.v2fly.org/"
|
||||
|
@ -3,9 +3,11 @@ package taggedfeatures
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v5cfg"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
func LoadJsonConfig(ctx context.Context, interfaceType, defaultImpl string, message json.RawMessage) (*Config, error) {
|
||||
|
@ -2,6 +2,7 @@ package taggedfeatures
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
|
@ -2,10 +2,11 @@ package taggedfeatures
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/common/task"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
"reflect"
|
||||
"sync"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/task"
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
)
|
||||
|
||||
type Holder struct {
|
||||
@ -56,7 +57,7 @@ func (h *Holder) GetFeaturesTag() ([]string, error) {
|
||||
h.access.RLock()
|
||||
defer h.access.RUnlock()
|
||||
var ret []string
|
||||
for key, _ := range h.features {
|
||||
for key := range h.features {
|
||||
ret = append(ret, key)
|
||||
}
|
||||
return ret, nil
|
||||
|
@ -2,6 +2,7 @@ package extension
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package extension
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/features"
|
||||
)
|
||||
|
||||
|
@ -3,13 +3,13 @@ package core_test
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"io"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
|
@ -2,6 +2,7 @@ package cfgcommon
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
)
|
||||
|
||||
|
@ -2,6 +2,7 @@ package cfgcommon
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
)
|
||||
|
@ -1,9 +1,10 @@
|
||||
package sniffer
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -1,8 +1,9 @@
|
||||
package socketcfg
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
"strings"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
)
|
||||
|
||||
type SocketConfig struct {
|
||||
|
@ -2,12 +2,12 @@ package testassist
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
)
|
||||
|
||||
func LoadJSON(creator func() cfgcommon.Buildable) func(string) (proto.Message, error) {
|
||||
|
@ -2,11 +2,13 @@ package tlscfg
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
|
||||
"strings"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -1,8 +1,9 @@
|
||||
package geodata
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"strings"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
)
|
||||
|
||||
type loader struct {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package memconservative
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
)
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package memconservative
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"runtime"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package standard
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
)
|
||||
|
@ -2,14 +2,16 @@ package jsonpb
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||
"github.com/v2fly/v2ray-core/v4/common/cmdarg"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"io"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -3,11 +3,11 @@ package rule
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
)
|
||||
|
@ -3,12 +3,12 @@ package serial
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"io"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common/errors"
|
||||
json_reader "github.com/v2fly/v2ray-core/v4/infra/conf/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
)
|
||||
|
||||
type offset struct {
|
||||
|
@ -5,11 +5,11 @@ package dns
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
|
@ -3,7 +3,6 @@ package dns_test
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -15,8 +14,8 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform/filesystem"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
|
||||
|
||||
dns2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
|
||||
)
|
||||
|
||||
|
@ -2,11 +2,11 @@ package router
|
||||
|
||||
import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -2,9 +2,6 @@ package router_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
router2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
"testing"
|
||||
"time"
|
||||
_ "unsafe"
|
||||
@ -12,12 +9,15 @@ import (
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
|
||||
// Geo loaders
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
|
||||
router2 "github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
)
|
||||
|
||||
func TestRouterConfig(t *testing.T) {
|
||||
|
@ -1,10 +1,11 @@
|
||||
package v2jsonpb
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
)
|
||||
|
||||
type V2JsonProtobufFollowerFieldDescriptor struct {
|
||||
|
@ -1,7 +1,8 @@
|
||||
package v2jsonpb
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"io"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
@ -9,7 +10,7 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||
"github.com/v2fly/v2ray-core/v4/common/cmdarg"
|
||||
"io"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
)
|
||||
|
||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
||||
|
@ -1,11 +1,11 @@
|
||||
package v4
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"strings"
|
||||
|
||||
"github.com/jhump/protoreflect/desc"
|
||||
"github.com/jhump/protoreflect/dynamic"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/commander"
|
||||
loggerservice "github.com/v2fly/v2ray-core/v4/app/log/command"
|
||||
|
@ -2,12 +2,12 @@ package v4
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
||||
)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
||||
)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/dns"
|
||||
)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
|
||||
)
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
|
||||
)
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/http"
|
||||
)
|
||||
|
||||
|
@ -2,16 +2,17 @@ package v4
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory/burst"
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory/multiObservatory"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/common/taggedfeatures"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/observatory"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/duration"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
)
|
||||
|
||||
type ObservatoryConfig struct {
|
||||
|
@ -1,10 +1,10 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
)
|
||||
|
||||
func TestBufferSize(t *testing.T) {
|
||||
|
@ -1,12 +1,12 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/app/reverse"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
)
|
||||
|
||||
func TestReverseConfig(t *testing.T) {
|
||||
|
@ -2,11 +2,11 @@ package v4
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/jhump/protoreflect/desc"
|
||||
"github.com/jhump/protoreflect/dynamic"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
)
|
||||
|
@ -1,14 +1,14 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/shadowsocks"
|
||||
)
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/socks"
|
||||
)
|
||||
|
||||
|
@ -2,9 +2,6 @@ package v4
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/tlscfg"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
@ -12,6 +9,9 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/tlscfg"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/domainsocket"
|
||||
httpheader "github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
|
||||
|
@ -2,15 +2,15 @@ package v4_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/socketcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/transport"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/headers/http"
|
||||
|
@ -2,22 +2,23 @@ package v4
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/sniffer"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/app/stats"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/loader"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/sniffer"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/router"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -2,26 +2,30 @@ package v4_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/app/log"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
clog "github.com/v2fly/v2ray-core/v4/common/log"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
|
||||
// Geo loaders
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
||||
dns_proxy "github.com/v2fly/v2ray-core/v4/proxy/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/freedom"
|
||||
@ -31,10 +35,6 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/http"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/tls"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet/websocket"
|
||||
|
||||
// Geo loaders
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/memconservative"
|
||||
_ "github.com/v2fly/v2ray-core/v4/infra/conf/geodata/standard"
|
||||
)
|
||||
|
||||
func TestV2RayConfig(t *testing.T) {
|
||||
|
@ -1,14 +1,14 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vless"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vless/inbound"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vless/outbound"
|
||||
|
@ -1,14 +1,14 @@
|
||||
package v4_test
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"testing"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/testassist"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vmess"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vmess/inbound"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/vmess/outbound"
|
||||
|
@ -3,7 +3,9 @@ package v5cfg
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/environment/envctx"
|
||||
"github.com/v2fly/v2ray-core/v4/common/environment/envimpl"
|
||||
"github.com/v2fly/v2ray-core/v4/common/registry"
|
||||
|
@ -2,7 +2,9 @@ package v5cfg
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
@ -1,11 +1,12 @@
|
||||
package v5cfg
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/buf"
|
||||
"github.com/v2fly/v2ray-core/v4/common/cmdarg"
|
||||
"io"
|
||||
)
|
||||
|
||||
const jsonV5 = "jsonv5"
|
||||
|
@ -2,7 +2,9 @@ package v5cfg
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
@ -3,7 +3,10 @@ package v5cfg
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
@ -12,7 +15,6 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/geodata"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/synthetic/log"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
func (c RootConfig) BuildV5(ctx context.Context) (proto.Message, error) {
|
||||
|
@ -2,6 +2,7 @@ package v5cfg
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/muxcfg"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/cfgcommon/proxycfg"
|
||||
|
@ -2,7 +2,9 @@ package v5cfg
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||
)
|
||||
|
@ -3,12 +3,12 @@ package api
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
|
@ -3,12 +3,14 @@ package engineering
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/common/cmdarg"
|
||||
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -3,13 +3,15 @@ package engineering
|
||||
import (
|
||||
"bytes"
|
||||
"flag"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
|
||||
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
var cmdReversePb = &base.Command{
|
||||
|
@ -3,8 +3,6 @@ package jsonv4
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
@ -13,7 +11,9 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/jsonpb"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v2jsonpb"
|
||||
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
||||
"github.com/v2fly/v2ray-core/v4/main/commands/helpers"
|
||||
)
|
||||
|
@ -2,12 +2,12 @@ package helpers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
"os"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/merge"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/mergers"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/infra/conf/v4"
|
||||
)
|
||||
|
||||
// LoadConfig load config files to *conf.Config, it will:
|
||||
|
@ -1,8 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/v2fly/v2ray-core/v4/main/v2binding"
|
||||
"time"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/main/v2binding"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -1,6 +1,8 @@
|
||||
package v2binding
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/commander"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
@ -13,7 +15,6 @@ import (
|
||||
_ "github.com/v2fly/v2ray-core/v4/main/distro/all"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/blackhole"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/dokodemo"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
)
|
||||
|
||||
type bindingInstance struct {
|
||||
|
@ -1,13 +1,13 @@
|
||||
package dns_test
|
||||
|
||||
import (
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"strconv"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/miekg/dns"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dispatcher"
|
||||
|
@ -2,6 +2,7 @@ package simplified
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/proxy/socks"
|
||||
|
@ -4,7 +4,6 @@ package inbound
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"io"
|
||||
"strings"
|
||||
"sync"
|
||||
@ -18,6 +17,7 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
"github.com/v2fly/v2ray-core/v4/common/signal"
|
||||
"github.com/v2fly/v2ray-core/v4/common/task"
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
"context"
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"hash/crc64"
|
||||
"time"
|
||||
|
||||
@ -17,6 +16,7 @@ import (
|
||||
"github.com/v2fly/v2ray-core/v4/common/platform"
|
||||
"github.com/v2fly/v2ray-core/v4/common/protocol"
|
||||
"github.com/v2fly/v2ray-core/v4/common/retry"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
"github.com/v2fly/v2ray-core/v4/common/session"
|
||||
"github.com/v2fly/v2ray-core/v4/common/signal"
|
||||
"github.com/v2fly/v2ray-core/v4/common/task"
|
||||
|
@ -3,7 +3,6 @@ package scenarios
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -12,6 +11,7 @@ import (
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/google/go-cmp/cmp/cmpopts"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/commander"
|
||||
|
@ -2,17 +2,17 @@ package scenarios
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
xproxy "golang.org/x/net/proxy"
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
core "github.com/v2fly/v2ray-core/v4"
|
||||
"github.com/v2fly/v2ray-core/v4/app/dns"
|
||||
"github.com/v2fly/v2ray-core/v4/app/proxyman"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router"
|
||||
"github.com/v2fly/v2ray-core/v4/app/router/routercommon"
|
||||
"github.com/v2fly/v2ray-core/v4/common"
|
||||
"github.com/v2fly/v2ray-core/v4/common/net"
|
||||
"github.com/v2fly/v2ray-core/v4/common/serial"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user