mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-08-23 18:16:50 +08:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3b06af882d | ||
![]() |
697156f6f6 | ||
![]() |
d8485bd5af | ||
![]() |
3632e83faa | ||
![]() |
7086d286be | ||
![]() |
d497de916f | ||
![]() |
acbf36e21b | ||
![]() |
93cff1a576 | ||
![]() |
7677ac980d |
@@ -1,7 +1,5 @@
|
|||||||
package commander
|
package commander
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package dispatcher
|
package dispatcher
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package dispatcher
|
package dispatcher
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
// Package dns is an implementation of core.DNS feature.
|
// Package dns is an implementation of core.DNS feature.
|
||||||
package dns
|
package dns
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package fakedns
|
package fakedns
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package log
|
package log
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@@ -5,8 +5,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/v2fly/v2ray-core/v4/common/errors/errorgen
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
rttFailed = time.Duration(math.MaxInt64 - iota)
|
rttFailed = time.Duration(math.MaxInt64 - iota)
|
||||||
rttUntested
|
rttUntested
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package observatory
|
package observatory
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
// Package policy is an implementation of policy.Manager feature.
|
// Package policy is an implementation of policy.Manager feature.
|
||||||
package policy
|
package policy
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package inbound
|
package inbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package outbound
|
package outbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"sort"
|
"sort"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package reverse
|
package reverse
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package router
|
package router
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
sync "sync"
|
sync "sync"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package command
|
package command
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package stats
|
package stats
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
// Package buf provides a light-weight memory allocation mechanism.
|
// Package buf provides a light-weight memory allocation mechanism.
|
||||||
package buf // import "github.com/xtls/xray-core/common/buf"
|
package buf // import "github.com/xtls/xray-core/common/buf"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -12,8 +12,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/errors"
|
"github.com/xtls/xray-core/common/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
// ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route.
|
// ErrNoClue is for the situation that existing information is not enough to make a decision. For example, Router may return this error when there is no suitable route.
|
||||||
var ErrNoClue = errors.New("not enough information for making a decision")
|
var ErrNoClue = errors.New("not enough information for making a decision")
|
||||||
|
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
// Package crypto provides common crypto libraries for Xray.
|
// Package crypto provides common crypto libraries for Xray.
|
||||||
package crypto // import "github.com/xtls/xray-core/common/crypto"
|
package crypto // import "github.com/xtls/xray-core/common/crypto"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -2,8 +2,6 @@ package drain
|
|||||||
|
|
||||||
import "io"
|
import "io"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
type Drainer interface {
|
type Drainer interface {
|
||||||
AcknowledgeReceive(size int)
|
AcknowledgeReceive(size int)
|
||||||
Drain(reader io.Reader) error
|
Drain(reader io.Reader) error
|
||||||
|
@@ -4,6 +4,15 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// PrintMigrateFeatureInfo prints a notice of the upcoming feature migration.
|
||||||
|
// Place it after the source feature related config file pharser code.
|
||||||
|
// Important note: Only use this when the target migrating feature is under construction.
|
||||||
|
// Important note: Even when the target migrating feature has finished its construction, this notice can still be used yet before announcing deprecation of the old feature.
|
||||||
|
// Do not remove this function even there is no reference to it.
|
||||||
|
func PrintMigrateFeatureInfo(sourceFeature string, targetFeature string) {
|
||||||
|
LogInfo(context.Background(), "The feature " + sourceFeature + " will be migrated to " + targetFeature + " in the future.")
|
||||||
|
}
|
||||||
|
|
||||||
// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
|
// PrintDeprecatedFeatureWarning prints a warning for deprecated and going to be removed feature.
|
||||||
// Do not remove this function even there is no reference to it.
|
// Do not remove this function even there is no reference to it.
|
||||||
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
|
func PrintDeprecatedFeatureWarning(feature string, migrateFeature string) {
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package mux
|
package mux
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
// Package net is a drop-in replacement to Golang's net package, with some more functionalities.
|
// Package net is a drop-in replacement to Golang's net package, with some more functionalities.
|
||||||
package net // import "github.com/xtls/xray-core/common/net"
|
package net // import "github.com/xtls/xray-core/common/net"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.2
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.28.0
|
||||||
// source: common/net/network.proto
|
// source: common/net/network.proto
|
||||||
|
|
||||||
package net
|
package net
|
||||||
@@ -24,8 +24,6 @@ type Network int32
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
Network_Unknown Network = 0
|
Network_Unknown Network = 0
|
||||||
// Deprecated: Marked as deprecated in common/net/network.proto.
|
|
||||||
Network_RawTCP Network = 1
|
|
||||||
Network_TCP Network = 2
|
Network_TCP Network = 2
|
||||||
Network_UDP Network = 3
|
Network_UDP Network = 3
|
||||||
Network_UNIX Network = 4
|
Network_UNIX Network = 4
|
||||||
@@ -35,14 +33,12 @@ const (
|
|||||||
var (
|
var (
|
||||||
Network_name = map[int32]string{
|
Network_name = map[int32]string{
|
||||||
0: "Unknown",
|
0: "Unknown",
|
||||||
1: "RawTCP",
|
|
||||||
2: "TCP",
|
2: "TCP",
|
||||||
3: "UDP",
|
3: "UDP",
|
||||||
4: "UNIX",
|
4: "UNIX",
|
||||||
}
|
}
|
||||||
Network_value = map[string]int32{
|
Network_value = map[string]int32{
|
||||||
"Unknown": 0,
|
"Unknown": 0,
|
||||||
"RawTCP": 1,
|
|
||||||
"TCP": 2,
|
"TCP": 2,
|
||||||
"UDP": 3,
|
"UDP": 3,
|
||||||
"UNIX": 4,
|
"UNIX": 4,
|
||||||
@@ -133,10 +129,9 @@ var file_common_net_network_proto_rawDesc = []byte{
|
|||||||
0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65,
|
0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x6e, 0x65,
|
||||||
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72,
|
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x78, 0x72,
|
||||||
0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65,
|
0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x2e, 0x4e, 0x65,
|
||||||
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x42,
|
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2a, 0x32,
|
||||||
0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b,
|
0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x6e, 0x6b,
|
||||||
0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x06, 0x52, 0x61, 0x77, 0x54, 0x43, 0x50,
|
0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12,
|
||||||
0x10, 0x01, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x43, 0x50, 0x10, 0x02, 0x12,
|
|
||||||
0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58,
|
0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x4e, 0x49, 0x58,
|
||||||
0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63,
|
0x10, 0x04, 0x42, 0x4f, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63,
|
||||||
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74,
|
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x24, 0x67, 0x69, 0x74,
|
||||||
|
@@ -9,7 +9,6 @@ option java_multiple_files = true;
|
|||||||
enum Network {
|
enum Network {
|
||||||
Unknown = 0;
|
Unknown = 0;
|
||||||
|
|
||||||
RawTCP = 1 [deprecated = true];
|
|
||||||
TCP = 2;
|
TCP = 2;
|
||||||
UDP = 3;
|
UDP = 3;
|
||||||
UNIX = 4;
|
UNIX = 4;
|
||||||
|
@@ -12,8 +12,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/platform"
|
"github.com/xtls/xray-core/common/platform"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
|
func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
|
||||||
xctl := platform.GetToolLocation("xctl")
|
xctl := platform.GetToolLocation("xctl")
|
||||||
if _, err := os.Stat(xctl); err != nil {
|
if _, err := os.Stat(xctl); err != nil {
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package protocol // import "github.com/xtls/xray-core/common/protocol"
|
package protocol // import "github.com/xtls/xray-core/common/protocol"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -16,8 +16,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/errors"
|
"github.com/xtls/xray-core/common/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
type Certificate struct {
|
type Certificate struct {
|
||||||
// certificate in ASN.1 DER format
|
// certificate in ASN.1 DER format
|
||||||
Certificate []byte
|
Certificate []byte
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package retry // import "github.com/xtls/xray-core/common/retry"
|
package retry // import "github.com/xtls/xray-core/common/retry"
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@@ -9,8 +9,6 @@
|
|||||||
// connections.
|
// connections.
|
||||||
package core
|
package core
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
@@ -21,7 +19,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
Version_x byte = 24
|
Version_x byte = 24
|
||||||
Version_y byte = 9
|
Version_y byte = 9
|
||||||
Version_z byte = 19
|
Version_z byte = 30
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package dns
|
package dns
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package stats
|
package stats
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
4
go.mod
4
go.mod
@@ -27,7 +27,7 @@ require (
|
|||||||
golang.org/x/sync v0.8.0
|
golang.org/x/sync v0.8.0
|
||||||
golang.org/x/sys v0.25.0
|
golang.org/x/sys v0.25.0
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173
|
||||||
google.golang.org/grpc v1.66.2
|
google.golang.org/grpc v1.67.0
|
||||||
google.golang.org/protobuf v1.34.2
|
google.golang.org/protobuf v1.34.2
|
||||||
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489
|
gvisor.dev/gvisor v0.0.0-20231202080848-1f7806d17489
|
||||||
h12.io/socks v1.0.3
|
h12.io/socks v1.0.3
|
||||||
@@ -55,7 +55,7 @@ require (
|
|||||||
golang.org/x/time v0.5.0 // indirect
|
golang.org/x/time v0.5.0 // indirect
|
||||||
golang.org/x/tools v0.22.0 // indirect
|
golang.org/x/tools v0.22.0 // indirect
|
||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
8
go.sum
8
go.sum
@@ -125,10 +125,10 @@ golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeu
|
|||||||
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173 h1:/jFs0duh4rdb8uIfPMv78iAJGcPKDeqAFnaLBropIC4=
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
golang.zx2c4.com/wireguard v0.0.0-20231211153847-12269c276173/go.mod h1:tkCQ4FQXmpAgYVh++1cq16/dH4QJtmvpRv19DWGAHSA=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
|
||||||
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
|
google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
|
||||||
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
|
google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
|
||||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||||
|
@@ -252,10 +252,23 @@ type Int32Range struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (v *Int32Range) UnmarshalJSON(data []byte) error {
|
func (v *Int32Range) UnmarshalJSON(data []byte) error {
|
||||||
var stringrange string
|
var str string
|
||||||
var rawint int32
|
var rawint int32
|
||||||
if err := json.Unmarshal(data, &stringrange); err == nil {
|
if err := json.Unmarshal(data, &str); err == nil {
|
||||||
pair := strings.SplitN(stringrange, "-", 2)
|
// for number in string format like "114" or "-1"
|
||||||
|
if value, err := strconv.Atoi(str); err == nil {
|
||||||
|
v.From = int32(value)
|
||||||
|
v.To = int32(value)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// for empty "", we treat it as 0
|
||||||
|
if str == "" {
|
||||||
|
v.From = 0
|
||||||
|
v.To = 0
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// for range value, like "114-514"
|
||||||
|
pair := strings.SplitN(str, "-", 2)
|
||||||
if len(pair) == 2 {
|
if len(pair) == 2 {
|
||||||
from, err := strconv.Atoi(pair[0])
|
from, err := strconv.Atoi(pair[0])
|
||||||
to, err2 := strconv.Atoi(pair[1])
|
to, err2 := strconv.Atoi(pair[1])
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package conf
|
package conf
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package serial
|
package serial
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -263,7 +263,7 @@ func (c *SplitHTTPConfig) Build() (proto.Message, error) {
|
|||||||
c.Host = c.Headers["Host"]
|
c.Host = c.Headers["Host"]
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.Xmux.MaxConnections != nil && c.Xmux.MaxConcurrency != nil {
|
if c.Xmux.MaxConnections != nil && c.Xmux.MaxConnections.To > 0 && c.Xmux.MaxConcurrency != nil && c.Xmux.MaxConcurrency.To > 0 {
|
||||||
return nil, errors.New("maxConnections cannot be specified together with maxConcurrency")
|
return nil, errors.New("maxConnections cannot be specified together with maxConcurrency")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,13 +644,13 @@ type TransportProtocol string
|
|||||||
// Build implements Buildable.
|
// Build implements Buildable.
|
||||||
func (p TransportProtocol) Build() (string, error) {
|
func (p TransportProtocol) Build() (string, error) {
|
||||||
switch strings.ToLower(string(p)) {
|
switch strings.ToLower(string(p)) {
|
||||||
case "tcp":
|
case "raw", "tcp":
|
||||||
return "tcp", nil
|
return "tcp", nil
|
||||||
case "kcp", "mkcp":
|
case "kcp", "mkcp":
|
||||||
return "mkcp", nil
|
return "mkcp", nil
|
||||||
case "ws", "websocket":
|
case "ws", "websocket":
|
||||||
return "websocket", nil
|
return "websocket", nil
|
||||||
case "h2", "http":
|
case "h2", "h3", "http":
|
||||||
return "http", nil
|
return "http", nil
|
||||||
case "grpc", "gun":
|
case "grpc", "gun":
|
||||||
return "grpc", nil
|
return "grpc", nil
|
||||||
@@ -783,6 +783,7 @@ type StreamConfig struct {
|
|||||||
Security string `json:"security"`
|
Security string `json:"security"`
|
||||||
TLSSettings *TLSConfig `json:"tlsSettings"`
|
TLSSettings *TLSConfig `json:"tlsSettings"`
|
||||||
REALITYSettings *REALITYConfig `json:"realitySettings"`
|
REALITYSettings *REALITYConfig `json:"realitySettings"`
|
||||||
|
RAWSettings *TCPConfig `json:"rawSettings"`
|
||||||
TCPSettings *TCPConfig `json:"tcpSettings"`
|
TCPSettings *TCPConfig `json:"tcpSettings"`
|
||||||
KCPSettings *KCPConfig `json:"kcpSettings"`
|
KCPSettings *KCPConfig `json:"kcpSettings"`
|
||||||
WSSettings *WebSocketConfig `json:"wsSettings"`
|
WSSettings *WebSocketConfig `json:"wsSettings"`
|
||||||
@@ -839,10 +840,13 @@ func (c *StreamConfig) Build() (*internet.StreamConfig, error) {
|
|||||||
default:
|
default:
|
||||||
return nil, errors.New(`Unknown security "` + c.Security + `".`)
|
return nil, errors.New(`Unknown security "` + c.Security + `".`)
|
||||||
}
|
}
|
||||||
|
if c.TCPSettings == nil {
|
||||||
|
c.TCPSettings = c.RAWSettings
|
||||||
|
}
|
||||||
if c.TCPSettings != nil {
|
if c.TCPSettings != nil {
|
||||||
ts, err := c.TCPSettings.Build()
|
ts, err := c.TCPSettings.Build()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("Failed to build TCP config.").Base(err)
|
return nil, errors.New("Failed to build RAW config.").Base(err)
|
||||||
}
|
}
|
||||||
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
config.TransportSettings = append(config.TransportSettings, &internet.TransportConfig{
|
||||||
ProtocolName: "tcp",
|
ProtocolName: "tcp",
|
||||||
|
@@ -7,8 +7,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/main/commands/base"
|
"github.com/xtls/xray-core/main/commands/base"
|
||||||
)
|
)
|
||||||
|
|
||||||
// go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
base.RootCommand.Commands = append(
|
base.RootCommand.Commands = append(
|
||||||
base.RootCommand.Commands,
|
base.RootCommand.Commands,
|
||||||
|
2
main/confloader/external/external.go
vendored
2
main/confloader/external/external.go
vendored
@@ -1,7 +1,5 @@
|
|||||||
package external
|
package external
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
// Package blackhole is an outbound handler that blocks all connections.
|
// Package blackhole is an outbound handler that blocks all connections.
|
||||||
package blackhole
|
package blackhole
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package dokodemo
|
package dokodemo
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package freedom
|
package freedom
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package loopback
|
package loopback
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -4,5 +4,3 @@
|
|||||||
//
|
//
|
||||||
// R.I.P Shadowsocks
|
// R.I.P Shadowsocks
|
||||||
package shadowsocks
|
package shadowsocks
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package shadowsocks_2022
|
package shadowsocks_2022
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,4 +1,2 @@
|
|||||||
// Package socks provides implements of Socks protocol 4, 4a and 5.
|
// Package socks provides implements of Socks protocol 4, 4a and 5.
|
||||||
package socks
|
package socks
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package trojan
|
package trojan
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package encoding
|
package encoding
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package inbound
|
package inbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package outbound
|
package outbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
|
@@ -5,8 +5,6 @@
|
|||||||
// clients with 'socks' for proxying.
|
// clients with 'socks' for proxying.
|
||||||
package vless
|
package vless
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
XRV = "xtls-rprx-vision"
|
XRV = "xtls-rprx-vision"
|
||||||
)
|
)
|
||||||
|
@@ -5,8 +5,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/protocol"
|
"github.com/xtls/xray-core/common/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = byte(1)
|
Version = byte(1)
|
||||||
)
|
)
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package inbound
|
package inbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package outbound
|
package outbound
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/hmac"
|
"crypto/hmac"
|
||||||
|
@@ -4,5 +4,3 @@
|
|||||||
// together with 'freedom' to talk to final destination, while VMess outbound is usually used on
|
// together with 'freedom' to talk to final destination, while VMess outbound is usually used on
|
||||||
// clients with 'socks' for proxying.
|
// clients with 'socks' for proxying.
|
||||||
package vmess
|
package vmess
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -12,8 +12,6 @@ import (
|
|||||||
"golang.zx2c4.com/wireguard/device"
|
"golang.zx2c4.com/wireguard/device"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
var wgLogger = &device.Logger{
|
var wgLogger = &device.Logger{
|
||||||
Verbosef: func(format string, args ...any) {
|
Verbosef: func(format string, args ...any) {
|
||||||
log.Record(&log.GeneralMessage{
|
log.Record(&log.GeneralMessage{
|
||||||
|
@@ -237,7 +237,7 @@ func TestProxyOverKCP(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
ProxySettings: serial.ToTypedMessage(&inbound.Config{
|
ProxySettings: serial.ToTypedMessage(&inbound.Config{
|
||||||
@@ -283,7 +283,7 @@ func TestProxyOverKCP(t *testing.T) {
|
|||||||
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -327,7 +327,7 @@ func TestProxyOverKCP(t *testing.T) {
|
|||||||
Tag: "proxy",
|
Tag: "proxy",
|
||||||
},
|
},
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@@ -265,7 +265,7 @@ func TestTLSOverKCP(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
SecurityType: serial.GetMessageType(&tls.Config{}),
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&tls.Config{
|
serial.ToTypedMessage(&tls.Config{
|
||||||
@@ -326,7 +326,7 @@ func TestTLSOverKCP(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
SecurityType: serial.GetMessageType(&tls.Config{}),
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&tls.Config{
|
serial.ToTypedMessage(&tls.Config{
|
||||||
@@ -365,7 +365,7 @@ func TestTLSOverWebSocket(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_WebSocket,
|
ProtocolName: "websocket",
|
||||||
SecurityType: serial.GetMessageType(&tls.Config{}),
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&tls.Config{
|
serial.ToTypedMessage(&tls.Config{
|
||||||
@@ -426,10 +426,10 @@ func TestTLSOverWebSocket(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_WebSocket,
|
ProtocolName: "websocket",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_WebSocket,
|
ProtocolName: "websocket",
|
||||||
Settings: serial.ToTypedMessage(&websocket.Config{}),
|
Settings: serial.ToTypedMessage(&websocket.Config{}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -475,10 +475,10 @@ func TestHTTP2(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_HTTP,
|
ProtocolName: "http",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_HTTP,
|
ProtocolName: "http",
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
Settings: serial.ToTypedMessage(&http.Config{
|
||||||
Host: []string{"example.com"},
|
Host: []string{"example.com"},
|
||||||
Path: "/testpath",
|
Path: "/testpath",
|
||||||
@@ -545,10 +545,10 @@ func TestHTTP2(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_HTTP,
|
ProtocolName: "http",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_HTTP,
|
ProtocolName: "http",
|
||||||
Settings: serial.ToTypedMessage(&http.Config{
|
Settings: serial.ToTypedMessage(&http.Config{
|
||||||
Host: []string{"example.com"},
|
Host: []string{"example.com"},
|
||||||
Path: "/testpath",
|
Path: "/testpath",
|
||||||
|
@@ -41,7 +41,7 @@ func TestHTTPConnectionHeader(t *testing.T) {
|
|||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
Settings: serial.ToTypedMessage(&tcptransport.Config{
|
Settings: serial.ToTypedMessage(&tcptransport.Config{
|
||||||
HeaderSettings: serial.ToTypedMessage(&http.Config{}),
|
HeaderSettings: serial.ToTypedMessage(&http.Config{}),
|
||||||
}),
|
}),
|
||||||
@@ -103,7 +103,7 @@ func TestHTTPConnectionHeader(t *testing.T) {
|
|||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
Settings: serial.ToTypedMessage(&tcptransport.Config{
|
Settings: serial.ToTypedMessage(&tcptransport.Config{
|
||||||
HeaderSettings: serial.ToTypedMessage(&http.Config{}),
|
HeaderSettings: serial.ToTypedMessage(&http.Config{}),
|
||||||
}),
|
}),
|
||||||
|
@@ -148,7 +148,7 @@ func TestVlessTls(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
SecurityType: serial.GetMessageType(&tls.Config{}),
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&tls.Config{
|
serial.ToTypedMessage(&tls.Config{
|
||||||
@@ -215,10 +215,10 @@ func TestVlessTls(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -270,7 +270,7 @@ func TestVlessXtlsVision(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
SecurityType: serial.GetMessageType(&tls.Config{}),
|
SecurityType: serial.GetMessageType(&tls.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&tls.Config{
|
serial.ToTypedMessage(&tls.Config{
|
||||||
@@ -339,10 +339,10 @@ func TestVlessXtlsVision(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -399,7 +399,7 @@ func TestVlessXtlsVisionReality(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
SecurityType: serial.GetMessageType(&reality.Config{}),
|
SecurityType: serial.GetMessageType(&reality.Config{}),
|
||||||
SecuritySettings: []*serial.TypedMessage{
|
SecuritySettings: []*serial.TypedMessage{
|
||||||
serial.ToTypedMessage(&reality.Config{
|
serial.ToTypedMessage(&reality.Config{
|
||||||
@@ -473,10 +473,10 @@ func TestVlessXtlsVisionReality(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_TCP,
|
ProtocolName: "tcp",
|
||||||
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
Settings: serial.ToTypedMessage(&transtcp.Config{}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -695,7 +695,7 @@ func TestVMessKCP(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
ProxySettings: serial.ToTypedMessage(&inbound.Config{
|
ProxySettings: serial.ToTypedMessage(&inbound.Config{
|
||||||
@@ -759,7 +759,7 @@ func TestVMessKCP(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
@@ -802,10 +802,10 @@ func TestVMessKCPLarge(t *testing.T) {
|
|||||||
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
PortList: &net.PortList{Range: []*net.PortRange{net.SinglePortRange(serverPort)}},
|
||||||
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
Listen: net.NewIPOrDomain(net.LocalHostIP),
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
Settings: serial.ToTypedMessage(&kcp.Config{
|
Settings: serial.ToTypedMessage(&kcp.Config{
|
||||||
ReadBuffer: &kcp.ReadBuffer{
|
ReadBuffer: &kcp.ReadBuffer{
|
||||||
Size: 512 * 1024,
|
Size: 512 * 1024,
|
||||||
@@ -885,10 +885,10 @@ func TestVMessKCPLarge(t *testing.T) {
|
|||||||
}),
|
}),
|
||||||
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
SenderSettings: serial.ToTypedMessage(&proxyman.SenderConfig{
|
||||||
StreamSettings: &internet.StreamConfig{
|
StreamSettings: &internet.StreamConfig{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
TransportSettings: []*internet.TransportConfig{
|
TransportSettings: []*internet.TransportConfig{
|
||||||
{
|
{
|
||||||
Protocol: internet.TransportProtocol_MKCP,
|
ProtocolName: "mkcp",
|
||||||
Settings: serial.ToTypedMessage(&kcp.Config{
|
Settings: serial.ToTypedMessage(&kcp.Config{
|
||||||
ReadBuffer: &kcp.ReadBuffer{
|
ReadBuffer: &kcp.ReadBuffer{
|
||||||
Size: 512 * 1024,
|
Size: 512 * 1024,
|
||||||
|
@@ -5,56 +5,60 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
|
"use strict";
|
||||||
|
// Enable a much more aggressive JIT for performance gains
|
||||||
|
|
||||||
// Copyright (c) 2021 XRAY. Mozilla Public License 2.0.
|
// Copyright (c) 2021 XRAY. Mozilla Public License 2.0.
|
||||||
var url = "ws://" + window.location.host + "/websocket?token=csrfToken";
|
let url = "ws://" + window.location.host + "/websocket?token=csrfToken";
|
||||||
var clientIdleCount = 0;
|
let clientIdleCount = 0;
|
||||||
var upstreamGetCount = 0;
|
let upstreamGetCount = 0;
|
||||||
var upstreamWsCount = 0;
|
let upstreamWsCount = 0;
|
||||||
var upstreamPostCount = 0;
|
let upstreamPostCount = 0;
|
||||||
setInterval(check, 1000);
|
let check = function () {
|
||||||
function check() {
|
|
||||||
if (clientIdleCount > 0) {
|
if (clientIdleCount > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
};
|
||||||
|
|
||||||
clientIdleCount += 1;
|
clientIdleCount += 1;
|
||||||
console.log("Prepare", url);
|
console.log("Prepare", url);
|
||||||
var ws = new WebSocket(url);
|
let ws = new WebSocket(url);
|
||||||
// arraybuffer is significantly faster in chrome than default
|
// arraybuffer is significantly faster in chrome than default
|
||||||
// blob, tested with chrome 123
|
// blob, tested with chrome 123
|
||||||
ws.binaryType = "arraybuffer";
|
ws.binaryType = "arraybuffer";
|
||||||
ws.onmessage = function (event) {
|
ws.addEventListener("message", (event) => {
|
||||||
clientIdleCount -= 1;
|
clientIdleCount -= 1;
|
||||||
let [method, url, protocol] = event.data.split(" ");
|
let [method, url, protocol] = event.data.split(" ");
|
||||||
if (method == "WS") {
|
switch (method) {
|
||||||
|
case "WS": {
|
||||||
upstreamWsCount += 1;
|
upstreamWsCount += 1;
|
||||||
console.log("Dial WS", url, protocol);
|
console.log("Dial WS", url, protocol);
|
||||||
const wss = new WebSocket(url, protocol);
|
const wss = new WebSocket(url, protocol);
|
||||||
wss.binaryType = "arraybuffer";
|
wss.binaryType = "arraybuffer";
|
||||||
var opened = false;
|
let opened = false;
|
||||||
ws.onmessage = function (event) {
|
ws.onmessage = function (event) {
|
||||||
wss.send(event.data)
|
wss.send(event.data)
|
||||||
}
|
};
|
||||||
wss.onopen = function (event) {
|
wss.onopen = function (event) {
|
||||||
opened = true;
|
opened = true;
|
||||||
ws.send("ok")
|
ws.send("ok")
|
||||||
}
|
};
|
||||||
wss.onmessage = function (event) {
|
wss.onmessage = function (event) {
|
||||||
ws.send(event.data)
|
ws.send(event.data)
|
||||||
}
|
};
|
||||||
wss.onclose = function (event) {
|
wss.onclose = function (event) {
|
||||||
upstreamWsCount -= 1;
|
upstreamWsCount -= 1;
|
||||||
console.log("Dial WS DONE, remaining: ", upstreamWsCount);
|
console.log("Dial WS DONE, remaining: ", upstreamWsCount);
|
||||||
ws.close()
|
ws.close()
|
||||||
}
|
};
|
||||||
wss.onerror = function (event) {
|
wss.onerror = function (event) {
|
||||||
!opened && ws.send("fail")
|
!opened && ws.send("fail")
|
||||||
wss.close()
|
wss.close()
|
||||||
}
|
};
|
||||||
ws.onclose = function (event) {
|
ws.onclose = function (event) {
|
||||||
wss.close()
|
wss.close()
|
||||||
}
|
};
|
||||||
} else if (method == "GET") {
|
break;
|
||||||
|
};
|
||||||
|
case "GET": {
|
||||||
(async () => {
|
(async () => {
|
||||||
console.log("Dial GET", url);
|
console.log("Dial GET", url);
|
||||||
ws.send("ok");
|
ws.send("ok");
|
||||||
@@ -76,12 +80,12 @@
|
|||||||
ws.onclose = (event) => {
|
ws.onclose = (event) => {
|
||||||
try {
|
try {
|
||||||
reader && reader.cancel();
|
reader && reader.cancel();
|
||||||
} catch(e) {}
|
} catch(e) {};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
controller.abort();
|
controller.abort();
|
||||||
} catch(e) {}
|
} catch(e) {};
|
||||||
}
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
upstreamGetCount += 1;
|
upstreamGetCount += 1;
|
||||||
@@ -94,14 +98,16 @@
|
|||||||
const { done, value } = await reader.read();
|
const { done, value } = await reader.read();
|
||||||
ws.send(value);
|
ws.send(value);
|
||||||
if (done) break;
|
if (done) break;
|
||||||
}
|
};
|
||||||
} finally {
|
} finally {
|
||||||
upstreamGetCount -= 1;
|
upstreamGetCount -= 1;
|
||||||
console.log("Dial GET DONE, remaining: ", upstreamGetCount);
|
console.log("Dial GET DONE, remaining: ", upstreamGetCount);
|
||||||
ws.close();
|
ws.close();
|
||||||
}
|
};
|
||||||
})()
|
})();
|
||||||
} else if (method == "POST") {
|
break;
|
||||||
|
};
|
||||||
|
case "POST": {
|
||||||
upstreamPostCount += 1;
|
upstreamPostCount += 1;
|
||||||
console.log("Dial POST", url);
|
console.log("Dial POST", url);
|
||||||
ws.send("ok");
|
ws.send("ok");
|
||||||
@@ -116,21 +122,24 @@
|
|||||||
} else {
|
} else {
|
||||||
console.error("bad status code");
|
console.error("bad status code");
|
||||||
ws.send("fail");
|
ws.send("fail");
|
||||||
}
|
};
|
||||||
} finally {
|
} finally {
|
||||||
upstreamPostCount -= 1;
|
upstreamPostCount -= 1;
|
||||||
console.log("Dial POST DONE, remaining: ", upstreamPostCount);
|
console.log("Dial POST DONE, remaining: ", upstreamPostCount);
|
||||||
ws.close();
|
ws.close();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
check()
|
check();
|
||||||
}
|
});
|
||||||
ws.onerror = function (event) {
|
ws.addEventListener("error", (event) => {
|
||||||
ws.close()
|
ws.close();
|
||||||
}
|
});
|
||||||
}
|
};
|
||||||
|
let checkTask = setInterval(check, 1000);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@@ -28,25 +28,6 @@ var strategy = [][]byte{
|
|||||||
|
|
||||||
const unknownProtocol = "unknown"
|
const unknownProtocol = "unknown"
|
||||||
|
|
||||||
func transportProtocolToString(protocol TransportProtocol) string {
|
|
||||||
switch protocol {
|
|
||||||
case TransportProtocol_TCP:
|
|
||||||
return "tcp"
|
|
||||||
case TransportProtocol_UDP:
|
|
||||||
return "udp"
|
|
||||||
case TransportProtocol_HTTP:
|
|
||||||
return "http"
|
|
||||||
case TransportProtocol_MKCP:
|
|
||||||
return "mkcp"
|
|
||||||
case TransportProtocol_WebSocket:
|
|
||||||
return "websocket"
|
|
||||||
case TransportProtocol_HTTPUpgrade:
|
|
||||||
return "httpupgrade"
|
|
||||||
default:
|
|
||||||
return unknownProtocol
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error {
|
func RegisterProtocolConfigCreator(name string, creator ConfigCreator) error {
|
||||||
if _, found := globalTransportConfigCreatorCache[name]; found {
|
if _, found := globalTransportConfigCreatorCache[name]; found {
|
||||||
return errors.New("protocol ", name, " is already registered").AtError()
|
return errors.New("protocol ", name, " is already registered").AtError()
|
||||||
@@ -70,23 +51,15 @@ func (c *TransportConfig) GetTypedSettings() (interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *TransportConfig) GetUnifiedProtocolName() string {
|
func (c *TransportConfig) GetUnifiedProtocolName() string {
|
||||||
if len(c.ProtocolName) > 0 {
|
|
||||||
return c.ProtocolName
|
return c.ProtocolName
|
||||||
}
|
|
||||||
|
|
||||||
return transportProtocolToString(c.Protocol)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *StreamConfig) GetEffectiveProtocol() string {
|
func (c *StreamConfig) GetEffectiveProtocol() string {
|
||||||
if c == nil {
|
if c == nil || len(c.ProtocolName) == 0 {
|
||||||
return "tcp"
|
return "tcp"
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.ProtocolName) > 0 {
|
|
||||||
return c.ProtocolName
|
return c.ProtocolName
|
||||||
}
|
|
||||||
|
|
||||||
return transportProtocolToString(c.Protocol)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *StreamConfig) GetEffectiveTransportSettings() (interface{}, error) {
|
func (c *StreamConfig) GetEffectiveTransportSettings() (interface{}, error) {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.34.2
|
// protoc-gen-go v1.34.2
|
||||||
// protoc v5.27.0
|
// protoc v5.28.0
|
||||||
// source: transport/internet/config.proto
|
// source: transport/internet/config.proto
|
||||||
|
|
||||||
package internet
|
package internet
|
||||||
@@ -21,67 +21,6 @@ const (
|
|||||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
)
|
)
|
||||||
|
|
||||||
type TransportProtocol int32
|
|
||||||
|
|
||||||
const (
|
|
||||||
TransportProtocol_TCP TransportProtocol = 0
|
|
||||||
TransportProtocol_UDP TransportProtocol = 1
|
|
||||||
TransportProtocol_MKCP TransportProtocol = 2
|
|
||||||
TransportProtocol_WebSocket TransportProtocol = 3
|
|
||||||
TransportProtocol_HTTP TransportProtocol = 4
|
|
||||||
TransportProtocol_HTTPUpgrade TransportProtocol = 6
|
|
||||||
TransportProtocol_SplitHTTP TransportProtocol = 7
|
|
||||||
)
|
|
||||||
|
|
||||||
// Enum value maps for TransportProtocol.
|
|
||||||
var (
|
|
||||||
TransportProtocol_name = map[int32]string{
|
|
||||||
0: "TCP",
|
|
||||||
1: "UDP",
|
|
||||||
2: "MKCP",
|
|
||||||
3: "WebSocket",
|
|
||||||
4: "HTTP",
|
|
||||||
6: "HTTPUpgrade",
|
|
||||||
7: "SplitHTTP",
|
|
||||||
}
|
|
||||||
TransportProtocol_value = map[string]int32{
|
|
||||||
"TCP": 0,
|
|
||||||
"UDP": 1,
|
|
||||||
"MKCP": 2,
|
|
||||||
"WebSocket": 3,
|
|
||||||
"HTTP": 4,
|
|
||||||
"HTTPUpgrade": 6,
|
|
||||||
"SplitHTTP": 7,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func (x TransportProtocol) Enum() *TransportProtocol {
|
|
||||||
p := new(TransportProtocol)
|
|
||||||
*p = x
|
|
||||||
return p
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x TransportProtocol) String() string {
|
|
||||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor {
|
|
||||||
return file_transport_internet_config_proto_enumTypes[0].Descriptor()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (TransportProtocol) Type() protoreflect.EnumType {
|
|
||||||
return &file_transport_internet_config_proto_enumTypes[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x TransportProtocol) Number() protoreflect.EnumNumber {
|
|
||||||
return protoreflect.EnumNumber(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use TransportProtocol.Descriptor instead.
|
|
||||||
func (TransportProtocol) EnumDescriptor() ([]byte, []int) {
|
|
||||||
return file_transport_internet_config_proto_rawDescGZIP(), []int{0}
|
|
||||||
}
|
|
||||||
|
|
||||||
type DomainStrategy int32
|
type DomainStrategy int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -139,11 +78,11 @@ func (x DomainStrategy) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (DomainStrategy) Descriptor() protoreflect.EnumDescriptor {
|
func (DomainStrategy) Descriptor() protoreflect.EnumDescriptor {
|
||||||
return file_transport_internet_config_proto_enumTypes[1].Descriptor()
|
return file_transport_internet_config_proto_enumTypes[0].Descriptor()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (DomainStrategy) Type() protoreflect.EnumType {
|
func (DomainStrategy) Type() protoreflect.EnumType {
|
||||||
return &file_transport_internet_config_proto_enumTypes[1]
|
return &file_transport_internet_config_proto_enumTypes[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x DomainStrategy) Number() protoreflect.EnumNumber {
|
func (x DomainStrategy) Number() protoreflect.EnumNumber {
|
||||||
@@ -152,7 +91,7 @@ func (x DomainStrategy) Number() protoreflect.EnumNumber {
|
|||||||
|
|
||||||
// Deprecated: Use DomainStrategy.Descriptor instead.
|
// Deprecated: Use DomainStrategy.Descriptor instead.
|
||||||
func (DomainStrategy) EnumDescriptor() ([]byte, []int) {
|
func (DomainStrategy) EnumDescriptor() ([]byte, []int) {
|
||||||
return file_transport_internet_config_proto_rawDescGZIP(), []int{1}
|
return file_transport_internet_config_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
type SocketConfig_TProxyMode int32
|
type SocketConfig_TProxyMode int32
|
||||||
@@ -191,11 +130,11 @@ func (x SocketConfig_TProxyMode) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor {
|
func (SocketConfig_TProxyMode) Descriptor() protoreflect.EnumDescriptor {
|
||||||
return file_transport_internet_config_proto_enumTypes[2].Descriptor()
|
return file_transport_internet_config_proto_enumTypes[1].Descriptor()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (SocketConfig_TProxyMode) Type() protoreflect.EnumType {
|
func (SocketConfig_TProxyMode) Type() protoreflect.EnumType {
|
||||||
return &file_transport_internet_config_proto_enumTypes[2]
|
return &file_transport_internet_config_proto_enumTypes[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber {
|
func (x SocketConfig_TProxyMode) Number() protoreflect.EnumNumber {
|
||||||
@@ -212,11 +151,6 @@ type TransportConfig struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Type of network that this settings supports.
|
|
||||||
// Deprecated. Use the string form below.
|
|
||||||
//
|
|
||||||
// Deprecated: Marked as deprecated in transport/internet/config.proto.
|
|
||||||
Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=xray.transport.internet.TransportProtocol" json:"protocol,omitempty"`
|
|
||||||
// Type of network that this settings supports.
|
// Type of network that this settings supports.
|
||||||
ProtocolName string `protobuf:"bytes,3,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"`
|
ProtocolName string `protobuf:"bytes,3,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"`
|
||||||
// Specific settings. Must be of the transports.
|
// Specific settings. Must be of the transports.
|
||||||
@@ -255,14 +189,6 @@ func (*TransportConfig) Descriptor() ([]byte, []int) {
|
|||||||
return file_transport_internet_config_proto_rawDescGZIP(), []int{0}
|
return file_transport_internet_config_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Marked as deprecated in transport/internet/config.proto.
|
|
||||||
func (x *TransportConfig) GetProtocol() TransportProtocol {
|
|
||||||
if x != nil {
|
|
||||||
return x.Protocol
|
|
||||||
}
|
|
||||||
return TransportProtocol_TCP
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *TransportConfig) GetProtocolName() string {
|
func (x *TransportConfig) GetProtocolName() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.ProtocolName
|
return x.ProtocolName
|
||||||
@@ -282,10 +208,6 @@ type StreamConfig struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
// Effective network. Deprecated. Use the string form below.
|
|
||||||
//
|
|
||||||
// Deprecated: Marked as deprecated in transport/internet/config.proto.
|
|
||||||
Protocol TransportProtocol `protobuf:"varint,1,opt,name=protocol,proto3,enum=xray.transport.internet.TransportProtocol" json:"protocol,omitempty"`
|
|
||||||
// Effective network.
|
// Effective network.
|
||||||
ProtocolName string `protobuf:"bytes,5,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"`
|
ProtocolName string `protobuf:"bytes,5,opt,name=protocol_name,json=protocolName,proto3" json:"protocol_name,omitempty"`
|
||||||
TransportSettings []*TransportConfig `protobuf:"bytes,2,rep,name=transport_settings,json=transportSettings,proto3" json:"transport_settings,omitempty"`
|
TransportSettings []*TransportConfig `protobuf:"bytes,2,rep,name=transport_settings,json=transportSettings,proto3" json:"transport_settings,omitempty"`
|
||||||
@@ -328,14 +250,6 @@ func (*StreamConfig) Descriptor() ([]byte, []int) {
|
|||||||
return file_transport_internet_config_proto_rawDescGZIP(), []int{1}
|
return file_transport_internet_config_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Marked as deprecated in transport/internet/config.proto.
|
|
||||||
func (x *StreamConfig) GetProtocol() TransportProtocol {
|
|
||||||
if x != nil {
|
|
||||||
return x.Protocol
|
|
||||||
}
|
|
||||||
return TransportProtocol_TCP
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *StreamConfig) GetProtocolName() string {
|
func (x *StreamConfig) GetProtocolName() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.ProtocolName
|
return x.ProtocolName
|
||||||
@@ -710,139 +624,123 @@ var file_transport_internet_config_proto_rawDesc = []byte{
|
|||||||
0x6f, 0x12, 0x17, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72,
|
0x6f, 0x12, 0x17, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72,
|
||||||
0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d,
|
0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x1a, 0x21, 0x63, 0x6f, 0x6d, 0x6d,
|
||||||
0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f,
|
0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x64, 0x5f,
|
||||||
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc0, 0x01,
|
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x74, 0x0a,
|
||||||
0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
0x67, 0x12, 0x4a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20,
|
0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d,
|
||||||
0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,
|
||||||
0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72,
|
0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||||
0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42,
|
0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63,
|
||||||
0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x23, 0x0a,
|
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70,
|
||||||
0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03,
|
0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61,
|
0x6e, 0x67, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f,
|
||||||
0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02,
|
0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
|
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f,
|
||||||
0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d,
|
0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x74, 0x72, 0x61,
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73,
|
0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18,
|
||||||
0x22, 0x9c, 0x03, 0x0a, 0x0c, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69,
|
0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61,
|
||||||
0x67, 0x12, 0x4a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20,
|
0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e,
|
||||||
0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
|
||||||
0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72,
|
0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
||||||
0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42,
|
0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x74,
|
||||||
0x02, 0x18, 0x01, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x23, 0x0a,
|
0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x75, 0x72,
|
||||||
0x0d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05,
|
0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x4d, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, 0x72,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4e, 0x61,
|
0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03,
|
||||||
0x6d, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x5f,
|
0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
|
||||||
0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28,
|
0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73,
|
||||||
0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e,
|
0x73, 0x61, 0x67, 0x65, 0x52, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65,
|
||||||
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f,
|
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x4e, 0x0a, 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74,
|
||||||
0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x11, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70,
|
0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x73,
|
0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
|
||||||
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
|
0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74,
|
||||||
0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x54, 0x79, 0x70, 0x65,
|
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65,
|
||||||
0x12, 0x4d, 0x0a, 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x73, 0x65, 0x74,
|
0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x51, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43,
|
||||||
0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x72,
|
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x61, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c,
|
0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
||||||
0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x10, 0x73,
|
0x70, 0x6f, 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x02,
|
||||||
0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12,
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c,
|
||||||
0x4e, 0x0a, 0x0f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e,
|
0x61, 0x79, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x22, 0x61, 0x0a, 0x0d, 0x43, 0x75, 0x73,
|
||||||
0x67, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e,
|
0x74, 0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65,
|
||||||
0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
|
0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
|
||||||
0x65, 0x74, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
|
0x12, 0x10, 0x0a, 0x03, 0x6f, 0x70, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f,
|
||||||
0x0e, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22,
|
0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x51, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x10,
|
0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
|
||||||
0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67,
|
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x9f, 0x07, 0x0a,
|
||||||
0x12, 0x30, 0x0a, 0x13, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x61, 0x79,
|
0x0c, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a,
|
||||||
0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x74,
|
0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6d, 0x61, 0x72,
|
||||||
0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x61, 0x79, 0x65, 0x72, 0x50, 0x72, 0x6f,
|
0x6b, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||||
0x78, 0x79, 0x22, 0x61, 0x0a, 0x0d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b,
|
0x74, 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x06, 0x74, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20,
|
||||||
0x6f, 0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01,
|
0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
|
||||||
0x28, 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x70, 0x74,
|
0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x6f,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x70, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76,
|
0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x54, 0x50, 0x72, 0x6f, 0x78,
|
||||||
0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x74, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x41, 0x0a,
|
||||||
0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x1d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61,
|
||||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x9f, 0x07, 0x0a, 0x0c, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74,
|
0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04,
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x01,
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4f, 0x72, 0x69,
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x66,
|
0x67, 0x69, 0x6e, 0x61, 0x6c, 0x44, 0x65, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||||
0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x74, 0x66, 0x6f, 0x12, 0x48, 0x0a, 0x06,
|
0x12, 0x21, 0x0a, 0x0c, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||||
0x74, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x78,
|
0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72,
|
||||||
0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e,
|
0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x70, 0x6f, 0x72, 0x74,
|
||||||
0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x6e,
|
0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74,
|
||||||
0x66, 0x69, 0x67, 0x2e, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x06,
|
0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79,
|
||||||
0x74, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76,
|
0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||||
0x65, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x5f,
|
0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74,
|
||||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x72,
|
0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x50, 0x0a, 0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73,
|
||||||
0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x44, 0x65,
|
0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e,
|
||||||
0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x69, 0x6e,
|
0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69,
|
||||||
0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52,
|
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74,
|
||||||
0x0b, 0x62, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09,
|
0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52, 0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74,
|
||||||
0x62, 0x69, 0x6e, 0x64, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x65, 0x72,
|
||||||
0x08, 0x62, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x63, 0x63,
|
0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69,
|
||||||
0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
0x61, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x35, 0x0a, 0x17, 0x74, 0x63, 0x70,
|
||||||
0x6f, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74,
|
0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65,
|
||||||
0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x50, 0x0a,
|
0x72, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x74, 0x63, 0x70, 0x4b,
|
||||||
0x0f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79,
|
0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
|
||||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72,
|
0x12, 0x2d, 0x0a, 0x13, 0x74, 0x63, 0x70, 0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69,
|
||||||
|
0x76, 0x65, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x74,
|
||||||
|
0x63, 0x70, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x49, 0x64, 0x6c, 0x65, 0x12,
|
||||||
|
0x25, 0x0a, 0x0e, 0x74, 0x63, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x63, 0x70, 0x43, 0x6f, 0x6e, 0x67,
|
||||||
|
0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,
|
||||||
|
0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72,
|
||||||
|
0x66, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x36, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x0e,
|
||||||
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x36, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10,
|
||||||
|
0x74, 0x63, 0x70, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6c, 0x61, 0x6d, 0x70,
|
||||||
|
0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x63, 0x70, 0x57, 0x69, 0x6e, 0x64, 0x6f,
|
||||||
|
0x77, 0x43, 0x6c, 0x61, 0x6d, 0x70, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x63, 0x70, 0x5f, 0x75, 0x73,
|
||||||
|
0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05,
|
||||||
|
0x52, 0x0e, 0x74, 0x63, 0x70, 0x55, 0x73, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
|
||||||
|
0x12, 0x1e, 0x0a, 0x0b, 0x74, 0x63, 0x70, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x65, 0x67, 0x18,
|
||||||
|
0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x63, 0x70, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x67,
|
||||||
|
0x12, 0x20, 0x0a, 0x0c, 0x74, 0x63, 0x70, 0x5f, 0x6e, 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79,
|
||||||
|
0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x63, 0x70, 0x4e, 0x6f, 0x44, 0x65, 0x6c,
|
||||||
|
0x61, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x63, 0x70, 0x5f, 0x6d, 0x70, 0x74, 0x63, 0x70, 0x18,
|
||||||
|
0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x63, 0x70, 0x4d, 0x70, 0x74, 0x63, 0x70, 0x12,
|
||||||
|
0x4c, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74,
|
||||||
|
0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72,
|
||||||
0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74,
|
0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74,
|
||||||
0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x52,
|
0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x52, 0x0d,
|
||||||
0x0e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12,
|
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x22, 0x2f, 0x0a,
|
||||||
0x21, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x18,
|
0x0a, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x4f,
|
||||||
0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x65, 0x72, 0x50, 0x72, 0x6f,
|
0x66, 0x66, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x10, 0x01,
|
||||||
0x78, 0x79, 0x12, 0x35, 0x0a, 0x17, 0x74, 0x63, 0x70, 0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61,
|
0x12, 0x0c, 0x0a, 0x08, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x10, 0x02, 0x2a, 0xa9,
|
||||||
0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x0a, 0x20,
|
0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67,
|
||||||
0x01, 0x28, 0x05, 0x52, 0x14, 0x74, 0x63, 0x70, 0x4b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76,
|
0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06,
|
||||||
0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2d, 0x0a, 0x13, 0x74, 0x63, 0x70,
|
0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f,
|
||||||
0x5f, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x64, 0x6c, 0x65,
|
0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36,
|
||||||
0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x74, 0x63, 0x70, 0x4b, 0x65, 0x65, 0x70, 0x41,
|
0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x04,
|
||||||
0x6c, 0x69, 0x76, 0x65, 0x49, 0x64, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x63, 0x70, 0x5f,
|
0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x05, 0x12, 0x0c,
|
||||||
0x63, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09,
|
0x0a, 0x08, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09,
|
||||||
0x52, 0x0d, 0x74, 0x63, 0x70, 0x43, 0x6f, 0x6e, 0x67, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x12,
|
0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x46,
|
||||||
0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01,
|
0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x08, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x4f,
|
||||||
0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x16, 0x0a,
|
0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x4f,
|
||||||
0x06, 0x76, 0x36, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76,
|
0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x0a, 0x42, 0x67, 0x0a, 0x1b, 0x63, 0x6f,
|
||||||
0x36, 0x6f, 0x6e, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x63, 0x70, 0x5f, 0x77, 0x69, 0x6e,
|
0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
|
||||||
0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2c, 0x67, 0x69, 0x74,
|
||||||
0x0e, 0x74, 0x63, 0x70, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x43, 0x6c, 0x61, 0x6d, 0x70, 0x12,
|
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f, 0x78, 0x72, 0x61,
|
||||||
0x28, 0x0a, 0x10, 0x74, 0x63, 0x70, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
|
||||||
0x6f, 0x75, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x63, 0x70, 0x55, 0x73,
|
0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58, 0x72, 0x61, 0x79,
|
||||||
0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0b, 0x74, 0x63, 0x70,
|
0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72,
|
||||||
0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x73, 0x65, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
|
0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
0x74, 0x63, 0x70, 0x4d, 0x61, 0x78, 0x53, 0x65, 0x67, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x63, 0x70,
|
|
||||||
0x5f, 0x6e, 0x6f, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x52,
|
|
||||||
0x0a, 0x74, 0x63, 0x70, 0x4e, 0x6f, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x74,
|
|
||||||
0x63, 0x70, 0x5f, 0x6d, 0x70, 0x74, 0x63, 0x70, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08,
|
|
||||||
0x74, 0x63, 0x70, 0x4d, 0x70, 0x74, 0x63, 0x70, 0x12, 0x4c, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74,
|
|
||||||
0x6f, 0x6d, 0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
|
||||||
0x26, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
|
|
||||||
0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,
|
|
||||||
0x53, 0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x52, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53,
|
|
||||||
0x6f, 0x63, 0x6b, 0x6f, 0x70, 0x74, 0x22, 0x2f, 0x0a, 0x0a, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79,
|
|
||||||
0x4d, 0x6f, 0x64, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x66, 0x66, 0x10, 0x00, 0x12, 0x0a, 0x0a,
|
|
||||||
0x06, 0x54, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x65, 0x64,
|
|
||||||
0x69, 0x72, 0x65, 0x63, 0x74, 0x10, 0x02, 0x2a, 0x68, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73,
|
|
||||||
0x70, 0x6f, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x07, 0x0a, 0x03,
|
|
||||||
0x54, 0x43, 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x55, 0x44, 0x50, 0x10, 0x01, 0x12, 0x08,
|
|
||||||
0x0a, 0x04, 0x4d, 0x4b, 0x43, 0x50, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x65, 0x62, 0x53,
|
|
||||||
0x6f, 0x63, 0x6b, 0x65, 0x74, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x10,
|
|
||||||
0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65,
|
|
||||||
0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x48, 0x54, 0x54, 0x50, 0x10,
|
|
||||||
0x07, 0x2a, 0xa9, 0x01, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x61,
|
|
||||||
0x74, 0x65, 0x67, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x53, 0x5f, 0x49, 0x53, 0x10, 0x00, 0x12,
|
|
||||||
0x0a, 0x0a, 0x06, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55,
|
|
||||||
0x53, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x53, 0x45, 0x5f,
|
|
||||||
0x49, 0x50, 0x36, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x34,
|
|
||||||
0x36, 0x10, 0x04, 0x12, 0x0c, 0x0a, 0x08, 0x55, 0x53, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10,
|
|
||||||
0x05, 0x12, 0x0c, 0x0a, 0x08, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x10, 0x06, 0x12,
|
|
||||||
0x0d, 0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x10, 0x07, 0x12, 0x0d,
|
|
||||||
0x0a, 0x09, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x10, 0x08, 0x12, 0x0e, 0x0a,
|
|
||||||
0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x34, 0x36, 0x10, 0x09, 0x12, 0x0e, 0x0a,
|
|
||||||
0x0a, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x50, 0x36, 0x34, 0x10, 0x0a, 0x42, 0x67, 0x0a,
|
|
||||||
0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61, 0x79, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70,
|
|
||||||
0x6f, 0x72, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x50, 0x01, 0x5a, 0x2c,
|
|
||||||
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x74, 0x6c, 0x73, 0x2f,
|
|
||||||
0x78, 0x72, 0x61, 0x79, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70,
|
|
||||||
0x6f, 0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0xaa, 0x02, 0x17, 0x58,
|
|
||||||
0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e,
|
|
||||||
0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -857,34 +755,31 @@ func file_transport_internet_config_proto_rawDescGZIP() []byte {
|
|||||||
return file_transport_internet_config_proto_rawDescData
|
return file_transport_internet_config_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_transport_internet_config_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
|
var file_transport_internet_config_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
|
||||||
var file_transport_internet_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
var file_transport_internet_config_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||||
var file_transport_internet_config_proto_goTypes = []any{
|
var file_transport_internet_config_proto_goTypes = []any{
|
||||||
(TransportProtocol)(0), // 0: xray.transport.internet.TransportProtocol
|
(DomainStrategy)(0), // 0: xray.transport.internet.DomainStrategy
|
||||||
(DomainStrategy)(0), // 1: xray.transport.internet.DomainStrategy
|
(SocketConfig_TProxyMode)(0), // 1: xray.transport.internet.SocketConfig.TProxyMode
|
||||||
(SocketConfig_TProxyMode)(0), // 2: xray.transport.internet.SocketConfig.TProxyMode
|
(*TransportConfig)(nil), // 2: xray.transport.internet.TransportConfig
|
||||||
(*TransportConfig)(nil), // 3: xray.transport.internet.TransportConfig
|
(*StreamConfig)(nil), // 3: xray.transport.internet.StreamConfig
|
||||||
(*StreamConfig)(nil), // 4: xray.transport.internet.StreamConfig
|
(*ProxyConfig)(nil), // 4: xray.transport.internet.ProxyConfig
|
||||||
(*ProxyConfig)(nil), // 5: xray.transport.internet.ProxyConfig
|
(*CustomSockopt)(nil), // 5: xray.transport.internet.CustomSockopt
|
||||||
(*CustomSockopt)(nil), // 6: xray.transport.internet.CustomSockopt
|
(*SocketConfig)(nil), // 6: xray.transport.internet.SocketConfig
|
||||||
(*SocketConfig)(nil), // 7: xray.transport.internet.SocketConfig
|
(*serial.TypedMessage)(nil), // 7: xray.common.serial.TypedMessage
|
||||||
(*serial.TypedMessage)(nil), // 8: xray.common.serial.TypedMessage
|
|
||||||
}
|
}
|
||||||
var file_transport_internet_config_proto_depIdxs = []int32{
|
var file_transport_internet_config_proto_depIdxs = []int32{
|
||||||
0, // 0: xray.transport.internet.TransportConfig.protocol:type_name -> xray.transport.internet.TransportProtocol
|
7, // 0: xray.transport.internet.TransportConfig.settings:type_name -> xray.common.serial.TypedMessage
|
||||||
8, // 1: xray.transport.internet.TransportConfig.settings:type_name -> xray.common.serial.TypedMessage
|
2, // 1: xray.transport.internet.StreamConfig.transport_settings:type_name -> xray.transport.internet.TransportConfig
|
||||||
0, // 2: xray.transport.internet.StreamConfig.protocol:type_name -> xray.transport.internet.TransportProtocol
|
7, // 2: xray.transport.internet.StreamConfig.security_settings:type_name -> xray.common.serial.TypedMessage
|
||||||
3, // 3: xray.transport.internet.StreamConfig.transport_settings:type_name -> xray.transport.internet.TransportConfig
|
6, // 3: xray.transport.internet.StreamConfig.socket_settings:type_name -> xray.transport.internet.SocketConfig
|
||||||
8, // 4: xray.transport.internet.StreamConfig.security_settings:type_name -> xray.common.serial.TypedMessage
|
1, // 4: xray.transport.internet.SocketConfig.tproxy:type_name -> xray.transport.internet.SocketConfig.TProxyMode
|
||||||
7, // 5: xray.transport.internet.StreamConfig.socket_settings:type_name -> xray.transport.internet.SocketConfig
|
0, // 5: xray.transport.internet.SocketConfig.domain_strategy:type_name -> xray.transport.internet.DomainStrategy
|
||||||
2, // 6: xray.transport.internet.SocketConfig.tproxy:type_name -> xray.transport.internet.SocketConfig.TProxyMode
|
5, // 6: xray.transport.internet.SocketConfig.customSockopt:type_name -> xray.transport.internet.CustomSockopt
|
||||||
1, // 7: xray.transport.internet.SocketConfig.domain_strategy:type_name -> xray.transport.internet.DomainStrategy
|
7, // [7:7] is the sub-list for method output_type
|
||||||
6, // 8: xray.transport.internet.SocketConfig.customSockopt:type_name -> xray.transport.internet.CustomSockopt
|
7, // [7:7] is the sub-list for method input_type
|
||||||
9, // [9:9] is the sub-list for method output_type
|
7, // [7:7] is the sub-list for extension type_name
|
||||||
9, // [9:9] is the sub-list for method input_type
|
7, // [7:7] is the sub-list for extension extendee
|
||||||
9, // [9:9] is the sub-list for extension type_name
|
0, // [0:7] is the sub-list for field type_name
|
||||||
9, // [9:9] is the sub-list for extension extendee
|
|
||||||
0, // [0:9] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_transport_internet_config_proto_init() }
|
func init() { file_transport_internet_config_proto_init() }
|
||||||
@@ -959,7 +854,7 @@ func file_transport_internet_config_proto_init() {
|
|||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_transport_internet_config_proto_rawDesc,
|
RawDescriptor: file_transport_internet_config_proto_rawDesc,
|
||||||
NumEnums: 3,
|
NumEnums: 2,
|
||||||
NumMessages: 5,
|
NumMessages: 5,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
|
@@ -8,16 +8,6 @@ option java_multiple_files = true;
|
|||||||
|
|
||||||
import "common/serial/typed_message.proto";
|
import "common/serial/typed_message.proto";
|
||||||
|
|
||||||
enum TransportProtocol {
|
|
||||||
TCP = 0;
|
|
||||||
UDP = 1;
|
|
||||||
MKCP = 2;
|
|
||||||
WebSocket = 3;
|
|
||||||
HTTP = 4;
|
|
||||||
HTTPUpgrade = 6;
|
|
||||||
SplitHTTP = 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum DomainStrategy {
|
enum DomainStrategy {
|
||||||
AS_IS = 0;
|
AS_IS = 0;
|
||||||
USE_IP = 1;
|
USE_IP = 1;
|
||||||
@@ -33,10 +23,6 @@ enum DomainStrategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message TransportConfig {
|
message TransportConfig {
|
||||||
// Type of network that this settings supports.
|
|
||||||
// Deprecated. Use the string form below.
|
|
||||||
TransportProtocol protocol = 1 [ deprecated = true ];
|
|
||||||
|
|
||||||
// Type of network that this settings supports.
|
// Type of network that this settings supports.
|
||||||
string protocol_name = 3;
|
string protocol_name = 3;
|
||||||
|
|
||||||
@@ -45,9 +31,6 @@ message TransportConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message StreamConfig {
|
message StreamConfig {
|
||||||
// Effective network. Deprecated. Use the string form below.
|
|
||||||
TransportProtocol protocol = 1 [ deprecated = true ];
|
|
||||||
|
|
||||||
// Effective network.
|
// Effective network.
|
||||||
string protocol_name = 5;
|
string protocol_name = 5;
|
||||||
|
|
||||||
|
@@ -8,8 +8,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const protocolName = "grpc"
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
||||||
return new(Config)
|
return new(Config)
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package encoding
|
package encoding
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
package grpc
|
package grpc
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
const protocolName = "grpc"
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
@@ -6,8 +6,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const protocolName = "http"
|
|
||||||
|
|
||||||
func (c *Config) getHosts() []string {
|
func (c *Config) getHosts() []string {
|
||||||
if len(c.Host) == 0 {
|
if len(c.Host) == 0 {
|
||||||
return []string{"www.example.com"}
|
return []string{"www.example.com"}
|
||||||
|
@@ -9,6 +9,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/quic-go/quic-go"
|
||||||
|
"github.com/quic-go/quic-go/http3"
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"github.com/xtls/xray-core/common/buf"
|
||||||
c "github.com/xtls/xray-core/common/ctx"
|
c "github.com/xtls/xray-core/common/ctx"
|
||||||
@@ -24,6 +26,13 @@ import (
|
|||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// defines the maximum time an idle TCP session can survive in the tunnel, so
|
||||||
|
// it should be consistent across HTTP versions and with other transports.
|
||||||
|
const connIdleTimeout = 300 * time.Second
|
||||||
|
|
||||||
|
// consistent with quic-go
|
||||||
|
const h3KeepalivePeriod = 10 * time.Second
|
||||||
|
|
||||||
type dialerConf struct {
|
type dialerConf struct {
|
||||||
net.Destination
|
net.Destination
|
||||||
*internet.MemoryStreamConfig
|
*internet.MemoryStreamConfig
|
||||||
@@ -48,13 +57,70 @@ func getHTTPClient(ctx context.Context, dest net.Destination, streamSettings *in
|
|||||||
if tlsConfigs == nil && realityConfigs == nil {
|
if tlsConfigs == nil && realityConfigs == nil {
|
||||||
return nil, errors.New("TLS or REALITY must be enabled for http transport.").AtWarning()
|
return nil, errors.New("TLS or REALITY must be enabled for http transport.").AtWarning()
|
||||||
}
|
}
|
||||||
|
isH3 := tlsConfigs != nil && (len(tlsConfigs.NextProtocol) == 1 && tlsConfigs.NextProtocol[0] == "h3")
|
||||||
|
if isH3 {
|
||||||
|
dest.Network = net.Network_UDP
|
||||||
|
}
|
||||||
sockopt := streamSettings.SocketSettings
|
sockopt := streamSettings.SocketSettings
|
||||||
|
|
||||||
if client, found := globalDialerMap[dialerConf{dest, streamSettings}]; found {
|
if client, found := globalDialerMap[dialerConf{dest, streamSettings}]; found {
|
||||||
return client, nil
|
return client, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
transport := &http2.Transport{
|
var transport http.RoundTripper
|
||||||
|
if isH3 {
|
||||||
|
quicConfig := &quic.Config{
|
||||||
|
MaxIdleTimeout: connIdleTimeout,
|
||||||
|
|
||||||
|
// these two are defaults of quic-go/http3. the default of quic-go (no
|
||||||
|
// http3) is different, so it is hardcoded here for clarity.
|
||||||
|
// https://github.com/quic-go/quic-go/blob/b8ea5c798155950fb5bbfdd06cad1939c9355878/http3/client.go#L36-L39
|
||||||
|
MaxIncomingStreams: -1,
|
||||||
|
KeepAlivePeriod: h3KeepalivePeriod,
|
||||||
|
}
|
||||||
|
roundTripper := &http3.RoundTripper{
|
||||||
|
QUICConfig: quicConfig,
|
||||||
|
TLSClientConfig: tlsConfigs.GetTLSConfig(tls.WithDestination(dest)),
|
||||||
|
Dial: func(ctx context.Context, addr string, tlsCfg *gotls.Config, cfg *quic.Config) (quic.EarlyConnection, error) {
|
||||||
|
conn, err := internet.DialSystem(ctx, dest, streamSettings.SocketSettings)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var udpConn net.PacketConn
|
||||||
|
var udpAddr *net.UDPAddr
|
||||||
|
|
||||||
|
switch c := conn.(type) {
|
||||||
|
case *internet.PacketConnWrapper:
|
||||||
|
var ok bool
|
||||||
|
udpConn, ok = c.Conn.(*net.UDPConn)
|
||||||
|
if !ok {
|
||||||
|
return nil, errors.New("PacketConnWrapper does not contain a UDP connection")
|
||||||
|
}
|
||||||
|
udpAddr, err = net.ResolveUDPAddr("udp", c.Dest.String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
case *net.UDPConn:
|
||||||
|
udpConn = c
|
||||||
|
udpAddr, err = net.ResolveUDPAddr("udp", c.RemoteAddr().String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
udpConn = &internet.FakePacketConn{c}
|
||||||
|
udpAddr, err = net.ResolveUDPAddr("udp", c.RemoteAddr().String())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return quic.DialEarly(ctx, udpConn, udpAddr, tlsCfg, cfg)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
transport = roundTripper
|
||||||
|
} else {
|
||||||
|
transportH2 := &http2.Transport{
|
||||||
DialTLSContext: func(hctx context.Context, string, addr string, tlsConfig *gotls.Config) (net.Conn, error) {
|
DialTLSContext: func(hctx context.Context, string, addr string, tlsConfig *gotls.Config) (net.Conn, error) {
|
||||||
rawHost, rawPort, err := net.SplitHostPort(addr)
|
rawHost, rawPort, err := net.SplitHostPort(addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -106,14 +172,14 @@ func getHTTPClient(ctx context.Context, dest net.Destination, streamSettings *in
|
|||||||
return cn, nil
|
return cn, nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if tlsConfigs != nil {
|
if tlsConfigs != nil {
|
||||||
transport.TLSClientConfig = tlsConfigs.GetTLSConfig(tls.WithDestination(dest))
|
transportH2.TLSClientConfig = tlsConfigs.GetTLSConfig(tls.WithDestination(dest))
|
||||||
}
|
}
|
||||||
|
|
||||||
if httpSettings.IdleTimeout > 0 || httpSettings.HealthCheckTimeout > 0 {
|
if httpSettings.IdleTimeout > 0 || httpSettings.HealthCheckTimeout > 0 {
|
||||||
transport.ReadIdleTimeout = time.Second * time.Duration(httpSettings.IdleTimeout)
|
transportH2.ReadIdleTimeout = time.Second * time.Duration(httpSettings.IdleTimeout)
|
||||||
transport.PingTimeout = time.Second * time.Duration(httpSettings.HealthCheckTimeout)
|
transportH2.PingTimeout = time.Second * time.Duration(httpSettings.HealthCheckTimeout)
|
||||||
|
}
|
||||||
|
transport = transportH2
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
@@ -158,9 +224,6 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||||||
Host: dest.NetAddr(),
|
Host: dest.NetAddr(),
|
||||||
Path: httpSettings.getNormalizedPath(),
|
Path: httpSettings.getNormalizedPath(),
|
||||||
},
|
},
|
||||||
Proto: "HTTP/2",
|
|
||||||
ProtoMajor: 2,
|
|
||||||
ProtoMinor: 0,
|
|
||||||
Header: httpHeaders,
|
Header: httpHeaders,
|
||||||
}
|
}
|
||||||
// Disable any compression method from server.
|
// Disable any compression method from server.
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
package http
|
package http
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
const protocolName = "http"
|
||||||
|
@@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
"github.com/xtls/xray-core/common/protocol/tls/cert"
|
"github.com/xtls/xray-core/common/protocol/tls/cert"
|
||||||
"github.com/xtls/xray-core/testing/servers/tcp"
|
"github.com/xtls/xray-core/testing/servers/tcp"
|
||||||
|
"github.com/xtls/xray-core/testing/servers/udp"
|
||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
. "github.com/xtls/xray-core/transport/internet/http"
|
. "github.com/xtls/xray-core/transport/internet/http"
|
||||||
"github.com/xtls/xray-core/transport/internet/stat"
|
"github.com/xtls/xray-core/transport/internet/stat"
|
||||||
@@ -92,3 +93,80 @@ func TestHTTPConnection(t *testing.T) {
|
|||||||
t.Error(r)
|
t.Error(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestH3Connection(t *testing.T) {
|
||||||
|
port := udp.PickPort()
|
||||||
|
|
||||||
|
listener, err := Listen(context.Background(), net.LocalHostIP, port, &internet.MemoryStreamConfig{
|
||||||
|
ProtocolName: "http",
|
||||||
|
ProtocolSettings: &Config{},
|
||||||
|
SecurityType: "tls",
|
||||||
|
SecuritySettings: &tls.Config{
|
||||||
|
NextProtocol: []string{"h3"},
|
||||||
|
Certificate: []*tls.Certificate{tls.ParseCertificate(cert.MustGenerate(nil, cert.CommonName("www.example.com")))},
|
||||||
|
},
|
||||||
|
}, func(conn stat.Connection) {
|
||||||
|
go func() {
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
b := buf.New()
|
||||||
|
defer b.Release()
|
||||||
|
|
||||||
|
for {
|
||||||
|
if _, err := b.ReadFrom(conn); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, err := conn.Write(b.Bytes())
|
||||||
|
common.Must(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
})
|
||||||
|
common.Must(err)
|
||||||
|
|
||||||
|
defer listener.Close()
|
||||||
|
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
|
dctx := context.Background()
|
||||||
|
conn, err := Dial(dctx, net.TCPDestination(net.LocalHostIP, port), &internet.MemoryStreamConfig{
|
||||||
|
ProtocolName: "http",
|
||||||
|
ProtocolSettings: &Config{},
|
||||||
|
SecurityType: "tls",
|
||||||
|
SecuritySettings: &tls.Config{
|
||||||
|
NextProtocol: []string{"h3"},
|
||||||
|
ServerName: "www.example.com",
|
||||||
|
AllowInsecure: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
common.Must(err)
|
||||||
|
defer conn.Close()
|
||||||
|
|
||||||
|
const N = 1024
|
||||||
|
b1 := make([]byte, N)
|
||||||
|
common.Must2(rand.Read(b1))
|
||||||
|
b2 := buf.New()
|
||||||
|
|
||||||
|
nBytes, err := conn.Write(b1)
|
||||||
|
common.Must(err)
|
||||||
|
if nBytes != N {
|
||||||
|
t.Error("write: ", nBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
b2.Clear()
|
||||||
|
common.Must2(b2.ReadFullFrom(conn, N))
|
||||||
|
if r := cmp.Diff(b2.Bytes(), b1); r != "" {
|
||||||
|
t.Error(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
nBytes, err = conn.Write(b1)
|
||||||
|
common.Must(err)
|
||||||
|
if nBytes != N {
|
||||||
|
t.Error("write: ", nBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
b2.Clear()
|
||||||
|
common.Must2(b2.ReadFullFrom(conn, N))
|
||||||
|
if r := cmp.Diff(b2.Bytes(), b1); r != "" {
|
||||||
|
t.Error(r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -2,11 +2,14 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
gotls "crypto/tls"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/quic-go/quic-go"
|
||||||
|
"github.com/quic-go/quic-go/http3"
|
||||||
goreality "github.com/xtls/reality"
|
goreality "github.com/xtls/reality"
|
||||||
"github.com/xtls/xray-core/common"
|
"github.com/xtls/xray-core/common"
|
||||||
"github.com/xtls/xray-core/common/errors"
|
"github.com/xtls/xray-core/common/errors"
|
||||||
@@ -24,9 +27,11 @@ import (
|
|||||||
|
|
||||||
type Listener struct {
|
type Listener struct {
|
||||||
server *http.Server
|
server *http.Server
|
||||||
|
h3server *http3.Server
|
||||||
handler internet.ConnHandler
|
handler internet.ConnHandler
|
||||||
local net.Addr
|
local net.Addr
|
||||||
config *Config
|
config *Config
|
||||||
|
isH3 bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Listener) Addr() net.Addr {
|
func (l *Listener) Addr() net.Addr {
|
||||||
@@ -34,7 +39,14 @@ func (l *Listener) Addr() net.Addr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (l *Listener) Close() error {
|
func (l *Listener) Close() error {
|
||||||
|
if l.h3server != nil {
|
||||||
|
if err := l.h3server.Close(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else if l.server != nil {
|
||||||
return l.server.Close()
|
return l.server.Close()
|
||||||
|
}
|
||||||
|
return errors.New("listener does not have an HTTP/3 server or h2 server")
|
||||||
}
|
}
|
||||||
|
|
||||||
type flushWriter struct {
|
type flushWriter struct {
|
||||||
@@ -119,29 +131,61 @@ func (l *Listener) ServeHTTP(writer http.ResponseWriter, request *http.Request)
|
|||||||
|
|
||||||
func Listen(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error) {
|
func Listen(ctx context.Context, address net.Address, port net.Port, streamSettings *internet.MemoryStreamConfig, handler internet.ConnHandler) (internet.Listener, error) {
|
||||||
httpSettings := streamSettings.ProtocolSettings.(*Config)
|
httpSettings := streamSettings.ProtocolSettings.(*Config)
|
||||||
var listener *Listener
|
config := tls.ConfigFromStreamSettings(streamSettings)
|
||||||
if port == net.Port(0) { // unix
|
var tlsConfig *gotls.Config
|
||||||
listener = &Listener{
|
if config == nil {
|
||||||
|
tlsConfig = &gotls.Config{}
|
||||||
|
} else {
|
||||||
|
tlsConfig = config.GetTLSConfig()
|
||||||
|
}
|
||||||
|
isH3 := len(tlsConfig.NextProtos) == 1 && tlsConfig.NextProtos[0] == "h3"
|
||||||
|
listener := &Listener{
|
||||||
handler: handler,
|
handler: handler,
|
||||||
local: &net.UnixAddr{
|
config: httpSettings,
|
||||||
|
isH3: isH3,
|
||||||
|
}
|
||||||
|
if port == net.Port(0) { // unix
|
||||||
|
listener.local = &net.UnixAddr{
|
||||||
Name: address.Domain(),
|
Name: address.Domain(),
|
||||||
Net: "unix",
|
Net: "unix",
|
||||||
},
|
|
||||||
config: httpSettings,
|
|
||||||
}
|
}
|
||||||
} else { // tcp
|
} else if isH3 { // udp
|
||||||
listener = &Listener{
|
listener.local = &net.UDPAddr{
|
||||||
handler: handler,
|
IP: address.IP(),
|
||||||
local: &net.TCPAddr{
|
Port: int(port),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
listener.local = &net.TCPAddr{
|
||||||
IP: address.IP(),
|
IP: address.IP(),
|
||||||
Port: int(port),
|
Port: int(port),
|
||||||
},
|
|
||||||
config: httpSettings,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if streamSettings.SocketSettings != nil && streamSettings.SocketSettings.AcceptProxyProtocol {
|
||||||
|
errors.LogWarning(ctx, "accepting PROXY protocol")
|
||||||
|
}
|
||||||
|
|
||||||
|
if isH3 {
|
||||||
|
Conn, err := internet.ListenSystemPacket(context.Background(), listener.local, streamSettings.SocketSettings)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("failed to listen UDP(for SH3) on ", address, ":", port).Base(err)
|
||||||
|
}
|
||||||
|
h3listener, err := quic.ListenEarly(Conn, tlsConfig, nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("failed to listen QUIC(for SH3) on ", address, ":", port).Base(err)
|
||||||
|
}
|
||||||
|
errors.LogInfo(ctx, "listening QUIC(for SH3) on ", address, ":", port)
|
||||||
|
|
||||||
|
listener.h3server = &http3.Server{
|
||||||
|
Handler: listener,
|
||||||
|
}
|
||||||
|
go func() {
|
||||||
|
if err := listener.h3server.ServeListener(h3listener); err != nil {
|
||||||
|
errors.LogWarningInner(ctx, err, "failed to serve http3 for splithttp")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
} else {
|
||||||
var server *http.Server
|
var server *http.Server
|
||||||
config := tls.ConfigFromStreamSettings(streamSettings)
|
|
||||||
if config == nil {
|
if config == nil {
|
||||||
h2s := &http2.Server{}
|
h2s := &http2.Server{}
|
||||||
|
|
||||||
@@ -159,10 +203,6 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if streamSettings.SocketSettings != nil && streamSettings.SocketSettings.AcceptProxyProtocol {
|
|
||||||
errors.LogWarning(ctx, "accepting PROXY protocol")
|
|
||||||
}
|
|
||||||
|
|
||||||
listener.server = server
|
listener.server = server
|
||||||
go func() {
|
go func() {
|
||||||
var streamListener net.Listener
|
var streamListener net.Listener
|
||||||
@@ -202,6 +242,7 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
return listener, nil
|
return listener, nil
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +1,3 @@
|
|||||||
package httpupgrade
|
package httpupgrade
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
const protocolName = "httpupgrade"
|
const protocolName = "httpupgrade"
|
||||||
|
|
||||||
func init() {
|
|
||||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
|
||||||
return nil, errors.New("httpupgrade is a transport protocol.")
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
@@ -5,8 +5,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
func IsValidHTTPHost(request string, config string) bool {
|
func IsValidHTTPHost(request string, config string) bool {
|
||||||
r := strings.ToLower(request)
|
r := strings.ToLower(request)
|
||||||
c := strings.ToLower(config)
|
c := strings.ToLower(config)
|
||||||
|
@@ -7,8 +7,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const protocolName = "mkcp"
|
|
||||||
|
|
||||||
// GetMTUValue returns the value of MTU settings.
|
// GetMTUValue returns the value of MTU settings.
|
||||||
func (c *Config) GetMTUValue() uint32 {
|
func (c *Config) GetMTUValue() uint32 {
|
||||||
if c == nil || c.Mtu == nil {
|
if c == nil || c.Mtu == nil {
|
||||||
|
@@ -6,4 +6,4 @@
|
|||||||
// xtaci@github for translating to Golang
|
// xtaci@github for translating to Golang
|
||||||
package kcp
|
package kcp
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
const protocolName = "mkcp"
|
||||||
|
@@ -36,8 +36,6 @@ import (
|
|||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
//go:linkname aesgcmPreferred github.com/refraction-networking/utls.aesgcmPreferred
|
//go:linkname aesgcmPreferred github.com/refraction-networking/utls.aesgcmPreferred
|
||||||
func aesgcmPreferred(ciphers []uint16) bool
|
func aesgcmPreferred(ciphers []uint16) bool
|
||||||
|
|
||||||
|
@@ -55,6 +55,9 @@ func (c *Config) GetRequestHeader() http.Header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) WriteResponseHeader(writer http.ResponseWriter) {
|
func (c *Config) WriteResponseHeader(writer http.ResponseWriter) {
|
||||||
|
// CORS headers for the browser dialer
|
||||||
|
writer.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
writer.Header().Set("Access-Control-Allow-Methods", "GET, POST")
|
||||||
paddingLen := c.GetNormalizedXPaddingBytes().roll()
|
paddingLen := c.GetNormalizedXPaddingBytes().roll()
|
||||||
if paddingLen > 0 {
|
if paddingLen > 0 {
|
||||||
writer.Header().Set("X-Padding", strings.Repeat("0", int(paddingLen)))
|
writer.Header().Set("X-Padding", strings.Repeat("0", int(paddingLen)))
|
||||||
|
@@ -365,7 +365,13 @@ func ListenSH(ctx context.Context, address net.Address, port net.Port, streamSet
|
|||||||
|
|
||||||
// Addr implements net.Listener.Addr().
|
// Addr implements net.Listener.Addr().
|
||||||
func (ln *Listener) Addr() net.Addr {
|
func (ln *Listener) Addr() net.Addr {
|
||||||
|
if ln.h3listener != nil {
|
||||||
|
return ln.h3listener.Addr()
|
||||||
|
}
|
||||||
|
if ln.listener != nil {
|
||||||
return ln.listener.Addr()
|
return ln.listener.Addr()
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close implements net.Listener.Close().
|
// Close implements net.Listener.Close().
|
||||||
|
@@ -1,18 +1,3 @@
|
|||||||
package splithttp
|
package splithttp
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/common"
|
|
||||||
"github.com/xtls/xray-core/common/errors"
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
const protocolName = "splithttp"
|
const protocolName = "splithttp"
|
||||||
|
|
||||||
func init() {
|
|
||||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
|
||||||
return nil, errors.New("splithttp is a transport protocol.")
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
@@ -1,3 +1 @@
|
|||||||
package taggedimpl
|
package taggedimpl
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
@@ -5,8 +5,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const protocolName = "tcp"
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
common.Must(internet.RegisterProtocolConfigCreator(protocolName, func() interface{} {
|
||||||
return new(Config)
|
return new(Config)
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
package tcp
|
package tcp
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
const protocolName = "tcp"
|
||||||
|
@@ -12,8 +12,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/common/net"
|
"github.com/xtls/xray-core/common/net"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
net.Conn
|
net.Conn
|
||||||
HandshakeContext(ctx context.Context) error
|
HandshakeContext(ctx context.Context) error
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
package udp
|
package udp
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
|
||||||
|
|
||||||
const protocolName = "udp"
|
const protocolName = "udp"
|
||||||
|
@@ -7,8 +7,6 @@ import (
|
|||||||
"github.com/xtls/xray-core/transport/internet"
|
"github.com/xtls/xray-core/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
const protocolName = "websocket"
|
|
||||||
|
|
||||||
func (c *Config) GetNormalizedPath() string {
|
func (c *Config) GetNormalizedPath() string {
|
||||||
path := c.Path
|
path := c.Path
|
||||||
if path == "" {
|
if path == "" {
|
||||||
|
@@ -5,4 +5,4 @@ WebSocket transport implements an HTTP(S) compliable, surveillance proof transpo
|
|||||||
*/
|
*/
|
||||||
package websocket
|
package websocket
|
||||||
|
|
||||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
const protocolName = "websocket"
|
||||||
|
Reference in New Issue
Block a user