Files
ProjectOctopus/agent-wdd/cmd/xray/vmessTemplate.go
zeaslity db3d259a0a Enhance Proxy and Configuration Management
- Implemented comprehensive VMESS proxy installation with dynamic configuration
- Added support for Xray installation and configuration generation
- Introduced hostname normalization with city, architecture, and IP-based naming
- Updated proxy commands to include VMESS and VLESS subcommands
- Improved configuration management with NormalizeConfig method
- Enhanced logging and error handling for proxy-related operations
2025-02-28 23:58:38 +08:00

39 lines
936 B
Go

package xray
var VmessServerTemplate = `
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": {{.PORT}},
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "{{.UUID}}"
}
]
},
"streamSettings": {
"network": "tcp"
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}
`
var VmessClientTemplate = `
{"type":"vmess","name":"{{.ServerNodeName}}","server":"{{.ServerNodeAddress}}","port":{{.PORT}},"uuid":"{{.UUID}}","alterId":0,"cipher":"auto","network":"tcp"}
vmess://{"v":"2","ps":"{{.ServerNodeName}}","add":"{{.ServerNodeAddress}}","port":{{.PORT}},"id":"{{.UUID}}","aid":0,"scy":"auto","net":"tcp"}
`