Run core/format.go

This commit is contained in:
yuhan6665 2022-12-25 19:37:35 -05:00
parent c9b6fc0104
commit c4fbdf1b78
18 changed files with 76 additions and 67 deletions

View file

@ -1,8 +1,9 @@
// Package kcp - A Fast and Reliable ARQ Protocol
//
// Acknowledgement:
// skywind3000@github for inventing the KCP protocol
// xtaci@github for translating to Golang
//
// skywind3000@github for inventing the KCP protocol
// xtaci@github for translating to Golang
package kcp
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen

View file

@ -140,8 +140,8 @@ func (s *clientConnections) openConnection(ctx context.Context, destAddr net.Add
}
quicConfig := &quic.Config{
ConnectionIDLength: 12,
KeepAlivePeriod: 0,
ConnectionIDLength: 12,
KeepAlivePeriod: 0,
HandshakeIdleTimeout: time.Second * 8,
MaxIdleTimeout: time.Second * 300,
Tracer: qlog.NewTracer(func(_ logging.Perspective, connID []byte) io.WriteCloser {

View file

@ -106,8 +106,8 @@ func Listen(ctx context.Context, address net.Address, port net.Port, streamSetti
quicConfig := &quic.Config{
ConnectionIDLength: 12,
KeepAlivePeriod: 0,
HandshakeIdleTimeout: time.Second * 8,
MaxIdleTimeout: time.Second * 300,
HandshakeIdleTimeout: time.Second * 8,
MaxIdleTimeout: time.Second * 300,
MaxIncomingStreams: 32,
MaxIncomingUniStreams: -1,
Tracer: qlog.NewTracer(func(_ logging.Perspective, connID []byte) io.WriteCloser {

View file

@ -1,11 +1,12 @@
package internet
import (
"github.com/xtls/xray-core/common/net"
"golang.org/x/sys/unix"
"os"
"syscall"
"unsafe"
"github.com/xtls/xray-core/common/net"
"golang.org/x/sys/unix"
)
const (

View file

@ -78,11 +78,11 @@ func applyOutboundSocketOptions(network string, address string, fd uintptr, conf
}
}
if config.TcpCongestion != "" {
if err := syscall.SetsockoptString(int(fd), syscall.SOL_TCP, syscall.TCP_CONGESTION, config.TcpCongestion); err != nil {
return newError("failed to set TCP_CONGESTION", err)
}
}
if config.TcpCongestion != "" {
if err := syscall.SetsockoptString(int(fd), syscall.SOL_TCP, syscall.TCP_CONGESTION, config.TcpCongestion); err != nil {
return newError("failed to set TCP_CONGESTION", err)
}
}
}
if config.Tproxy.IsEnabled() {
@ -128,11 +128,11 @@ func applyInboundSocketOptions(network string, fd uintptr, config *SocketConfig)
}
}
if config.TcpCongestion != "" {
if err := syscall.SetsockoptString(int(fd), syscall.SOL_TCP, syscall.TCP_CONGESTION, config.TcpCongestion); err != nil {
return newError("failed to set TCP_CONGESTION", err)
}
}
if config.TcpCongestion != "" {
if err := syscall.SetsockoptString(int(fd), syscall.SOL_TCP, syscall.TCP_CONGESTION, config.TcpCongestion); err != nil {
return newError("failed to set TCP_CONGESTION", err)
}
}
}
if config.Tproxy.IsEnabled() {

View file

@ -3,11 +3,12 @@ package tls
import (
"context"
gotls "crypto/tls"
utls "github.com/refraction-networking/utls"
"google.golang.org/grpc/credentials"
"net"
"net/url"
"strconv"
utls "github.com/refraction-networking/utls"
"google.golang.org/grpc/credentials"
)
// grpcUtlsInfo contains the auth information for a TLS authenticated connection.

View file

@ -1,4 +1,5 @@
/*Package websocket implements WebSocket transport
/*
Package websocket implements WebSocket transport
WebSocket transport implements an HTTP(S) compliable, surveillance proof transport method with plausible deniability.
*/

View file

@ -2,7 +2,6 @@ package xtls
import (
xtls "github.com/xtls/go"
"github.com/xtls/xray-core/common/net"
)