v2ray

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfigJSON

func BuildConfigJSON(port int, clients ...string) string

func GenerateTrojanURL

func GenerateTrojanURL(baseURL string) (string, error)

func GenerateVlessURL

func GenerateVlessURL(baseURL, userID string) (string, error)

func Run

func Run(args []string) error

Types

type Builder

type Builder interface {
	AddInbound(Inbound) Builder
	AddOutbound(Outbound) Builder
	Build() (Config, error)
}

func NewConfigBuilder

func NewConfigBuilder() Builder

type Client

type Client struct {
	ID    string `json:"id"`
	Level int    `json:"level"`
}

type Config

type Config struct {
	Inbounds  []Inbound  `json:"inbounds"`
	Outbounds []Outbound `json:"outbounds"`
}

type Inbound

type Inbound struct {
	Port           int             `json:"port"`
	Listen         string          `json:"listen"`
	Protocol       string          `json:"protocol"`
	Settings       InboundSettings `json:"settings"`
	StreamSettings StreamSettings  `json:"streamSettings"`
}

type InboundSettings

type InboundSettings struct {
	Decryption string   `json:"decryption"`
	Clients    []Client `json:"clients"`
}

type Outbound

type Outbound struct {
	Protocol string                 `json:"protocol"`
	Settings map[string]interface{} `json:"settings"`
}

type StreamSettings

type StreamSettings struct {
	Network string `json:"network"`
}

Jump to

Keyboard shortcuts

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