Perlba...Extras(3pm)

πŸ“¦
version 1.80 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– Perlbal::Plugin::XFFExtras πŸ’–

okay so bestie, this is Perlbal::Plugin::XFFExtras, and it lives in the User Contributed Perl Documentation corner of the 3pm section (iykyk 🫢). it's a Perlbal plugin that can optionally add an X-Forwarded-Port and/or X-Forwarded-Proto header to reverse proxied requests. that's it. that's the whole vibe. ✨


🌸 NAME 🌸

Perlbal::Plugin::XFFExtras β€” a Perlbal plugin that can <highkey>optionally</highkey> add an X-Forwarded-Port and/or an X-Forwarded-Proto header to reverse proxied requests. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

drop this in your perlbal.conf, no notes:

# in perlbal.conf

LOAD XFFExtra

CREATE POOL web
    POOL web ADD 10.0.0.1:80

CREATE SERVICE proxy
    SET role                        = reverse_proxy
    SET listen                      = 0.0.0.0:80
    SET pool                        = web

    SET plugins             = XFFExtras

    SET send_backend_port   = yes
    SET send_backend_proto  = yes
ENABLE proxy

✨ DESCRIPTION ✨

so the way this works is: this plugin adds optional headers that get sent to your backend servers when you're in reverse proxy mode. that's the entire job description bestie, and it does it flawlessly. πŸ‘‘


πŸŽ€ HEADERS πŸŽ€

  • X-Forwarded-Port β€” this header is gonna hold an integer value telling you which port the peer connected to. and like, that number? it corresponds to the port number you specified on the listen line of the perlbal service that initially handled the connection. so it's the original port, not some random one. periodt. πŸ’–
  • X-Forwarded-Proto β€” this one holds a string telling you which protocol the client used to connect to perlbal. and rn, currently, it's gonna be either 'http' or 'https'. those are the only two options, that's the whole menu. 🌈

πŸ‘‘ AUTHOR πŸ‘‘

Jonathan Steinert, <hachi@kuiki.net> πŸ’œ


Copyright (C) 2012 by Say Media Inc, <cpan@saymedia.com> 🌸

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available. 🫢


okay and that's the whole page bestie!! this was documented with perl v5.34.0 and it's dated 2022-06-28, so it's giving vintage but still iconic ✨ go forth and forward those headers, you absolute main character πŸ’…πŸŽ€

πŸ“¦ where this page comes from