Skip to content

Instantly share code, notes, and snippets.

diff --git i/src/run.rs w/src/run.rs
index c978e6a..8e61cf7 100644
--- i/src/run.rs
+++ w/src/run.rs
@@ -53,54 +53,13 @@ pub(crate) fn run(mut cmd: Command) -> i32 {
}
};
- let old_mask = mask
- .thread_swap_mask(SIG_BLOCK)
@gszr
gszr / db.lua
Created October 20, 2025 18:43
require "luarocks.loader"
setmetatable(_G, nil)
local config = {
application_name = "kong",
host = "localhost",
port = 5432,
user = "kong",
password = nil,
@gszr
gszr / datakit_add_header.json
Created October 16, 2025 12:48
Datakit Add Header
{
"name": "datakit",
"config": {
"nodes": [
{
"name": "DATA",
"type": "call",
"url": "http://<callout server>:8080/uuid",
"outputs": {
"body": "service_request.headers"
@gszr
gszr / callout_add_header.json
Created October 16, 2025 12:46
Callout Add Header
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "simple",
"request": {
"url": "https://<callout server>:8080/anything",
"method": "GET"
}
@gszr
gszr / callout.json
Created August 6, 2025 15:19
Callout body via Lua code
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "c1",
"request": {
"url": "https://httpbin.org/anything",
"method": "POST",
"body": {
@gszr
gszr / callout.json
Created August 1, 2025 11:59
Use full callouts response in upstream request
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "c1",
"request": {
"url": "https://mocki.io/v1/3b51613b-a7e0-44bf-803a-35f6939e55f3",
"method": "GET"
},
@gszr
gszr / callout_dupe_header.json
Last active July 25, 2025 13:37
callout with duplicated headers
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "echo",
"cache": {
"bypass": false
},
"depends_on": [],
luarocks --verbose --tree /tmp/test install lua-cjson
-------------------------------------------------------------------------------
Current configuration:
-------------------------------------------------------------------------------
accept_unknown_fields = false
arch = "linux-aarch64"
cache = {}
cache_fail_timeout = 86400
cache_timeout = 60
check_certificates = false
@gszr
gszr / t.lua
Created May 30, 2025 16:09
luarocks issue repro
function run_file(filename, env)
local fd, err = io.open(filename)
if not fd then
return nil, err, "open"
end
local str, err = fd:read("*a")
fd:close()
if not str then
return nil, err, "open"
end
@gszr
gszr / gist:98962ed0ccc2c9503d942f5f31570efa
Created April 17, 2025 16:19
callout-custom-cache-key
{
"name": "request-callout",
"config": {
"callouts": [
{
"name": "callout1",
"request": {
"url": "http://httpbin.org/anything",
"by_lua": "kong.ctx.shared.callouts.callout1.caching.cache_key = kong.request.get_header('cache-key')"
},