From f7760ecb6dabb4b7636ffec97046e4139f52bf00 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Tue, 12 Sep 2023 08:22:12 -0700 Subject: [PATCH] misc(lua-resolver) add a comment elaborating on the Lua resolver use-case --- src/common/lua/ngx_wasm_lua_resolver.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/lua/ngx_wasm_lua_resolver.c b/src/common/lua/ngx_wasm_lua_resolver.c index d496ed528..147069ea8 100644 --- a/src/common/lua/ngx_wasm_lua_resolver.c +++ b/src/common/lua/ngx_wasm_lua_resolver.c @@ -1,3 +1,16 @@ +/** + * DNS resolution for Proxy-Wasm filters running in Kong Gateway. + * + * ngx_wasm_module handles DNS resolution via Nginx's configured `resolver` + * (http{}, wasm{}, or default from ngx_wasm.h). However, Kong Gateway's DNS + * resolution is handled by the Gateway's Lua-land resolver: resty.dns.client. + * + * To ensure DNS resolution consistency between Kong Gateway core/plugins and + * Proxy-Wasm filters, this file leverages our Wasm/Lua bridge to invoke the + * Gateway's Lua-land resolver in lieu of the configured Nginx resolver when + * built against OpenResty and enabled via `proxy_wasm_lua_resolver`. + */ + #ifndef DDEBUG #define DDEBUG 0 #endif