To be more clear about the end result: prosody 13.0.1 cannot be
accessed via an HTTP proxy that uses x-forwarded-for from an ipv6
address. To reproduce without setting up a proxy:
curl -v -H 'x-forwarded-for: 2605:aaaa:a0c9:c900:d8b3:aaaa:aaaa:aaaa'
0:5280/xmpp-websocket
This results in a 500 response and the following exception:
2025-04-08 17:03:09 http.server error Traceback[httpserver]:
/usr/share/lua/5.4/prosody/util/ip.lua:217: attempt to index a nil
value (local 'ipA')
stack traceback:
/usr/share/lua/5.4/prosody/util/ip.lua:217: in function
'prosody.util.ip.match'
/usr/lib/prosody/modules/mod_http.lua:345: in upvalue 'is_trusted_proxy'
/usr/lib/prosody/modules/mod_http.lua:391: in upvalue
'get_forwarded_connection_info'
/usr/lib/prosody/modules/mod_http.lua:407: in function
</usr/lib/prosody/modules/mod_http.lua:403>
The expected result is a 200. This is a regression since 0.12.5.
You get the expected result if the v6 address is encoded in the
rfc7239 format as the changeset I pointed to above intends, but the
widely used x-forwarded-for format (no brackets around v6 address) is
now broken.
Boris