vrnobody / V2RayGCon

V2Ray的图形配置器。Graphic configer for v2ray-core/xray-core.
https://vrnobody.github.io/V2RayGCon
GNU General Public License v3.0
125 stars 19 forks source link

功能建议 #23

Closed PennHui666 closed 1 year ago

PennHui666 commented 1 year ago

求支持批量修改host和端口

vrnobody commented 1 year ago

如果想修改Inbound的host和端口,选中想修改的服务器,然后点 主窗口-服务器-批量修改 就可以。 这里有Inbound几种模式的说明:自定义Inbounds

如果想修改Outbound,这个需求有点奇怪。不过可以通过Luna插件写脚本实现:

local json = require('lua.libs.json')

-- 对第1个服务器进行操作
local coreServ = Server:GetAllServers()[0]

local title = coreServ:GetCoreStates():GetTitle()
print(title)
local coreConfiger = coreServ:GetConfiger()

-- 获取config
local str = coreConfiger:GetConfig()
local config = json.decode(str)

-- 修改outbounds.0的tag为hello
config["outbounds"][1]["tag"] = "hello"

-- 把config写回去
str = json.encode(config)
coreConfiger:SetConfig(str)

这时查看第1个服务器的outbound.0.tag应该变了

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.