common

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdminExpirationTime = time.Date(2900, 1, 1, 0, 0, 0, 0, time.UTC)

Functions

func CheckConnectivity

func CheckConnectivity(ip string, port int)

func CheckSingBoxInstalled

func CheckSingBoxInstalled() bool

func GenerateBasicSingBoxServerConfig

func GenerateBasicSingBoxServerConfig(dataDir string) (*option.Options, error)

func GenerateSingBoxConnectConfig

func GenerateSingBoxConnectConfig(dataDir, publicIP, username string) ([]byte, error)

func GetPublicIP

func GetPublicIP() (string, error)

func GetShadowsocksInboundConfig

func GetShadowsocksInboundConfig(singBoxServerConfig *option.Options) (*option.ShadowsocksInboundOptions, error)

func ReadSingBoxServerConfig

func ReadSingBoxServerConfig(dataDir string) (*option.Options, error)

func RestartSingBox

func RestartSingBox() error

func RevokeUser

func RevokeUser(dataDir, username string) error

func WriteSingBoxServerConfig

func WriteSingBoxServerConfig(dataDir string, opt *option.Options) error

Types

type ServerConfig

type ServerConfig struct {
	IP          string `json:"ip"`
	Port        int    `json:"port"`
	AccessToken string `json:"access_token"`
	HMACSecret  []byte `json:"hmac_secret"`
}

func GenerateServerConfig

func GenerateServerConfig(dataDir string) (*ServerConfig, error)

func ReadServerConfig

func ReadServerConfig(dataDir string) (*ServerConfig, error)

func (*ServerConfig) GetNewServerURL

func (c *ServerConfig) GetNewServerURL() string

func (*ServerConfig) GetQR

func (c *ServerConfig) GetQR() string

Jump to

Keyboard shortcuts

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