mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-12 05:11:35 +01:00
Add `relay_proxy_protocol_header` configuration option for TCP routes that enables forwarding the original client IP address to upstream services via PROXY protocol v2 headers. This feature is only available for TCP routes and includes validation to prevent misuse on UDP routes. - Add RelayProxyProtocolHeader field to Route struct with JSON tag - Implement writeProxyProtocolHeader in stream package to craft v2 headers - Update TCPTCPStream to conditionally send PROXY header to upstream - Add validation ensuring feature is TCP-only - Include tests for both enabled/disabled states and incoming proxy header relay
35 lines
788 B
YAML
35 lines
788 B
YAML
example: # matching `example.y.z`
|
|
scheme: https
|
|
host: 10.0.0.1
|
|
port: 80
|
|
path_patterns: # Check https://pkg.go.dev/net/http#hdr-Patterns-ServeMux for syntax
|
|
- GET / # accept any GET request
|
|
- POST /auth # for /auth and /auth/* accept only POST
|
|
- GET /home/{$} # for exactly /home
|
|
no_tls_verify: false
|
|
middlewares:
|
|
cidr_whitelist:
|
|
allow:
|
|
- 127.0.0.1
|
|
- 10.0.0.0/8
|
|
status_code: 403
|
|
message: "IP not allowed"
|
|
homepage:
|
|
name: Example App
|
|
icon: png/example.png
|
|
description: An example app
|
|
category: example
|
|
|
|
app1: # app1 -> localhost:8080
|
|
port: 8080
|
|
app2:
|
|
scheme: udp
|
|
host: 10.0.0.2
|
|
port: 2223:dns
|
|
|
|
ssh-with-proxy-protocol:
|
|
scheme: tcp
|
|
host: 10.0.0.3
|
|
port: 2222:22
|
|
relay_proxy_protocol_header: true
|