lua: add recursive read-only bindings for borrowed slices

This commit is contained in:
Meo597
2026-10-15 06:36:12 +08:00
parent ef4f4888df
commit b408f7f0c7
5 changed files with 187 additions and 3 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ func luaServers(s *DNS) []luaDNSServer {
func registerLua(L *lua.LState, servers []luaDNSServer, client featureDNS.Client) {
L.PreloadModule("xray.dns", func(L *lua.LState) int {
pushIPs := xlua.NewSlicePusher[net.IP](L)
pushIPs := xlua.NewReadOnlySlicePusher[net.IP](L)
serverList := L.CreateTable(len(servers), 0)
for i, client := range servers {