Files
kumomta/docs/reference/events/proxy_init.md
T
2026-03-04 08:03:21 +00:00

32 lines
707 B
Markdown

# proxy_init
{{since('2026.03.04-bb93ecb1')}}
The `proxy_init` event is triggered when the proxy server starts up.
!!! note
This event is only available to the `proxy-server` executable.
This is where you should configure your proxy listeners and any other
initialization tasks for the proxy server.
```lua
local kumo = require 'kumo'
local proxy = require 'proxy'
kumo.on('proxy_init', function()
-- Start SOCKS5 proxy listener
proxy.start_proxy_listener {
listen = '0.0.0.0:1080',
timeout = '60 seconds',
}
-- Start HTTP listener for metrics and administration
proxy.start_http_listener {
listen = '0.0.0.0:8080',
trusted_hosts = { '127.0.0.1', '::1' },
}
end)
```