This commit is contained in:
RPRX 2020-12-04 09:36:16 +08:00
parent ed8d6d743c
commit 16544c18ab
627 changed files with 3247 additions and 2635 deletions

View file

@ -3,8 +3,8 @@
package tcp
import (
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/transport/internet"
)
const protocolName = "tcp"

View file

@ -8,7 +8,7 @@ package tcp
import (
proto "github.com/golang/protobuf/proto"
serial "github.com/xtls/xray-core/v1/common/serial"
serial "github.com/xtls/xray-core/common/serial"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -99,15 +99,15 @@ var file_transport_internet_tcp_config_proto_rawDesc = []byte{
0x63, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x63, 0x63, 0x65,
0x70, 0x74, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4a,
0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x76, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x78, 0x72, 0x61,
0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x73, 0x0a, 0x1f, 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, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68,
0x72, 0x6e, 0x65, 0x74, 0x2e, 0x74, 0x63, 0x70, 0x50, 0x01, 0x5a, 0x30, 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, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f,
0x72, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa,
0x02, 0x1b, 0x58, 0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2f, 0x74, 0x63, 0x70, 0xaa, 0x02, 0x1b, 0x58,
0x72, 0x61, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x49, 0x6e,
0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2e, 0x54, 0x63, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (

View file

@ -2,7 +2,7 @@ syntax = "proto3";
package xray.transport.internet.tcp;
option csharp_namespace = "Xray.Transport.Internet.Tcp";
option go_package = "github.com/xtls/xray-core/v1/transport/internet/tcp";
option go_package = "github.com/xtls/xray-core/transport/internet/tcp";
option java_package = "com.xray.transport.internet.tcp";
option java_multiple_files = true;

View file

@ -5,12 +5,12 @@ package tcp
import (
"context"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/net"
"github.com/xtls/xray-core/v1/common/session"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/v1/transport/internet/tls"
"github.com/xtls/xray-core/v1/transport/internet/xtls"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/session"
"github.com/xtls/xray-core/transport/internet"
"github.com/xtls/xray-core/transport/internet/tls"
"github.com/xtls/xray-core/transport/internet/xtls"
)
// Dial dials a new TCP connection to the given destination.

View file

@ -1,6 +1,6 @@
package tcp
import "github.com/xtls/xray-core/v1/common/errors"
import "github.com/xtls/xray-core/common/errors"
type errPathObjHolder struct{}

View file

@ -10,12 +10,12 @@ import (
goxtls "github.com/xtls/go"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/common/net"
"github.com/xtls/xray-core/v1/common/session"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/v1/transport/internet/tls"
"github.com/xtls/xray-core/v1/transport/internet/xtls"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/common/session"
"github.com/xtls/xray-core/transport/internet"
"github.com/xtls/xray-core/transport/internet/tls"
"github.com/xtls/xray-core/transport/internet/xtls"
)
// Listener is an internet.Listener that listens for TCP connections.

View file

@ -4,8 +4,8 @@
package tcp
import (
"github.com/xtls/xray-core/v1/common/net"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/transport/internet"
)
// GetOriginalDestination from tcp conn

View file

@ -6,8 +6,8 @@ package tcp
import (
"syscall"
"github.com/xtls/xray-core/v1/common/net"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/transport/internet"
)
const SO_ORIGINAL_DST = 80

View file

@ -7,10 +7,10 @@ import (
"strings"
"testing"
"github.com/xtls/xray-core/v1/common"
"github.com/xtls/xray-core/v1/testing/servers/tcp"
"github.com/xtls/xray-core/v1/transport/internet"
. "github.com/xtls/xray-core/v1/transport/internet/tcp"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/testing/servers/tcp"
"github.com/xtls/xray-core/transport/internet"
. "github.com/xtls/xray-core/transport/internet/tcp"
)
func TestGetOriginalDestination(t *testing.T) {

View file

@ -4,8 +4,8 @@
package tcp
import (
"github.com/xtls/xray-core/v1/common/net"
"github.com/xtls/xray-core/v1/transport/internet"
"github.com/xtls/xray-core/common/net"
"github.com/xtls/xray-core/transport/internet"
)
func GetOriginalDestination(conn internet.Connection) (net.Destination, error) {

View file

@ -1,3 +1,3 @@
package tcp
//go:generate go run github.com/xtls/xray-core/v1/common/errors/errorgen
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen