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