tuicv4

package module
v0.0.0-...-b0bd5c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: GPL-3.0 Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Copyright (C) 2025  dyhkwong

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

Documentation

Index

Constants

View Source
const (
	CommandAuthenticate = iota
	CommandConnect
	CommandPacket
	CommandDissociate
	CommandHeartbeat
	CommandResponse = 0xff
)
View Source
const (
	OptionResponseSuccess          = 0x00
	OptionResponseFailed           = 0xff
	ErrorCodeProtocolError         = uint64(0xfffffff0)
	ErrorCodeAuthenticationFailed  = uint64(0xfffffff1)
	ErrorCodeAuthenticationTimeout = uint64(0xfffffff2)
	ErrorCodeBadCommand            = uint64(0xfffffff3)
)
View Source
const AuthenticateLen = 2 + 32
View Source
const (
	Version = 4
)

Variables

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options ClientOptions) (*Client, error)

func (*Client) CloseIdleConnections

func (c *Client) CloseIdleConnections()

func (*Client) CloseWithError

func (c *Client) CloseWithError(err error) error

func (*Client) DialConn

func (c *Client) DialConn(ctx context.Context, destination M.Socksaddr) (net.Conn, error)

func (*Client) ListenPacket

func (c *Client) ListenPacket(ctx context.Context) (net.PacketConn, error)

func (*Client) SetKeepIdleConnections

func (c *Client) SetKeepIdleConnections(keep bool)

type ClientOptions

type ClientOptions struct {
	Context           context.Context
	Dialer            N.Dialer
	ServerAddress     M.Socksaddr
	TLSConfig         aTLS.Config
	QUICConfig        *quic.Config
	QUICOptions       qtls.QUICOptions
	Password          string
	CongestionControl string
	UDPStream         bool
	ZeroRTTHandshake  bool
	Heartbeat         time.Duration

	// Deperecated: no-op
	UDPMTU int
}

type Service

type Service[U comparable] struct {
	// contains filtered or unexported fields
}

func NewService

func NewService[U comparable](options ServiceOptions) (*Service[U], error)

func (*Service[U]) Close

func (s *Service[U]) Close() error

func (*Service[U]) Start

func (s *Service[U]) Start(conn net.PacketConn) error

func (*Service[U]) UpdateUsers

func (s *Service[U]) UpdateUsers(userList []U, passwordList []string)

type ServiceHandler

type ServiceHandler interface {
	N.TCPConnectionHandlerEx
	N.UDPConnectionHandlerEx
}

type ServiceOptions

type ServiceOptions struct {
	Context           context.Context
	Logger            logger.Logger
	TLSConfig         aTLS.ServerConfig
	QUICConfig        *quic.Config
	QUICOptions       qtls.QUICOptions
	CongestionControl string
	AuthTimeout       time.Duration
	ZeroRTTHandshake  bool
	Heartbeat         time.Duration
	UDPTimeout        time.Duration
	Handler           ServiceHandler

	// Deperecated: no-op
	UDPMTU int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL