pingap icon indicating copy to clipboard operation
pingap copied to clipboard

Feature Request: Support for generic TCP proxying (stream mode) for non-HTTP protocols like LDAP(S), SMTP, IMAP, etc.

Open LordKalEl opened this issue 10 months ago • 8 comments

Hello @vicanso, first of all: thank you for creating Pingap! It's already very pleasant to use with the Web UI, hot-reload and the plugin system – especially as a lightweight alternative to Nginx for HTTP/HTTPS workloads. Current situation Pingap is currently focused on HTTP/1.1, HTTP/2 and gRPC-web reverse proxying (which works great for web UIs, APIs, etc.). However, many self-hosted setups (including mine) also need to proxy non-HTTP protocols such as:

LDAP / LDAPS (ports 389 / 636) – e.g. for Kanidm, OpenLDAP SMTP / Submission / SMTPS (25 / 465 / 587) IMAP / IMAPS (143 / 993) POP3 / POP3S (110 / 995) Potentially others like PostgreSQL, Redis, SSH (with limitations), etc.

These protocols require generic TCP proxying (similar to Nginx stream {} block, HAProxy mode tcp, Traefik TCP routers or Envoy TCP proxy). Features like:

TCP listener on arbitrary ports TLS passthrough (for LDAPS, SMTPS, IMAPS) Proxy Protocol v1/v2 support (to pass real client IP to backend) Basic health checks / connection limits SNI-based routing (where possible)

are currently not possible with Pingap, because it only handles HTTP layers. Use case example In my setup I run Kanidm as identity provider:

HTTP(S) Web UI + OAuth → perfectly handled by Pingap LDAP(S) for authentication from mail servers (Stalwart), Linux clients, Nextcloud etc. → cannot be proxied → have to expose ports directly or use a second proxy (Traefik/HAProxy) only for TCP

This leads to fragmented proxy management (one tool for HTTP, another for TCP), more attack surface and more complexity. Proposed feature Add support for a new "stream" or "tcp" section (inspired by Nginx stream or HAProxy TCP mode), e.g.:

[[tcp_server]]
listen = "0.0.0.0:636"
mode = "tcp"
default_backend = "kanidm-ldaps"

[[tcp_upstream]]
name = "kanidm-ldaps"
addresses = ["127.0.0.1:636"]
tls_passthrough = true          # or terminate + re-encrypt
proxy_protocol = "v2"           # optional
health_check = { type = "tcp", interval = "10s" }

Or integrate it into the existing Web UI with a new tab "TCP Streams" / "Non-HTTP Proxies". This would make Pingap a true "all-in-one" application gateway (like modern Nginx + stream module), especially useful for homelab / small enterprise setups with mixed protocols. Alternatives considered

Keep using a second proxy only for TCP → works, but adds overhead Switch to HAProxy / Nginx stream / Traefik → loses Pingap's nice UI and Rust performance for HTTP parts

Adding TCP support (even basic at first: plain TCP + TLS passthrough) would make Pingap much more versatile without losing its focus on simplicity. Thanks for considering this feature request! I'm happy to provide more details about my use case or test any early PoC if needed. Best regards, Kal

LordKalEl avatar Jan 12 '26 22:01 LordKalEl

Thanks for the feedback. However, there are no plans to support Layer 4 (TCP stream) proxying in Pingap.

vicanso avatar Jan 15 '26 12:01 vicanso

Is it, because they don't support it in pingora? I can make an issue there too.

LordKalEl avatar Jan 15 '26 15:01 LordKalEl

o, Pingora actually supports it. It is just that Pingap has no plans to implement L4 proxying in the near future.

vicanso avatar Jan 16 '26 12:01 vicanso

This question has been stale for a week. It will be closed in an additional day if not updated.

github-actions[bot] avatar Jan 24 '26 03:01 github-actions[bot]

If there is already a support for that, in the the framework, why not adding it to the application? You don't have to reinvent it … do you? (Just a question, because I don't understand the idea behind it)

LordKalEl avatar Jan 24 '26 13:01 LordKalEl

This question has been stale for a week. It will be closed in an additional day if not updated.

github-actions[bot] avatar Feb 01 '26 04:02 github-actions[bot]

This issue has been closed because it has been stalled with no activity.

github-actions[bot] avatar Feb 03 '26 03:02 github-actions[bot]

Pingap is created as nginx modern replacement, i believe tcp streaming should be implemented.

Sk7Str1p3 avatar Aug 24 '26 21:08 Sk7Str1p3