Skip to content

[Feature Request] Support Incoming PROXY Protocol in frpc #4705

@MahdiAkrami01

Description

@MahdiAkrami01

Describe the feature request

Hi
I’m using frpc behind HAProxy, which sends PROXY protocol v2 headers to pass client info. Currently, frpc doesn’t seem to support accepting incoming PROXY headers on its listening ports.
This causes connection failures when HAProxy uses send-proxy-v2.

Could you please consider adding support for frpc to accept incoming PROXY protocol (v1/v2)? Something like an acceptProxyProtocol = "v2" option in [[proxies]] would be amazing. It’d help log client IPs and work better with upstream proxies like HAProxy.

Thanks for your great work - happy to help test if needed

Flow

Client ---> HAProxy ---(Add PROXY v2)---> frpc ---(Log then remove PROXY v2)---> Local app

haproxy

listen chatWS
    mode http
    balance leastconn
    bind *:443 shards by-thread ssl crt key.pem

    server s01  :::8443 send-proxy-v2

frpc

[[proxies]]
name = "server-s01"
type = "tcp"
localIP = "::"
localPort = 8443
remotePort = 8443
transport.proxyProtocolVersion = ""
acceptProxyProtocol = "v2" <------ Not currently supported

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions