Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ The options table has the following fields:
* `host`: target host, or path to a unix domain socket
* `port`: port on target host, will default to `80` or `443` based on the scheme
* `pool`: custom connection pool name. Option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect), except that the default will become a pool name constructed using the SSL / proxy properties, which is important for safe connection reuse. When in doubt, leave it blank!
* `pool_debug`: set to `true` to log the connection pool name at `DEBUG` level, off by default
* `pool_size`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect)
* `backlog`: option as per [OpenResty docs](https://github.com/openresty/lua-nginx-module#tcpsockconnect)
* `proxy_opts`: sub-table, defaults to the global proxy options set, see [set\_proxy\_options](#set_proxy_options).
Expand Down
5 changes: 4 additions & 1 deletion lib/resty/http_connect.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ client:connect {
host = "myhost.com", -- target machine, or a unix domain socket
port = nil, -- port on target machine, will default to 80/443 based on scheme
pool = nil, -- connection pool name, leave blank! this function knows best!
pool_debug = nil, -- set to 'true' to log the connection pool name at DEBUG level
pool_size = nil, -- options as per: https://github.com/openresty/lua-nginx-module#tcpsockconnect
backlog = nil,

Expand Down Expand Up @@ -250,7 +251,9 @@ local function connect(self, options)
-- with a plain http request the authorization is part of the actual request.
end

ngx_log(ngx_DEBUG, "poolname: ", poolname)
if options.pool_debug == true then
ngx_log(ngx_DEBUG, "poolname: ", poolname)
end

-- do TCP level connection
local tcp_opts = { pool = poolname, pool_size = pool_size, backlog = backlog }
Expand Down
Loading