Documentation ¶
Index ¶
- Constants
- Variables
- func GenConf(Settings map[string]string) ([]byte, error)
- func GenFromSecRawData(secRawData string) error
- func GenFromURL(URL string) error
- func GenSettings(node vmess.Link, userConfPath string) map[string]string
- func GetUserConf(path string) map[string]string
- func GetVmessList(secDataList []string) *[]vmess.Link
- func InitV2GenConf(p string) error
- func MakeNode(k int, v vmess.Link, waitList *int, npCh chan NodePingStatus, doneCh chan bool)
- func ParseHost(s string) string
- func ParseV2GenConf(b []byte) map[string]string
- func Ping(lk *vmess.Link) (*ping.Status, error)
- func PrettyPrint(b []byte) ([]byte, error)
- func Pri2Sec(priData string) []string
- func PrintNode(i int, vmessList *[]vmess.Link, np *NodePingStatus)
- func SecRaw2Sec(secRawData string) []string
- func SelectNode(vmessList *[]vmess.Link) (int, error)
- func URL2Pri(URL string) string
- type NodePingStatus
- type NodeStatusList
Constants ¶
View Source
const ( TLSObject = `{ "serverName": "{{address}}", "allowInsecure": {{allowInsecure}}, "alpn": ["http/1.1"] }` WsObject = `{ "path": "{{path}}", "headers": { "Host": "{{host}}" } }` KcpObject = `` /* 255-byte string literal not displayed */ HttpObject = `{ "host": [{{host}}], "path": "{{path}}" }` QuicObject = `{ "security": "{{host}}", "key": "{{path}}", "header": { "type": "{{type}}" } }` )
View Source
const ChinaSites = `
{
"type": "field",
"outboundTag": "direct",
"domain": ["geosite:cn"]
},`
View Source
const ConfigTpl = `` /* 1453-byte string literal not displayed */
View Source
const DefaultV2GenConf = `` /* 1301-byte string literal not displayed */
Variables ¶
View Source
var ( FlagURL = flag.String("u", "", "subscription URL") FlagPath = flag.String("o", "/etc/v2ray/config.json", "output path") FlagUserConf = flag.String("c", "/etc/v2ray/v2gen.ini", "v2gen config path") FlagTPL = flag.String("tpl", "", "V2Ray tpl path") FlagURIs = flag.String("vmess", "", "vmess link(s)") FlagInit = flag.Bool("init", false, "initialize v2gen config") FlagIndex = flag.Int("n", -1, "node index") FlagRandom = flag.Bool("r", false, "random node index") FlagNoPing = flag.Bool("np", false, "do not ping") FlagDest = flag.String("dest", "https://cloudflare.com/cdn-cgi/trace", "test destination url (vmess ping only)") FlagCount = flag.Int("ct", 3, "ping count for each node") FlagETO = flag.Int("eto", 8, "timeout seconds for each request") FlagTTO = flag.Int("tto", 25, "timeout seconds for each node") FlagICMP = flag.Bool("ic", false, "use ICMP ping instead of vmess ping") FlagMedian = flag.Bool("med", false, "use median instead of ArithmeticMean") FlagThreads = flag.Int("t", 5, "threads used when pinging") FlagSort = flag.Bool("sort", false, "sort ping results") FlagBest = flag.Bool("best", false, "use best node judged by ping result") FlagVersion = flag.Bool("v", false, "show version") )
Functions ¶
func GenFromSecRawData ¶
func GenFromURL ¶
func GetUserConf ¶
func GetVmessList ¶
func InitV2GenConf ¶
func ParseV2GenConf ¶
func PrettyPrint ¶
func SecRaw2Sec ¶
Types ¶
type NodePingStatus ¶
type NodeStatusList ¶
type NodeStatusList []NodePingStatus
func (*NodeStatusList) Len ¶
func (sList *NodeStatusList) Len() int
func (*NodeStatusList) Less ¶
func (sList *NodeStatusList) Less(i, j int) bool
func (*NodeStatusList) Swap ¶
func (sList *NodeStatusList) Swap(i, j int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.