Skip to content

tLib v1.1

Choose a tag to compare

@tommy141x tommy141x released this 30 Oct 18:36
· 93 commits to main since this release

Resources now answer on the FiveM server port, so an admin panel or a dispatch console needs no second port opened.

Read this before updating

tlib_http_port unset now binds nothing. If you relied on the old 7777 default without setting the convar, the listener no longer comes up and everything moves to the FiveM server port. You lose WebSocket and the 8 KB upload headroom until you set tlib_http_port explicitly. Set it to a port of your choice if you want both.

The server-port ingress

A registered web app answers on the FiveM server port under /<resource> — tLib's hub at /tLib/, and whatever your other resources register. tlib_http_ingress defaults on; set it false to turn the route off estate-wide and go back to tLib's own listener.

Each consumer loads @tLib/server/sv_http_ingress.lua itself, because FXServer routes a path's first segment to the resource that owns it — /tRadio/... can only be answered from inside tRadio.

The route cannot carry WebSocket, so an app falls back to long-polling, and a browser-to-server message over 8 KB drops the connection. For a panel worked all day, tLib's own port is still the better choice.

Security

The ingress no longer relays a client's forwarding headers. An app behind the door sees every request arrive from 127.0.0.1, and consumers trust loopback unconditionally — so a client-supplied X-Forwarded-For was read back as that client's own address, making every per-IP rate limit a value the caller chose. The canonical spelling was already overwritten; a lowercase x-forwarded-for survived and won. x-forwarded-for, -proto, -host, -prefix, x-real-ip and forwarded are now dropped and authored by the relay alone.

Also

  • Paths are case-insensitive, and a legacy mount 301s to its new address
  • tLib prints the resolved address at startup