1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-26 05:59:08 -04:00

update version: auto replacement to v5 path

This commit is contained in:
Shelikhoo
2022-01-02 15:16:23 +00:00
parent 9f0d7e7f40
commit 3ef7feaeaf
809 changed files with 2669 additions and 2641 deletions

View File

@@ -3,10 +3,10 @@ package protocol
import (
"io"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/serial"
)
type AddressOption func(*option)

View File

@@ -6,10 +6,10 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/net"
. "github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/net"
. "github.com/v2fly/v2ray-core/v5/common/protocol"
)
func TestAddressReading(t *testing.T) {

View File

@@ -6,8 +6,8 @@ import (
"math"
"time"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
)
type SniffHeader struct{}

View File

@@ -1,6 +1,6 @@
package dns
import "github.com/v2fly/v2ray-core/v4/common/errors"
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}

View File

@@ -6,9 +6,9 @@ import (
"golang.org/x/net/dns/dnsmessage"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/serial"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/serial"
)
func PackMessage(msg *dnsmessage.Message) (*buf.Buffer, error) {

View File

@@ -1,6 +1,6 @@
package protocol
import "github.com/v2fly/v2ray-core/v4/common/errors"
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}

View File

@@ -3,9 +3,9 @@ package protocol
import (
"runtime"
"github.com/v2fly/v2ray-core/v4/common/bitmask"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v4/common/uuid"
"github.com/v2fly/v2ray-core/v5/common/bitmask"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/common/uuid"
)
// RequestCommand is a custom command in a proxy request.

View File

@@ -150,7 +150,7 @@ var file_common_protocol_headers_proto_rawDesc = []byte{
0x2e, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x2e, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f,
0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a,
0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,

View File

@@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.common.protocol;
option csharp_namespace = "V2Ray.Core.Common.Protocol";
option go_package = "github.com/v2fly/v2ray-core/v4/common/protocol";
option go_package = "github.com/v2fly/v2ray-core/v5/common/protocol";
option java_package = "com.v2ray.core.common.protocol";
option java_multiple_files = true;

View File

@@ -5,7 +5,7 @@ import (
"strconv"
"strings"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v5/common/net"
)
// ParseXForwardedFor parses X-Forwarded-For header in http headers, and return the IP list in it.

View File

@@ -8,9 +8,9 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
. "github.com/v2fly/v2ray-core/v4/common/protocol/http"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
. "github.com/v2fly/v2ray-core/v5/common/protocol/http"
)
func TestParseXForwardedFor(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"errors"
"strings"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
)
type version byte

View File

@@ -3,7 +3,7 @@ package http_test
import (
"testing"
. "github.com/v2fly/v2ray-core/v4/common/protocol/http"
. "github.com/v2fly/v2ray-core/v5/common/protocol/http"
)
func TestHTTPHeaders(t *testing.T) {

View File

@@ -5,8 +5,8 @@ import (
"crypto/md5"
"hash"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/uuid"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/uuid"
)
const (

View File

@@ -3,8 +3,8 @@ package protocol_test
import (
"testing"
. "github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v4/common/uuid"
. "github.com/v2fly/v2ray-core/v5/common/protocol"
"github.com/v2fly/v2ray-core/v5/common/uuid"
)
func TestIdEquals(t *testing.T) {

View File

@@ -1,3 +1,3 @@
package protocol
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen

View File

@@ -11,10 +11,10 @@ import (
"github.com/marten-seemann/qtls-go1-17"
"golang.org/x/crypto/hkdf"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/errors"
ptls "github.com/v2fly/v2ray-core/v4/common/protocol/tls"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/errors"
ptls "github.com/v2fly/v2ray-core/v5/common/protocol/tls"
)
type SniffHeader struct {

View File

@@ -4,8 +4,8 @@ import (
"encoding/hex"
"testing"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/protocol/quic"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/protocol/quic"
)
func TestSniffQUIC(t *testing.T) {

View File

@@ -4,8 +4,8 @@ import (
"testing"
"time"
"github.com/v2fly/v2ray-core/v4/common/net"
. "github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v5/common/net"
. "github.com/v2fly/v2ray-core/v5/common/protocol"
)
func TestServerList(t *testing.T) {

View File

@@ -4,8 +4,8 @@ import (
"sync"
"time"
"github.com/v2fly/v2ray-core/v4/common/dice"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v5/common/dice"
"github.com/v2fly/v2ray-core/v5/common/net"
)
type ValidationStrategy interface {

View File

@@ -7,7 +7,7 @@
package protocol
import (
net "github.com/v2fly/v2ray-core/v4/common/net"
net "github.com/v2fly/v2ray-core/v5/common/net"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -108,7 +108,7 @@ var file_common_protocol_server_spec_proto_rawDesc = []byte{
0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
0x6c, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65,
0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32, 0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65,
0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.common.protocol;
option csharp_namespace = "V2Ray.Core.Common.Protocol";
option go_package = "github.com/v2fly/v2ray-core/v4/common/protocol";
option go_package = "github.com/v2fly/v2ray-core/v5/common/protocol";
option java_package = "com.v2ray.core.common.protocol";
option java_multiple_files = true;

View File

@@ -5,11 +5,11 @@ import (
"testing"
"time"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/net"
. "github.com/v2fly/v2ray-core/v4/common/protocol"
"github.com/v2fly/v2ray-core/v4/common/uuid"
"github.com/v2fly/v2ray-core/v4/proxy/vmess"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/net"
. "github.com/v2fly/v2ray-core/v5/common/protocol"
"github.com/v2fly/v2ray-core/v5/common/uuid"
"github.com/v2fly/v2ray-core/v5/proxy/vmess"
)
func TestAlwaysValidStrategy(t *testing.T) {

View File

@@ -3,7 +3,7 @@ package protocol
import (
"time"
"github.com/v2fly/v2ray-core/v4/common/dice"
"github.com/v2fly/v2ray-core/v5/common/dice"
)
type Timestamp int64

View File

@@ -4,7 +4,7 @@ import (
"testing"
"time"
. "github.com/v2fly/v2ray-core/v4/common/protocol"
. "github.com/v2fly/v2ray-core/v5/common/protocol"
)
func TestGenerateRandomInt64InRange(t *testing.T) {

View File

@@ -12,10 +12,10 @@ import (
"math/big"
"time"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v5/common"
)
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
type Certificate struct {
// Certificate in ASN.1 DER format

View File

@@ -9,8 +9,8 @@ import (
"testing"
"time"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v4/common/task"
"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/task"
)
func TestGenerate(t *testing.T) {

View File

@@ -1,6 +1,6 @@
package cert
import "github.com/v2fly/v2ray-core/v4/common/errors"
import "github.com/v2fly/v2ray-core/v5/common/errors"
type errPathObjHolder struct{}

View File

@@ -5,7 +5,7 @@ import (
"errors"
"strings"
"github.com/v2fly/v2ray-core/v4/common"
"github.com/v2fly/v2ray-core/v5/common"
)
type SniffHeader struct {

View File

@@ -3,7 +3,7 @@ package tls_test
import (
"testing"
. "github.com/v2fly/v2ray-core/v4/common/protocol/tls"
. "github.com/v2fly/v2ray-core/v5/common/protocol/tls"
)
func TestTLSHeaders(t *testing.T) {

View File

@@ -1,8 +1,8 @@
package udp
import (
"github.com/v2fly/v2ray-core/v4/common/buf"
"github.com/v2fly/v2ray-core/v4/common/net"
"github.com/v2fly/v2ray-core/v5/common/buf"
"github.com/v2fly/v2ray-core/v5/common/net"
)
// Packet is a UDP packet together with its source and destination address.

View File

@@ -1,6 +1,6 @@
package protocol
import "github.com/v2fly/v2ray-core/v4/common/serial"
import "github.com/v2fly/v2ray-core/v5/common/serial"
func (u *User) GetTypedAccount() (Account, error) {
if u.GetAccount() == nil {

View File

@@ -105,7 +105,7 @@ var file_common_protocol_user_proto_rawDesc = []byte{
0x32, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x50, 0x01, 0x5a, 0x2e, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x32, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32,
0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x34, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0xaa, 0x02, 0x1a, 0x56, 0x32,
0x52, 0x61, 0x79, 0x2e, 0x43, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,

View File

@@ -2,7 +2,7 @@ syntax = "proto3";
package v2ray.core.common.protocol;
option csharp_namespace = "V2Ray.Core.Common.Protocol";
option go_package = "github.com/v2fly/v2ray-core/v4/common/protocol";
option go_package = "github.com/v2fly/v2ray-core/v5/common/protocol";
option java_package = "com.v2ray.core.common.protocol";
option java_multiple_files = true;