Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"proxy_protocol": "v2" seems dosen't work for udp forward (from l4 to http) #283

Closed
CharlesWou opened this issue Jan 8, 2025 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@CharlesWou
Copy link

CharlesWou commented Jan 8, 2025

I wanna do udp forward (from l4 to http), and get real client ip by "proxy_protocol".
"proxy_proctocol_v2" has added UDP support , but it seems dosen't work despite I set "proxy_protocol" to "v2" in caddy.
Only "127.0.0.1" in log files, and I can't get real client ip.
Why? How to solve?

    "layer4": {
      "servers": {
        "fwd_udp": {
          "listen": [
            "udp/0.0.0.0:443"
          ],
          "routes": [
            {
              "handle": [
                {
                  "handler": "proxy",
                  "proxy_protocol": "v2",
                  "upstreams": [
                    {
                      "dial": [
                        "udp/127.0.0.1:7443"
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    },
    "http": {
      "servers": {
         "srv_h3": {
            "listen": [
              "127.0.0.1:7443"
            ],
            "listener_wrappers": [
              {
                "wrapper": "proxy_protocol",
                "allow": [
                  "127.0.0.1/32"
                ]
              },
              {
                "wrapper": "tls"
              }
            ],
            ...........
         }
      }  
    }
@mohammed90
Copy link
Collaborator

This is duplicate of #269. It's a gap because l4 should wrap every UDP packet with the PROXY protocol header, while it currently only wraps the first packet.

@mohammed90 mohammed90 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2025
@mohammed90 mohammed90 added the duplicate This issue or pull request already exists label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants