juicity

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: GPL-3.0 Imports: 27 Imported by: 0

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 (
	NetworkTCP = 1
	NetworkUDP = 3
)
View Source
const AuthenticateLen = 2 + 16 + 32
View Source
const (
	CommandAuthenticate = 0
)
View Source
const (
	Version = 0
)

Variables

Juicity Specification tells us it is 0x01 for IPv4, 0x02 for IPv6, and 0x03 for domain, which is incorrect.

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) CloseWithError

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

func (*Client) DialConn

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

func (*Client) ListenPacket

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

type ClientOptions

type ClientOptions struct {
	Context           context.Context
	Dialer            network.Dialer
	ServerAddress     metadata.Socksaddr
	TLSConfig         tls.Config
	QUICConfig        *quic.Config
	UUID              [16]byte
	Password          string
	CongestionControl string
}

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, uuidList [][16]byte, passwordList []string)

type ServiceOptions

type ServiceOptions struct {
	Context           context.Context
	Logger            logger.Logger
	TLSConfig         tls.ServerConfig
	QUICConfig        *quic.Config
	CongestionControl string
	AuthTimeout       time.Duration
	// UDPTimeout  time.Duration todo?
	Handler ServiceHandler
}

Jump to

Keyboard shortcuts

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