Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 6, 2024 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/89256fa24f38d6930dac996d362efbff to your computer and use it in GitHub Desktop.
Save Habbie/89256fa24f38d6930dac996d362efbff to your computer and use it in GitHub Desktop.
newServer('9.9.9.9')
pc = newPacketCache(10000, {maxTTL=86400, minTTL=0, temporaryFailureTTL=60, staleTTL=60, dontAge=false})
getPool(""):setCache(pc)
function randomdelay()
local d = math.random() * 100
print("delaying", d, "ms")
return DNSResponseAction.Delay, d
end
addCacheHitResponseAction(AllRule(), LuaResponseAction(randomdelay))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment